hytopia 0.8.7-prerelease-2 → 0.8.8

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/node-server.mjs CHANGED
@@ -25,13 +25,13 @@ import{createRequire as Pz1}from"node:module";var Mz1=Object.create;var{getProto
25
25
  || ${K} === "boolean" || ${$} === null`).assign(W,n0._`[${$}]`)}}}function uk1({gen:Z,parentData:J,parentDataProperty:X},Y){Z.if(n0._`${J} !== undefined`,()=>Z.assign(n0._`${J}[${X}]`,Y))}function vk(Z,J,X,Y=OW.Correct){let $=Y===OW.Correct?n0.operators.EQ:n0.operators.NEQ,Q;switch(Z){case"null":return n0._`${J} ${$} null`;case"array":Q=n0._`Array.isArray(${J})`;break;case"object":Q=n0._`${J} && typeof ${J} == "object" && !Array.isArray(${J})`;break;case"integer":Q=K(n0._`!(${J} % 1) && !isNaN(${J})`);break;case"number":Q=K();break;default:return n0._`typeof ${J} ${$} ${Z}`}return Y===OW.Correct?Q:n0.not(Q);function K(W=n0.nil){return n0.and(n0._`typeof ${J} == "number"`,W,X?n0._`isFinite(${J})`:n0.nil)}}Ae.checkDataType=vk;function Sk(Z,J,X,Y){if(Z.length===1)return vk(Z[0],J,X,Y);let $,Q=_e.toHash(Z);if(Q.array&&Q.object){let K=n0._`typeof ${J} != "object"`;$=Q.null?K:n0._`!${J} || ${K}`,delete Q.null,delete Q.array,delete Q.object}else $=n0.nil;if(Q.number)delete Q.integer;for(let K in Q)$=n0.and($,vk(K,J,X,Y));return $}Ae.checkDataTypes=Sk;var dk1={message:({schema:Z})=>`must be ${Z}`,params:({schema:Z,schemaValue:J})=>typeof Z=="string"?n0._`{type: ${Z}}`:n0._`{type: ${J}}`};function Ak(Z){let J=ck1(Z);fk1.reportError(J,dk1)}Ae.reportTypeError=Ak;function ck1(Z){let{gen:J,data:X,schema:Y}=Z,$=_e.schemaRefOrVal(Z,Y,"type");return{gen:J,keyword:"type",data:X,schema:Y.type,schemaCode:$,schemaValue:$,parentSchema:Y,params:{},it:Z}}});var be=O((fe)=>{Object.defineProperty(fe,"__esModule",{value:!0});fe.assignDefaults=void 0;var RW=t0(),ok1=F1();function rk1(Z,J){let{properties:X,items:Y}=Z.schema;if(J==="object"&&X)for(let $ in X)he(Z,$,X[$].default);else if(J==="array"&&Array.isArray(Y))Y.forEach(($,Q)=>he(Z,Q,$.default))}fe.assignDefaults=rk1;function he(Z,J,X){let{gen:Y,compositeRule:$,data:Q,opts:K}=Z;if(X===void 0)return;let W=RW._`${Q}${RW.getProperty(J)}`;if($){ok1.checkStrictMode(Z,`default is ignored for: ${W}`);return}let G=RW._`${W} === undefined`;if(K.useDefaults==="empty")G=RW._`${G} || ${W} === null || ${W} === ""`;Y.if(G,RW._`${W} = ${RW.stringify(X)}`)}});var d9=O((ue)=>{Object.defineProperty(ue,"__esModule",{value:!0});ue.validateUnion=ue.validateArray=ue.usePattern=ue.callValidateCode=ue.schemaProperties=ue.allSchemaProperties=ue.noPropertyInData=ue.propertyInData=ue.isOwnProperty=ue.hasPropFunc=ue.reportMissingProp=ue.checkMissingProp=ue.checkReportMissingProp=void 0;var l1=t0(),xk=F1(),zX=gZ(),tk1=F1();function ek1(Z,J){let{gen:X,data:Y,it:$}=Z;X.if(fk(X,Y,J,$.opts.ownProperties),()=>{Z.setParams({missingProperty:l1._`${J}`},!0),Z.error()})}ue.checkReportMissingProp=ek1;function ZI1({gen:Z,data:J,it:{opts:X}},Y,$){return l1.or(...Y.map((Q)=>l1.and(fk(Z,J,Q,X.ownProperties),l1._`${$} = ${Q}`)))}ue.checkMissingProp=ZI1;function JI1(Z,J){Z.setParams({missingProperty:J},!0),Z.error()}ue.reportMissingProp=JI1;function ge(Z){return Z.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:l1._`Object.prototype.hasOwnProperty`})}ue.hasPropFunc=ge;function hk(Z,J,X){return l1._`${ge(Z)}.call(${J}, ${X})`}ue.isOwnProperty=hk;function XI1(Z,J,X,Y){let $=l1._`${J}${l1.getProperty(X)} !== undefined`;return Y?l1._`${$} && ${hk(Z,J,X)}`:$}ue.propertyInData=XI1;function fk(Z,J,X,Y){let $=l1._`${J}${l1.getProperty(X)} === undefined`;return Y?l1.or($,l1.not(hk(Z,J,X))):$}ue.noPropertyInData=fk;function me(Z){return Z?Object.keys(Z).filter((J)=>J!=="__proto__"):[]}ue.allSchemaProperties=me;function YI1(Z,J){return me(J).filter((X)=>!xk.alwaysValidSchema(Z,J[X]))}ue.schemaProperties=YI1;function $I1({schemaCode:Z,data:J,it:{gen:X,topSchemaRef:Y,schemaPath:$,errorPath:Q},it:K},W,G,V){let z=V?l1._`${Z}, ${J}, ${Y}${$}`:J,F=[[zX.default.instancePath,l1.strConcat(zX.default.instancePath,Q)],[zX.default.parentData,K.parentData],[zX.default.parentDataProperty,K.parentDataProperty],[zX.default.rootData,zX.default.rootData]];if(K.opts.dynamicRef)F.push([zX.default.dynamicAnchors,zX.default.dynamicAnchors]);let H=l1._`${z}, ${X.object(...F)}`;return G!==l1.nil?l1._`${W}.call(${G}, ${H})`:l1._`${W}(${H})`}ue.callValidateCode=$I1;var QI1=l1._`new RegExp`;function KI1({gen:Z,it:{opts:J}},X){let Y=J.unicodeRegExp?"u":"",{regExp:$}=J.code,Q=$(X,Y);return Z.scopeValue("pattern",{key:Q.toString(),ref:Q,code:l1._`${$.code==="new RegExp"?QI1:tk1.useFunc(Z,$)}(${X}, ${Y})`})}ue.usePattern=KI1;function WI1(Z){let{gen:J,data:X,keyword:Y,it:$}=Z,Q=J.name("valid");if($.allErrors){let W=J.let("valid",!0);return K(()=>J.assign(W,!1)),W}return J.var(Q,!0),K(()=>J.break()),Q;function K(W){let G=J.const("len",l1._`${X}.length`);J.forRange("i",0,G,(V)=>{Z.subschema({keyword:Y,dataProp:V,dataPropType:xk.Type.Num},Q),J.if(l1.not(Q),W)})}}ue.validateArray=WI1;function GI1(Z){let{gen:J,schema:X,keyword:Y,it:$}=Z;if(!Array.isArray(X))throw new Error("ajv implementation error");if(X.some((G)=>xk.alwaysValidSchema($,G))&&!$.opts.unevaluated)return;let K=J.let("valid",!1),W=J.name("_valid");J.block(()=>X.forEach((G,V)=>{let z=Z.subschema({keyword:Y,schemaProp:V,compositeRule:!0},W);if(J.assign(K,l1._`${K} || ${W}`),!Z.mergeValidEvaluated(z,W))J.if(l1.not(K))})),Z.result(K,()=>Z.reset(),()=>Z.error(!0))}ue.validateUnion=GI1});var ne=O((pe)=>{Object.defineProperty(pe,"__esModule",{value:!0});pe.validateKeywordUsage=pe.validSchemaType=pe.funcKeywordCode=pe.macroKeywordCode=void 0;var Q5=t0(),j$=gZ(),NI1=d9(),jI1=jz();function DI1(Z,J){let{gen:X,keyword:Y,schema:$,parentSchema:Q,it:K}=Z,W=J.macro.call(K.self,$,Q,K),G=le(X,Y,W);if(K.opts.validateSchema!==!1)K.self.validateSchema(W,!0);let V=X.name("valid");Z.subschema({schema:W,schemaPath:Q5.nil,errSchemaPath:`${K.errSchemaPath}/${Y}`,topSchemaRef:G,compositeRule:!0},V),Z.pass(V,()=>Z.error(!0))}pe.macroKeywordCode=DI1;function PI1(Z,J){var X;let{gen:Y,keyword:$,schema:Q,parentSchema:K,$data:W,it:G}=Z;TI1(G,J);let V=!W&&J.compile?J.compile.call(G.self,Q,K,G):J.validate,z=le(Y,$,V),F=Y.let("valid");Z.block$data(F,H),Z.ok((X=J.valid)!==null&&X!==void 0?X:F);function H(){if(J.errors===!1){if(L(),J.modifying)ce(Z);B(()=>Z.error())}else{let w=J.async?q():U();if(J.modifying)ce(Z);B(()=>CI1(Z,w))}}function q(){let w=Y.let("ruleErrs",null);return Y.try(()=>L(Q5._`await `),(R)=>Y.assign(F,!1).if(Q5._`${R} instanceof ${G.ValidationError}`,()=>Y.assign(w,Q5._`${R}.errors`),()=>Y.throw(R))),w}function U(){let w=Q5._`${z}.errors`;return Y.assign(w,null),L(Q5.nil),w}function L(w=J.async?Q5._`await `:Q5.nil){let R=G.opts.passContext?j$.default.this:j$.default.self,M=!(("compile"in J)&&!W||J.schema===!1);Y.assign(F,Q5._`${w}${NI1.callValidateCode(Z,z,R,M)}`,J.modifying)}function B(w){var R;Y.if(Q5.not((R=J.valid)!==null&&R!==void 0?R:F),w)}}pe.funcKeywordCode=PI1;function ce(Z){let{gen:J,data:X,it:Y}=Z;J.if(Y.parentData,()=>J.assign(X,Q5._`${Y.parentData}[${Y.parentDataProperty}]`))}function CI1(Z,J){let{gen:X}=Z;X.if(Q5._`Array.isArray(${J})`,()=>{X.assign(j$.default.vErrors,Q5._`${j$.default.vErrors} === null ? ${J} : ${j$.default.vErrors}.concat(${J})`).assign(j$.default.errors,Q5._`${j$.default.vErrors}.length`),jI1.extendErrors(Z)},()=>Z.error())}function TI1({schemaEnv:Z},J){if(J.async&&!Z.$async)throw new Error("async keyword in sync schema")}function le(Z,J,X){if(X===void 0)throw new Error(`keyword "${J}" failed to compile`);return Z.scopeValue("keyword",typeof X=="function"?{ref:X}:{ref:X,code:Q5.stringify(X)})}function EI1(Z,J,X=!1){return!J.length||J.some((Y)=>Y==="array"?Array.isArray(Z):Y==="object"?Z&&typeof Z=="object"&&!Array.isArray(Z):typeof Z==Y||X&&typeof Z=="undefined")}pe.validSchemaType=EI1;function kI1({schema:Z,opts:J,self:X,errSchemaPath:Y},$,Q){if(Array.isArray($.keyword)?!$.keyword.includes(Q):$.keyword!==Q)throw new Error("ajv implementation error");let K=$.dependencies;if(K===null||K===void 0?void 0:K.some((W)=>!Object.prototype.hasOwnProperty.call(Z,W)))throw new Error(`parent schema must have dependencies of ${Q}: ${K.join(",")}`);if($.validateSchema){if(!$.validateSchema(Z[Q])){let G=`keyword "${Q}" value is invalid at path "${Y}": `+X.errorsText($.validateSchema.errors);if(J.validateSchema==="log")X.logger.error(G);else throw new Error(G)}}}pe.validateKeywordUsage=kI1});var re=O((se)=>{Object.defineProperty(se,"__esModule",{value:!0});se.extendSubschemaMode=se.extendSubschemaData=se.getSubschema=void 0;var h7=t0(),ae=F1();function SI1(Z,{keyword:J,schemaProp:X,schema:Y,schemaPath:$,errSchemaPath:Q,topSchemaRef:K}){if(J!==void 0&&Y!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(J!==void 0){let W=Z.schema[J];return X===void 0?{schema:W,schemaPath:h7._`${Z.schemaPath}${h7.getProperty(J)}`,errSchemaPath:`${Z.errSchemaPath}/${J}`}:{schema:W[X],schemaPath:h7._`${Z.schemaPath}${h7.getProperty(J)}${h7.getProperty(X)}`,errSchemaPath:`${Z.errSchemaPath}/${J}/${ae.escapeFragment(X)}`}}if(Y!==void 0){if($===void 0||Q===void 0||K===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:Y,schemaPath:$,topSchemaRef:K,errSchemaPath:Q}}throw new Error('either "keyword" or "schema" must be passed')}se.getSubschema=SI1;function AI1(Z,J,{dataProp:X,dataPropType:Y,data:$,dataTypes:Q,propertyName:K}){if($!==void 0&&X!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:W}=J;if(X!==void 0){let{errorPath:V,dataPathArr:z,opts:F}=J,H=W.let("data",h7._`${J.data}${h7.getProperty(X)}`,!0);G(H),Z.errorPath=h7.str`${V}${ae.getErrorPath(X,Y,F.jsPropertySyntax)}`,Z.parentDataProperty=h7._`${X}`,Z.dataPathArr=[...z,Z.parentDataProperty]}if($!==void 0){let V=$ instanceof h7.Name?$:W.let("data",$,!0);if(G(V),K!==void 0)Z.propertyName=K}if(Q)Z.dataTypes=Q;function G(V){Z.data=V,Z.dataLevel=J.dataLevel+1,Z.dataTypes=[],J.definedProperties=new Set,Z.parentData=J.data,Z.dataNames=[...J.dataNames,V]}}se.extendSubschemaData=AI1;function xI1(Z,{jtdDiscriminator:J,jtdMetadata:X,compositeRule:Y,createErrors:$,allErrors:Q}){if(Y!==void 0)Z.compositeRule=Y;if($!==void 0)Z.createErrors=$;if(Q!==void 0)Z.allErrors=Q;Z.jtdDiscriminator=J,Z.jtdMetadata=X}se.extendSubschemaMode=xI1});var yk=O((nS6,te)=>{te.exports=function Z(J,X){if(J===X)return!0;if(J&&X&&typeof J=="object"&&typeof X=="object"){if(J.constructor!==X.constructor)return!1;var Y,$,Q;if(Array.isArray(J)){if(Y=J.length,Y!=X.length)return!1;for($=Y;$--!==0;)if(!Z(J[$],X[$]))return!1;return!0}if(J.constructor===RegExp)return J.source===X.source&&J.flags===X.flags;if(J.valueOf!==Object.prototype.valueOf)return J.valueOf()===X.valueOf();if(J.toString!==Object.prototype.toString)return J.toString()===X.toString();if(Q=Object.keys(J),Y=Q.length,Y!==Object.keys(X).length)return!1;for($=Y;$--!==0;)if(!Object.prototype.hasOwnProperty.call(X,Q[$]))return!1;for($=Y;$--!==0;){var K=Q[$];if(!Z(J[K],X[K]))return!1}return!0}return J!==J&&X!==X}});var Z00=O((aS6,ee)=>{var HX=ee.exports=function(Z,J,X){if(typeof J=="function")X=J,J={};X=J.cb||X;var Y=typeof X=="function"?X:X.pre||function(){},$=X.post||function(){};Uw(J,Y,$,Z,"",Z)};HX.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};HX.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};HX.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};HX.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Uw(Z,J,X,Y,$,Q,K,W,G,V){if(Y&&typeof Y=="object"&&!Array.isArray(Y)){J(Y,$,Q,K,W,G,V);for(var z in Y){var F=Y[z];if(Array.isArray(F)){if(z in HX.arrayKeywords)for(var H=0;H<F.length;H++)Uw(Z,J,X,F[H],$+"/"+z+"/"+H,Q,$,z,Y,H)}else if(z in HX.propsKeywords){if(F&&typeof F=="object")for(var q in F)Uw(Z,J,X,F[q],$+"/"+z+"/"+yI1(q),Q,$,z,Y,q)}else if(z in HX.keywords||Z.allKeys&&!(z in HX.skipKeywords))Uw(Z,J,X,F,$+"/"+z,Q,$,z,Y)}X(Y,$,Q,K,W,G,V)}}function yI1(Z){return Z.replace(/~/g,"~0").replace(/\//g,"~1")}});var Pz=O(($00)=>{Object.defineProperty($00,"__esModule",{value:!0});$00.getSchemaRefs=$00.resolveUrl=$00.normalizeId=$00._getFullPath=$00.getFullPath=$00.inlineRef=void 0;var bI1=F1(),gI1=yk(),mI1=Z00(),uI1=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function dI1(Z,J=!0){if(typeof Z=="boolean")return!0;if(J===!0)return!bk(Z);if(!J)return!1;return J00(Z)<=J}$00.inlineRef=dI1;var cI1=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function bk(Z){for(let J in Z){if(cI1.has(J))return!0;let X=Z[J];if(Array.isArray(X)&&X.some(bk))return!0;if(typeof X=="object"&&bk(X))return!0}return!1}function J00(Z){let J=0;for(let X in Z){if(X==="$ref")return 1/0;if(J++,uI1.has(X))continue;if(typeof Z[X]=="object")bI1.eachItem(Z[X],(Y)=>J+=J00(Y));if(J===1/0)return 1/0}return J}function X00(Z,J="",X){if(X!==!1)J=MW(J);let Y=Z.parse(J);return Y00(Z,Y)}$00.getFullPath=X00;function Y00(Z,J){return Z.serialize(J).split("#")[0]+"#"}$00._getFullPath=Y00;var lI1=/#\/?$/;function MW(Z){return Z?Z.replace(lI1,""):""}$00.normalizeId=MW;function pI1(Z,J,X){return X=MW(X),Z.resolve(J,X)}$00.resolveUrl=pI1;var iI1=/^[a-z_][-a-z0-9._]*$/i;function nI1(Z,J){if(typeof Z=="boolean")return{};let{schemaId:X,uriResolver:Y}=this.opts,$=MW(Z[X]||J),Q={"":$},K=X00(Y,$,!1),W={},G=new Set;return mI1(Z,{allKeys:!0},(F,H,q,U)=>{if(U===void 0)return;let L=K+H,B=Q[U];if(typeof F[X]=="string")B=w.call(this,F[X]);R.call(this,F.$anchor),R.call(this,F.$dynamicAnchor),Q[H]=B;function w(M){let N=this.opts.uriResolver.resolve;if(M=MW(B?N(B,M):M),G.has(M))throw z(M);G.add(M);let P=this.refs[M];if(typeof P=="string")P=this.refs[P];if(typeof P=="object")V(F,P.schema,M);else if(M!==MW(L))if(M[0]==="#")V(F,W[M],M),W[M]=F;else this.refs[M]=L;return M}function R(M){if(typeof M=="string"){if(!iI1.test(M))throw new Error(`invalid anchor "${M}"`);w.call(this,`#${M}`)}}}),W;function V(F,H,q){if(H!==void 0&&!gI1(F,H))throw z(q)}function z(F){return new Error(`reference "${F}" resolves to more than one schema`)}}$00.getSchemaRefs=nI1});var Ez=O((M00)=>{Object.defineProperty(M00,"__esModule",{value:!0});M00.getData=M00.KeywordCxt=M00.validateFunctionCode=void 0;var z00=De(),K00=Dz(),mk=_k(),Lw=Dz(),eI1=be(),Tz=ne(),gk=re(),j0=t0(),f0=gZ(),Z_1=Pz(),mZ=F1(),Cz=jz();function J_1(Z){if(q00(Z)){if(U00(Z),F00(Z)){$_1(Z);return}}H00(Z,()=>z00.topBoolOrEmptySchema(Z))}M00.validateFunctionCode=J_1;function H00({gen:Z,validateName:J,schema:X,schemaEnv:Y,opts:$},Q){if($.code.es5)Z.func(J,j0._`${f0.default.data}, ${f0.default.valCxt}`,Y.$async,()=>{Z.code(j0._`"use strict"; ${W00(X,$)}`),Y_1(Z,$),Z.code(Q)});else Z.func(J,j0._`${f0.default.data}, ${X_1($)}`,Y.$async,()=>Z.code(W00(X,$)).code(Q))}function X_1(Z){return j0._`{${f0.default.instancePath}="", ${f0.default.parentData}, ${f0.default.parentDataProperty}, ${f0.default.rootData}=${f0.default.data}${Z.dynamicRef?j0._`, ${f0.default.dynamicAnchors}={}`:j0.nil}}={}`}function Y_1(Z,J){Z.if(f0.default.valCxt,()=>{if(Z.var(f0.default.instancePath,j0._`${f0.default.valCxt}.${f0.default.instancePath}`),Z.var(f0.default.parentData,j0._`${f0.default.valCxt}.${f0.default.parentData}`),Z.var(f0.default.parentDataProperty,j0._`${f0.default.valCxt}.${f0.default.parentDataProperty}`),Z.var(f0.default.rootData,j0._`${f0.default.valCxt}.${f0.default.rootData}`),J.dynamicRef)Z.var(f0.default.dynamicAnchors,j0._`${f0.default.valCxt}.${f0.default.dynamicAnchors}`)},()=>{if(Z.var(f0.default.instancePath,j0._`""`),Z.var(f0.default.parentData,j0._`undefined`),Z.var(f0.default.parentDataProperty,j0._`undefined`),Z.var(f0.default.rootData,f0.default.data),J.dynamicRef)Z.var(f0.default.dynamicAnchors,j0._`{}`)})}function $_1(Z){let{schema:J,opts:X,gen:Y}=Z;H00(Z,()=>{if(X.$comment&&J.$comment)B00(Z);if(V_1(Z),Y.let(f0.default.vErrors,null),Y.let(f0.default.errors,0),X.unevaluated)Q_1(Z);L00(Z),F_1(Z)});return}function Q_1(Z){let{gen:J,validateName:X}=Z;Z.evaluated=J.const("evaluated",j0._`${X}.evaluated`),J.if(j0._`${Z.evaluated}.dynamicProps`,()=>J.assign(j0._`${Z.evaluated}.props`,j0._`undefined`)),J.if(j0._`${Z.evaluated}.dynamicItems`,()=>J.assign(j0._`${Z.evaluated}.items`,j0._`undefined`))}function W00(Z,J){let X=typeof Z=="object"&&Z[J.schemaId];return X&&(J.code.source||J.code.process)?j0._`/*# sourceURL=${X} */`:j0.nil}function K_1(Z,J){if(q00(Z)){if(U00(Z),F00(Z)){W_1(Z,J);return}}z00.boolOrEmptySchema(Z,J)}function F00({schema:Z,self:J}){if(typeof Z=="boolean")return!Z;for(let X in Z)if(J.RULES.all[X])return!0;return!1}function q00(Z){return typeof Z.schema!="boolean"}function W_1(Z,J){let{schema:X,gen:Y,opts:$}=Z;if($.$comment&&X.$comment)B00(Z);z_1(Z),H_1(Z);let Q=Y.const("_errs",f0.default.errors);L00(Z,Q),Y.var(J,j0._`${Q} === ${f0.default.errors}`)}function U00(Z){mZ.checkUnknownRules(Z),G_1(Z)}function L00(Z,J){if(Z.opts.jtd)return G00(Z,[],!1,J);let X=K00.getSchemaTypes(Z.schema),Y=K00.coerceAndCheckDataType(Z,X);G00(Z,X,!Y,J)}function G_1(Z){let{schema:J,errSchemaPath:X,opts:Y,self:$}=Z;if(J.$ref&&Y.ignoreKeywordsWithRef&&mZ.schemaHasRulesButRef(J,$.RULES))$.logger.warn(`$ref: keywords ignored in schema at path "${X}"`)}function V_1(Z){let{schema:J,opts:X}=Z;if(J.default!==void 0&&X.useDefaults&&X.strictSchema)mZ.checkStrictMode(Z,"default is ignored in the schema root")}function z_1(Z){let J=Z.schema[Z.opts.schemaId];if(J)Z.baseId=Z_1.resolveUrl(Z.opts.uriResolver,Z.baseId,J)}function H_1(Z){if(Z.schema.$async&&!Z.schemaEnv.$async)throw new Error("async schema in sync schema")}function B00({gen:Z,schemaEnv:J,schema:X,errSchemaPath:Y,opts:$}){let Q=X.$comment;if($.$comment===!0)Z.code(j0._`${f0.default.self}.logger.log(${Q})`);else if(typeof $.$comment=="function"){let K=j0.str`${Y}/$comment`,W=Z.scopeValue("root",{ref:J.root});Z.code(j0._`${f0.default.self}.opts.$comment(${Q}, ${K}, ${W}.schema)`)}}function F_1(Z){let{gen:J,schemaEnv:X,validateName:Y,ValidationError:$,opts:Q}=Z;if(X.$async)J.if(j0._`${f0.default.errors} === 0`,()=>J.return(f0.default.data),()=>J.throw(j0._`new ${$}(${f0.default.vErrors})`));else{if(J.assign(j0._`${Y}.errors`,f0.default.vErrors),Q.unevaluated)q_1(Z);J.return(j0._`${f0.default.errors} === 0`)}}function q_1({gen:Z,evaluated:J,props:X,items:Y}){if(X instanceof j0.Name)Z.assign(j0._`${J}.props`,X);if(Y instanceof j0.Name)Z.assign(j0._`${J}.items`,Y)}function G00(Z,J,X,Y){let{gen:$,schema:Q,data:K,allErrors:W,opts:G,self:V}=Z,{RULES:z}=V;if(Q.$ref&&(G.ignoreKeywordsWithRef||!mZ.schemaHasRulesButRef(Q,z))){$.block(()=>O00(Z,"$ref",z.all.$ref.definition));return}if(!G.jtd)U_1(Z,J);$.block(()=>{for(let H of z.rules)F(H);F(z.post)});function F(H){if(!mk.shouldUseGroup(Q,H))return;if(H.type){if($.if(Lw.checkDataType(H.type,K,G.strictNumbers)),V00(Z,H),J.length===1&&J[0]===H.type&&X)$.else(),Lw.reportTypeError(Z);$.endIf()}else V00(Z,H);if(!W)$.if(j0._`${f0.default.errors} === ${Y||0}`)}}function V00(Z,J){let{gen:X,schema:Y,opts:{useDefaults:$}}=Z;if($)eI1.assignDefaults(Z,J.type);X.block(()=>{for(let Q of J.rules)if(mk.shouldUseRule(Y,Q))O00(Z,Q.keyword,Q.definition,J.type)})}function U_1(Z,J){if(Z.schemaEnv.meta||!Z.opts.strictTypes)return;if(L_1(Z,J),!Z.opts.allowUnionTypes)B_1(Z,J);w_1(Z,Z.dataTypes)}function L_1(Z,J){if(!J.length)return;if(!Z.dataTypes.length){Z.dataTypes=J;return}J.forEach((X)=>{if(!w00(Z.dataTypes,X))uk(Z,`type "${X}" not allowed by context "${Z.dataTypes.join(",")}"`)}),R_1(Z,J)}function B_1(Z,J){if(J.length>1&&!(J.length===2&&J.includes("null")))uk(Z,"use allowUnionTypes to allow union type keyword")}function w_1(Z,J){let X=Z.self.RULES.all;for(let Y in X){let $=X[Y];if(typeof $=="object"&&mk.shouldUseRule(Z.schema,$)){let{type:Q}=$.definition;if(Q.length&&!Q.some((K)=>O_1(J,K)))uk(Z,`missing type "${Q.join(",")}" for keyword "${Y}"`)}}}function O_1(Z,J){return Z.includes(J)||J==="number"&&Z.includes("integer")}function w00(Z,J){return Z.includes(J)||J==="integer"&&Z.includes("number")}function R_1(Z,J){let X=[];for(let Y of Z.dataTypes)if(w00(J,Y))X.push(Y);else if(J.includes("integer")&&Y==="number")X.push("integer");Z.dataTypes=X}function uk(Z,J){let X=Z.schemaEnv.baseId+Z.errSchemaPath;J+=` at "${X}" (strictTypes)`,mZ.checkStrictMode(Z,J,Z.opts.strictTypes)}class dk{constructor(Z,J,X){if(Tz.validateKeywordUsage(Z,J,X),this.gen=Z.gen,this.allErrors=Z.allErrors,this.keyword=X,this.data=Z.data,this.schema=Z.schema[X],this.$data=J.$data&&Z.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=mZ.schemaRefOrVal(Z,this.schema,X,this.$data),this.schemaType=J.schemaType,this.parentSchema=Z.schema,this.params={},this.it=Z,this.def=J,this.$data)this.schemaCode=Z.gen.const("vSchema",R00(this.$data,Z));else if(this.schemaCode=this.schemaValue,!Tz.validSchemaType(this.schema,J.schemaType,J.allowUndefined))throw new Error(`${X} value must be ${JSON.stringify(J.schemaType)}`);if("code"in J?J.trackErrors:J.errors!==!1)this.errsCount=Z.gen.const("_errs",f0.default.errors)}result(Z,J,X){this.failResult(j0.not(Z),J,X)}failResult(Z,J,X){if(this.gen.if(Z),X)X();else this.error();if(J){if(this.gen.else(),J(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(Z,J){this.failResult(j0.not(Z),void 0,J)}fail(Z){if(Z===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(Z),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(Z){if(!this.$data)return this.fail(Z);let{schemaCode:J}=this;this.fail(j0._`${J} !== undefined && (${j0.or(this.invalid$data(),Z)})`)}error(Z,J,X){if(J){this.setParams(J),this._error(Z,X),this.setParams({});return}this._error(Z,X)}_error(Z,J){(Z?Cz.reportExtraError:Cz.reportError)(this,this.def.error,J)}$dataError(){Cz.reportError(this,this.def.$dataError||Cz.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');Cz.resetErrorsCount(this.gen,this.errsCount)}ok(Z){if(!this.allErrors)this.gen.if(Z)}setParams(Z,J){if(J)Object.assign(this.params,Z);else this.params=Z}block$data(Z,J,X=j0.nil){this.gen.block(()=>{this.check$data(Z,X),J()})}check$data(Z=j0.nil,J=j0.nil){if(!this.$data)return;let{gen:X,schemaCode:Y,schemaType:$,def:Q}=this;if(X.if(j0.or(j0._`${Y} === undefined`,J)),Z!==j0.nil)X.assign(Z,!0);if($.length||Q.validateSchema){if(X.elseIf(this.invalid$data()),this.$dataError(),Z!==j0.nil)X.assign(Z,!1)}X.else()}invalid$data(){let{gen:Z,schemaCode:J,schemaType:X,def:Y,it:$}=this;return j0.or(Q(),K());function Q(){if(X.length){if(!(J instanceof j0.Name))throw new Error("ajv implementation error");let W=Array.isArray(X)?X:[X];return j0._`${Lw.checkDataTypes(W,J,$.opts.strictNumbers,Lw.DataType.Wrong)}`}return j0.nil}function K(){if(Y.validateSchema){let W=Z.scopeValue("validate$data",{ref:Y.validateSchema});return j0._`!${W}(${J})`}return j0.nil}}subschema(Z,J){let X=gk.getSubschema(this.it,Z);gk.extendSubschemaData(X,this.it,Z),gk.extendSubschemaMode(X,Z);let Y={...this.it,...X,items:void 0,props:void 0};return K_1(Y,J),Y}mergeEvaluated(Z,J){let{it:X,gen:Y}=this;if(!X.opts.unevaluated)return;if(X.props!==!0&&Z.props!==void 0)X.props=mZ.mergeEvaluated.props(Y,Z.props,X.props,J);if(X.items!==!0&&Z.items!==void 0)X.items=mZ.mergeEvaluated.items(Y,Z.items,X.items,J)}mergeValidEvaluated(Z,J){let{it:X,gen:Y}=this;if(X.opts.unevaluated&&(X.props!==!0||X.items!==!0))return Y.if(J,()=>this.mergeEvaluated(Z,j0.Name)),!0}}M00.KeywordCxt=dk;function O00(Z,J,X,Y){let $=new dk(Z,X,J);if("code"in X)X.code($,Y);else if($.$data&&X.validate)Tz.funcKeywordCode($,X);else if("macro"in X)Tz.macroKeywordCode($,X);else if(X.compile||X.validate)Tz.funcKeywordCode($,X)}var M_1=/^\/(?:[^~]|~0|~1)*$/,N_1=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function R00(Z,{dataLevel:J,dataNames:X,dataPathArr:Y}){let $,Q;if(Z==="")return f0.default.rootData;if(Z[0]==="/"){if(!M_1.test(Z))throw new Error(`Invalid JSON-pointer: ${Z}`);$=Z,Q=f0.default.rootData}else{let V=N_1.exec(Z);if(!V)throw new Error(`Invalid JSON-pointer: ${Z}`);let z=+V[1];if($=V[2],$==="#"){if(z>=J)throw new Error(G("property/index",z));return Y[J-z]}if(z>J)throw new Error(G("data",z));if(Q=X[J-z],!$)return Q}let K=Q,W=$.split("/");for(let V of W)if(V)Q=j0._`${Q}${j0.getProperty(mZ.unescapeJsonPointer(V))}`,K=j0._`${K} && ${Q}`;return K;function G(V,z){return`Cannot access ${V} ${z} levels up, current level is ${J}`}}M00.getData=R00});var Bw=O((D00)=>{Object.defineProperty(D00,"__esModule",{value:!0});class j00 extends Error{constructor(Z){super("validation failed");this.errors=Z,this.ajv=this.validation=!0}}D00.default=j00});var kz=O((C00)=>{Object.defineProperty(C00,"__esModule",{value:!0});var ck=Pz();class P00 extends Error{constructor(Z,J,X,Y){super(Y||`can't resolve reference ${X} from id ${J}`);this.missingRef=ck.resolveUrl(Z,J,X),this.missingSchema=ck.normalizeId(ck.getFullPath(Z,this.missingRef))}}C00.default=P00});var Ow=O((k00)=>{Object.defineProperty(k00,"__esModule",{value:!0});k00.resolveSchema=k00.getCompilingSchema=k00.resolveRef=k00.compileSchema=k00.SchemaEnv=void 0;var g4=t0(),T_1=Bw(),D$=gZ(),m4=Pz(),T00=F1(),E_1=Ez();class Iz{constructor(Z){var J;this.refs={},this.dynamicAnchors={};let X;if(typeof Z.schema=="object")X=Z.schema;this.schema=Z.schema,this.schemaId=Z.schemaId,this.root=Z.root||this,this.baseId=(J=Z.baseId)!==null&&J!==void 0?J:m4.normalizeId(X===null||X===void 0?void 0:X[Z.schemaId||"$id"]),this.schemaPath=Z.schemaPath,this.localRefs=Z.localRefs,this.meta=Z.meta,this.$async=X===null||X===void 0?void 0:X.$async,this.refs={}}}k00.SchemaEnv=Iz;function pk(Z){let J=E00.call(this,Z);if(J)return J;let X=m4.getFullPath(this.opts.uriResolver,Z.root.baseId),{es5:Y,lines:$}=this.opts.code,{ownProperties:Q}=this.opts,K=new g4.CodeGen(this.scope,{es5:Y,lines:$,ownProperties:Q}),W;if(Z.$async)W=K.scopeValue("Error",{ref:T_1.default,code:g4._`require("ajv/dist/runtime/validation_error").default`});let G=K.scopeName("validate");Z.validateName=G;let V={gen:K,allErrors:this.opts.allErrors,data:D$.default.data,parentData:D$.default.parentData,parentDataProperty:D$.default.parentDataProperty,dataNames:[D$.default.data],dataPathArr:[g4.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:K.scopeValue("schema",this.opts.code.source===!0?{ref:Z.schema,code:g4.stringify(Z.schema)}:{ref:Z.schema}),validateName:G,ValidationError:W,schema:Z.schema,schemaEnv:Z,rootId:X,baseId:Z.baseId||X,schemaPath:g4.nil,errSchemaPath:Z.schemaPath||(this.opts.jtd?"":"#"),errorPath:g4._`""`,opts:this.opts,self:this},z;try{this._compilations.add(Z),E_1.validateFunctionCode(V),K.optimize(this.opts.code.optimize);let F=K.toString();if(z=`${K.scopeRefs(D$.default.scope)}return ${F}`,this.opts.code.process)z=this.opts.code.process(z,Z);let q=new Function(`${D$.default.self}`,`${D$.default.scope}`,z)(this,this.scope.get());if(this.scope.value(G,{ref:q}),q.errors=null,q.schema=Z.schema,q.schemaEnv=Z,Z.$async)q.$async=!0;if(this.opts.code.source===!0)q.source={validateName:G,validateCode:F,scopeValues:K._values};if(this.opts.unevaluated){let{props:U,items:L}=V;if(q.evaluated={props:U instanceof g4.Name?void 0:U,items:L instanceof g4.Name?void 0:L,dynamicProps:U instanceof g4.Name,dynamicItems:L instanceof g4.Name},q.source)q.source.evaluated=g4.stringify(q.evaluated)}return Z.validate=q,Z}catch(F){if(delete Z.validate,delete Z.validateName,z)this.logger.error("Error compiling schema, function code:",z);throw F}finally{this._compilations.delete(Z)}}k00.compileSchema=pk;function k_1(Z,J,X){var Y;X=m4.resolveUrl(this.opts.uriResolver,J,X);let $=Z.refs[X];if($)return $;let Q=v_1.call(this,Z,X);if(Q===void 0){let K=(Y=Z.localRefs)===null||Y===void 0?void 0:Y[X],{schemaId:W}=this.opts;if(K)Q=new Iz({schema:K,schemaId:W,root:Z,baseId:J})}if(Q===void 0)return;return Z.refs[X]=I_1.call(this,Q)}k00.resolveRef=k_1;function I_1(Z){if(m4.inlineRef(Z.schema,this.opts.inlineRefs))return Z.schema;return Z.validate?Z:pk.call(this,Z)}function E00(Z){for(let J of this._compilations)if(__1(J,Z))return J}k00.getCompilingSchema=E00;function __1(Z,J){return Z.schema===J.schema&&Z.root===J.root&&Z.baseId===J.baseId}function v_1(Z,J){let X;while(typeof(X=this.refs[J])=="string")J=X;return X||this.schemas[J]||ww.call(this,Z,J)}function ww(Z,J){let X=this.opts.uriResolver.parse(J),Y=m4._getFullPath(this.opts.uriResolver,X),$=m4.getFullPath(this.opts.uriResolver,Z.baseId,void 0);if(Object.keys(Z.schema).length>0&&Y===$)return lk.call(this,X,Z);let Q=m4.normalizeId(Y),K=this.refs[Q]||this.schemas[Q];if(typeof K=="string"){let W=ww.call(this,Z,K);if(typeof(W===null||W===void 0?void 0:W.schema)!=="object")return;return lk.call(this,X,W)}if(typeof(K===null||K===void 0?void 0:K.schema)!=="object")return;if(!K.validate)pk.call(this,K);if(Q===m4.normalizeId(J)){let{schema:W}=K,{schemaId:G}=this.opts,V=W[G];if(V)$=m4.resolveUrl(this.opts.uriResolver,$,V);return new Iz({schema:W,schemaId:G,root:Z,baseId:$})}return lk.call(this,X,K)}k00.resolveSchema=ww;var S_1=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function lk(Z,{baseId:J,schema:X,root:Y}){var $;if((($=Z.fragment)===null||$===void 0?void 0:$[0])!=="/")return;for(let W of Z.fragment.slice(1).split("/")){if(typeof X==="boolean")return;let G=X[T00.unescapeFragment(W)];if(G===void 0)return;X=G;let V=typeof X==="object"&&X[this.opts.schemaId];if(!S_1.has(W)&&V)J=m4.resolveUrl(this.opts.uriResolver,J,V)}let Q;if(typeof X!="boolean"&&X.$ref&&!T00.schemaHasRulesButRef(X,this.RULES)){let W=m4.resolveUrl(this.opts.uriResolver,J,X.$ref);Q=ww.call(this,Y,W)}let{schemaId:K}=this.opts;if(Q=Q||new Iz({schema:X,schemaId:K,root:Y,baseId:J}),Q.schema!==Q.root.schema)return Q;return}});var _00=O((ZA6,y_1)=>{y_1.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var S00=O((JA6,v00)=>{var b_1={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};v00.exports={HEX:b_1}});var m00=O((XA6,g00)=>{var{HEX:g_1}=S00(),m_1=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function f00(Z){if(b00(Z,".")<3)return{host:Z,isIPV4:!1};let J=Z.match(m_1)||[],[X]=J;if(X)return{host:d_1(X,"."),isIPV4:!0};else return{host:Z,isIPV4:!1}}function ik(Z,J=!1){let X="",Y=!0;for(let $ of Z){if(g_1[$]===void 0)return;if($!=="0"&&Y===!0)Y=!1;if(!Y)X+=$}if(J&&X.length===0)X="0";return X}function u_1(Z){let J=0,X={error:!1,address:"",zone:""},Y=[],$=[],Q=!1,K=!1,W=!1;function G(){if($.length){if(Q===!1){let V=ik($);if(V!==void 0)Y.push(V);else return X.error=!0,!1}$.length=0}return!0}for(let V=0;V<Z.length;V++){let z=Z[V];if(z==="["||z==="]")continue;if(z===":"){if(K===!0)W=!0;if(!G())break;if(J++,Y.push(":"),J>7){X.error=!0;break}if(V-1>=0&&Z[V-1]===":")K=!0;continue}else if(z==="%"){if(!G())break;Q=!0}else{$.push(z);continue}}if($.length)if(Q)X.zone=$.join("");else if(W)Y.push($.join(""));else Y.push(ik($));return X.address=Y.join(""),X}function y00(Z){if(b00(Z,":")<2)return{host:Z,isIPV6:!1};let J=u_1(Z);if(!J.error){let{address:X,address:Y}=J;if(J.zone)X+="%"+J.zone,Y+="%25"+J.zone;return{host:X,escapedHost:Y,isIPV6:!0}}else return{host:Z,isIPV6:!1}}function d_1(Z,J){let X="",Y=!0,$=Z.length;for(let Q=0;Q<$;Q++){let K=Z[Q];if(K==="0"&&Y){if(Q+1<=$&&Z[Q+1]===J||Q+1===$)X+=K,Y=!1}else{if(K===J)Y=!0;else Y=!1;X+=K}}return X}function b00(Z,J){let X=0;for(let Y=0;Y<Z.length;Y++)if(Z[Y]===J)X++;return X}var A00=/^\.\.?\//u,x00=/^\/\.(?:\/|$)/u,h00=/^\/\.\.(?:\/|$)/u,c_1=/^\/?(?:.|\n)*?(?=\/|$)/u;function l_1(Z){let J=[];while(Z.length)if(Z.match(A00))Z=Z.replace(A00,"");else if(Z.match(x00))Z=Z.replace(x00,"/");else if(Z.match(h00))Z=Z.replace(h00,"/"),J.pop();else if(Z==="."||Z==="..")Z="";else{let X=Z.match(c_1);if(X){let Y=X[0];Z=Z.slice(Y.length),J.push(Y)}else throw new Error("Unexpected dot segment condition")}return J.join("")}function p_1(Z,J){let X=J!==!0?escape:unescape;if(Z.scheme!==void 0)Z.scheme=X(Z.scheme);if(Z.userinfo!==void 0)Z.userinfo=X(Z.userinfo);if(Z.host!==void 0)Z.host=X(Z.host);if(Z.path!==void 0)Z.path=X(Z.path);if(Z.query!==void 0)Z.query=X(Z.query);if(Z.fragment!==void 0)Z.fragment=X(Z.fragment);return Z}function i_1(Z){let J=[];if(Z.userinfo!==void 0)J.push(Z.userinfo),J.push("@");if(Z.host!==void 0){let X=unescape(Z.host),Y=f00(X);if(Y.isIPV4)X=Y.host;else{let $=y00(Y.host);if($.isIPV6===!0)X=`[${$.escapedHost}]`;else X=Z.host}J.push(X)}if(typeof Z.port==="number"||typeof Z.port==="string")J.push(":"),J.push(String(Z.port));return J.length?J.join(""):void 0}g00.exports={recomposeAuthority:i_1,normalizeComponentEncoding:p_1,removeDotSegments:l_1,normalizeIPv4:f00,normalizeIPv6:y00,stringArrayToHexStripped:ik}});var i00=O((YA6,p00)=>{var n_1=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,a_1=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function u00(Z){return typeof Z.secure==="boolean"?Z.secure:String(Z.scheme).toLowerCase()==="wss"}function d00(Z){if(!Z.host)Z.error=Z.error||"HTTP URIs must have a host.";return Z}function c00(Z){let J=String(Z.scheme).toLowerCase()==="https";if(Z.port===(J?443:80)||Z.port==="")Z.port=void 0;if(!Z.path)Z.path="/";return Z}function s_1(Z){return Z.secure=u00(Z),Z.resourceName=(Z.path||"/")+(Z.query?"?"+Z.query:""),Z.path=void 0,Z.query=void 0,Z}function o_1(Z){if(Z.port===(u00(Z)?443:80)||Z.port==="")Z.port=void 0;if(typeof Z.secure==="boolean")Z.scheme=Z.secure?"wss":"ws",Z.secure=void 0;if(Z.resourceName){let[J,X]=Z.resourceName.split("?");Z.path=J&&J!=="/"?J:void 0,Z.query=X,Z.resourceName=void 0}return Z.fragment=void 0,Z}function r_1(Z,J){if(!Z.path)return Z.error="URN can not be parsed",Z;let X=Z.path.match(a_1);if(X){let Y=J.scheme||Z.scheme||"urn";Z.nid=X[1].toLowerCase(),Z.nss=X[2];let $=`${Y}:${J.nid||Z.nid}`,Q=nk[$];if(Z.path=void 0,Q)Z=Q.parse(Z,J)}else Z.error=Z.error||"URN can not be parsed.";return Z}function t_1(Z,J){let X=J.scheme||Z.scheme||"urn",Y=Z.nid.toLowerCase(),$=`${X}:${J.nid||Y}`,Q=nk[$];if(Q)Z=Q.serialize(Z,J);let K=Z,W=Z.nss;return K.path=`${Y||J.nid}:${W}`,J.skipEscape=!0,K}function e_1(Z,J){let X=Z;if(X.uuid=X.nss,X.nss=void 0,!J.tolerant&&(!X.uuid||!n_1.test(X.uuid)))X.error=X.error||"UUID is not valid.";return X}function Zv1(Z){let J=Z;return J.nss=(Z.uuid||"").toLowerCase(),J}var l00={scheme:"http",domainHost:!0,parse:d00,serialize:c00},Jv1={scheme:"https",domainHost:l00.domainHost,parse:d00,serialize:c00},Rw={scheme:"ws",domainHost:!0,parse:s_1,serialize:o_1},Xv1={scheme:"wss",domainHost:Rw.domainHost,parse:Rw.parse,serialize:Rw.serialize},Yv1={scheme:"urn",parse:r_1,serialize:t_1,skipNormalize:!0},$v1={scheme:"urn:uuid",parse:e_1,serialize:Zv1,skipNormalize:!0},nk={http:l00,https:Jv1,ws:Rw,wss:Xv1,urn:Yv1,"urn:uuid":$v1};p00.exports=nk});var a00=O(($A6,Nw)=>{var{normalizeIPv6:Qv1,normalizeIPv4:Kv1,removeDotSegments:_z,recomposeAuthority:Wv1,normalizeComponentEncoding:Mw}=m00(),ak=i00();function Gv1(Z,J){if(typeof Z==="string")Z=f7(uZ(Z,J),J);else if(typeof Z==="object")Z=uZ(f7(Z,J),J);return Z}function Vv1(Z,J,X){let Y=Object.assign({scheme:"null"},X),$=n00(uZ(Z,Y),uZ(J,Y),Y,!0);return f7($,{...Y,skipEscape:!0})}function n00(Z,J,X,Y){let $={};if(!Y)Z=uZ(f7(Z,X),X),J=uZ(f7(J,X),X);if(X=X||{},!X.tolerant&&J.scheme)$.scheme=J.scheme,$.userinfo=J.userinfo,$.host=J.host,$.port=J.port,$.path=_z(J.path||""),$.query=J.query;else{if(J.userinfo!==void 0||J.host!==void 0||J.port!==void 0)$.userinfo=J.userinfo,$.host=J.host,$.port=J.port,$.path=_z(J.path||""),$.query=J.query;else{if(!J.path)if($.path=Z.path,J.query!==void 0)$.query=J.query;else $.query=Z.query;else{if(J.path.charAt(0)==="/")$.path=_z(J.path);else{if((Z.userinfo!==void 0||Z.host!==void 0||Z.port!==void 0)&&!Z.path)$.path="/"+J.path;else if(!Z.path)$.path=J.path;else $.path=Z.path.slice(0,Z.path.lastIndexOf("/")+1)+J.path;$.path=_z($.path)}$.query=J.query}$.userinfo=Z.userinfo,$.host=Z.host,$.port=Z.port}$.scheme=Z.scheme}return $.fragment=J.fragment,$}function zv1(Z,J,X){if(typeof Z==="string")Z=unescape(Z),Z=f7(Mw(uZ(Z,X),!0),{...X,skipEscape:!0});else if(typeof Z==="object")Z=f7(Mw(Z,!0),{...X,skipEscape:!0});if(typeof J==="string")J=unescape(J),J=f7(Mw(uZ(J,X),!0),{...X,skipEscape:!0});else if(typeof J==="object")J=f7(Mw(J,!0),{...X,skipEscape:!0});return Z.toLowerCase()===J.toLowerCase()}function f7(Z,J){let X={host:Z.host,scheme:Z.scheme,userinfo:Z.userinfo,port:Z.port,path:Z.path,query:Z.query,nid:Z.nid,nss:Z.nss,uuid:Z.uuid,fragment:Z.fragment,reference:Z.reference,resourceName:Z.resourceName,secure:Z.secure,error:""},Y=Object.assign({},J),$=[],Q=ak[(Y.scheme||X.scheme||"").toLowerCase()];if(Q&&Q.serialize)Q.serialize(X,Y);if(X.path!==void 0)if(!Y.skipEscape){if(X.path=escape(X.path),X.scheme!==void 0)X.path=X.path.split("%3A").join(":")}else X.path=unescape(X.path);if(Y.reference!=="suffix"&&X.scheme)$.push(X.scheme,":");let K=Wv1(X);if(K!==void 0){if(Y.reference!=="suffix")$.push("//");if($.push(K),X.path&&X.path.charAt(0)!=="/")$.push("/")}if(X.path!==void 0){let W=X.path;if(!Y.absolutePath&&(!Q||!Q.absolutePath))W=_z(W);if(K===void 0)W=W.replace(/^\/\//u,"/%2F");$.push(W)}if(X.query!==void 0)$.push("?",X.query);if(X.fragment!==void 0)$.push("#",X.fragment);return $.join("")}var Hv1=Array.from({length:127},(Z,J)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(J)));function Fv1(Z){let J=0;for(let X=0,Y=Z.length;X<Y;++X)if(J=Z.charCodeAt(X),J>126||Hv1[J])return!0;return!1}var qv1=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function uZ(Z,J){let X=Object.assign({},J),Y={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},$=Z.indexOf("%")!==-1,Q=!1;if(X.reference==="suffix")Z=(X.scheme?X.scheme+":":"")+"//"+Z;let K=Z.match(qv1);if(K){if(Y.scheme=K[1],Y.userinfo=K[3],Y.host=K[4],Y.port=parseInt(K[5],10),Y.path=K[6]||"",Y.query=K[7],Y.fragment=K[8],isNaN(Y.port))Y.port=K[5];if(Y.host){let G=Kv1(Y.host);if(G.isIPV4===!1){let V=Qv1(G.host);Y.host=V.host.toLowerCase(),Q=V.isIPV6}else Y.host=G.host,Q=!0}if(Y.scheme===void 0&&Y.userinfo===void 0&&Y.host===void 0&&Y.port===void 0&&Y.query===void 0&&!Y.path)Y.reference="same-document";else if(Y.scheme===void 0)Y.reference="relative";else if(Y.fragment===void 0)Y.reference="absolute";else Y.reference="uri";if(X.reference&&X.reference!=="suffix"&&X.reference!==Y.reference)Y.error=Y.error||"URI is not a "+X.reference+" reference.";let W=ak[(X.scheme||Y.scheme||"").toLowerCase()];if(!X.unicodeSupport&&(!W||!W.unicodeSupport)){if(Y.host&&(X.domainHost||W&&W.domainHost)&&Q===!1&&Fv1(Y.host))try{Y.host=URL.domainToASCII(Y.host.toLowerCase())}catch(G){Y.error=Y.error||"Host's domain name can not be converted to ASCII: "+G}}if(!W||W&&!W.skipNormalize){if($&&Y.scheme!==void 0)Y.scheme=unescape(Y.scheme);if($&&Y.host!==void 0)Y.host=unescape(Y.host);if(Y.path)Y.path=escape(unescape(Y.path));if(Y.fragment)Y.fragment=encodeURI(decodeURIComponent(Y.fragment))}if(W&&W.parse)W.parse(Y,X)}else Y.error=Y.error||"URI can not be parsed.";return Y}var sk={SCHEMES:ak,normalize:Gv1,resolve:Vv1,resolveComponents:n00,equal:zv1,serialize:f7,parse:uZ};Nw.exports=sk;Nw.exports.default=sk;Nw.exports.fastUri=sk});var r00=O((o00)=>{Object.defineProperty(o00,"__esModule",{value:!0});var s00=a00();s00.code='require("ajv/dist/runtime/uri").default';o00.default=s00});var Q10=O((dZ)=>{Object.defineProperty(dZ,"__esModule",{value:!0});dZ.CodeGen=dZ.Name=dZ.nil=dZ.stringify=dZ.str=dZ._=dZ.KeywordCxt=void 0;var Lv1=Ez();Object.defineProperty(dZ,"KeywordCxt",{enumerable:!0,get:function(){return Lv1.KeywordCxt}});var NW=t0();Object.defineProperty(dZ,"_",{enumerable:!0,get:function(){return NW._}});Object.defineProperty(dZ,"str",{enumerable:!0,get:function(){return NW.str}});Object.defineProperty(dZ,"stringify",{enumerable:!0,get:function(){return NW.stringify}});Object.defineProperty(dZ,"nil",{enumerable:!0,get:function(){return NW.nil}});Object.defineProperty(dZ,"Name",{enumerable:!0,get:function(){return NW.Name}});Object.defineProperty(dZ,"CodeGen",{enumerable:!0,get:function(){return NW.CodeGen}});var Bv1=Bw(),X10=kz(),wv1=Ik(),vz=Ow(),Ov1=t0(),Sz=Pz(),jw=Dz(),rk=F1(),t00=_00(),Rv1=r00(),Y10=(Z,J)=>new RegExp(Z,J);Y10.code="new RegExp";var Mv1=["removeAdditional","useDefaults","coerceTypes"],Nv1=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),jv1={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},Dv1={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},e00=200;function Pv1(Z){var J,X,Y,$,Q,K,W,G,V,z,F,H,q,U,L,B,w,R,M,N,P,D,C,T,E;let A=Z.strict,v=(J=Z.code)===null||J===void 0?void 0:J.optimize,x=v===!0||v===void 0?1:v||0,I=(Y=(X=Z.code)===null||X===void 0?void 0:X.regExp)!==null&&Y!==void 0?Y:Y10,_=($=Z.uriResolver)!==null&&$!==void 0?$:Rv1.default;return{strictSchema:(K=(Q=Z.strictSchema)!==null&&Q!==void 0?Q:A)!==null&&K!==void 0?K:!0,strictNumbers:(G=(W=Z.strictNumbers)!==null&&W!==void 0?W:A)!==null&&G!==void 0?G:!0,strictTypes:(z=(V=Z.strictTypes)!==null&&V!==void 0?V:A)!==null&&z!==void 0?z:"log",strictTuples:(H=(F=Z.strictTuples)!==null&&F!==void 0?F:A)!==null&&H!==void 0?H:"log",strictRequired:(U=(q=Z.strictRequired)!==null&&q!==void 0?q:A)!==null&&U!==void 0?U:!1,code:Z.code?{...Z.code,optimize:x,regExp:I}:{optimize:x,regExp:I},loopRequired:(L=Z.loopRequired)!==null&&L!==void 0?L:e00,loopEnum:(B=Z.loopEnum)!==null&&B!==void 0?B:e00,meta:(w=Z.meta)!==null&&w!==void 0?w:!0,messages:(R=Z.messages)!==null&&R!==void 0?R:!0,inlineRefs:(M=Z.inlineRefs)!==null&&M!==void 0?M:!0,schemaId:(N=Z.schemaId)!==null&&N!==void 0?N:"$id",addUsedSchema:(P=Z.addUsedSchema)!==null&&P!==void 0?P:!0,validateSchema:(D=Z.validateSchema)!==null&&D!==void 0?D:!0,validateFormats:(C=Z.validateFormats)!==null&&C!==void 0?C:!0,unicodeRegExp:(T=Z.unicodeRegExp)!==null&&T!==void 0?T:!0,int32range:(E=Z.int32range)!==null&&E!==void 0?E:!0,uriResolver:_}}class Dw{constructor(Z={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,Z=this.opts={...Z,...Pv1(Z)};let{es5:J,lines:X}=this.opts.code;this.scope=new Ov1.ValueScope({scope:{},prefixes:Nv1,es5:J,lines:X}),this.logger=_v1(Z.logger);let Y=Z.validateFormats;if(Z.validateFormats=!1,this.RULES=wv1.getRules(),Z10.call(this,jv1,Z,"NOT SUPPORTED"),Z10.call(this,Dv1,Z,"DEPRECATED","warn"),this._metaOpts=kv1.call(this),Z.formats)Tv1.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),Z.keywords)Ev1.call(this,Z.keywords);if(typeof Z.meta=="object")this.addMetaSchema(Z.meta);Cv1.call(this),Z.validateFormats=Y}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:Z,meta:J,schemaId:X}=this.opts,Y=t00;if(X==="id")Y={...t00},Y.id=Y.$id,delete Y.$id;if(J&&Z)this.addMetaSchema(Y,Y[X],!1)}defaultMeta(){let{meta:Z,schemaId:J}=this.opts;return this.opts.defaultMeta=typeof Z=="object"?Z[J]||Z:void 0}validate(Z,J){let X;if(typeof Z=="string"){if(X=this.getSchema(Z),!X)throw new Error(`no schema with key or ref "${Z}"`)}else X=this.compile(Z);let Y=X(J);if(!("$async"in X))this.errors=X.errors;return Y}compile(Z,J){let X=this._addSchema(Z,J);return X.validate||this._compileSchemaEnv(X)}compileAsync(Z,J){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:X}=this.opts;return Y.call(this,Z,J);async function Y(V,z){await $.call(this,V.$schema);let F=this._addSchema(V,z);return F.validate||Q.call(this,F)}async function $(V){if(V&&!this.getSchema(V))await Y.call(this,{$ref:V},!0)}async function Q(V){try{return this._compileSchemaEnv(V)}catch(z){if(!(z instanceof X10.default))throw z;return K.call(this,z),await W.call(this,z.missingSchema),Q.call(this,V)}}function K({missingSchema:V,missingRef:z}){if(this.refs[V])throw new Error(`AnySchema ${V} is loaded but ${z} cannot be resolved`)}async function W(V){let z=await G.call(this,V);if(!this.refs[V])await $.call(this,z.$schema);if(!this.refs[V])this.addSchema(z,V,J)}async function G(V){let z=this._loading[V];if(z)return z;try{return await(this._loading[V]=X(V))}finally{delete this._loading[V]}}}addSchema(Z,J,X,Y=this.opts.validateSchema){if(Array.isArray(Z)){for(let Q of Z)this.addSchema(Q,void 0,X,Y);return this}let $;if(typeof Z==="object"){let{schemaId:Q}=this.opts;if($=Z[Q],$!==void 0&&typeof $!="string")throw new Error(`schema ${Q} must be string`)}return J=Sz.normalizeId(J||$),this._checkUnique(J),this.schemas[J]=this._addSchema(Z,X,J,Y,!0),this}addMetaSchema(Z,J,X=this.opts.validateSchema){return this.addSchema(Z,J,!0,X),this}validateSchema(Z,J){if(typeof Z=="boolean")return!0;let X;if(X=Z.$schema,X!==void 0&&typeof X!="string")throw new Error("$schema must be a string");if(X=X||this.opts.defaultMeta||this.defaultMeta(),!X)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let Y=this.validate(X,Z);if(!Y&&J){let $="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error($);else throw new Error($)}return Y}getSchema(Z){let J;while(typeof(J=J10.call(this,Z))=="string")Z=J;if(J===void 0){let{schemaId:X}=this.opts,Y=new vz.SchemaEnv({schema:{},schemaId:X});if(J=vz.resolveSchema.call(this,Y,Z),!J)return;this.refs[Z]=J}return J.validate||this._compileSchemaEnv(J)}removeSchema(Z){if(Z instanceof RegExp)return this._removeAllSchemas(this.schemas,Z),this._removeAllSchemas(this.refs,Z),this;switch(typeof Z){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let J=J10.call(this,Z);if(typeof J=="object")this._cache.delete(J.schema);return delete this.schemas[Z],delete this.refs[Z],this}case"object":{let J=Z;this._cache.delete(J);let X=Z[this.opts.schemaId];if(X)X=Sz.normalizeId(X),delete this.schemas[X],delete this.refs[X];return this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(Z){for(let J of Z)this.addKeyword(J);return this}addKeyword(Z,J){let X;if(typeof Z=="string"){if(X=Z,typeof J=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),J.keyword=X}else if(typeof Z=="object"&&J===void 0){if(J=Z,X=J.keyword,Array.isArray(X)&&!X.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Sv1.call(this,X,J),!J)return rk.eachItem(X,($)=>ok.call(this,$)),this;xv1.call(this,J);let Y={...J,type:jw.getJSONTypes(J.type),schemaType:jw.getJSONTypes(J.schemaType)};return rk.eachItem(X,Y.type.length===0?($)=>ok.call(this,$,Y):($)=>Y.type.forEach((Q)=>ok.call(this,$,Y,Q))),this}getKeyword(Z){let J=this.RULES.all[Z];return typeof J=="object"?J.definition:!!J}removeKeyword(Z){let{RULES:J}=this;delete J.keywords[Z],delete J.all[Z];for(let X of J.rules){let Y=X.rules.findIndex(($)=>$.keyword===Z);if(Y>=0)X.rules.splice(Y,1)}return this}addFormat(Z,J){if(typeof J=="string")J=new RegExp(J);return this.formats[Z]=J,this}errorsText(Z=this.errors,{separator:J=", ",dataVar:X="data"}={}){if(!Z||Z.length===0)return"No errors";return Z.map((Y)=>`${X}${Y.instancePath} ${Y.message}`).reduce((Y,$)=>Y+J+$)}$dataMetaSchema(Z,J){let X=this.RULES.all;Z=JSON.parse(JSON.stringify(Z));for(let Y of J){let $=Y.split("/").slice(1),Q=Z;for(let K of $)Q=Q[K];for(let K in X){let W=X[K];if(typeof W!="object")continue;let{$data:G}=W.definition,V=Q[K];if(G&&V)Q[K]=$10(V)}}return Z}_removeAllSchemas(Z,J){for(let X in Z){let Y=Z[X];if(!J||J.test(X)){if(typeof Y=="string")delete Z[X];else if(Y&&!Y.meta)this._cache.delete(Y.schema),delete Z[X]}}}_addSchema(Z,J,X,Y=this.opts.validateSchema,$=this.opts.addUsedSchema){let Q,{schemaId:K}=this.opts;if(typeof Z=="object")Q=Z[K];else if(this.opts.jtd)throw new Error("schema must be object");else if(typeof Z!="boolean")throw new Error("schema must be object or boolean");let W=this._cache.get(Z);if(W!==void 0)return W;X=Sz.normalizeId(Q||X);let G=Sz.getSchemaRefs.call(this,Z,X);if(W=new vz.SchemaEnv({schema:Z,schemaId:K,meta:J,baseId:X,localRefs:G}),this._cache.set(W.schema,W),$&&!X.startsWith("#")){if(X)this._checkUnique(X);this.refs[X]=W}if(Y)this.validateSchema(Z,!0);return W}_checkUnique(Z){if(this.schemas[Z]||this.refs[Z])throw new Error(`schema with key or id "${Z}" already exists`)}_compileSchemaEnv(Z){if(Z.meta)this._compileMetaSchema(Z);else vz.compileSchema.call(this,Z);if(!Z.validate)throw new Error("ajv implementation error");return Z.validate}_compileMetaSchema(Z){let J=this.opts;this.opts=this._metaOpts;try{vz.compileSchema.call(this,Z)}finally{this.opts=J}}}Dw.ValidationError=Bv1.default;Dw.MissingRefError=X10.default;dZ.default=Dw;function Z10(Z,J,X,Y="error"){for(let $ in Z){let Q=$;if(Q in J)this.logger[Y](`${X}: option ${$}. ${Z[Q]}`)}}function J10(Z){return Z=Sz.normalizeId(Z),this.schemas[Z]||this.refs[Z]}function Cv1(){let Z=this.opts.schemas;if(!Z)return;if(Array.isArray(Z))this.addSchema(Z);else for(let J in Z)this.addSchema(Z[J],J)}function Tv1(){for(let Z in this.opts.formats){let J=this.opts.formats[Z];if(J)this.addFormat(Z,J)}}function Ev1(Z){if(Array.isArray(Z)){this.addVocabulary(Z);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let J in Z){let X=Z[J];if(!X.keyword)X.keyword=J;this.addKeyword(X)}}function kv1(){let Z={...this.opts};for(let J of Mv1)delete Z[J];return Z}var Iv1={log(){},warn(){},error(){}};function _v1(Z){if(Z===!1)return Iv1;if(Z===void 0)return console;if(Z.log&&Z.warn&&Z.error)return Z;throw new Error("logger must implement log, warn and error methods")}var vv1=/^[a-z_$][a-z0-9_$:-]*$/i;function Sv1(Z,J){let{RULES:X}=this;if(rk.eachItem(Z,(Y)=>{if(X.keywords[Y])throw new Error(`Keyword ${Y} is already defined`);if(!vv1.test(Y))throw new Error(`Keyword ${Y} has invalid name`)}),!J)return;if(J.$data&&!(("code"in J)||("validate"in J)))throw new Error('$data keyword must have "code" or "validate" function')}function ok(Z,J,X){var Y;let $=J===null||J===void 0?void 0:J.post;if(X&&$)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:Q}=this,K=$?Q.post:Q.rules.find(({type:G})=>G===X);if(!K)K={type:X,rules:[]},Q.rules.push(K);if(Q.keywords[Z]=!0,!J)return;let W={keyword:Z,definition:{...J,type:jw.getJSONTypes(J.type),schemaType:jw.getJSONTypes(J.schemaType)}};if(J.before)Av1.call(this,K,W,J.before);else K.rules.push(W);Q.all[Z]=W,(Y=J.implements)===null||Y===void 0||Y.forEach((G)=>this.addKeyword(G))}function Av1(Z,J,X){let Y=Z.rules.findIndex(($)=>$.keyword===X);if(Y>=0)Z.rules.splice(Y,0,J);else Z.rules.push(J),this.logger.warn(`rule ${X} is not defined`)}function xv1(Z){let{metaSchema:J}=Z;if(J===void 0)return;if(Z.$data&&this.opts.$data)J=$10(J);Z.validateSchema=this.compile(J,!0)}var hv1={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function $10(Z){return{anyOf:[Z,hv1]}}});var W10=O((K10)=>{Object.defineProperty(K10,"__esModule",{value:!0});var bv1={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};K10.default=bv1});var q10=O((H10)=>{Object.defineProperty(H10,"__esModule",{value:!0});H10.callRef=H10.getValidate=void 0;var mv1=kz(),G10=d9(),h5=t0(),jW=gZ(),V10=Ow(),Pw=F1(),uv1={keyword:"$ref",schemaType:"string",code(Z){let{gen:J,schema:X,it:Y}=Z,{baseId:$,schemaEnv:Q,validateName:K,opts:W,self:G}=Y,{root:V}=Q;if((X==="#"||X==="#/")&&$===V.baseId)return F();let z=V10.resolveRef.call(G,V,$,X);if(z===void 0)throw new mv1.default(Y.opts.uriResolver,$,X);if(z instanceof V10.SchemaEnv)return H(z);return q(z);function F(){if(Q===V)return Cw(Z,K,Q,Q.$async);let U=J.scopeValue("root",{ref:V});return Cw(Z,h5._`${U}.validate`,V,V.$async)}function H(U){let L=z10(Z,U);Cw(Z,L,U,U.$async)}function q(U){let L=J.scopeValue("schema",W.code.source===!0?{ref:U,code:h5.stringify(U)}:{ref:U}),B=J.name("valid"),w=Z.subschema({schema:U,dataTypes:[],schemaPath:h5.nil,topSchemaRef:L,errSchemaPath:X},B);Z.mergeEvaluated(w),Z.ok(B)}}};function z10(Z,J){let{gen:X}=Z;return J.validate?X.scopeValue("validate",{ref:J.validate}):h5._`${X.scopeValue("wrapper",{ref:J})}.validate`}H10.getValidate=z10;function Cw(Z,J,X,Y){let{gen:$,it:Q}=Z,{allErrors:K,schemaEnv:W,opts:G}=Q,V=G.passContext?jW.default.this:h5.nil;if(Y)z();else F();function z(){if(!W.$async)throw new Error("async schema referenced by sync schema");let U=$.let("valid");$.try(()=>{if($.code(h5._`await ${G10.callValidateCode(Z,J,V)}`),q(J),!K)$.assign(U,!0)},(L)=>{if($.if(h5._`!(${L} instanceof ${Q.ValidationError})`,()=>$.throw(L)),H(L),!K)$.assign(U,!1)}),Z.ok(U)}function F(){Z.result(G10.callValidateCode(Z,J,V),()=>q(J),()=>H(J))}function H(U){let L=h5._`${U}.errors`;$.assign(jW.default.vErrors,h5._`${jW.default.vErrors} === null ? ${L} : ${jW.default.vErrors}.concat(${L})`),$.assign(jW.default.errors,h5._`${jW.default.vErrors}.length`)}function q(U){var L;if(!Q.opts.unevaluated)return;let B=(L=X===null||X===void 0?void 0:X.validate)===null||L===void 0?void 0:L.evaluated;if(Q.props!==!0)if(B&&!B.dynamicProps){if(B.props!==void 0)Q.props=Pw.mergeEvaluated.props($,B.props,Q.props)}else{let w=$.var("props",h5._`${U}.evaluated.props`);Q.props=Pw.mergeEvaluated.props($,w,Q.props,h5.Name)}if(Q.items!==!0)if(B&&!B.dynamicItems){if(B.items!==void 0)Q.items=Pw.mergeEvaluated.items($,B.items,Q.items)}else{let w=$.var("items",h5._`${U}.evaluated.items`);Q.items=Pw.mergeEvaluated.items($,w,Q.items,h5.Name)}}}H10.callRef=Cw;H10.default=uv1});var L10=O((U10)=>{Object.defineProperty(U10,"__esModule",{value:!0});var lv1=W10(),pv1=q10(),iv1=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",lv1.default,pv1.default];U10.default=iv1});var w10=O((B10)=>{Object.defineProperty(B10,"__esModule",{value:!0});var Tw=t0(),FX=Tw.operators,Ew={maximum:{okStr:"<=",ok:FX.LTE,fail:FX.GT},minimum:{okStr:">=",ok:FX.GTE,fail:FX.LT},exclusiveMaximum:{okStr:"<",ok:FX.LT,fail:FX.GTE},exclusiveMinimum:{okStr:">",ok:FX.GT,fail:FX.LTE}},av1={message:({keyword:Z,schemaCode:J})=>Tw.str`must be ${Ew[Z].okStr} ${J}`,params:({keyword:Z,schemaCode:J})=>Tw._`{comparison: ${Ew[Z].okStr}, limit: ${J}}`},sv1={keyword:Object.keys(Ew),type:"number",schemaType:"number",$data:!0,error:av1,code(Z){let{keyword:J,data:X,schemaCode:Y}=Z;Z.fail$data(Tw._`${X} ${Ew[J].fail} ${Y} || isNaN(${X})`)}};B10.default=sv1});var R10=O((O10)=>{Object.defineProperty(O10,"__esModule",{value:!0});var Az=t0(),rv1={message:({schemaCode:Z})=>Az.str`must be multiple of ${Z}`,params:({schemaCode:Z})=>Az._`{multipleOf: ${Z}}`},tv1={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:rv1,code(Z){let{gen:J,data:X,schemaCode:Y,it:$}=Z,Q=$.opts.multipleOfPrecision,K=J.let("res"),W=Q?Az._`Math.abs(Math.round(${K}) - ${K}) > 1e-${Q}`:Az._`${K} !== parseInt(${K})`;Z.fail$data(Az._`(${Y} === 0 || (${K} = ${X}/${Y}, ${W}))`)}};O10.default=tv1});var j10=O((N10)=>{Object.defineProperty(N10,"__esModule",{value:!0});function M10(Z){let J=Z.length,X=0,Y=0,$;while(Y<J)if(X++,$=Z.charCodeAt(Y++),$>=55296&&$<=56319&&Y<J){if($=Z.charCodeAt(Y),($&64512)===56320)Y++}return X}N10.default=M10;M10.code='require("ajv/dist/runtime/ucs2length").default'});var P10=O((D10)=>{Object.defineProperty(D10,"__esModule",{value:!0});var P$=t0(),JS1=F1(),XS1=j10(),YS1={message({keyword:Z,schemaCode:J}){let X=Z==="maxLength"?"more":"fewer";return P$.str`must NOT have ${X} than ${J} characters`},params:({schemaCode:Z})=>P$._`{limit: ${Z}}`},$S1={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:YS1,code(Z){let{keyword:J,data:X,schemaCode:Y,it:$}=Z,Q=J==="maxLength"?P$.operators.GT:P$.operators.LT,K=$.opts.unicode===!1?P$._`${X}.length`:P$._`${JS1.useFunc(Z.gen,XS1.default)}(${X})`;Z.fail$data(P$._`${K} ${Q} ${Y}`)}};D10.default=$S1});var T10=O((C10)=>{Object.defineProperty(C10,"__esModule",{value:!0});var KS1=d9(),kw=t0(),WS1={message:({schemaCode:Z})=>kw.str`must match pattern "${Z}"`,params:({schemaCode:Z})=>kw._`{pattern: ${Z}}`},GS1={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:WS1,code(Z){let{data:J,$data:X,schema:Y,schemaCode:$,it:Q}=Z,K=Q.opts.unicodeRegExp?"u":"",W=X?kw._`(new RegExp(${$}, ${K}))`:KS1.usePattern(Z,Y);Z.fail$data(kw._`!${W}.test(${J})`)}};C10.default=GS1});var k10=O((E10)=>{Object.defineProperty(E10,"__esModule",{value:!0});var xz=t0(),zS1={message({keyword:Z,schemaCode:J}){let X=Z==="maxProperties"?"more":"fewer";return xz.str`must NOT have ${X} than ${J} properties`},params:({schemaCode:Z})=>xz._`{limit: ${Z}}`},HS1={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:zS1,code(Z){let{keyword:J,data:X,schemaCode:Y}=Z,$=J==="maxProperties"?xz.operators.GT:xz.operators.LT;Z.fail$data(xz._`Object.keys(${X}).length ${$} ${Y}`)}};E10.default=HS1});var _10=O((I10)=>{Object.defineProperty(I10,"__esModule",{value:!0});var hz=d9(),fz=t0(),qS1=F1(),US1={message:({params:{missingProperty:Z}})=>fz.str`must have required property '${Z}'`,params:({params:{missingProperty:Z}})=>fz._`{missingProperty: ${Z}}`},LS1={keyword:"required",type:"object",schemaType:"array",$data:!0,error:US1,code(Z){let{gen:J,schema:X,schemaCode:Y,data:$,$data:Q,it:K}=Z,{opts:W}=K;if(!Q&&X.length===0)return;let G=X.length>=W.loopRequired;if(K.allErrors)V();else z();if(W.strictRequired){let q=Z.parentSchema.properties,{definedProperties:U}=Z.it;for(let L of X)if((q===null||q===void 0?void 0:q[L])===void 0&&!U.has(L)){let B=K.schemaEnv.baseId+K.errSchemaPath,w=`required property "${L}" is not defined at "${B}" (strictRequired)`;qS1.checkStrictMode(K,w,K.opts.strictRequired)}}function V(){if(G||Q)Z.block$data(fz.nil,F);else for(let q of X)hz.checkReportMissingProp(Z,q)}function z(){let q=J.let("missing");if(G||Q){let U=J.let("valid",!0);Z.block$data(U,()=>H(q,U)),Z.ok(U)}else J.if(hz.checkMissingProp(Z,X,q)),hz.reportMissingProp(Z,q),J.else()}function F(){J.forOf("prop",Y,(q)=>{Z.setParams({missingProperty:q}),J.if(hz.noPropertyInData(J,$,q,W.ownProperties),()=>Z.error())})}function H(q,U){Z.setParams({missingProperty:q}),J.forOf(q,Y,()=>{J.assign(U,hz.propertyInData(J,$,q,W.ownProperties)),J.if(fz.not(U),()=>{Z.error(),J.break()})},fz.nil)}}};I10.default=LS1});var S10=O((v10)=>{Object.defineProperty(v10,"__esModule",{value:!0});var yz=t0(),wS1={message({keyword:Z,schemaCode:J}){let X=Z==="maxItems"?"more":"fewer";return yz.str`must NOT have ${X} than ${J} items`},params:({schemaCode:Z})=>yz._`{limit: ${Z}}`},OS1={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:wS1,code(Z){let{keyword:J,data:X,schemaCode:Y}=Z,$=J==="maxItems"?yz.operators.GT:yz.operators.LT;Z.fail$data(yz._`${X}.length ${$} ${Y}`)}};v10.default=OS1});var Iw=O((x10)=>{Object.defineProperty(x10,"__esModule",{value:!0});var A10=yk();A10.code='require("ajv/dist/runtime/equal").default';x10.default=A10});var f10=O((h10)=>{Object.defineProperty(h10,"__esModule",{value:!0});var tk=Dz(),R6=t0(),NS1=F1(),jS1=Iw(),DS1={message:({params:{i:Z,j:J}})=>R6.str`must NOT have duplicate items (items ## ${J} and ${Z} are identical)`,params:({params:{i:Z,j:J}})=>R6._`{i: ${Z}, j: ${J}}`},PS1={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:DS1,code(Z){let{gen:J,data:X,$data:Y,schema:$,parentSchema:Q,schemaCode:K,it:W}=Z;if(!Y&&!$)return;let G=J.let("valid"),V=Q.items?tk.getSchemaTypes(Q.items):[];Z.block$data(G,z,R6._`${K} === false`),Z.ok(G);function z(){let U=J.let("i",R6._`${X}.length`),L=J.let("j");Z.setParams({i:U,j:L}),J.assign(G,!0),J.if(R6._`${U} > 1`,()=>(F()?H:q)(U,L))}function F(){return V.length>0&&!V.some((U)=>U==="object"||U==="array")}function H(U,L){let B=J.name("item"),w=tk.checkDataTypes(V,B,W.opts.strictNumbers,tk.DataType.Wrong),R=J.const("indices",R6._`{}`);J.for(R6._`;${U}--;`,()=>{if(J.let(B,R6._`${X}[${U}]`),J.if(w,R6._`continue`),V.length>1)J.if(R6._`typeof ${B} == "string"`,R6._`${B} += "_"`);J.if(R6._`typeof ${R}[${B}] == "number"`,()=>{J.assign(L,R6._`${R}[${B}]`),Z.error(),J.assign(G,!1).break()}).code(R6._`${R}[${B}] = ${U}`)})}function q(U,L){let B=NS1.useFunc(J,jS1.default),w=J.name("outer");J.label(w).for(R6._`;${U}--;`,()=>J.for(R6._`${L} = ${U}; ${L}--;`,()=>J.if(R6._`${B}(${X}[${U}], ${X}[${L}])`,()=>{Z.error(),J.assign(G,!1).break(w)})))}}};h10.default=PS1});var b10=O((y10)=>{Object.defineProperty(y10,"__esModule",{value:!0});var ek=t0(),TS1=F1(),ES1=Iw(),kS1={message:"must be equal to constant",params:({schemaCode:Z})=>ek._`{allowedValue: ${Z}}`},IS1={keyword:"const",$data:!0,error:kS1,code(Z){let{gen:J,data:X,$data:Y,schemaCode:$,schema:Q}=Z;if(Y||Q&&typeof Q=="object")Z.fail$data(ek._`!${TS1.useFunc(J,ES1.default)}(${X}, ${$})`);else Z.fail(ek._`${Q} !== ${X}`)}};y10.default=IS1});var m10=O((g10)=>{Object.defineProperty(g10,"__esModule",{value:!0});var bz=t0(),vS1=F1(),SS1=Iw(),AS1={message:"must be equal to one of the allowed values",params:({schemaCode:Z})=>bz._`{allowedValues: ${Z}}`},xS1={keyword:"enum",schemaType:"array",$data:!0,error:AS1,code(Z){let{gen:J,data:X,$data:Y,schema:$,schemaCode:Q,it:K}=Z;if(!Y&&$.length===0)throw new Error("enum must have non-empty array");let W=$.length>=K.opts.loopEnum,G,V=()=>G!==null&&G!==void 0?G:G=vS1.useFunc(J,SS1.default),z;if(W||Y)z=J.let("valid"),Z.block$data(z,F);else{if(!Array.isArray($))throw new Error("ajv implementation error");let q=J.const("vSchema",Q);z=bz.or(...$.map((U,L)=>H(q,L)))}Z.pass(z);function F(){J.assign(z,!1),J.forOf("v",Q,(q)=>J.if(bz._`${V()}(${X}, ${q})`,()=>J.assign(z,!0).break()))}function H(q,U){let L=$[U];return typeof L==="object"&&L!==null?bz._`${V()}(${X}, ${q}[${U}])`:bz._`${X} === ${L}`}}};g10.default=xS1});var d10=O((u10)=>{Object.defineProperty(u10,"__esModule",{value:!0});var fS1=w10(),yS1=R10(),bS1=P10(),gS1=T10(),mS1=k10(),uS1=_10(),dS1=S10(),cS1=f10(),lS1=b10(),pS1=m10(),iS1=[fS1.default,yS1.default,bS1.default,gS1.default,mS1.default,uS1.default,dS1.default,cS1.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},lS1.default,pS1.default];u10.default=iS1});var JI=O((l10)=>{Object.defineProperty(l10,"__esModule",{value:!0});l10.validateAdditionalItems=void 0;var C$=t0(),ZI=F1(),aS1={message:({params:{len:Z}})=>C$.str`must NOT have more than ${Z} items`,params:({params:{len:Z}})=>C$._`{limit: ${Z}}`},sS1={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:aS1,code(Z){let{parentSchema:J,it:X}=Z,{items:Y}=J;if(!Array.isArray(Y)){ZI.checkStrictMode(X,'"additionalItems" is ignored when "items" is not an array of schemas');return}c10(Z,Y)}};function c10(Z,J){let{gen:X,schema:Y,data:$,keyword:Q,it:K}=Z;K.items=!0;let W=X.const("len",C$._`${$}.length`);if(Y===!1)Z.setParams({len:J.length}),Z.pass(C$._`${W} <= ${J.length}`);else if(typeof Y=="object"&&!ZI.alwaysValidSchema(K,Y)){let V=X.var("valid",C$._`${W} <= ${J.length}`);X.if(C$.not(V),()=>G(V)),Z.ok(V)}function G(V){X.forRange("i",J.length,W,(z)=>{if(Z.subschema({keyword:Q,dataProp:z,dataPropType:ZI.Type.Num},V),!K.allErrors)X.if(C$.not(V),()=>X.break())})}}l10.validateAdditionalItems=c10;l10.default=sS1});var XI=O((a10)=>{Object.defineProperty(a10,"__esModule",{value:!0});a10.validateTuple=void 0;var i10=t0(),_w=F1(),rS1=d9(),tS1={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(Z){let{schema:J,it:X}=Z;if(Array.isArray(J))return n10(Z,"additionalItems",J);if(X.items=!0,_w.alwaysValidSchema(X,J))return;Z.ok(rS1.validateArray(Z))}};function n10(Z,J,X=Z.schema){let{gen:Y,parentSchema:$,data:Q,keyword:K,it:W}=Z;if(z($),W.opts.unevaluated&&X.length&&W.items!==!0)W.items=_w.mergeEvaluated.items(Y,X.length,W.items);let G=Y.name("valid"),V=Y.const("len",i10._`${Q}.length`);X.forEach((F,H)=>{if(_w.alwaysValidSchema(W,F))return;Y.if(i10._`${V} > ${H}`,()=>Z.subschema({keyword:K,schemaProp:H,dataProp:H},G)),Z.ok(G)});function z(F){let{opts:H,errSchemaPath:q}=W,U=X.length,L=U===F.minItems&&(U===F.maxItems||F[J]===!1);if(H.strictTuples&&!L){let B=`"${K}" is ${U}-tuple, but minItems or maxItems/${J} are not specified or different at path "${q}"`;_w.checkStrictMode(W,B,H.strictTuples)}}}a10.validateTuple=n10;a10.default=tS1});var r10=O((o10)=>{Object.defineProperty(o10,"__esModule",{value:!0});var ZA1=XI(),JA1={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(Z)=>ZA1.validateTuple(Z,"items")};o10.default=JA1});var Z80=O((e10)=>{Object.defineProperty(e10,"__esModule",{value:!0});var t10=t0(),YA1=F1(),$A1=d9(),QA1=JI(),KA1={message:({params:{len:Z}})=>t10.str`must NOT have more than ${Z} items`,params:({params:{len:Z}})=>t10._`{limit: ${Z}}`},WA1={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:KA1,code(Z){let{schema:J,parentSchema:X,it:Y}=Z,{prefixItems:$}=X;if(Y.items=!0,YA1.alwaysValidSchema(Y,J))return;if($)QA1.validateAdditionalItems(Z,$);else Z.ok($A1.validateArray(Z))}};e10.default=WA1});var X80=O((J80)=>{Object.defineProperty(J80,"__esModule",{value:!0});var c9=t0(),vw=F1(),VA1={message:({params:{min:Z,max:J}})=>J===void 0?c9.str`must contain at least ${Z} valid item(s)`:c9.str`must contain at least ${Z} and no more than ${J} valid item(s)`,params:({params:{min:Z,max:J}})=>J===void 0?c9._`{minContains: ${Z}}`:c9._`{minContains: ${Z}, maxContains: ${J}}`},zA1={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:VA1,code(Z){let{gen:J,schema:X,parentSchema:Y,data:$,it:Q}=Z,K,W,{minContains:G,maxContains:V}=Y;if(Q.opts.next)K=G===void 0?1:G,W=V;else K=1;let z=J.const("len",c9._`${$}.length`);if(Z.setParams({min:K,max:W}),W===void 0&&K===0){vw.checkStrictMode(Q,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(W!==void 0&&K>W){vw.checkStrictMode(Q,'"minContains" > "maxContains" is always invalid'),Z.fail();return}if(vw.alwaysValidSchema(Q,X)){let L=c9._`${z} >= ${K}`;if(W!==void 0)L=c9._`${L} && ${z} <= ${W}`;Z.pass(L);return}Q.items=!0;let F=J.name("valid");if(W===void 0&&K===1)q(F,()=>J.if(F,()=>J.break()));else if(K===0){if(J.let(F,!0),W!==void 0)J.if(c9._`${$}.length > 0`,H)}else J.let(F,!1),H();Z.result(F,()=>Z.reset());function H(){let L=J.name("_valid"),B=J.let("count",0);q(L,()=>J.if(L,()=>U(B)))}function q(L,B){J.forRange("i",0,z,(w)=>{Z.subschema({keyword:"contains",dataProp:w,dataPropType:vw.Type.Num,compositeRule:!0},L),B()})}function U(L){if(J.code(c9._`${L}++`),W===void 0)J.if(c9._`${L} >= ${K}`,()=>J.assign(F,!0).break());else if(J.if(c9._`${L} > ${W}`,()=>J.assign(F,!1).break()),K===1)J.assign(F,!0);else J.if(c9._`${L} >= ${K}`,()=>J.assign(F,!0))}}};J80.default=zA1});var G80=O((Q80)=>{Object.defineProperty(Q80,"__esModule",{value:!0});Q80.validateSchemaDeps=Q80.validatePropertyDeps=Q80.error=void 0;var YI=t0(),FA1=F1(),gz=d9();Q80.error={message:({params:{property:Z,depsCount:J,deps:X}})=>{let Y=J===1?"property":"properties";return YI.str`must have ${Y} ${X} when property ${Z} is present`},params:({params:{property:Z,depsCount:J,deps:X,missingProperty:Y}})=>YI._`{property: ${Z},
26
26
  missingProperty: ${Y},
27
27
  depsCount: ${J},
28
- deps: ${X}}`};var qA1={keyword:"dependencies",type:"object",schemaType:"object",error:Q80.error,code(Z){let[J,X]=UA1(Z);Y80(Z,J),$80(Z,X)}};function UA1({schema:Z}){let J={},X={};for(let Y in Z){if(Y==="__proto__")continue;let $=Array.isArray(Z[Y])?J:X;$[Y]=Z[Y]}return[J,X]}function Y80(Z,J=Z.schema){let{gen:X,data:Y,it:$}=Z;if(Object.keys(J).length===0)return;let Q=X.let("missing");for(let K in J){let W=J[K];if(W.length===0)continue;let G=gz.propertyInData(X,Y,K,$.opts.ownProperties);if(Z.setParams({property:K,depsCount:W.length,deps:W.join(", ")}),$.allErrors)X.if(G,()=>{for(let V of W)gz.checkReportMissingProp(Z,V)});else X.if(YI._`${G} && (${gz.checkMissingProp(Z,W,Q)})`),gz.reportMissingProp(Z,Q),X.else()}}Q80.validatePropertyDeps=Y80;function $80(Z,J=Z.schema){let{gen:X,data:Y,keyword:$,it:Q}=Z,K=X.name("valid");for(let W in J){if(FA1.alwaysValidSchema(Q,J[W]))continue;X.if(gz.propertyInData(X,Y,W,Q.opts.ownProperties),()=>{let G=Z.subschema({keyword:$,schemaProp:W},K);Z.mergeValidEvaluated(G,K)},()=>X.var(K,!0)),Z.ok(K)}}Q80.validateSchemaDeps=$80;Q80.default=qA1});var H80=O((z80)=>{Object.defineProperty(z80,"__esModule",{value:!0});var V80=t0(),wA1=F1(),OA1={message:"property name must be valid",params:({params:Z})=>V80._`{propertyName: ${Z.propertyName}}`},RA1={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:OA1,code(Z){let{gen:J,schema:X,data:Y,it:$}=Z;if(wA1.alwaysValidSchema($,X))return;let Q=J.name("valid");J.forIn("key",Y,(K)=>{Z.setParams({propertyName:K}),Z.subschema({keyword:"propertyNames",data:K,dataTypes:["string"],propertyName:K,compositeRule:!0},Q),J.if(V80.not(Q),()=>{if(Z.error(!0),!$.allErrors)J.break()})}),Z.ok(Q)}};z80.default=RA1});var $I=O((F80)=>{Object.defineProperty(F80,"__esModule",{value:!0});var Sw=d9(),u4=t0(),NA1=gZ(),Aw=F1(),jA1={message:"must NOT have additional properties",params:({params:Z})=>u4._`{additionalProperty: ${Z.additionalProperty}}`},DA1={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:jA1,code(Z){let{gen:J,schema:X,parentSchema:Y,data:$,errsCount:Q,it:K}=Z;if(!Q)throw new Error("ajv implementation error");let{allErrors:W,opts:G}=K;if(K.props=!0,G.removeAdditional!=="all"&&Aw.alwaysValidSchema(K,X))return;let V=Sw.allSchemaProperties(Y.properties),z=Sw.allSchemaProperties(Y.patternProperties);F(),Z.ok(u4._`${Q} === ${NA1.default.errors}`);function F(){J.forIn("key",$,(B)=>{if(!V.length&&!z.length)U(B);else J.if(H(B),()=>U(B))})}function H(B){let w;if(V.length>8){let R=Aw.schemaRefOrVal(K,Y.properties,"properties");w=Sw.isOwnProperty(J,R,B)}else if(V.length)w=u4.or(...V.map((R)=>u4._`${B} === ${R}`));else w=u4.nil;if(z.length)w=u4.or(w,...z.map((R)=>u4._`${Sw.usePattern(Z,R)}.test(${B})`));return u4.not(w)}function q(B){J.code(u4._`delete ${$}[${B}]`)}function U(B){if(G.removeAdditional==="all"||G.removeAdditional&&X===!1){q(B);return}if(X===!1){if(Z.setParams({additionalProperty:B}),Z.error(),!W)J.break();return}if(typeof X=="object"&&!Aw.alwaysValidSchema(K,X)){let w=J.name("valid");if(G.removeAdditional==="failing")L(B,w,!1),J.if(u4.not(w),()=>{Z.reset(),q(B)});else if(L(B,w),!W)J.if(u4.not(w),()=>J.break())}}function L(B,w,R){let M={keyword:"additionalProperties",dataProp:B,dataPropType:Aw.Type.Str};if(R===!1)Object.assign(M,{compositeRule:!0,createErrors:!1,allErrors:!1});Z.subschema(M,w)}}};F80.default=DA1});var B80=O((L80)=>{Object.defineProperty(L80,"__esModule",{value:!0});var CA1=Ez(),q80=d9(),QI=F1(),U80=$I(),TA1={keyword:"properties",type:"object",schemaType:"object",code(Z){let{gen:J,schema:X,parentSchema:Y,data:$,it:Q}=Z;if(Q.opts.removeAdditional==="all"&&Y.additionalProperties===void 0)U80.default.code(new CA1.KeywordCxt(Q,U80.default,"additionalProperties"));let K=q80.allSchemaProperties(X);for(let F of K)Q.definedProperties.add(F);if(Q.opts.unevaluated&&K.length&&Q.props!==!0)Q.props=QI.mergeEvaluated.props(J,QI.toHash(K),Q.props);let W=K.filter((F)=>!QI.alwaysValidSchema(Q,X[F]));if(W.length===0)return;let G=J.name("valid");for(let F of W){if(V(F))z(F);else{if(J.if(q80.propertyInData(J,$,F,Q.opts.ownProperties)),z(F),!Q.allErrors)J.else().var(G,!0);J.endIf()}Z.it.definedProperties.add(F),Z.ok(G)}function V(F){return Q.opts.useDefaults&&!Q.compositeRule&&X[F].default!==void 0}function z(F){Z.subschema({keyword:"properties",schemaProp:F,dataProp:F},G)}}};L80.default=TA1});var N80=O((M80)=>{Object.defineProperty(M80,"__esModule",{value:!0});var w80=d9(),xw=t0(),O80=F1(),R80=F1(),kA1={keyword:"patternProperties",type:"object",schemaType:"object",code(Z){let{gen:J,schema:X,data:Y,parentSchema:$,it:Q}=Z,{opts:K}=Q,W=w80.allSchemaProperties(X),G=W.filter((L)=>O80.alwaysValidSchema(Q,X[L]));if(W.length===0||G.length===W.length&&(!Q.opts.unevaluated||Q.props===!0))return;let V=K.strictSchema&&!K.allowMatchingProperties&&$.properties,z=J.name("valid");if(Q.props!==!0&&!(Q.props instanceof xw.Name))Q.props=R80.evaluatedPropsToName(J,Q.props);let{props:F}=Q;H();function H(){for(let L of W){if(V)q(L);if(Q.allErrors)U(L);else J.var(z,!0),U(L),J.if(z)}}function q(L){for(let B in V)if(new RegExp(L).test(B))O80.checkStrictMode(Q,`property ${B} matches pattern ${L} (use allowMatchingProperties)`)}function U(L){J.forIn("key",Y,(B)=>{J.if(xw._`${w80.usePattern(Z,L)}.test(${B})`,()=>{let w=G.includes(L);if(!w)Z.subschema({keyword:"patternProperties",schemaProp:L,dataProp:B,dataPropType:R80.Type.Str},z);if(Q.opts.unevaluated&&F!==!0)J.assign(xw._`${F}[${B}]`,!0);else if(!w&&!Q.allErrors)J.if(xw.not(z),()=>J.break())})})}}};M80.default=kA1});var D80=O((j80)=>{Object.defineProperty(j80,"__esModule",{value:!0});var _A1=F1(),vA1={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(Z){let{gen:J,schema:X,it:Y}=Z;if(_A1.alwaysValidSchema(Y,X)){Z.fail();return}let $=J.name("valid");Z.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},$),Z.failResult($,()=>Z.reset(),()=>Z.error())},error:{message:"must NOT be valid"}};j80.default=vA1});var C80=O((P80)=>{Object.defineProperty(P80,"__esModule",{value:!0});var AA1=d9(),xA1={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:AA1.validateUnion,error:{message:"must match a schema in anyOf"}};P80.default=xA1});var E80=O((T80)=>{Object.defineProperty(T80,"__esModule",{value:!0});var hw=t0(),fA1=F1(),yA1={message:"must match exactly one schema in oneOf",params:({params:Z})=>hw._`{passingSchemas: ${Z.passing}}`},bA1={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:yA1,code(Z){let{gen:J,schema:X,parentSchema:Y,it:$}=Z;if(!Array.isArray(X))throw new Error("ajv implementation error");if($.opts.discriminator&&Y.discriminator)return;let Q=X,K=J.let("valid",!1),W=J.let("passing",null),G=J.name("_valid");Z.setParams({passing:W}),J.block(V),Z.result(K,()=>Z.reset(),()=>Z.error(!0));function V(){Q.forEach((z,F)=>{let H;if(fA1.alwaysValidSchema($,z))J.var(G,!0);else H=Z.subschema({keyword:"oneOf",schemaProp:F,compositeRule:!0},G);if(F>0)J.if(hw._`${G} && ${K}`).assign(K,!1).assign(W,hw._`[${W}, ${F}]`).else();J.if(G,()=>{if(J.assign(K,!0),J.assign(W,F),H)Z.mergeEvaluated(H,hw.Name)})})}}};T80.default=bA1});var I80=O((k80)=>{Object.defineProperty(k80,"__esModule",{value:!0});var mA1=F1(),uA1={keyword:"allOf",schemaType:"array",code(Z){let{gen:J,schema:X,it:Y}=Z;if(!Array.isArray(X))throw new Error("ajv implementation error");let $=J.name("valid");X.forEach((Q,K)=>{if(mA1.alwaysValidSchema(Y,Q))return;let W=Z.subschema({keyword:"allOf",schemaProp:K},$);Z.ok($),Z.mergeEvaluated(W)})}};k80.default=uA1});var A80=O((S80)=>{Object.defineProperty(S80,"__esModule",{value:!0});var fw=t0(),v80=F1(),cA1={message:({params:Z})=>fw.str`must match "${Z.ifClause}" schema`,params:({params:Z})=>fw._`{failingKeyword: ${Z.ifClause}}`},lA1={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:cA1,code(Z){let{gen:J,parentSchema:X,it:Y}=Z;if(X.then===void 0&&X.else===void 0)v80.checkStrictMode(Y,'"if" without "then" and "else" is ignored');let $=_80(Y,"then"),Q=_80(Y,"else");if(!$&&!Q)return;let K=J.let("valid",!0),W=J.name("_valid");if(G(),Z.reset(),$&&Q){let z=J.let("ifClause");Z.setParams({ifClause:z}),J.if(W,V("then",z),V("else",z))}else if($)J.if(W,V("then"));else J.if(fw.not(W),V("else"));Z.pass(K,()=>Z.error(!0));function G(){let z=Z.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},W);Z.mergeEvaluated(z)}function V(z,F){return()=>{let H=Z.subschema({keyword:z},W);if(J.assign(K,W),Z.mergeValidEvaluated(H,K),F)J.assign(F,fw._`${z}`);else Z.setParams({ifClause:z})}}}};function _80(Z,J){let X=Z.schema[J];return X!==void 0&&!v80.alwaysValidSchema(Z,X)}S80.default=lA1});var h80=O((x80)=>{Object.defineProperty(x80,"__esModule",{value:!0});var iA1=F1(),nA1={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:Z,parentSchema:J,it:X}){if(J.if===void 0)iA1.checkStrictMode(X,`"${Z}" without "if" is ignored`)}};x80.default=nA1});var y80=O((f80)=>{Object.defineProperty(f80,"__esModule",{value:!0});var sA1=JI(),oA1=r10(),rA1=XI(),tA1=Z80(),eA1=X80(),Zx1=G80(),Jx1=H80(),Xx1=$I(),Yx1=B80(),$x1=N80(),Qx1=D80(),Kx1=C80(),Wx1=E80(),Gx1=I80(),Vx1=A80(),zx1=h80();function Hx1(Z=!1){let J=[Qx1.default,Kx1.default,Wx1.default,Gx1.default,Vx1.default,zx1.default,Jx1.default,Xx1.default,Zx1.default,Yx1.default,$x1.default];if(Z)J.push(oA1.default,tA1.default);else J.push(sA1.default,rA1.default);return J.push(eA1.default),J}f80.default=Hx1});var g80=O((b80)=>{Object.defineProperty(b80,"__esModule",{value:!0});var I8=t0(),qx1={message:({schemaCode:Z})=>I8.str`must match format "${Z}"`,params:({schemaCode:Z})=>I8._`{format: ${Z}}`},Ux1={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:qx1,code(Z,J){let{gen:X,data:Y,$data:$,schema:Q,schemaCode:K,it:W}=Z,{opts:G,errSchemaPath:V,schemaEnv:z,self:F}=W;if(!G.validateFormats)return;if($)H();else q();function H(){let U=X.scopeValue("formats",{ref:F.formats,code:G.code.formats}),L=X.const("fDef",I8._`${U}[${K}]`),B=X.let("fType"),w=X.let("format");X.if(I8._`typeof ${L} == "object" && !(${L} instanceof RegExp)`,()=>X.assign(B,I8._`${L}.type || "string"`).assign(w,I8._`${L}.validate`),()=>X.assign(B,I8._`"string"`).assign(w,L)),Z.fail$data(I8.or(R(),M()));function R(){if(G.strictSchema===!1)return I8.nil;return I8._`${K} && !${w}`}function M(){let N=z.$async?I8._`(${L}.async ? await ${w}(${Y}) : ${w}(${Y}))`:I8._`${w}(${Y})`,P=I8._`(typeof ${w} == "function" ? ${N} : ${w}.test(${Y}))`;return I8._`${w} && ${w} !== true && ${B} === ${J} && !${P}`}}function q(){let U=F.formats[Q];if(!U){R();return}if(U===!0)return;let[L,B,w]=M(U);if(L===J)Z.pass(N());function R(){if(G.strictSchema===!1){F.logger.warn(P());return}throw new Error(P());function P(){return`unknown format "${Q}" ignored in schema at path "${V}"`}}function M(P){let D=P instanceof RegExp?I8.regexpCode(P):G.code.formats?I8._`${G.code.formats}${I8.getProperty(Q)}`:void 0,C=X.scopeValue("formats",{key:Q,ref:P,code:D});if(typeof P=="object"&&!(P instanceof RegExp))return[P.type||"string",P.validate,I8._`${C}.validate`];return["string",P,C]}function N(){if(typeof U=="object"&&!(U instanceof RegExp)&&U.async){if(!z.$async)throw new Error("async format in sync schema");return I8._`await ${w}(${Y})`}return typeof B=="function"?I8._`${w}(${Y})`:I8._`${w}.test(${Y})`}}}};b80.default=Ux1});var u80=O((m80)=>{Object.defineProperty(m80,"__esModule",{value:!0});var Bx1=g80(),wx1=[Bx1.default];m80.default=wx1});var l80=O((d80)=>{Object.defineProperty(d80,"__esModule",{value:!0});d80.contentVocabulary=d80.metadataVocabulary=void 0;d80.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];d80.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var n80=O((i80)=>{Object.defineProperty(i80,"__esModule",{value:!0});var Mx1=L10(),Nx1=d10(),jx1=y80(),Dx1=u80(),p80=l80(),Px1=[Mx1.default,Nx1.default,jx1.default(),Dx1.default,p80.metadataVocabulary,p80.contentVocabulary];i80.default=Px1});var r80=O((s80)=>{Object.defineProperty(s80,"__esModule",{value:!0});s80.DiscrError=void 0;var a80;(function(Z){Z.Tag="tag",Z.Mapping="mapping"})(a80||(s80.DiscrError=a80={}))});var Z60=O((e80)=>{Object.defineProperty(e80,"__esModule",{value:!0});var DW=t0(),KI=r80(),t80=Ow(),Tx1=kz(),Ex1=F1(),kx1={message:({params:{discrError:Z,tagName:J}})=>Z===KI.DiscrError.Tag?`tag "${J}" must be string`:`value of tag "${J}" must be in oneOf`,params:({params:{discrError:Z,tag:J,tagName:X}})=>DW._`{error: ${Z}, tag: ${X}, tagValue: ${J}}`},Ix1={keyword:"discriminator",type:"object",schemaType:"object",error:kx1,code(Z){let{gen:J,data:X,schema:Y,parentSchema:$,it:Q}=Z,{oneOf:K}=$;if(!Q.opts.discriminator)throw new Error("discriminator: requires discriminator option");let W=Y.propertyName;if(typeof W!="string")throw new Error("discriminator: requires propertyName");if(Y.mapping)throw new Error("discriminator: mapping is not supported");if(!K)throw new Error("discriminator: requires oneOf keyword");let G=J.let("valid",!1),V=J.const("tag",DW._`${X}${DW.getProperty(W)}`);J.if(DW._`typeof ${V} == "string"`,()=>z(),()=>Z.error(!1,{discrError:KI.DiscrError.Tag,tag:V,tagName:W})),Z.ok(G);function z(){let q=H();J.if(!1);for(let U in q)J.elseIf(DW._`${V} === ${U}`),J.assign(G,F(q[U]));J.else(),Z.error(!1,{discrError:KI.DiscrError.Mapping,tag:V,tagName:W}),J.endIf()}function F(q){let U=J.name("valid"),L=Z.subschema({keyword:"oneOf",schemaProp:q},U);return Z.mergeEvaluated(L,DW.Name),U}function H(){var q;let U={},L=w($),B=!0;for(let N=0;N<K.length;N++){let P=K[N];if((P===null||P===void 0?void 0:P.$ref)&&!Ex1.schemaHasRulesButRef(P,Q.self.RULES)){let C=P.$ref;if(P=t80.resolveRef.call(Q.self,Q.schemaEnv.root,Q.baseId,C),P instanceof t80.SchemaEnv)P=P.schema;if(P===void 0)throw new Tx1.default(Q.opts.uriResolver,Q.baseId,C)}let D=(q=P===null||P===void 0?void 0:P.properties)===null||q===void 0?void 0:q[W];if(typeof D!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${W}"`);B=B&&(L||w(P)),R(D,N)}if(!B)throw new Error(`discriminator: "${W}" must be required`);return U;function w({required:N}){return Array.isArray(N)&&N.includes(W)}function R(N,P){if(N.const)M(N.const,P);else if(N.enum)for(let D of N.enum)M(D,P);else throw new Error(`discriminator: "properties/${W}" must have "const" or "enum"`)}function M(N,P){if(typeof N!="string"||N in U)throw new Error(`discriminator: "${W}" values must be unique strings`);U[N]=P}}}};e80.default=Ix1});var J60=O((tA6,vx1)=>{vx1.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Y60=O((f5,WI)=>{Object.defineProperty(f5,"__esModule",{value:!0});f5.MissingRefError=f5.ValidationError=f5.CodeGen=f5.Name=f5.nil=f5.stringify=f5.str=f5._=f5.KeywordCxt=f5.Ajv=void 0;var Sx1=Q10(),Ax1=n80(),xx1=Z60(),X60=J60(),hx1=["/properties"],yw="http://json-schema.org/draft-07/schema";class mz extends Sx1.default{_addVocabularies(){if(super._addVocabularies(),Ax1.default.forEach((Z)=>this.addVocabulary(Z)),this.opts.discriminator)this.addKeyword(xx1.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let Z=this.opts.$data?this.$dataMetaSchema(X60,hx1):X60;this.addMetaSchema(Z,yw,!1),this.refs["http://json-schema.org/schema"]=yw}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(yw)?yw:void 0)}}f5.Ajv=mz;WI.exports=f5=mz;WI.exports.Ajv=mz;Object.defineProperty(f5,"__esModule",{value:!0});f5.default=mz;var fx1=Ez();Object.defineProperty(f5,"KeywordCxt",{enumerable:!0,get:function(){return fx1.KeywordCxt}});var PW=t0();Object.defineProperty(f5,"_",{enumerable:!0,get:function(){return PW._}});Object.defineProperty(f5,"str",{enumerable:!0,get:function(){return PW.str}});Object.defineProperty(f5,"stringify",{enumerable:!0,get:function(){return PW.stringify}});Object.defineProperty(f5,"nil",{enumerable:!0,get:function(){return PW.nil}});Object.defineProperty(f5,"Name",{enumerable:!0,get:function(){return PW.Name}});Object.defineProperty(f5,"CodeGen",{enumerable:!0,get:function(){return PW.CodeGen}});var yx1=Bw();Object.defineProperty(f5,"ValidationError",{enumerable:!0,get:function(){return yx1.default}});var bx1=kz();Object.defineProperty(f5,"MissingRefError",{enumerable:!0,get:function(){return bx1.default}})});var nI=O((_60)=>{Object.defineProperty(_60,"__esModule",{value:!0});_60.buildDefaultCredentialsProvider=Zh1;function Zh1(){let Z=process.env.HYTOPIA_API_KEY,J=process.env.HYTOPIA_GAME_ID,X=process.env.HYTOPIA_LOBBY_ID;if(!Z)throw new Error("Missing environment variable HYTOPIA_API_KEY");if(!J)throw new Error("Missing environment variable HYTOPIA_GAME_ID");if(!X)throw new Error("Missing environment variable HYTOPIA_LOBBY_ID");return async()=>({apiKey:Z,gameId:J,lobbyId:X})}});var S60=O((v60)=>{Object.defineProperty(v60,"__esModule",{value:!0});v60.getLoadout=Xh1;async function Xh1(Z){return await fetch(`${this.context.baseUrl}/Locker/GetLoadoutForGameByUserId/${Z}`).then((J)=>J.json()).then((J)=>J).catch(()=>({error:{code:"networkError",message:"A network error happened"}}))}});var h60=O((x60)=>{Object.defineProperty(x60,"__esModule",{value:!0});x60.default=A60;function A60(Z){if(!Z)return Z;for(let[X,Y]of Object.entries(Z))if(typeof Y==="string"){var J=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*))(?:Z|(\+|-)([\d|:]*))?$/;if(J.test(Y))Z[X]=new Date(Y)}else if(typeof Y==="object")A60(Y);return Z}});var f60=O((cz)=>{var Qh1=cz&&cz.__importDefault||function(Z){return Z&&Z.__esModule?Z:{default:Z}};Object.defineProperty(cz,"__esModule",{value:!0});cz.getSession=Wh1;var Kh1=Qh1(h60());async function Wh1(Z){let J=await this.context.credentialsProvider();return await fetch(`${this.context.baseUrl}/Play/Matchmaking/Lobbies/ValidateSession`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lobbyId:J.lobbyId,sessionToken:Z})}).then((X)=>X.json()).then((X)=>Kh1.default(X)).then((X)=>X).catch(()=>({error:{code:"networkError",message:"A network error happened"}}))}});var b60=O((y60)=>{Object.defineProperty(y60,"__esModule",{value:!0});y60.get=Gh1;async function Gh1(Z){let J=await this.context.credentialsProvider();return await fetch(`${this.context.baseUrl}/Play/KV/Get/${J.gameId}/${Z}`,{headers:{"X-Api-Key":J.apiKey}}).then((X)=>X.json()).then((X)=>X).catch(()=>({error:{code:"networkError",message:"A network error happened"}}))}});var m60=O((g60)=>{Object.defineProperty(g60,"__esModule",{value:!0});g60.set=zh1;async function zh1(Z,J,X="merge"){let Y=await this.context.credentialsProvider();return await fetch(`${this.context.baseUrl}/Play/KV/Set/${Y.gameId}/${Z}?mode=${X}`,{method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":Y.apiKey},body:JSON.stringify(J)}).then(($)=>$.json()).then(($)=>$).catch(()=>({error:{code:"networkError",message:"A network error happened"}}))}});var d60=O((u60)=>{Object.defineProperty(u60,"__esModule",{value:!0});u60.unset=Fh1;async function Fh1(Z){let J=await this.context.credentialsProvider();return await fetch(`${this.context.baseUrl}/Play/KV/Unset/${J.gameId}/${Z}`,{method:"DELETE",headers:{"X-Api-Key":J.apiKey}}).then((X)=>X.json()).then((X)=>X).catch(()=>({error:{code:"networkError",message:"A network error happened"}}))}});var i60=O((l60)=>{Object.defineProperty(l60,"__esModule",{value:!0});l60.KVClient=void 0;var Uh1=b60(),Lh1=m60(),Bh1=d60();class c60{context;constructor(Z){this.context=Z}get=Uh1.get;set=Lh1.set;unset=Bh1.unset}l60.KVClient=c60});var r60=O((a60)=>{Object.defineProperty(a60,"__esModule",{value:!0});a60.CreativeGateway=a60.DEFAULT_BASE_URL=void 0;var wh1=nI(),Oh1=S60(),Rh1=f60(),Mh1=i60();a60.DEFAULT_BASE_URL="https://prod.creative.hytopia.com";class n60{context;kv;constructor(Z){if(Z?.baseUrl){if(!Z.baseUrl.startsWith("https://")&&!Z.baseUrl.startsWith("http://"))throw new Error("Base URL, if provided, must start with https:// or http://");if(Z.baseUrl.endsWith("/"))throw new Error("Base URL, if provided, must not end with '/'")}this.context={baseUrl:Z?.baseUrl??process.env.HYTOPIA_CREATIVE_GATEWAY_BASE_URL??a60.DEFAULT_BASE_URL,credentialsProvider:Z?.credentialsProvider??wh1.buildDefaultCredentialsProvider()},this.kv=new Mh1.KVClient(this.context)}getLoadout=Oh1.getLoadout;getSession=Rh1.getSession}a60.CreativeGateway=n60});var t60=O((dw)=>{Object.defineProperty(dw,"__esModule",{value:!0});dw.buildDefaultCredentialsProvider=dw.CreativeGateway=void 0;var Nh1=r60();Object.defineProperty(dw,"CreativeGateway",{enumerable:!0,get:function(){return Nh1.CreativeGateway}});var jh1=nI();Object.defineProperty(dw,"buildDefaultCredentialsProvider",{enumerable:!0,get:function(){return jh1.buildDefaultCredentialsProvider}})});var cZ=O((yg6,z50)=>{var G50=["nodebuffer","arraybuffer","fragments"],V50=typeof Blob!=="undefined";if(V50)G50.push("blob");z50.exports={BINARY_TYPES:G50,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:V50,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var ZH=O((bg6,lw)=>{var{EMPTY_BUFFER:Ch1}=cZ(),Z_=Buffer[Symbol.species];function Th1(Z,J){if(Z.length===0)return Ch1;if(Z.length===1)return Z[0];let X=Buffer.allocUnsafe(J),Y=0;for(let $=0;$<Z.length;$++){let Q=Z[$];X.set(Q,Y),Y+=Q.length}if(Y<J)return new Z_(X.buffer,X.byteOffset,Y);return X}function H50(Z,J,X,Y,$){for(let Q=0;Q<$;Q++)X[Y+Q]=Z[Q]^J[Q&3]}function F50(Z,J){for(let X=0;X<Z.length;X++)Z[X]^=J[X&3]}function Eh1(Z){if(Z.length===Z.buffer.byteLength)return Z.buffer;return Z.buffer.slice(Z.byteOffset,Z.byteOffset+Z.length)}function J_(Z){if(J_.readOnly=!0,Buffer.isBuffer(Z))return Z;let J;if(Z instanceof ArrayBuffer)J=new Z_(Z);else if(ArrayBuffer.isView(Z))J=new Z_(Z.buffer,Z.byteOffset,Z.byteLength);else J=Buffer.from(Z),J_.readOnly=!1;return J}lw.exports={concat:Th1,mask:H50,toArrayBuffer:Eh1,toBuffer:J_,unmask:F50};if(!process.env.WS_NO_BUFFER_UTIL)try{let Z=(()=>{throw new Error("Cannot require module "+"bufferutil");})();lw.exports.mask=function(J,X,Y,$,Q){if(Q<48)H50(J,X,Y,$,Q);else Z.mask(J,X,Y,$,Q)},lw.exports.unmask=function(J,X){if(J.length<32)F50(J,X);else Z.unmask(J,X)}}catch(Z){}});var B50=O((gg6,L50)=>{var q50=Symbol("kDone"),X_=Symbol("kRun");class U50{constructor(Z){this[q50]=()=>{this.pending--,this[X_]()},this.concurrency=Z||1/0,this.jobs=[],this.pending=0}add(Z){this.jobs.push(Z),this[X_]()}[X_](){if(this.pending===this.concurrency)return;if(this.jobs.length){let Z=this.jobs.shift();this.pending++,Z(this[q50])}}}L50.exports=U50});var XH=O((mg6,N50)=>{var JH=m("zlib"),w50=ZH(),kh1=B50(),{kStatusCode:O50}=cZ(),Ih1=Buffer[Symbol.species],_h1=Buffer.from([0,0,255,255]),iw=Symbol("permessage-deflate"),lZ=Symbol("total-length"),TW=Symbol("callback"),qX=Symbol("buffers"),EW=Symbol("error"),pw;class R50{constructor(Z,J,X){if(this._maxPayload=X|0,this._options=Z||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!J,this._deflate=null,this._inflate=null,this.params=null,!pw){let Y=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;pw=new kh1(Y)}}static get extensionName(){return"permessage-deflate"}offer(){let Z={};if(this._options.serverNoContextTakeover)Z.server_no_context_takeover=!0;if(this._options.clientNoContextTakeover)Z.client_no_context_takeover=!0;if(this._options.serverMaxWindowBits)Z.server_max_window_bits=this._options.serverMaxWindowBits;if(this._options.clientMaxWindowBits)Z.client_max_window_bits=this._options.clientMaxWindowBits;else if(this._options.clientMaxWindowBits==null)Z.client_max_window_bits=!0;return Z}accept(Z){return Z=this.normalizeParams(Z),this.params=this._isServer?this.acceptAsServer(Z):this.acceptAsClient(Z),this.params}cleanup(){if(this._inflate)this._inflate.close(),this._inflate=null;if(this._deflate){let Z=this._deflate[TW];if(this._deflate.close(),this._deflate=null,Z)Z(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(Z){let J=this._options,X=Z.find((Y)=>{if(J.serverNoContextTakeover===!1&&Y.server_no_context_takeover||Y.server_max_window_bits&&(J.serverMaxWindowBits===!1||typeof J.serverMaxWindowBits==="number"&&J.serverMaxWindowBits>Y.server_max_window_bits)||typeof J.clientMaxWindowBits==="number"&&!Y.client_max_window_bits)return!1;return!0});if(!X)throw new Error("None of the extension offers can be accepted");if(J.serverNoContextTakeover)X.server_no_context_takeover=!0;if(J.clientNoContextTakeover)X.client_no_context_takeover=!0;if(typeof J.serverMaxWindowBits==="number")X.server_max_window_bits=J.serverMaxWindowBits;if(typeof J.clientMaxWindowBits==="number")X.client_max_window_bits=J.clientMaxWindowBits;else if(X.client_max_window_bits===!0||J.clientMaxWindowBits===!1)delete X.client_max_window_bits;return X}acceptAsClient(Z){let J=Z[0];if(this._options.clientNoContextTakeover===!1&&J.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!J.client_max_window_bits){if(typeof this._options.clientMaxWindowBits==="number")J.client_max_window_bits=this._options.clientMaxWindowBits}else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits==="number"&&J.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return J}normalizeParams(Z){return Z.forEach((J)=>{Object.keys(J).forEach((X)=>{let Y=J[X];if(Y.length>1)throw new Error(`Parameter "${X}" must have only a single value`);if(Y=Y[0],X==="client_max_window_bits"){if(Y!==!0){let $=+Y;if(!Number.isInteger($)||$<8||$>15)throw new TypeError(`Invalid value for parameter "${X}": ${Y}`);Y=$}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${X}": ${Y}`)}else if(X==="server_max_window_bits"){let $=+Y;if(!Number.isInteger($)||$<8||$>15)throw new TypeError(`Invalid value for parameter "${X}": ${Y}`);Y=$}else if(X==="client_no_context_takeover"||X==="server_no_context_takeover"){if(Y!==!0)throw new TypeError(`Invalid value for parameter "${X}": ${Y}`)}else throw new Error(`Unknown parameter "${X}"`);J[X]=Y})}),Z}decompress(Z,J,X){pw.add((Y)=>{this._decompress(Z,J,($,Q)=>{Y(),X($,Q)})})}compress(Z,J,X){pw.add((Y)=>{this._compress(Z,J,($,Q)=>{Y(),X($,Q)})})}_decompress(Z,J,X){let Y=this._isServer?"client":"server";if(!this._inflate){let $=`${Y}_max_window_bits`,Q=typeof this.params[$]!=="number"?JH.Z_DEFAULT_WINDOWBITS:this.params[$];this._inflate=JH.createInflateRaw({...this._options.zlibInflateOptions,windowBits:Q}),this._inflate[iw]=this,this._inflate[lZ]=0,this._inflate[qX]=[],this._inflate.on("error",Sh1),this._inflate.on("data",M50)}if(this._inflate[TW]=X,this._inflate.write(Z),J)this._inflate.write(_h1);this._inflate.flush(()=>{let $=this._inflate[EW];if($){this._inflate.close(),this._inflate=null,X($);return}let Q=w50.concat(this._inflate[qX],this._inflate[lZ]);if(this._inflate._readableState.endEmitted)this._inflate.close(),this._inflate=null;else if(this._inflate[lZ]=0,this._inflate[qX]=[],J&&this.params[`${Y}_no_context_takeover`])this._inflate.reset();X(null,Q)})}_compress(Z,J,X){let Y=this._isServer?"server":"client";if(!this._deflate){let $=`${Y}_max_window_bits`,Q=typeof this.params[$]!=="number"?JH.Z_DEFAULT_WINDOWBITS:this.params[$];this._deflate=JH.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:Q}),this._deflate[lZ]=0,this._deflate[qX]=[],this._deflate.on("data",vh1)}this._deflate[TW]=X,this._deflate.write(Z),this._deflate.flush(JH.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let $=w50.concat(this._deflate[qX],this._deflate[lZ]);if(J)$=new Ih1($.buffer,$.byteOffset,$.length-4);if(this._deflate[TW]=null,this._deflate[lZ]=0,this._deflate[qX]=[],J&&this.params[`${Y}_no_context_takeover`])this._deflate.reset();X(null,$)})}}N50.exports=R50;function vh1(Z){this[qX].push(Z),this[lZ]+=Z.length}function M50(Z){if(this[lZ]+=Z.length,this[iw]._maxPayload<1||this[lZ]<=this[iw]._maxPayload){this[qX].push(Z);return}this[EW]=new RangeError("Max payload size exceeded"),this[EW].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[EW][O50]=1009,this.removeListener("data",M50),this.reset()}function Sh1(Z){if(this[iw]._inflate=null,this[EW]){this[TW](this[EW]);return}Z[O50]=1007,this[TW](Z)}});var kW=O((ug6,nw)=>{var{isUtf8:j50}=m("buffer"),{hasBlob:Ah1}=cZ(),xh1=[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 hh1(Z){return Z>=1000&&Z<=1014&&Z!==1004&&Z!==1005&&Z!==1006||Z>=3000&&Z<=4999}function Y_(Z){let J=Z.length,X=0;while(X<J)if((Z[X]&128)===0)X++;else if((Z[X]&224)===192){if(X+1===J||(Z[X+1]&192)!==128||(Z[X]&254)===192)return!1;X+=2}else if((Z[X]&240)===224){if(X+2>=J||(Z[X+1]&192)!==128||(Z[X+2]&192)!==128||Z[X]===224&&(Z[X+1]&224)===128||Z[X]===237&&(Z[X+1]&224)===160)return!1;X+=3}else if((Z[X]&248)===240){if(X+3>=J||(Z[X+1]&192)!==128||(Z[X+2]&192)!==128||(Z[X+3]&192)!==128||Z[X]===240&&(Z[X+1]&240)===128||Z[X]===244&&Z[X+1]>143||Z[X]>244)return!1;X+=4}else return!1;return!0}function fh1(Z){return Ah1&&typeof Z==="object"&&typeof Z.arrayBuffer==="function"&&typeof Z.type==="string"&&typeof Z.stream==="function"&&(Z[Symbol.toStringTag]==="Blob"||Z[Symbol.toStringTag]==="File")}nw.exports={isBlob:fh1,isValidStatusCode:hh1,isValidUTF8:Y_,tokenChars:xh1};if(j50)nw.exports.isValidUTF8=function(Z){return Z.length<24?Y_(Z):j50(Z)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let Z=(()=>{throw new Error("Cannot require module "+"utf-8-validate");})();nw.exports.isValidUTF8=function(J){return J.length<32?Y_(J):Z(J)}}catch(Z){}});var Q_=O((dg6,E50)=>{var{Writable:yh1}=m("stream"),D50=XH(),{BINARY_TYPES:bh1,EMPTY_BUFFER:P50,kStatusCode:gh1,kWebSocket:mh1}=cZ(),{concat:$_,toArrayBuffer:uh1,unmask:dh1}=ZH(),{isValidStatusCode:ch1,isValidUTF8:C50}=kW(),aw=Buffer[Symbol.species];class T50 extends yh1{constructor(Z={}){super();this._allowSynchronousEvents=Z.allowSynchronousEvents!==void 0?Z.allowSynchronousEvents:!0,this._binaryType=Z.binaryType||bh1[0],this._extensions=Z.extensions||{},this._isServer=!!Z.isServer,this._maxPayload=Z.maxPayload|0,this._skipUTF8Validation=!!Z.skipUTF8Validation,this[mh1]=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(Z,J,X){if(this._opcode===8&&this._state==0)return X();this._bufferedBytes+=Z.length,this._buffers.push(Z),this.startLoop(X)}consume(Z){if(this._bufferedBytes-=Z,Z===this._buffers[0].length)return this._buffers.shift();if(Z<this._buffers[0].length){let X=this._buffers[0];return this._buffers[0]=new aw(X.buffer,X.byteOffset+Z,X.length-Z),new aw(X.buffer,X.byteOffset,Z)}let J=Buffer.allocUnsafe(Z);do{let X=this._buffers[0],Y=J.length-Z;if(Z>=X.length)J.set(this._buffers.shift(),Y);else J.set(new Uint8Array(X.buffer,X.byteOffset,Z),Y),this._buffers[0]=new aw(X.buffer,X.byteOffset+Z,X.length-Z);Z-=X.length}while(Z>0);return J}startLoop(Z){this._loop=!0;do switch(this._state){case 0:this.getInfo(Z);break;case 1:this.getPayloadLength16(Z);break;case 2:this.getPayloadLength64(Z);break;case 3:this.getMask();break;case 4:this.getData(Z);break;case 5:case 6:this._loop=!1;return}while(this._loop);if(!this._errored)Z()}getInfo(Z){if(this._bufferedBytes<2){this._loop=!1;return}let J=this.consume(2);if((J[0]&48)!==0){let Y=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");Z(Y);return}let X=(J[0]&64)===64;if(X&&!this._extensions[D50.extensionName]){let Y=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");Z(Y);return}if(this._fin=(J[0]&128)===128,this._opcode=J[0]&15,this._payloadLength=J[1]&127,this._opcode===0){if(X){let Y=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");Z(Y);return}if(!this._fragmented){let Y=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");Z(Y);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let Y=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");Z(Y);return}this._compressed=X}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let Y=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");Z(Y);return}if(X){let Y=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");Z(Y);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let Y=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");Z(Y);return}}else{let Y=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");Z(Y);return}if(!this._fin&&!this._fragmented)this._fragmented=this._opcode;if(this._masked=(J[1]&128)===128,this._isServer){if(!this._masked){let Y=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");Z(Y);return}}else if(this._masked){let Y=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");Z(Y);return}if(this._payloadLength===126)this._state=1;else if(this._payloadLength===127)this._state=2;else this.haveLength(Z)}getPayloadLength16(Z){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(Z)}getPayloadLength64(Z){if(this._bufferedBytes<8){this._loop=!1;return}let J=this.consume(8),X=J.readUInt32BE(0);if(X>Math.pow(2,21)-1){let Y=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");Z(Y);return}this._payloadLength=X*Math.pow(2,32)+J.readUInt32BE(4),this.haveLength(Z)}haveLength(Z){if(this._payloadLength&&this._opcode<8){if(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0){let J=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");Z(J);return}}if(this._masked)this._state=3;else this._state=4}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=4}getData(Z){let J=P50;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}if(J=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0)dh1(J,this._mask)}if(this._opcode>7){this.controlMessage(J,Z);return}if(this._compressed){this._state=5,this.decompress(J,Z);return}if(J.length)this._messageLength=this._totalPayloadLength,this._fragments.push(J);this.dataMessage(Z)}decompress(Z,J){this._extensions[D50.extensionName].decompress(Z,this._fin,(Y,$)=>{if(Y)return J(Y);if($.length){if(this._messageLength+=$.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let Q=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");J(Q);return}this._fragments.push($)}if(this.dataMessage(J),this._state===0)this.startLoop(J)})}dataMessage(Z){if(!this._fin){this._state=0;return}let J=this._messageLength,X=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let Y;if(this._binaryType==="nodebuffer")Y=$_(X,J);else if(this._binaryType==="arraybuffer")Y=uh1($_(X,J));else if(this._binaryType==="blob")Y=new Blob(X);else Y=X;if(this._allowSynchronousEvents)this.emit("message",Y,!0),this._state=0;else this._state=6,setImmediate(()=>{this.emit("message",Y,!0),this._state=0,this.startLoop(Z)})}else{let Y=$_(X,J);if(!this._skipUTF8Validation&&!C50(Y)){let $=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");Z($);return}if(this._state===5||this._allowSynchronousEvents)this.emit("message",Y,!1),this._state=0;else this._state=6,setImmediate(()=>{this.emit("message",Y,!1),this._state=0,this.startLoop(Z)})}}controlMessage(Z,J){if(this._opcode===8){if(Z.length===0)this._loop=!1,this.emit("conclude",1005,P50),this.end();else{let X=Z.readUInt16BE(0);if(!ch1(X)){let $=this.createError(RangeError,`invalid status code ${X}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");J($);return}let Y=new aw(Z.buffer,Z.byteOffset+2,Z.length-2);if(!this._skipUTF8Validation&&!C50(Y)){let $=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");J($);return}this._loop=!1,this.emit("conclude",X,Y),this.end()}this._state=0;return}if(this._allowSynchronousEvents)this.emit(this._opcode===9?"ping":"pong",Z),this._state=0;else this._state=6,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",Z),this._state=0,this.startLoop(J)})}createError(Z,J,X,Y,$){this._loop=!1,this._errored=!0;let Q=new Z(X?`Invalid WebSocket frame: ${J}`:J);return Error.captureStackTrace(Q,this.createError),Q.code=$,Q[gh1]=Y,Q}}E50.exports=T50});var W_=O((lg6,_50)=>{var{Duplex:cg6}=m("stream"),{randomFillSync:lh1}=m("crypto"),k50=XH(),{EMPTY_BUFFER:ph1,kWebSocket:ih1,NOOP:nh1}=cZ(),{isBlob:IW,isValidStatusCode:ah1}=kW(),{mask:I50,toBuffer:k$}=ZH(),l9=Symbol("kByteLength"),sh1=Buffer.alloc(4),I$,_W=8192,d4=0,oh1=1,rh1=2;class UX{constructor(Z,J,X){if(this._extensions=J||{},X)this._generateMask=X,this._maskBuffer=Buffer.alloc(4);this._socket=Z,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=d4,this.onerror=nh1,this[ih1]=void 0}static frame(Z,J){let X,Y=!1,$=2,Q=!1;if(J.mask){if(X=J.maskBuffer||sh1,J.generateMask)J.generateMask(X);else{if(_W===8192){if(I$===void 0)I$=Buffer.alloc(8192);lh1(I$,0,8192),_W=0}X[0]=I$[_W++],X[1]=I$[_W++],X[2]=I$[_W++],X[3]=I$[_W++]}Q=(X[0]|X[1]|X[2]|X[3])===0,$=6}let K;if(typeof Z==="string")if((!J.mask||Q)&&J[l9]!==void 0)K=J[l9];else Z=Buffer.from(Z),K=Z.length;else K=Z.length,Y=J.mask&&J.readOnly&&!Q;let W=K;if(K>=65536)$+=8,W=127;else if(K>125)$+=2,W=126;let G=Buffer.allocUnsafe(Y?K+$:$);if(G[0]=J.fin?J.opcode|128:J.opcode,J.rsv1)G[0]|=64;if(G[1]=W,W===126)G.writeUInt16BE(K,2);else if(W===127)G[2]=G[3]=0,G.writeUIntBE(K,4,6);if(!J.mask)return[G,Z];if(G[1]|=128,G[$-4]=X[0],G[$-3]=X[1],G[$-2]=X[2],G[$-1]=X[3],Q)return[G,Z];if(Y)return I50(Z,X,G,$,K),[G];return I50(Z,X,Z,0,K),[G,Z]}close(Z,J,X,Y){let $;if(Z===void 0)$=ph1;else if(typeof Z!=="number"||!ah1(Z))throw new TypeError("First argument must be a valid error code number");else if(J===void 0||!J.length)$=Buffer.allocUnsafe(2),$.writeUInt16BE(Z,0);else{let K=Buffer.byteLength(J);if(K>123)throw new RangeError("The message must not be greater than 123 bytes");if($=Buffer.allocUnsafe(2+K),$.writeUInt16BE(Z,0),typeof J==="string")$.write(J,2);else $.set(J,2)}let Q={[l9]:$.length,fin:!0,generateMask:this._generateMask,mask:X,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};if(this._state!==d4)this.enqueue([this.dispatch,$,!1,Q,Y]);else this.sendFrame(UX.frame($,Q),Y)}ping(Z,J,X){let Y,$;if(typeof Z==="string")Y=Buffer.byteLength(Z),$=!1;else if(IW(Z))Y=Z.size,$=!1;else Z=k$(Z),Y=Z.length,$=k$.readOnly;if(Y>125)throw new RangeError("The data size must not be greater than 125 bytes");let Q={[l9]:Y,fin:!0,generateMask:this._generateMask,mask:J,maskBuffer:this._maskBuffer,opcode:9,readOnly:$,rsv1:!1};if(IW(Z))if(this._state!==d4)this.enqueue([this.getBlobData,Z,!1,Q,X]);else this.getBlobData(Z,!1,Q,X);else if(this._state!==d4)this.enqueue([this.dispatch,Z,!1,Q,X]);else this.sendFrame(UX.frame(Z,Q),X)}pong(Z,J,X){let Y,$;if(typeof Z==="string")Y=Buffer.byteLength(Z),$=!1;else if(IW(Z))Y=Z.size,$=!1;else Z=k$(Z),Y=Z.length,$=k$.readOnly;if(Y>125)throw new RangeError("The data size must not be greater than 125 bytes");let Q={[l9]:Y,fin:!0,generateMask:this._generateMask,mask:J,maskBuffer:this._maskBuffer,opcode:10,readOnly:$,rsv1:!1};if(IW(Z))if(this._state!==d4)this.enqueue([this.getBlobData,Z,!1,Q,X]);else this.getBlobData(Z,!1,Q,X);else if(this._state!==d4)this.enqueue([this.dispatch,Z,!1,Q,X]);else this.sendFrame(UX.frame(Z,Q),X)}send(Z,J,X){let Y=this._extensions[k50.extensionName],$=J.binary?2:1,Q=J.compress,K,W;if(typeof Z==="string")K=Buffer.byteLength(Z),W=!1;else if(IW(Z))K=Z.size,W=!1;else Z=k$(Z),K=Z.length,W=k$.readOnly;if(this._firstFragment){if(this._firstFragment=!1,Q&&Y&&Y.params[Y._isServer?"server_no_context_takeover":"client_no_context_takeover"])Q=K>=Y._threshold;this._compress=Q}else Q=!1,$=0;if(J.fin)this._firstFragment=!0;let G={[l9]:K,fin:J.fin,generateMask:this._generateMask,mask:J.mask,maskBuffer:this._maskBuffer,opcode:$,readOnly:W,rsv1:Q};if(IW(Z))if(this._state!==d4)this.enqueue([this.getBlobData,Z,this._compress,G,X]);else this.getBlobData(Z,this._compress,G,X);else if(this._state!==d4)this.enqueue([this.dispatch,Z,this._compress,G,X]);else this.dispatch(Z,this._compress,G,X)}getBlobData(Z,J,X,Y){this._bufferedBytes+=X[l9],this._state=rh1,Z.arrayBuffer().then(($)=>{if(this._socket.destroyed){let K=new Error("The socket was closed while the blob was being read");process.nextTick(K_,this,K,Y);return}this._bufferedBytes-=X[l9];let Q=k$($);if(!J)this._state=d4,this.sendFrame(UX.frame(Q,X),Y),this.dequeue();else this.dispatch(Q,J,X,Y)}).catch(($)=>{process.nextTick(th1,this,$,Y)})}dispatch(Z,J,X,Y){if(!J){this.sendFrame(UX.frame(Z,X),Y);return}let $=this._extensions[k50.extensionName];this._bufferedBytes+=X[l9],this._state=oh1,$.compress(Z,X.fin,(Q,K)=>{if(this._socket.destroyed){let W=new Error("The socket was closed while data was being compressed");K_(this,W,Y);return}this._bufferedBytes-=X[l9],this._state=d4,X.readOnly=!1,this.sendFrame(UX.frame(K,X),Y),this.dequeue()})}dequeue(){while(this._state===d4&&this._queue.length){let Z=this._queue.shift();this._bufferedBytes-=Z[3][l9],Reflect.apply(Z[0],this,Z.slice(1))}}enqueue(Z){this._bufferedBytes+=Z[3][l9],this._queue.push(Z)}sendFrame(Z,J){if(Z.length===2)this._socket.cork(),this._socket.write(Z[0]),this._socket.write(Z[1],J),this._socket.uncork();else this._socket.write(Z[0],J)}}_50.exports=UX;function K_(Z,J,X){if(typeof X==="function")X(J);for(let Y=0;Y<Z._queue.length;Y++){let $=Z._queue[Y],Q=$[$.length-1];if(typeof Q==="function")Q(J)}}function th1(Z,J,X){K_(Z,J,X),Z.onerror(J)}});var g50=O((pg6,b50)=>{var{kForOnEventAttribute:YH,kListener:G_}=cZ(),v50=Symbol("kCode"),S50=Symbol("kData"),A50=Symbol("kError"),x50=Symbol("kMessage"),h50=Symbol("kReason"),vW=Symbol("kTarget"),f50=Symbol("kType"),y50=Symbol("kWasClean");class LX{constructor(Z){this[vW]=null,this[f50]=Z}get target(){return this[vW]}get type(){return this[f50]}}Object.defineProperty(LX.prototype,"target",{enumerable:!0});Object.defineProperty(LX.prototype,"type",{enumerable:!0});class SW extends LX{constructor(Z,J={}){super(Z);this[v50]=J.code===void 0?0:J.code,this[h50]=J.reason===void 0?"":J.reason,this[y50]=J.wasClean===void 0?!1:J.wasClean}get code(){return this[v50]}get reason(){return this[h50]}get wasClean(){return this[y50]}}Object.defineProperty(SW.prototype,"code",{enumerable:!0});Object.defineProperty(SW.prototype,"reason",{enumerable:!0});Object.defineProperty(SW.prototype,"wasClean",{enumerable:!0});class $H extends LX{constructor(Z,J={}){super(Z);this[A50]=J.error===void 0?null:J.error,this[x50]=J.message===void 0?"":J.message}get error(){return this[A50]}get message(){return this[x50]}}Object.defineProperty($H.prototype,"error",{enumerable:!0});Object.defineProperty($H.prototype,"message",{enumerable:!0});class ow extends LX{constructor(Z,J={}){super(Z);this[S50]=J.data===void 0?null:J.data}get data(){return this[S50]}}Object.defineProperty(ow.prototype,"data",{enumerable:!0});var eh1={addEventListener(Z,J,X={}){for(let $ of this.listeners(Z))if(!X[YH]&&$[G_]===J&&!$[YH])return;let Y;if(Z==="message")Y=function $(Q,K){let W=new ow("message",{data:K?Q:Q.toString()});W[vW]=this,sw(J,this,W)};else if(Z==="close")Y=function $(Q,K){let W=new SW("close",{code:Q,reason:K.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});W[vW]=this,sw(J,this,W)};else if(Z==="error")Y=function $(Q){let K=new $H("error",{error:Q,message:Q.message});K[vW]=this,sw(J,this,K)};else if(Z==="open")Y=function $(){let Q=new LX("open");Q[vW]=this,sw(J,this,Q)};else return;if(Y[YH]=!!X[YH],Y[G_]=J,X.once)this.once(Z,Y);else this.on(Z,Y)},removeEventListener(Z,J){for(let X of this.listeners(Z))if(X[G_]===J&&!X[YH]){this.removeListener(Z,X);break}}};b50.exports={CloseEvent:SW,ErrorEvent:$H,Event:LX,EventTarget:eh1,MessageEvent:ow};function sw(Z,J,X){if(typeof Z==="object"&&Z.handleEvent)Z.handleEvent.call(Z,X);else Z.call(J,X)}});var V_=O((ig6,m50)=>{var{tokenChars:QH}=kW();function g7(Z,J,X){if(Z[J]===void 0)Z[J]=[X];else Z[J].push(X)}function Zf1(Z){let J=Object.create(null),X=Object.create(null),Y=!1,$=!1,Q=!1,K,W,G=-1,V=-1,z=-1,F=0;for(;F<Z.length;F++)if(V=Z.charCodeAt(F),K===void 0)if(z===-1&&QH[V]===1){if(G===-1)G=F}else if(F!==0&&(V===32||V===9)){if(z===-1&&G!==-1)z=F}else if(V===59||V===44){if(G===-1)throw new SyntaxError(`Unexpected character at index ${F}`);if(z===-1)z=F;let q=Z.slice(G,z);if(V===44)g7(J,q,X),X=Object.create(null);else K=q;G=z=-1}else throw new SyntaxError(`Unexpected character at index ${F}`);else if(W===void 0)if(z===-1&&QH[V]===1){if(G===-1)G=F}else if(V===32||V===9){if(z===-1&&G!==-1)z=F}else if(V===59||V===44){if(G===-1)throw new SyntaxError(`Unexpected character at index ${F}`);if(z===-1)z=F;if(g7(X,Z.slice(G,z),!0),V===44)g7(J,K,X),X=Object.create(null),K=void 0;G=z=-1}else if(V===61&&G!==-1&&z===-1)W=Z.slice(G,F),G=z=-1;else throw new SyntaxError(`Unexpected character at index ${F}`);else if($){if(QH[V]!==1)throw new SyntaxError(`Unexpected character at index ${F}`);if(G===-1)G=F;else if(!Y)Y=!0;$=!1}else if(Q)if(QH[V]===1){if(G===-1)G=F}else if(V===34&&G!==-1)Q=!1,z=F;else if(V===92)$=!0;else throw new SyntaxError(`Unexpected character at index ${F}`);else if(V===34&&Z.charCodeAt(F-1)===61)Q=!0;else if(z===-1&&QH[V]===1){if(G===-1)G=F}else if(G!==-1&&(V===32||V===9)){if(z===-1)z=F}else if(V===59||V===44){if(G===-1)throw new SyntaxError(`Unexpected character at index ${F}`);if(z===-1)z=F;let q=Z.slice(G,z);if(Y)q=q.replace(/\\/g,""),Y=!1;if(g7(X,W,q),V===44)g7(J,K,X),X=Object.create(null),K=void 0;W=void 0,G=z=-1}else throw new SyntaxError(`Unexpected character at index ${F}`);if(G===-1||Q||V===32||V===9)throw new SyntaxError("Unexpected end of input");if(z===-1)z=F;let H=Z.slice(G,z);if(K===void 0)g7(J,H,X);else{if(W===void 0)g7(X,H,!0);else if(Y)g7(X,W,H.replace(/\\/g,""));else g7(X,W,H);g7(J,K,X)}return J}function Jf1(Z){return Object.keys(Z).map((J)=>{let X=Z[J];if(!Array.isArray(X))X=[X];return X.map((Y)=>{return[J].concat(Object.keys(Y).map(($)=>{let Q=Y[$];if(!Array.isArray(Q))Q=[Q];return Q.map((K)=>K===!0?$:`${$}=${K}`).join("; ")})).join("; ")}).join(", ")}).join(", ")}m50.exports={format:Jf1,parse:Zf1}});var ZO=O((sg6,t50)=>{var Xf1=m("events"),Yf1=m("https"),$f1=m("http"),c50=m("net"),Qf1=m("tls"),{randomBytes:Kf1,createHash:Wf1}=m("crypto"),{Duplex:ng6,Readable:ag6}=m("stream"),{URL:z_}=m("url"),BX=XH(),Gf1=Q_(),Vf1=W_(),{isBlob:zf1}=kW(),{BINARY_TYPES:u50,EMPTY_BUFFER:rw,GUID:Hf1,kForOnEventAttribute:H_,kListener:Ff1,kStatusCode:qf1,kWebSocket:Y6,NOOP:l50}=cZ(),{EventTarget:{addEventListener:Uf1,removeEventListener:Lf1}}=g50(),{format:Bf1,parse:wf1}=V_(),{toBuffer:Of1}=ZH(),p50=Symbol("kAborted"),F_=[8,13],pZ=["CONNECTING","OPEN","CLOSING","CLOSED"],Rf1=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class g0 extends Xf1{constructor(Z,J,X){super();if(this._binaryType=u50[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=rw,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=g0.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,Z!==null){if(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,J===void 0)J=[];else if(!Array.isArray(J))if(typeof J==="object"&&J!==null)X=J,J=[];else J=[J];i50(this,Z,J,X)}else this._autoPong=X.autoPong,this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(Z){if(!u50.includes(Z))return;if(this._binaryType=Z,this._receiver)this._receiver._binaryType=Z}get bufferedAmount(){if(!this._socket)return this._bufferedAmount;return this._socket._writableState.length+this._sender._bufferedBytes}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(Z,J,X){let Y=new Gf1({allowSynchronousEvents:X.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:X.maxPayload,skipUTF8Validation:X.skipUTF8Validation}),$=new Vf1(Z,this._extensions,X.generateMask);if(this._receiver=Y,this._sender=$,this._socket=Z,Y[Y6]=this,$[Y6]=this,Z[Y6]=this,Y.on("conclude",jf1),Y.on("drain",Df1),Y.on("error",Pf1),Y.on("message",Cf1),Y.on("ping",Tf1),Y.on("pong",Ef1),$.onerror=kf1,Z.setTimeout)Z.setTimeout(0);if(Z.setNoDelay)Z.setNoDelay();if(J.length>0)Z.unshift(J);Z.on("close",s50),Z.on("data",ew),Z.on("end",o50),Z.on("error",r50),this._readyState=g0.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=g0.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}if(this._extensions[BX.extensionName])this._extensions[BX.extensionName].cleanup();this._receiver.removeAllListeners(),this._readyState=g0.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(Z,J){if(this.readyState===g0.CLOSED)return;if(this.readyState===g0.CONNECTING){z9(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===g0.CLOSING){if(this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted))this._socket.end();return}this._readyState=g0.CLOSING,this._sender.close(Z,J,!this._isServer,(X)=>{if(X)return;if(this._closeFrameSent=!0,this._closeFrameReceived||this._receiver._writableState.errorEmitted)this._socket.end()}),a50(this)}pause(){if(this.readyState===g0.CONNECTING||this.readyState===g0.CLOSED)return;this._paused=!0,this._socket.pause()}ping(Z,J,X){if(this.readyState===g0.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof Z==="function")X=Z,Z=J=void 0;else if(typeof J==="function")X=J,J=void 0;if(typeof Z==="number")Z=Z.toString();if(this.readyState!==g0.OPEN){q_(this,Z,X);return}if(J===void 0)J=!this._isServer;this._sender.ping(Z||rw,J,X)}pong(Z,J,X){if(this.readyState===g0.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof Z==="function")X=Z,Z=J=void 0;else if(typeof J==="function")X=J,J=void 0;if(typeof Z==="number")Z=Z.toString();if(this.readyState!==g0.OPEN){q_(this,Z,X);return}if(J===void 0)J=!this._isServer;this._sender.pong(Z||rw,J,X)}resume(){if(this.readyState===g0.CONNECTING||this.readyState===g0.CLOSED)return;if(this._paused=!1,!this._receiver._writableState.needDrain)this._socket.resume()}send(Z,J,X){if(this.readyState===g0.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof J==="function")X=J,J={};if(typeof Z==="number")Z=Z.toString();if(this.readyState!==g0.OPEN){q_(this,Z,X);return}let Y={binary:typeof Z!=="string",mask:!this._isServer,compress:!0,fin:!0,...J};if(!this._extensions[BX.extensionName])Y.compress=!1;this._sender.send(Z||rw,Y,X)}terminate(){if(this.readyState===g0.CLOSED)return;if(this.readyState===g0.CONNECTING){z9(this,this._req,"WebSocket was closed before the connection was established");return}if(this._socket)this._readyState=g0.CLOSING,this._socket.destroy()}}Object.defineProperty(g0,"CONNECTING",{enumerable:!0,value:pZ.indexOf("CONNECTING")});Object.defineProperty(g0.prototype,"CONNECTING",{enumerable:!0,value:pZ.indexOf("CONNECTING")});Object.defineProperty(g0,"OPEN",{enumerable:!0,value:pZ.indexOf("OPEN")});Object.defineProperty(g0.prototype,"OPEN",{enumerable:!0,value:pZ.indexOf("OPEN")});Object.defineProperty(g0,"CLOSING",{enumerable:!0,value:pZ.indexOf("CLOSING")});Object.defineProperty(g0.prototype,"CLOSING",{enumerable:!0,value:pZ.indexOf("CLOSING")});Object.defineProperty(g0,"CLOSED",{enumerable:!0,value:pZ.indexOf("CLOSED")});Object.defineProperty(g0.prototype,"CLOSED",{enumerable:!0,value:pZ.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach((Z)=>{Object.defineProperty(g0.prototype,Z,{enumerable:!0})});["open","error","close","message"].forEach((Z)=>{Object.defineProperty(g0.prototype,`on${Z}`,{enumerable:!0,get(){for(let J of this.listeners(Z))if(J[H_])return J[Ff1];return null},set(J){for(let X of this.listeners(Z))if(X[H_]){this.removeListener(Z,X);break}if(typeof J!=="function")return;this.addEventListener(Z,J,{[H_]:!0})}})});g0.prototype.addEventListener=Uf1;g0.prototype.removeEventListener=Lf1;t50.exports=g0;function i50(Z,J,X,Y){let $={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:F_[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...Y,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(Z._autoPong=$.autoPong,!F_.includes($.protocolVersion))throw new RangeError(`Unsupported protocol version: ${$.protocolVersion} (supported versions: ${F_.join(", ")})`);let Q;if(J instanceof z_)Q=J;else try{Q=new z_(J)}catch(L){throw new SyntaxError(`Invalid URL: ${J}`)}if(Q.protocol==="http:")Q.protocol="ws:";else if(Q.protocol==="https:")Q.protocol="wss:";Z._url=Q.href;let K=Q.protocol==="wss:",W=Q.protocol==="ws+unix:",G;if(Q.protocol!=="ws:"&&!K&&!W)G=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`;else if(W&&!Q.pathname)G="The URL's pathname is empty";else if(Q.hash)G="The URL contains a fragment identifier";if(G){let L=new SyntaxError(G);if(Z._redirects===0)throw L;else{tw(Z,L);return}}let V=K?443:80,z=Kf1(16).toString("base64"),F=K?Yf1.request:$f1.request,H=new Set,q;if($.createConnection=$.createConnection||(K?Nf1:Mf1),$.defaultPort=$.defaultPort||V,$.port=Q.port||V,$.host=Q.hostname.startsWith("[")?Q.hostname.slice(1,-1):Q.hostname,$.headers={...$.headers,"Sec-WebSocket-Version":$.protocolVersion,"Sec-WebSocket-Key":z,Connection:"Upgrade",Upgrade:"websocket"},$.path=Q.pathname+Q.search,$.timeout=$.handshakeTimeout,$.perMessageDeflate)q=new BX($.perMessageDeflate!==!0?$.perMessageDeflate:{},!1,$.maxPayload),$.headers["Sec-WebSocket-Extensions"]=Bf1({[BX.extensionName]:q.offer()});if(X.length){for(let L of X){if(typeof L!=="string"||!Rf1.test(L)||H.has(L))throw new SyntaxError("An invalid or duplicated subprotocol was specified");H.add(L)}$.headers["Sec-WebSocket-Protocol"]=X.join(",")}if($.origin)if($.protocolVersion<13)$.headers["Sec-WebSocket-Origin"]=$.origin;else $.headers.Origin=$.origin;if(Q.username||Q.password)$.auth=`${Q.username}:${Q.password}`;if(W){let L=$.path.split(":");$.socketPath=L[0],$.path=L[1]}let U;if($.followRedirects){if(Z._redirects===0){Z._originalIpc=W,Z._originalSecure=K,Z._originalHostOrSocketPath=W?$.socketPath:Q.host;let L=Y&&Y.headers;if(Y={...Y,headers:{}},L)for(let[B,w]of Object.entries(L))Y.headers[B.toLowerCase()]=w}else if(Z.listenerCount("redirect")===0){let L=W?Z._originalIpc?$.socketPath===Z._originalHostOrSocketPath:!1:Z._originalIpc?!1:Q.host===Z._originalHostOrSocketPath;if(!L||Z._originalSecure&&!K){if(delete $.headers.authorization,delete $.headers.cookie,!L)delete $.headers.host;$.auth=void 0}}if($.auth&&!Y.headers.authorization)Y.headers.authorization="Basic "+Buffer.from($.auth).toString("base64");if(U=Z._req=F($),Z._redirects)Z.emit("redirect",Z.url,U)}else U=Z._req=F($);if($.timeout)U.on("timeout",()=>{z9(Z,U,"Opening handshake has timed out")});if(U.on("error",(L)=>{if(U===null||U[p50])return;U=Z._req=null,tw(Z,L)}),U.on("response",(L)=>{let B=L.headers.location,w=L.statusCode;if(B&&$.followRedirects&&w>=300&&w<400){if(++Z._redirects>$.maxRedirects){z9(Z,U,"Maximum redirects exceeded");return}U.abort();let R;try{R=new z_(B,J)}catch(M){let N=new SyntaxError(`Invalid URL: ${B}`);tw(Z,N);return}i50(Z,R,X,Y)}else if(!Z.emit("unexpected-response",U,L))z9(Z,U,`Unexpected server response: ${L.statusCode}`)}),U.on("upgrade",(L,B,w)=>{if(Z.emit("upgrade",L),Z.readyState!==g0.CONNECTING)return;U=Z._req=null;let R=L.headers.upgrade;if(R===void 0||R.toLowerCase()!=="websocket"){z9(Z,B,"Invalid Upgrade header");return}let M=Wf1("sha1").update(z+Hf1).digest("base64");if(L.headers["sec-websocket-accept"]!==M){z9(Z,B,"Invalid Sec-WebSocket-Accept header");return}let N=L.headers["sec-websocket-protocol"],P;if(N!==void 0){if(!H.size)P="Server sent a subprotocol but none was requested";else if(!H.has(N))P="Server sent an invalid subprotocol"}else if(H.size)P="Server sent no subprotocol";if(P){z9(Z,B,P);return}if(N)Z._protocol=N;let D=L.headers["sec-websocket-extensions"];if(D!==void 0){if(!q){z9(Z,B,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let C;try{C=wf1(D)}catch(E){z9(Z,B,"Invalid Sec-WebSocket-Extensions header");return}let T=Object.keys(C);if(T.length!==1||T[0]!==BX.extensionName){z9(Z,B,"Server indicated an extension that was not requested");return}try{q.accept(C[BX.extensionName])}catch(E){z9(Z,B,"Invalid Sec-WebSocket-Extensions header");return}Z._extensions[BX.extensionName]=q}Z.setSocket(B,w,{allowSynchronousEvents:$.allowSynchronousEvents,generateMask:$.generateMask,maxPayload:$.maxPayload,skipUTF8Validation:$.skipUTF8Validation})}),$.finishRequest)$.finishRequest(U,Z);else U.end()}function tw(Z,J){Z._readyState=g0.CLOSING,Z._errorEmitted=!0,Z.emit("error",J),Z.emitClose()}function Mf1(Z){return Z.path=Z.socketPath,c50.connect(Z)}function Nf1(Z){if(Z.path=void 0,!Z.servername&&Z.servername!=="")Z.servername=c50.isIP(Z.host)?"":Z.host;return Qf1.connect(Z)}function z9(Z,J,X){Z._readyState=g0.CLOSING;let Y=new Error(X);if(Error.captureStackTrace(Y,z9),J.setHeader){if(J[p50]=!0,J.abort(),J.socket&&!J.socket.destroyed)J.socket.destroy();process.nextTick(tw,Z,Y)}else J.destroy(Y),J.once("error",Z.emit.bind(Z,"error")),J.once("close",Z.emitClose.bind(Z))}function q_(Z,J,X){if(J){let Y=zf1(J)?J.size:Of1(J).length;if(Z._socket)Z._sender._bufferedBytes+=Y;else Z._bufferedAmount+=Y}if(X){let Y=new Error(`WebSocket is not open: readyState ${Z.readyState} (${pZ[Z.readyState]})`);process.nextTick(X,Y)}}function jf1(Z,J){let X=this[Y6];if(X._closeFrameReceived=!0,X._closeMessage=J,X._closeCode=Z,X._socket[Y6]===void 0)return;if(X._socket.removeListener("data",ew),process.nextTick(n50,X._socket),Z===1005)X.close();else X.close(Z,J)}function Df1(){let Z=this[Y6];if(!Z.isPaused)Z._socket.resume()}function Pf1(Z){let J=this[Y6];if(J._socket[Y6]!==void 0)J._socket.removeListener("data",ew),process.nextTick(n50,J._socket),J.close(Z[qf1]);if(!J._errorEmitted)J._errorEmitted=!0,J.emit("error",Z)}function d50(){this[Y6].emitClose()}function Cf1(Z,J){this[Y6].emit("message",Z,J)}function Tf1(Z){let J=this[Y6];if(J._autoPong)J.pong(Z,!this._isServer,l50);J.emit("ping",Z)}function Ef1(Z){this[Y6].emit("pong",Z)}function n50(Z){Z.resume()}function kf1(Z){let J=this[Y6];if(J.readyState===g0.CLOSED)return;if(J.readyState===g0.OPEN)J._readyState=g0.CLOSING,a50(J);if(this._socket.end(),!J._errorEmitted)J._errorEmitted=!0,J.emit("error",Z)}function a50(Z){Z._closeTimer=setTimeout(Z._socket.destroy.bind(Z._socket),30000)}function s50(){let Z=this[Y6];this.removeListener("close",s50),this.removeListener("data",ew),this.removeListener("end",o50),Z._readyState=g0.CLOSING;let J;if(!this._readableState.endEmitted&&!Z._closeFrameReceived&&!Z._receiver._writableState.errorEmitted&&(J=Z._socket.read())!==null)Z._receiver.write(J);if(Z._receiver.end(),this[Y6]=void 0,clearTimeout(Z._closeTimer),Z._receiver._writableState.finished||Z._receiver._writableState.errorEmitted)Z.emitClose();else Z._receiver.on("error",d50),Z._receiver.on("finish",d50)}function ew(Z){if(!this[Y6]._receiver.write(Z))this.pause()}function o50(){let Z=this[Y6];Z._readyState=g0.CLOSING,Z._receiver.end(),this.end()}function r50(){let Z=this[Y6];if(this.removeListener("error",r50),this.on("error",l50),Z)Z._readyState=g0.CLOSING,this.destroy()}});var X90=O((rg6,J90)=>{var og6=ZO(),{Duplex:If1}=m("stream");function e50(Z){Z.emit("close")}function _f1(){if(!this.destroyed&&this._writableState.finished)this.destroy()}function Z90(Z){if(this.removeListener("error",Z90),this.destroy(),this.listenerCount("error")===0)this.emit("error",Z)}function vf1(Z,J){let X=!0,Y=new If1({...J,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return Z.on("message",function $(Q,K){let W=!K&&Y._readableState.objectMode?Q.toString():Q;if(!Y.push(W))Z.pause()}),Z.once("error",function $(Q){if(Y.destroyed)return;X=!1,Y.destroy(Q)}),Z.once("close",function $(){if(Y.destroyed)return;Y.push(null)}),Y._destroy=function($,Q){if(Z.readyState===Z.CLOSED){Q($),process.nextTick(e50,Y);return}let K=!1;if(Z.once("error",function W(G){K=!0,Q(G)}),Z.once("close",function W(){if(!K)Q($);process.nextTick(e50,Y)}),X)Z.terminate()},Y._final=function($){if(Z.readyState===Z.CONNECTING){Z.once("open",function Q(){Y._final($)});return}if(Z._socket===null)return;if(Z._socket._writableState.finished){if($(),Y._readableState.endEmitted)Y.destroy()}else Z._socket.once("finish",function Q(){$()}),Z.close()},Y._read=function(){if(Z.isPaused)Z.resume()},Y._write=function($,Q,K){if(Z.readyState===Z.CONNECTING){Z.once("open",function W(){Y._write($,Q,K)});return}Z.send($,K)},Y.on("end",_f1),Y.on("error",Z90),Y}J90.exports=vf1});var $90=O((tg6,Y90)=>{var{tokenChars:Sf1}=kW();function Af1(Z){let J=new Set,X=-1,Y=-1,$=0;for($;$<Z.length;$++){let K=Z.charCodeAt($);if(Y===-1&&Sf1[K]===1){if(X===-1)X=$}else if($!==0&&(K===32||K===9)){if(Y===-1&&X!==-1)Y=$}else if(K===44){if(X===-1)throw new SyntaxError(`Unexpected character at index ${$}`);if(Y===-1)Y=$;let W=Z.slice(X,Y);if(J.has(W))throw new SyntaxError(`The "${W}" subprotocol is duplicated`);J.add(W),X=Y=-1}else throw new SyntaxError(`Unexpected character at index ${$}`)}if(X===-1||Y!==-1)throw new SyntaxError("Unexpected end of input");let Q=Z.slice(X,$);if(J.has(Q))throw new SyntaxError(`The "${Q}" subprotocol is duplicated`);return J.add(Q),J}Y90.exports={parse:Af1}});var V90=O((Zm6,G90)=>{var xf1=m("events"),JO=m("http"),{Duplex:eg6}=m("stream"),{createHash:hf1}=m("crypto"),Q90=V_(),_$=XH(),ff1=$90(),yf1=ZO(),{GUID:bf1,kWebSocket:gf1}=cZ(),mf1=/^[+/0-9A-Za-z]{22}==$/;class W90 extends xf1{constructor(Z,J){super();if(Z={allowSynchronousEvents:!0,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:yf1,...Z},Z.port==null&&!Z.server&&!Z.noServer||Z.port!=null&&(Z.server||Z.noServer)||Z.server&&Z.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(Z.port!=null)this._server=JO.createServer((X,Y)=>{let $=JO.STATUS_CODES[426];Y.writeHead(426,{"Content-Length":$.length,"Content-Type":"text/plain"}),Y.end($)}),this._server.listen(Z.port,Z.host,Z.backlog,J);else if(Z.server)this._server=Z.server;if(this._server){let X=this.emit.bind(this,"connection");this._removeListeners=uf1(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(Y,$,Q)=>{this.handleUpgrade(Y,$,Q,X)}})}if(Z.perMessageDeflate===!0)Z.perMessageDeflate={};if(Z.clientTracking)this.clients=new Set,this._shouldEmitClose=!1;this.options=Z,this._state=0}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');if(!this._server)return null;return this._server.address()}close(Z){if(this._state===2){if(Z)this.once("close",()=>{Z(new Error("The server is not running"))});process.nextTick(KH,this);return}if(Z)this.once("close",Z);if(this._state===1)return;if(this._state=1,this.options.noServer||this.options.server){if(this._server)this._removeListeners(),this._removeListeners=this._server=null;if(this.clients)if(!this.clients.size)process.nextTick(KH,this);else this._shouldEmitClose=!0;else process.nextTick(KH,this)}else{let J=this._server;this._removeListeners(),this._removeListeners=this._server=null,J.close(()=>{KH(this)})}}shouldHandle(Z){if(this.options.path){let J=Z.url.indexOf("?");if((J!==-1?Z.url.slice(0,J):Z.url)!==this.options.path)return!1}return!0}handleUpgrade(Z,J,X,Y){J.on("error",K90);let $=Z.headers["sec-websocket-key"],Q=Z.headers.upgrade,K=+Z.headers["sec-websocket-version"];if(Z.method!=="GET"){v$(this,Z,J,405,"Invalid HTTP method");return}if(Q===void 0||Q.toLowerCase()!=="websocket"){v$(this,Z,J,400,"Invalid Upgrade header");return}if($===void 0||!mf1.test($)){v$(this,Z,J,400,"Missing or invalid Sec-WebSocket-Key header");return}if(K!==8&&K!==13){v$(this,Z,J,400,"Missing or invalid Sec-WebSocket-Version header");return}if(!this.shouldHandle(Z)){WH(J,400);return}let W=Z.headers["sec-websocket-protocol"],G=new Set;if(W!==void 0)try{G=ff1.parse(W)}catch(F){v$(this,Z,J,400,"Invalid Sec-WebSocket-Protocol header");return}let V=Z.headers["sec-websocket-extensions"],z={};if(this.options.perMessageDeflate&&V!==void 0){let F=new _$(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let H=Q90.parse(V);if(H[_$.extensionName])F.accept(H[_$.extensionName]),z[_$.extensionName]=F}catch(H){v$(this,Z,J,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let F={origin:Z.headers[`${K===8?"sec-websocket-origin":"origin"}`],secure:!!(Z.socket.authorized||Z.socket.encrypted),req:Z};if(this.options.verifyClient.length===2){this.options.verifyClient(F,(H,q,U,L)=>{if(!H)return WH(J,q||401,U,L);this.completeUpgrade(z,$,G,Z,J,X,Y)});return}if(!this.options.verifyClient(F))return WH(J,401)}this.completeUpgrade(z,$,G,Z,J,X,Y)}completeUpgrade(Z,J,X,Y,$,Q,K){if(!$.readable||!$.writable)return $.destroy();if($[gf1])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>0)return WH($,503);let G=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${hf1("sha1").update(J+bf1).digest("base64")}`],V=new this.options.WebSocket(null,void 0,this.options);if(X.size){let z=this.options.handleProtocols?this.options.handleProtocols(X,Y):X.values().next().value;if(z)G.push(`Sec-WebSocket-Protocol: ${z}`),V._protocol=z}if(Z[_$.extensionName]){let z=Z[_$.extensionName].params,F=Q90.format({[_$.extensionName]:[z]});G.push(`Sec-WebSocket-Extensions: ${F}`),V._extensions=Z}if(this.emit("headers",G,Y),$.write(G.concat(`\r
28
+ deps: ${X}}`};var qA1={keyword:"dependencies",type:"object",schemaType:"object",error:Q80.error,code(Z){let[J,X]=UA1(Z);Y80(Z,J),$80(Z,X)}};function UA1({schema:Z}){let J={},X={};for(let Y in Z){if(Y==="__proto__")continue;let $=Array.isArray(Z[Y])?J:X;$[Y]=Z[Y]}return[J,X]}function Y80(Z,J=Z.schema){let{gen:X,data:Y,it:$}=Z;if(Object.keys(J).length===0)return;let Q=X.let("missing");for(let K in J){let W=J[K];if(W.length===0)continue;let G=gz.propertyInData(X,Y,K,$.opts.ownProperties);if(Z.setParams({property:K,depsCount:W.length,deps:W.join(", ")}),$.allErrors)X.if(G,()=>{for(let V of W)gz.checkReportMissingProp(Z,V)});else X.if(YI._`${G} && (${gz.checkMissingProp(Z,W,Q)})`),gz.reportMissingProp(Z,Q),X.else()}}Q80.validatePropertyDeps=Y80;function $80(Z,J=Z.schema){let{gen:X,data:Y,keyword:$,it:Q}=Z,K=X.name("valid");for(let W in J){if(FA1.alwaysValidSchema(Q,J[W]))continue;X.if(gz.propertyInData(X,Y,W,Q.opts.ownProperties),()=>{let G=Z.subschema({keyword:$,schemaProp:W},K);Z.mergeValidEvaluated(G,K)},()=>X.var(K,!0)),Z.ok(K)}}Q80.validateSchemaDeps=$80;Q80.default=qA1});var H80=O((z80)=>{Object.defineProperty(z80,"__esModule",{value:!0});var V80=t0(),wA1=F1(),OA1={message:"property name must be valid",params:({params:Z})=>V80._`{propertyName: ${Z.propertyName}}`},RA1={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:OA1,code(Z){let{gen:J,schema:X,data:Y,it:$}=Z;if(wA1.alwaysValidSchema($,X))return;let Q=J.name("valid");J.forIn("key",Y,(K)=>{Z.setParams({propertyName:K}),Z.subschema({keyword:"propertyNames",data:K,dataTypes:["string"],propertyName:K,compositeRule:!0},Q),J.if(V80.not(Q),()=>{if(Z.error(!0),!$.allErrors)J.break()})}),Z.ok(Q)}};z80.default=RA1});var $I=O((F80)=>{Object.defineProperty(F80,"__esModule",{value:!0});var Sw=d9(),u4=t0(),NA1=gZ(),Aw=F1(),jA1={message:"must NOT have additional properties",params:({params:Z})=>u4._`{additionalProperty: ${Z.additionalProperty}}`},DA1={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:jA1,code(Z){let{gen:J,schema:X,parentSchema:Y,data:$,errsCount:Q,it:K}=Z;if(!Q)throw new Error("ajv implementation error");let{allErrors:W,opts:G}=K;if(K.props=!0,G.removeAdditional!=="all"&&Aw.alwaysValidSchema(K,X))return;let V=Sw.allSchemaProperties(Y.properties),z=Sw.allSchemaProperties(Y.patternProperties);F(),Z.ok(u4._`${Q} === ${NA1.default.errors}`);function F(){J.forIn("key",$,(B)=>{if(!V.length&&!z.length)U(B);else J.if(H(B),()=>U(B))})}function H(B){let w;if(V.length>8){let R=Aw.schemaRefOrVal(K,Y.properties,"properties");w=Sw.isOwnProperty(J,R,B)}else if(V.length)w=u4.or(...V.map((R)=>u4._`${B} === ${R}`));else w=u4.nil;if(z.length)w=u4.or(w,...z.map((R)=>u4._`${Sw.usePattern(Z,R)}.test(${B})`));return u4.not(w)}function q(B){J.code(u4._`delete ${$}[${B}]`)}function U(B){if(G.removeAdditional==="all"||G.removeAdditional&&X===!1){q(B);return}if(X===!1){if(Z.setParams({additionalProperty:B}),Z.error(),!W)J.break();return}if(typeof X=="object"&&!Aw.alwaysValidSchema(K,X)){let w=J.name("valid");if(G.removeAdditional==="failing")L(B,w,!1),J.if(u4.not(w),()=>{Z.reset(),q(B)});else if(L(B,w),!W)J.if(u4.not(w),()=>J.break())}}function L(B,w,R){let M={keyword:"additionalProperties",dataProp:B,dataPropType:Aw.Type.Str};if(R===!1)Object.assign(M,{compositeRule:!0,createErrors:!1,allErrors:!1});Z.subschema(M,w)}}};F80.default=DA1});var B80=O((L80)=>{Object.defineProperty(L80,"__esModule",{value:!0});var CA1=Ez(),q80=d9(),QI=F1(),U80=$I(),TA1={keyword:"properties",type:"object",schemaType:"object",code(Z){let{gen:J,schema:X,parentSchema:Y,data:$,it:Q}=Z;if(Q.opts.removeAdditional==="all"&&Y.additionalProperties===void 0)U80.default.code(new CA1.KeywordCxt(Q,U80.default,"additionalProperties"));let K=q80.allSchemaProperties(X);for(let F of K)Q.definedProperties.add(F);if(Q.opts.unevaluated&&K.length&&Q.props!==!0)Q.props=QI.mergeEvaluated.props(J,QI.toHash(K),Q.props);let W=K.filter((F)=>!QI.alwaysValidSchema(Q,X[F]));if(W.length===0)return;let G=J.name("valid");for(let F of W){if(V(F))z(F);else{if(J.if(q80.propertyInData(J,$,F,Q.opts.ownProperties)),z(F),!Q.allErrors)J.else().var(G,!0);J.endIf()}Z.it.definedProperties.add(F),Z.ok(G)}function V(F){return Q.opts.useDefaults&&!Q.compositeRule&&X[F].default!==void 0}function z(F){Z.subschema({keyword:"properties",schemaProp:F,dataProp:F},G)}}};L80.default=TA1});var N80=O((M80)=>{Object.defineProperty(M80,"__esModule",{value:!0});var w80=d9(),xw=t0(),O80=F1(),R80=F1(),kA1={keyword:"patternProperties",type:"object",schemaType:"object",code(Z){let{gen:J,schema:X,data:Y,parentSchema:$,it:Q}=Z,{opts:K}=Q,W=w80.allSchemaProperties(X),G=W.filter((L)=>O80.alwaysValidSchema(Q,X[L]));if(W.length===0||G.length===W.length&&(!Q.opts.unevaluated||Q.props===!0))return;let V=K.strictSchema&&!K.allowMatchingProperties&&$.properties,z=J.name("valid");if(Q.props!==!0&&!(Q.props instanceof xw.Name))Q.props=R80.evaluatedPropsToName(J,Q.props);let{props:F}=Q;H();function H(){for(let L of W){if(V)q(L);if(Q.allErrors)U(L);else J.var(z,!0),U(L),J.if(z)}}function q(L){for(let B in V)if(new RegExp(L).test(B))O80.checkStrictMode(Q,`property ${B} matches pattern ${L} (use allowMatchingProperties)`)}function U(L){J.forIn("key",Y,(B)=>{J.if(xw._`${w80.usePattern(Z,L)}.test(${B})`,()=>{let w=G.includes(L);if(!w)Z.subschema({keyword:"patternProperties",schemaProp:L,dataProp:B,dataPropType:R80.Type.Str},z);if(Q.opts.unevaluated&&F!==!0)J.assign(xw._`${F}[${B}]`,!0);else if(!w&&!Q.allErrors)J.if(xw.not(z),()=>J.break())})})}}};M80.default=kA1});var D80=O((j80)=>{Object.defineProperty(j80,"__esModule",{value:!0});var _A1=F1(),vA1={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(Z){let{gen:J,schema:X,it:Y}=Z;if(_A1.alwaysValidSchema(Y,X)){Z.fail();return}let $=J.name("valid");Z.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},$),Z.failResult($,()=>Z.reset(),()=>Z.error())},error:{message:"must NOT be valid"}};j80.default=vA1});var C80=O((P80)=>{Object.defineProperty(P80,"__esModule",{value:!0});var AA1=d9(),xA1={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:AA1.validateUnion,error:{message:"must match a schema in anyOf"}};P80.default=xA1});var E80=O((T80)=>{Object.defineProperty(T80,"__esModule",{value:!0});var hw=t0(),fA1=F1(),yA1={message:"must match exactly one schema in oneOf",params:({params:Z})=>hw._`{passingSchemas: ${Z.passing}}`},bA1={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:yA1,code(Z){let{gen:J,schema:X,parentSchema:Y,it:$}=Z;if(!Array.isArray(X))throw new Error("ajv implementation error");if($.opts.discriminator&&Y.discriminator)return;let Q=X,K=J.let("valid",!1),W=J.let("passing",null),G=J.name("_valid");Z.setParams({passing:W}),J.block(V),Z.result(K,()=>Z.reset(),()=>Z.error(!0));function V(){Q.forEach((z,F)=>{let H;if(fA1.alwaysValidSchema($,z))J.var(G,!0);else H=Z.subschema({keyword:"oneOf",schemaProp:F,compositeRule:!0},G);if(F>0)J.if(hw._`${G} && ${K}`).assign(K,!1).assign(W,hw._`[${W}, ${F}]`).else();J.if(G,()=>{if(J.assign(K,!0),J.assign(W,F),H)Z.mergeEvaluated(H,hw.Name)})})}}};T80.default=bA1});var I80=O((k80)=>{Object.defineProperty(k80,"__esModule",{value:!0});var mA1=F1(),uA1={keyword:"allOf",schemaType:"array",code(Z){let{gen:J,schema:X,it:Y}=Z;if(!Array.isArray(X))throw new Error("ajv implementation error");let $=J.name("valid");X.forEach((Q,K)=>{if(mA1.alwaysValidSchema(Y,Q))return;let W=Z.subschema({keyword:"allOf",schemaProp:K},$);Z.ok($),Z.mergeEvaluated(W)})}};k80.default=uA1});var A80=O((S80)=>{Object.defineProperty(S80,"__esModule",{value:!0});var fw=t0(),v80=F1(),cA1={message:({params:Z})=>fw.str`must match "${Z.ifClause}" schema`,params:({params:Z})=>fw._`{failingKeyword: ${Z.ifClause}}`},lA1={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:cA1,code(Z){let{gen:J,parentSchema:X,it:Y}=Z;if(X.then===void 0&&X.else===void 0)v80.checkStrictMode(Y,'"if" without "then" and "else" is ignored');let $=_80(Y,"then"),Q=_80(Y,"else");if(!$&&!Q)return;let K=J.let("valid",!0),W=J.name("_valid");if(G(),Z.reset(),$&&Q){let z=J.let("ifClause");Z.setParams({ifClause:z}),J.if(W,V("then",z),V("else",z))}else if($)J.if(W,V("then"));else J.if(fw.not(W),V("else"));Z.pass(K,()=>Z.error(!0));function G(){let z=Z.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},W);Z.mergeEvaluated(z)}function V(z,F){return()=>{let H=Z.subschema({keyword:z},W);if(J.assign(K,W),Z.mergeValidEvaluated(H,K),F)J.assign(F,fw._`${z}`);else Z.setParams({ifClause:z})}}}};function _80(Z,J){let X=Z.schema[J];return X!==void 0&&!v80.alwaysValidSchema(Z,X)}S80.default=lA1});var h80=O((x80)=>{Object.defineProperty(x80,"__esModule",{value:!0});var iA1=F1(),nA1={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:Z,parentSchema:J,it:X}){if(J.if===void 0)iA1.checkStrictMode(X,`"${Z}" without "if" is ignored`)}};x80.default=nA1});var y80=O((f80)=>{Object.defineProperty(f80,"__esModule",{value:!0});var sA1=JI(),oA1=r10(),rA1=XI(),tA1=Z80(),eA1=X80(),Zx1=G80(),Jx1=H80(),Xx1=$I(),Yx1=B80(),$x1=N80(),Qx1=D80(),Kx1=C80(),Wx1=E80(),Gx1=I80(),Vx1=A80(),zx1=h80();function Hx1(Z=!1){let J=[Qx1.default,Kx1.default,Wx1.default,Gx1.default,Vx1.default,zx1.default,Jx1.default,Xx1.default,Zx1.default,Yx1.default,$x1.default];if(Z)J.push(oA1.default,tA1.default);else J.push(sA1.default,rA1.default);return J.push(eA1.default),J}f80.default=Hx1});var g80=O((b80)=>{Object.defineProperty(b80,"__esModule",{value:!0});var I8=t0(),qx1={message:({schemaCode:Z})=>I8.str`must match format "${Z}"`,params:({schemaCode:Z})=>I8._`{format: ${Z}}`},Ux1={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:qx1,code(Z,J){let{gen:X,data:Y,$data:$,schema:Q,schemaCode:K,it:W}=Z,{opts:G,errSchemaPath:V,schemaEnv:z,self:F}=W;if(!G.validateFormats)return;if($)H();else q();function H(){let U=X.scopeValue("formats",{ref:F.formats,code:G.code.formats}),L=X.const("fDef",I8._`${U}[${K}]`),B=X.let("fType"),w=X.let("format");X.if(I8._`typeof ${L} == "object" && !(${L} instanceof RegExp)`,()=>X.assign(B,I8._`${L}.type || "string"`).assign(w,I8._`${L}.validate`),()=>X.assign(B,I8._`"string"`).assign(w,L)),Z.fail$data(I8.or(R(),M()));function R(){if(G.strictSchema===!1)return I8.nil;return I8._`${K} && !${w}`}function M(){let N=z.$async?I8._`(${L}.async ? await ${w}(${Y}) : ${w}(${Y}))`:I8._`${w}(${Y})`,P=I8._`(typeof ${w} == "function" ? ${N} : ${w}.test(${Y}))`;return I8._`${w} && ${w} !== true && ${B} === ${J} && !${P}`}}function q(){let U=F.formats[Q];if(!U){R();return}if(U===!0)return;let[L,B,w]=M(U);if(L===J)Z.pass(N());function R(){if(G.strictSchema===!1){F.logger.warn(P());return}throw new Error(P());function P(){return`unknown format "${Q}" ignored in schema at path "${V}"`}}function M(P){let D=P instanceof RegExp?I8.regexpCode(P):G.code.formats?I8._`${G.code.formats}${I8.getProperty(Q)}`:void 0,C=X.scopeValue("formats",{key:Q,ref:P,code:D});if(typeof P=="object"&&!(P instanceof RegExp))return[P.type||"string",P.validate,I8._`${C}.validate`];return["string",P,C]}function N(){if(typeof U=="object"&&!(U instanceof RegExp)&&U.async){if(!z.$async)throw new Error("async format in sync schema");return I8._`await ${w}(${Y})`}return typeof B=="function"?I8._`${w}(${Y})`:I8._`${w}.test(${Y})`}}}};b80.default=Ux1});var u80=O((m80)=>{Object.defineProperty(m80,"__esModule",{value:!0});var Bx1=g80(),wx1=[Bx1.default];m80.default=wx1});var l80=O((d80)=>{Object.defineProperty(d80,"__esModule",{value:!0});d80.contentVocabulary=d80.metadataVocabulary=void 0;d80.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];d80.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var n80=O((i80)=>{Object.defineProperty(i80,"__esModule",{value:!0});var Mx1=L10(),Nx1=d10(),jx1=y80(),Dx1=u80(),p80=l80(),Px1=[Mx1.default,Nx1.default,jx1.default(),Dx1.default,p80.metadataVocabulary,p80.contentVocabulary];i80.default=Px1});var r80=O((s80)=>{Object.defineProperty(s80,"__esModule",{value:!0});s80.DiscrError=void 0;var a80;(function(Z){Z.Tag="tag",Z.Mapping="mapping"})(a80||(s80.DiscrError=a80={}))});var Z60=O((e80)=>{Object.defineProperty(e80,"__esModule",{value:!0});var DW=t0(),KI=r80(),t80=Ow(),Tx1=kz(),Ex1=F1(),kx1={message:({params:{discrError:Z,tagName:J}})=>Z===KI.DiscrError.Tag?`tag "${J}" must be string`:`value of tag "${J}" must be in oneOf`,params:({params:{discrError:Z,tag:J,tagName:X}})=>DW._`{error: ${Z}, tag: ${X}, tagValue: ${J}}`},Ix1={keyword:"discriminator",type:"object",schemaType:"object",error:kx1,code(Z){let{gen:J,data:X,schema:Y,parentSchema:$,it:Q}=Z,{oneOf:K}=$;if(!Q.opts.discriminator)throw new Error("discriminator: requires discriminator option");let W=Y.propertyName;if(typeof W!="string")throw new Error("discriminator: requires propertyName");if(Y.mapping)throw new Error("discriminator: mapping is not supported");if(!K)throw new Error("discriminator: requires oneOf keyword");let G=J.let("valid",!1),V=J.const("tag",DW._`${X}${DW.getProperty(W)}`);J.if(DW._`typeof ${V} == "string"`,()=>z(),()=>Z.error(!1,{discrError:KI.DiscrError.Tag,tag:V,tagName:W})),Z.ok(G);function z(){let q=H();J.if(!1);for(let U in q)J.elseIf(DW._`${V} === ${U}`),J.assign(G,F(q[U]));J.else(),Z.error(!1,{discrError:KI.DiscrError.Mapping,tag:V,tagName:W}),J.endIf()}function F(q){let U=J.name("valid"),L=Z.subschema({keyword:"oneOf",schemaProp:q},U);return Z.mergeEvaluated(L,DW.Name),U}function H(){var q;let U={},L=w($),B=!0;for(let N=0;N<K.length;N++){let P=K[N];if((P===null||P===void 0?void 0:P.$ref)&&!Ex1.schemaHasRulesButRef(P,Q.self.RULES)){let C=P.$ref;if(P=t80.resolveRef.call(Q.self,Q.schemaEnv.root,Q.baseId,C),P instanceof t80.SchemaEnv)P=P.schema;if(P===void 0)throw new Tx1.default(Q.opts.uriResolver,Q.baseId,C)}let D=(q=P===null||P===void 0?void 0:P.properties)===null||q===void 0?void 0:q[W];if(typeof D!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${W}"`);B=B&&(L||w(P)),R(D,N)}if(!B)throw new Error(`discriminator: "${W}" must be required`);return U;function w({required:N}){return Array.isArray(N)&&N.includes(W)}function R(N,P){if(N.const)M(N.const,P);else if(N.enum)for(let D of N.enum)M(D,P);else throw new Error(`discriminator: "properties/${W}" must have "const" or "enum"`)}function M(N,P){if(typeof N!="string"||N in U)throw new Error(`discriminator: "${W}" values must be unique strings`);U[N]=P}}}};e80.default=Ix1});var J60=O((tA6,vx1)=>{vx1.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Y60=O((f5,WI)=>{Object.defineProperty(f5,"__esModule",{value:!0});f5.MissingRefError=f5.ValidationError=f5.CodeGen=f5.Name=f5.nil=f5.stringify=f5.str=f5._=f5.KeywordCxt=f5.Ajv=void 0;var Sx1=Q10(),Ax1=n80(),xx1=Z60(),X60=J60(),hx1=["/properties"],yw="http://json-schema.org/draft-07/schema";class mz extends Sx1.default{_addVocabularies(){if(super._addVocabularies(),Ax1.default.forEach((Z)=>this.addVocabulary(Z)),this.opts.discriminator)this.addKeyword(xx1.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let Z=this.opts.$data?this.$dataMetaSchema(X60,hx1):X60;this.addMetaSchema(Z,yw,!1),this.refs["http://json-schema.org/schema"]=yw}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(yw)?yw:void 0)}}f5.Ajv=mz;WI.exports=f5=mz;WI.exports.Ajv=mz;Object.defineProperty(f5,"__esModule",{value:!0});f5.default=mz;var fx1=Ez();Object.defineProperty(f5,"KeywordCxt",{enumerable:!0,get:function(){return fx1.KeywordCxt}});var PW=t0();Object.defineProperty(f5,"_",{enumerable:!0,get:function(){return PW._}});Object.defineProperty(f5,"str",{enumerable:!0,get:function(){return PW.str}});Object.defineProperty(f5,"stringify",{enumerable:!0,get:function(){return PW.stringify}});Object.defineProperty(f5,"nil",{enumerable:!0,get:function(){return PW.nil}});Object.defineProperty(f5,"Name",{enumerable:!0,get:function(){return PW.Name}});Object.defineProperty(f5,"CodeGen",{enumerable:!0,get:function(){return PW.CodeGen}});var yx1=Bw();Object.defineProperty(f5,"ValidationError",{enumerable:!0,get:function(){return yx1.default}});var bx1=kz();Object.defineProperty(f5,"MissingRefError",{enumerable:!0,get:function(){return bx1.default}})});var nI=O((_60)=>{Object.defineProperty(_60,"__esModule",{value:!0});_60.buildDefaultCredentialsProvider=Zh1;function Zh1(){let Z=process.env.HYTOPIA_API_KEY,J=process.env.HYTOPIA_GAME_ID,X=process.env.HYTOPIA_LOBBY_ID;if(!Z)throw new Error("Missing environment variable HYTOPIA_API_KEY");if(!J)throw new Error("Missing environment variable HYTOPIA_GAME_ID");if(!X)throw new Error("Missing environment variable HYTOPIA_LOBBY_ID");return async()=>({apiKey:Z,gameId:J,lobbyId:X})}});var S60=O((v60)=>{Object.defineProperty(v60,"__esModule",{value:!0});v60.getLoadout=Xh1;async function Xh1(Z){return await fetch(`${this.context.baseUrl}/Locker/GetLoadoutForGameByUserId/${Z}`).then((J)=>J.json()).then((J)=>J).catch(()=>({error:{code:"networkError",message:"A network error happened"}}))}});var h60=O((x60)=>{Object.defineProperty(x60,"__esModule",{value:!0});x60.default=A60;function A60(Z){if(!Z)return Z;for(let[X,Y]of Object.entries(Z))if(typeof Y==="string"){var J=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*))(?:Z|(\+|-)([\d|:]*))?$/;if(J.test(Y))Z[X]=new Date(Y)}else if(typeof Y==="object")A60(Y);return Z}});var f60=O((cz)=>{var Qh1=cz&&cz.__importDefault||function(Z){return Z&&Z.__esModule?Z:{default:Z}};Object.defineProperty(cz,"__esModule",{value:!0});cz.getSession=Wh1;var Kh1=Qh1(h60());async function Wh1(Z){let J=await this.context.credentialsProvider();return await fetch(`${this.context.baseUrl}/Play/Matchmaking/Lobbies/ValidateSession`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lobbyId:J.lobbyId,sessionToken:Z})}).then((X)=>X.json()).then((X)=>Kh1.default(X)).then((X)=>X).catch(()=>({error:{code:"networkError",message:"A network error happened"}}))}});var b60=O((y60)=>{Object.defineProperty(y60,"__esModule",{value:!0});y60.get=Gh1;async function Gh1(Z){let J=await this.context.credentialsProvider();return await fetch(`${this.context.baseUrl}/Play/KV/Get/${J.gameId}/${Z}`,{headers:{"X-Api-Key":J.apiKey}}).then((X)=>X.json()).then((X)=>X).catch(()=>({error:{code:"networkError",message:"A network error happened"}}))}});var m60=O((g60)=>{Object.defineProperty(g60,"__esModule",{value:!0});g60.set=zh1;async function zh1(Z,J,X="merge"){let Y=await this.context.credentialsProvider();return await fetch(`${this.context.baseUrl}/Play/KV/Set/${Y.gameId}/${Z}?mode=${X}`,{method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":Y.apiKey},body:JSON.stringify(J)}).then(($)=>$.json()).then(($)=>$).catch(()=>({error:{code:"networkError",message:"A network error happened"}}))}});var d60=O((u60)=>{Object.defineProperty(u60,"__esModule",{value:!0});u60.unset=Fh1;async function Fh1(Z){let J=await this.context.credentialsProvider();return await fetch(`${this.context.baseUrl}/Play/KV/Unset/${J.gameId}/${Z}`,{method:"DELETE",headers:{"X-Api-Key":J.apiKey}}).then((X)=>X.json()).then((X)=>X).catch(()=>({error:{code:"networkError",message:"A network error happened"}}))}});var i60=O((l60)=>{Object.defineProperty(l60,"__esModule",{value:!0});l60.KVClient=void 0;var Uh1=b60(),Lh1=m60(),Bh1=d60();class c60{context;constructor(Z){this.context=Z}get=Uh1.get;set=Lh1.set;unset=Bh1.unset}l60.KVClient=c60});var r60=O((a60)=>{Object.defineProperty(a60,"__esModule",{value:!0});a60.CreativeGateway=a60.DEFAULT_BASE_URL=void 0;var wh1=nI(),Oh1=S60(),Rh1=f60(),Mh1=i60();a60.DEFAULT_BASE_URL="https://prod.creative.hytopia.com";class n60{context;kv;constructor(Z){if(Z?.baseUrl){if(!Z.baseUrl.startsWith("https://")&&!Z.baseUrl.startsWith("http://"))throw new Error("Base URL, if provided, must start with https:// or http://");if(Z.baseUrl.endsWith("/"))throw new Error("Base URL, if provided, must not end with '/'")}this.context={baseUrl:Z?.baseUrl??process.env.HYTOPIA_CREATIVE_GATEWAY_BASE_URL??a60.DEFAULT_BASE_URL,credentialsProvider:Z?.credentialsProvider??wh1.buildDefaultCredentialsProvider()},this.kv=new Mh1.KVClient(this.context)}getLoadout=Oh1.getLoadout;getSession=Rh1.getSession}a60.CreativeGateway=n60});var t60=O((dw)=>{Object.defineProperty(dw,"__esModule",{value:!0});dw.buildDefaultCredentialsProvider=dw.CreativeGateway=void 0;var Nh1=r60();Object.defineProperty(dw,"CreativeGateway",{enumerable:!0,get:function(){return Nh1.CreativeGateway}});var jh1=nI();Object.defineProperty(dw,"buildDefaultCredentialsProvider",{enumerable:!0,get:function(){return jh1.buildDefaultCredentialsProvider}})});var cZ=O((yg6,z50)=>{var G50=["nodebuffer","arraybuffer","fragments"],V50=typeof Blob!=="undefined";if(V50)G50.push("blob");z50.exports={BINARY_TYPES:G50,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:V50,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var ZH=O((bg6,lw)=>{var{EMPTY_BUFFER:Ch1}=cZ(),Z_=Buffer[Symbol.species];function Th1(Z,J){if(Z.length===0)return Ch1;if(Z.length===1)return Z[0];let X=Buffer.allocUnsafe(J),Y=0;for(let $=0;$<Z.length;$++){let Q=Z[$];X.set(Q,Y),Y+=Q.length}if(Y<J)return new Z_(X.buffer,X.byteOffset,Y);return X}function H50(Z,J,X,Y,$){for(let Q=0;Q<$;Q++)X[Y+Q]=Z[Q]^J[Q&3]}function F50(Z,J){for(let X=0;X<Z.length;X++)Z[X]^=J[X&3]}function Eh1(Z){if(Z.length===Z.buffer.byteLength)return Z.buffer;return Z.buffer.slice(Z.byteOffset,Z.byteOffset+Z.length)}function J_(Z){if(J_.readOnly=!0,Buffer.isBuffer(Z))return Z;let J;if(Z instanceof ArrayBuffer)J=new Z_(Z);else if(ArrayBuffer.isView(Z))J=new Z_(Z.buffer,Z.byteOffset,Z.byteLength);else J=Buffer.from(Z),J_.readOnly=!1;return J}lw.exports={concat:Th1,mask:H50,toArrayBuffer:Eh1,toBuffer:J_,unmask:F50};if(!process.env.WS_NO_BUFFER_UTIL)try{let Z=(()=>{throw new Error("Cannot require module "+"bufferutil");})();lw.exports.mask=function(J,X,Y,$,Q){if(Q<48)H50(J,X,Y,$,Q);else Z.mask(J,X,Y,$,Q)},lw.exports.unmask=function(J,X){if(J.length<32)F50(J,X);else Z.unmask(J,X)}}catch(Z){}});var B50=O((gg6,L50)=>{var q50=Symbol("kDone"),X_=Symbol("kRun");class U50{constructor(Z){this[q50]=()=>{this.pending--,this[X_]()},this.concurrency=Z||1/0,this.jobs=[],this.pending=0}add(Z){this.jobs.push(Z),this[X_]()}[X_](){if(this.pending===this.concurrency)return;if(this.jobs.length){let Z=this.jobs.shift();this.pending++,Z(this[q50])}}}L50.exports=U50});var XH=O((mg6,N50)=>{var JH=m("zlib"),w50=ZH(),kh1=B50(),{kStatusCode:O50}=cZ(),Ih1=Buffer[Symbol.species],_h1=Buffer.from([0,0,255,255]),iw=Symbol("permessage-deflate"),lZ=Symbol("total-length"),TW=Symbol("callback"),qX=Symbol("buffers"),EW=Symbol("error"),pw;class R50{constructor(Z,J,X){if(this._maxPayload=X|0,this._options=Z||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!J,this._deflate=null,this._inflate=null,this.params=null,!pw){let Y=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;pw=new kh1(Y)}}static get extensionName(){return"permessage-deflate"}offer(){let Z={};if(this._options.serverNoContextTakeover)Z.server_no_context_takeover=!0;if(this._options.clientNoContextTakeover)Z.client_no_context_takeover=!0;if(this._options.serverMaxWindowBits)Z.server_max_window_bits=this._options.serverMaxWindowBits;if(this._options.clientMaxWindowBits)Z.client_max_window_bits=this._options.clientMaxWindowBits;else if(this._options.clientMaxWindowBits==null)Z.client_max_window_bits=!0;return Z}accept(Z){return Z=this.normalizeParams(Z),this.params=this._isServer?this.acceptAsServer(Z):this.acceptAsClient(Z),this.params}cleanup(){if(this._inflate)this._inflate.close(),this._inflate=null;if(this._deflate){let Z=this._deflate[TW];if(this._deflate.close(),this._deflate=null,Z)Z(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(Z){let J=this._options,X=Z.find((Y)=>{if(J.serverNoContextTakeover===!1&&Y.server_no_context_takeover||Y.server_max_window_bits&&(J.serverMaxWindowBits===!1||typeof J.serverMaxWindowBits==="number"&&J.serverMaxWindowBits>Y.server_max_window_bits)||typeof J.clientMaxWindowBits==="number"&&!Y.client_max_window_bits)return!1;return!0});if(!X)throw new Error("None of the extension offers can be accepted");if(J.serverNoContextTakeover)X.server_no_context_takeover=!0;if(J.clientNoContextTakeover)X.client_no_context_takeover=!0;if(typeof J.serverMaxWindowBits==="number")X.server_max_window_bits=J.serverMaxWindowBits;if(typeof J.clientMaxWindowBits==="number")X.client_max_window_bits=J.clientMaxWindowBits;else if(X.client_max_window_bits===!0||J.clientMaxWindowBits===!1)delete X.client_max_window_bits;return X}acceptAsClient(Z){let J=Z[0];if(this._options.clientNoContextTakeover===!1&&J.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!J.client_max_window_bits){if(typeof this._options.clientMaxWindowBits==="number")J.client_max_window_bits=this._options.clientMaxWindowBits}else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits==="number"&&J.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return J}normalizeParams(Z){return Z.forEach((J)=>{Object.keys(J).forEach((X)=>{let Y=J[X];if(Y.length>1)throw new Error(`Parameter "${X}" must have only a single value`);if(Y=Y[0],X==="client_max_window_bits"){if(Y!==!0){let $=+Y;if(!Number.isInteger($)||$<8||$>15)throw new TypeError(`Invalid value for parameter "${X}": ${Y}`);Y=$}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${X}": ${Y}`)}else if(X==="server_max_window_bits"){let $=+Y;if(!Number.isInteger($)||$<8||$>15)throw new TypeError(`Invalid value for parameter "${X}": ${Y}`);Y=$}else if(X==="client_no_context_takeover"||X==="server_no_context_takeover"){if(Y!==!0)throw new TypeError(`Invalid value for parameter "${X}": ${Y}`)}else throw new Error(`Unknown parameter "${X}"`);J[X]=Y})}),Z}decompress(Z,J,X){pw.add((Y)=>{this._decompress(Z,J,($,Q)=>{Y(),X($,Q)})})}compress(Z,J,X){pw.add((Y)=>{this._compress(Z,J,($,Q)=>{Y(),X($,Q)})})}_decompress(Z,J,X){let Y=this._isServer?"client":"server";if(!this._inflate){let $=`${Y}_max_window_bits`,Q=typeof this.params[$]!=="number"?JH.Z_DEFAULT_WINDOWBITS:this.params[$];this._inflate=JH.createInflateRaw({...this._options.zlibInflateOptions,windowBits:Q}),this._inflate[iw]=this,this._inflate[lZ]=0,this._inflate[qX]=[],this._inflate.on("error",Sh1),this._inflate.on("data",M50)}if(this._inflate[TW]=X,this._inflate.write(Z),J)this._inflate.write(_h1);this._inflate.flush(()=>{let $=this._inflate[EW];if($){this._inflate.close(),this._inflate=null,X($);return}let Q=w50.concat(this._inflate[qX],this._inflate[lZ]);if(this._inflate._readableState.endEmitted)this._inflate.close(),this._inflate=null;else if(this._inflate[lZ]=0,this._inflate[qX]=[],J&&this.params[`${Y}_no_context_takeover`])this._inflate.reset();X(null,Q)})}_compress(Z,J,X){let Y=this._isServer?"server":"client";if(!this._deflate){let $=`${Y}_max_window_bits`,Q=typeof this.params[$]!=="number"?JH.Z_DEFAULT_WINDOWBITS:this.params[$];this._deflate=JH.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:Q}),this._deflate[lZ]=0,this._deflate[qX]=[],this._deflate.on("data",vh1)}this._deflate[TW]=X,this._deflate.write(Z),this._deflate.flush(JH.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let $=w50.concat(this._deflate[qX],this._deflate[lZ]);if(J)$=new Ih1($.buffer,$.byteOffset,$.length-4);if(this._deflate[TW]=null,this._deflate[lZ]=0,this._deflate[qX]=[],J&&this.params[`${Y}_no_context_takeover`])this._deflate.reset();X(null,$)})}}N50.exports=R50;function vh1(Z){this[qX].push(Z),this[lZ]+=Z.length}function M50(Z){if(this[lZ]+=Z.length,this[iw]._maxPayload<1||this[lZ]<=this[iw]._maxPayload){this[qX].push(Z);return}this[EW]=new RangeError("Max payload size exceeded"),this[EW].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[EW][O50]=1009,this.removeListener("data",M50),this.reset()}function Sh1(Z){if(this[iw]._inflate=null,this[EW]){this[TW](this[EW]);return}Z[O50]=1007,this[TW](Z)}});var kW=O((ug6,nw)=>{var{isUtf8:j50}=m("buffer"),{hasBlob:Ah1}=cZ(),xh1=[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 hh1(Z){return Z>=1000&&Z<=1014&&Z!==1004&&Z!==1005&&Z!==1006||Z>=3000&&Z<=4999}function Y_(Z){let J=Z.length,X=0;while(X<J)if((Z[X]&128)===0)X++;else if((Z[X]&224)===192){if(X+1===J||(Z[X+1]&192)!==128||(Z[X]&254)===192)return!1;X+=2}else if((Z[X]&240)===224){if(X+2>=J||(Z[X+1]&192)!==128||(Z[X+2]&192)!==128||Z[X]===224&&(Z[X+1]&224)===128||Z[X]===237&&(Z[X+1]&224)===160)return!1;X+=3}else if((Z[X]&248)===240){if(X+3>=J||(Z[X+1]&192)!==128||(Z[X+2]&192)!==128||(Z[X+3]&192)!==128||Z[X]===240&&(Z[X+1]&240)===128||Z[X]===244&&Z[X+1]>143||Z[X]>244)return!1;X+=4}else return!1;return!0}function fh1(Z){return Ah1&&typeof Z==="object"&&typeof Z.arrayBuffer==="function"&&typeof Z.type==="string"&&typeof Z.stream==="function"&&(Z[Symbol.toStringTag]==="Blob"||Z[Symbol.toStringTag]==="File")}nw.exports={isBlob:fh1,isValidStatusCode:hh1,isValidUTF8:Y_,tokenChars:xh1};if(j50)nw.exports.isValidUTF8=function(Z){return Z.length<24?Y_(Z):j50(Z)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let Z=(()=>{throw new Error("Cannot require module "+"utf-8-validate");})();nw.exports.isValidUTF8=function(J){return J.length<32?Y_(J):Z(J)}}catch(Z){}});var Q_=O((dg6,E50)=>{var{Writable:yh1}=m("stream"),D50=XH(),{BINARY_TYPES:bh1,EMPTY_BUFFER:P50,kStatusCode:gh1,kWebSocket:mh1}=cZ(),{concat:$_,toArrayBuffer:uh1,unmask:dh1}=ZH(),{isValidStatusCode:ch1,isValidUTF8:C50}=kW(),aw=Buffer[Symbol.species];class T50 extends yh1{constructor(Z={}){super();this._allowSynchronousEvents=Z.allowSynchronousEvents!==void 0?Z.allowSynchronousEvents:!0,this._binaryType=Z.binaryType||bh1[0],this._extensions=Z.extensions||{},this._isServer=!!Z.isServer,this._maxPayload=Z.maxPayload|0,this._skipUTF8Validation=!!Z.skipUTF8Validation,this[mh1]=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(Z,J,X){if(this._opcode===8&&this._state==0)return X();this._bufferedBytes+=Z.length,this._buffers.push(Z),this.startLoop(X)}consume(Z){if(this._bufferedBytes-=Z,Z===this._buffers[0].length)return this._buffers.shift();if(Z<this._buffers[0].length){let X=this._buffers[0];return this._buffers[0]=new aw(X.buffer,X.byteOffset+Z,X.length-Z),new aw(X.buffer,X.byteOffset,Z)}let J=Buffer.allocUnsafe(Z);do{let X=this._buffers[0],Y=J.length-Z;if(Z>=X.length)J.set(this._buffers.shift(),Y);else J.set(new Uint8Array(X.buffer,X.byteOffset,Z),Y),this._buffers[0]=new aw(X.buffer,X.byteOffset+Z,X.length-Z);Z-=X.length}while(Z>0);return J}startLoop(Z){this._loop=!0;do switch(this._state){case 0:this.getInfo(Z);break;case 1:this.getPayloadLength16(Z);break;case 2:this.getPayloadLength64(Z);break;case 3:this.getMask();break;case 4:this.getData(Z);break;case 5:case 6:this._loop=!1;return}while(this._loop);if(!this._errored)Z()}getInfo(Z){if(this._bufferedBytes<2){this._loop=!1;return}let J=this.consume(2);if((J[0]&48)!==0){let Y=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");Z(Y);return}let X=(J[0]&64)===64;if(X&&!this._extensions[D50.extensionName]){let Y=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");Z(Y);return}if(this._fin=(J[0]&128)===128,this._opcode=J[0]&15,this._payloadLength=J[1]&127,this._opcode===0){if(X){let Y=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");Z(Y);return}if(!this._fragmented){let Y=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");Z(Y);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let Y=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");Z(Y);return}this._compressed=X}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let Y=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");Z(Y);return}if(X){let Y=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");Z(Y);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let Y=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");Z(Y);return}}else{let Y=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");Z(Y);return}if(!this._fin&&!this._fragmented)this._fragmented=this._opcode;if(this._masked=(J[1]&128)===128,this._isServer){if(!this._masked){let Y=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");Z(Y);return}}else if(this._masked){let Y=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");Z(Y);return}if(this._payloadLength===126)this._state=1;else if(this._payloadLength===127)this._state=2;else this.haveLength(Z)}getPayloadLength16(Z){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(Z)}getPayloadLength64(Z){if(this._bufferedBytes<8){this._loop=!1;return}let J=this.consume(8),X=J.readUInt32BE(0);if(X>Math.pow(2,21)-1){let Y=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");Z(Y);return}this._payloadLength=X*Math.pow(2,32)+J.readUInt32BE(4),this.haveLength(Z)}haveLength(Z){if(this._payloadLength&&this._opcode<8){if(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0){let J=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");Z(J);return}}if(this._masked)this._state=3;else this._state=4}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=4}getData(Z){let J=P50;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}if(J=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0)dh1(J,this._mask)}if(this._opcode>7){this.controlMessage(J,Z);return}if(this._compressed){this._state=5,this.decompress(J,Z);return}if(J.length)this._messageLength=this._totalPayloadLength,this._fragments.push(J);this.dataMessage(Z)}decompress(Z,J){this._extensions[D50.extensionName].decompress(Z,this._fin,(Y,$)=>{if(Y)return J(Y);if($.length){if(this._messageLength+=$.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let Q=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");J(Q);return}this._fragments.push($)}if(this.dataMessage(J),this._state===0)this.startLoop(J)})}dataMessage(Z){if(!this._fin){this._state=0;return}let J=this._messageLength,X=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let Y;if(this._binaryType==="nodebuffer")Y=$_(X,J);else if(this._binaryType==="arraybuffer")Y=uh1($_(X,J));else if(this._binaryType==="blob")Y=new Blob(X);else Y=X;if(this._allowSynchronousEvents)this.emit("message",Y,!0),this._state=0;else this._state=6,setImmediate(()=>{this.emit("message",Y,!0),this._state=0,this.startLoop(Z)})}else{let Y=$_(X,J);if(!this._skipUTF8Validation&&!C50(Y)){let $=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");Z($);return}if(this._state===5||this._allowSynchronousEvents)this.emit("message",Y,!1),this._state=0;else this._state=6,setImmediate(()=>{this.emit("message",Y,!1),this._state=0,this.startLoop(Z)})}}controlMessage(Z,J){if(this._opcode===8){if(Z.length===0)this._loop=!1,this.emit("conclude",1005,P50),this.end();else{let X=Z.readUInt16BE(0);if(!ch1(X)){let $=this.createError(RangeError,`invalid status code ${X}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");J($);return}let Y=new aw(Z.buffer,Z.byteOffset+2,Z.length-2);if(!this._skipUTF8Validation&&!C50(Y)){let $=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");J($);return}this._loop=!1,this.emit("conclude",X,Y),this.end()}this._state=0;return}if(this._allowSynchronousEvents)this.emit(this._opcode===9?"ping":"pong",Z),this._state=0;else this._state=6,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",Z),this._state=0,this.startLoop(J)})}createError(Z,J,X,Y,$){this._loop=!1,this._errored=!0;let Q=new Z(X?`Invalid WebSocket frame: ${J}`:J);return Error.captureStackTrace(Q,this.createError),Q.code=$,Q[gh1]=Y,Q}}E50.exports=T50});var W_=O((lg6,_50)=>{var{Duplex:cg6}=m("stream"),{randomFillSync:lh1}=m("crypto"),k50=XH(),{EMPTY_BUFFER:ph1,kWebSocket:ih1,NOOP:nh1}=cZ(),{isBlob:IW,isValidStatusCode:ah1}=kW(),{mask:I50,toBuffer:k$}=ZH(),l9=Symbol("kByteLength"),sh1=Buffer.alloc(4),I$,_W=8192,d4=0,oh1=1,rh1=2;class UX{constructor(Z,J,X){if(this._extensions=J||{},X)this._generateMask=X,this._maskBuffer=Buffer.alloc(4);this._socket=Z,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=d4,this.onerror=nh1,this[ih1]=void 0}static frame(Z,J){let X,Y=!1,$=2,Q=!1;if(J.mask){if(X=J.maskBuffer||sh1,J.generateMask)J.generateMask(X);else{if(_W===8192){if(I$===void 0)I$=Buffer.alloc(8192);lh1(I$,0,8192),_W=0}X[0]=I$[_W++],X[1]=I$[_W++],X[2]=I$[_W++],X[3]=I$[_W++]}Q=(X[0]|X[1]|X[2]|X[3])===0,$=6}let K;if(typeof Z==="string")if((!J.mask||Q)&&J[l9]!==void 0)K=J[l9];else Z=Buffer.from(Z),K=Z.length;else K=Z.length,Y=J.mask&&J.readOnly&&!Q;let W=K;if(K>=65536)$+=8,W=127;else if(K>125)$+=2,W=126;let G=Buffer.allocUnsafe(Y?K+$:$);if(G[0]=J.fin?J.opcode|128:J.opcode,J.rsv1)G[0]|=64;if(G[1]=W,W===126)G.writeUInt16BE(K,2);else if(W===127)G[2]=G[3]=0,G.writeUIntBE(K,4,6);if(!J.mask)return[G,Z];if(G[1]|=128,G[$-4]=X[0],G[$-3]=X[1],G[$-2]=X[2],G[$-1]=X[3],Q)return[G,Z];if(Y)return I50(Z,X,G,$,K),[G];return I50(Z,X,Z,0,K),[G,Z]}close(Z,J,X,Y){let $;if(Z===void 0)$=ph1;else if(typeof Z!=="number"||!ah1(Z))throw new TypeError("First argument must be a valid error code number");else if(J===void 0||!J.length)$=Buffer.allocUnsafe(2),$.writeUInt16BE(Z,0);else{let K=Buffer.byteLength(J);if(K>123)throw new RangeError("The message must not be greater than 123 bytes");if($=Buffer.allocUnsafe(2+K),$.writeUInt16BE(Z,0),typeof J==="string")$.write(J,2);else $.set(J,2)}let Q={[l9]:$.length,fin:!0,generateMask:this._generateMask,mask:X,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};if(this._state!==d4)this.enqueue([this.dispatch,$,!1,Q,Y]);else this.sendFrame(UX.frame($,Q),Y)}ping(Z,J,X){let Y,$;if(typeof Z==="string")Y=Buffer.byteLength(Z),$=!1;else if(IW(Z))Y=Z.size,$=!1;else Z=k$(Z),Y=Z.length,$=k$.readOnly;if(Y>125)throw new RangeError("The data size must not be greater than 125 bytes");let Q={[l9]:Y,fin:!0,generateMask:this._generateMask,mask:J,maskBuffer:this._maskBuffer,opcode:9,readOnly:$,rsv1:!1};if(IW(Z))if(this._state!==d4)this.enqueue([this.getBlobData,Z,!1,Q,X]);else this.getBlobData(Z,!1,Q,X);else if(this._state!==d4)this.enqueue([this.dispatch,Z,!1,Q,X]);else this.sendFrame(UX.frame(Z,Q),X)}pong(Z,J,X){let Y,$;if(typeof Z==="string")Y=Buffer.byteLength(Z),$=!1;else if(IW(Z))Y=Z.size,$=!1;else Z=k$(Z),Y=Z.length,$=k$.readOnly;if(Y>125)throw new RangeError("The data size must not be greater than 125 bytes");let Q={[l9]:Y,fin:!0,generateMask:this._generateMask,mask:J,maskBuffer:this._maskBuffer,opcode:10,readOnly:$,rsv1:!1};if(IW(Z))if(this._state!==d4)this.enqueue([this.getBlobData,Z,!1,Q,X]);else this.getBlobData(Z,!1,Q,X);else if(this._state!==d4)this.enqueue([this.dispatch,Z,!1,Q,X]);else this.sendFrame(UX.frame(Z,Q),X)}send(Z,J,X){let Y=this._extensions[k50.extensionName],$=J.binary?2:1,Q=J.compress,K,W;if(typeof Z==="string")K=Buffer.byteLength(Z),W=!1;else if(IW(Z))K=Z.size,W=!1;else Z=k$(Z),K=Z.length,W=k$.readOnly;if(this._firstFragment){if(this._firstFragment=!1,Q&&Y&&Y.params[Y._isServer?"server_no_context_takeover":"client_no_context_takeover"])Q=K>=Y._threshold;this._compress=Q}else Q=!1,$=0;if(J.fin)this._firstFragment=!0;let G={[l9]:K,fin:J.fin,generateMask:this._generateMask,mask:J.mask,maskBuffer:this._maskBuffer,opcode:$,readOnly:W,rsv1:Q};if(IW(Z))if(this._state!==d4)this.enqueue([this.getBlobData,Z,this._compress,G,X]);else this.getBlobData(Z,this._compress,G,X);else if(this._state!==d4)this.enqueue([this.dispatch,Z,this._compress,G,X]);else this.dispatch(Z,this._compress,G,X)}getBlobData(Z,J,X,Y){this._bufferedBytes+=X[l9],this._state=rh1,Z.arrayBuffer().then(($)=>{if(this._socket.destroyed){let K=new Error("The socket was closed while the blob was being read");process.nextTick(K_,this,K,Y);return}this._bufferedBytes-=X[l9];let Q=k$($);if(!J)this._state=d4,this.sendFrame(UX.frame(Q,X),Y),this.dequeue();else this.dispatch(Q,J,X,Y)}).catch(($)=>{process.nextTick(th1,this,$,Y)})}dispatch(Z,J,X,Y){if(!J){this.sendFrame(UX.frame(Z,X),Y);return}let $=this._extensions[k50.extensionName];this._bufferedBytes+=X[l9],this._state=oh1,$.compress(Z,X.fin,(Q,K)=>{if(this._socket.destroyed){let W=new Error("The socket was closed while data was being compressed");K_(this,W,Y);return}this._bufferedBytes-=X[l9],this._state=d4,X.readOnly=!1,this.sendFrame(UX.frame(K,X),Y),this.dequeue()})}dequeue(){while(this._state===d4&&this._queue.length){let Z=this._queue.shift();this._bufferedBytes-=Z[3][l9],Reflect.apply(Z[0],this,Z.slice(1))}}enqueue(Z){this._bufferedBytes+=Z[3][l9],this._queue.push(Z)}sendFrame(Z,J){if(Z.length===2)this._socket.cork(),this._socket.write(Z[0]),this._socket.write(Z[1],J),this._socket.uncork();else this._socket.write(Z[0],J)}}_50.exports=UX;function K_(Z,J,X){if(typeof X==="function")X(J);for(let Y=0;Y<Z._queue.length;Y++){let $=Z._queue[Y],Q=$[$.length-1];if(typeof Q==="function")Q(J)}}function th1(Z,J,X){K_(Z,J,X),Z.onerror(J)}});var g50=O((pg6,b50)=>{var{kForOnEventAttribute:YH,kListener:G_}=cZ(),v50=Symbol("kCode"),S50=Symbol("kData"),A50=Symbol("kError"),x50=Symbol("kMessage"),h50=Symbol("kReason"),vW=Symbol("kTarget"),f50=Symbol("kType"),y50=Symbol("kWasClean");class LX{constructor(Z){this[vW]=null,this[f50]=Z}get target(){return this[vW]}get type(){return this[f50]}}Object.defineProperty(LX.prototype,"target",{enumerable:!0});Object.defineProperty(LX.prototype,"type",{enumerable:!0});class SW extends LX{constructor(Z,J={}){super(Z);this[v50]=J.code===void 0?0:J.code,this[h50]=J.reason===void 0?"":J.reason,this[y50]=J.wasClean===void 0?!1:J.wasClean}get code(){return this[v50]}get reason(){return this[h50]}get wasClean(){return this[y50]}}Object.defineProperty(SW.prototype,"code",{enumerable:!0});Object.defineProperty(SW.prototype,"reason",{enumerable:!0});Object.defineProperty(SW.prototype,"wasClean",{enumerable:!0});class $H extends LX{constructor(Z,J={}){super(Z);this[A50]=J.error===void 0?null:J.error,this[x50]=J.message===void 0?"":J.message}get error(){return this[A50]}get message(){return this[x50]}}Object.defineProperty($H.prototype,"error",{enumerable:!0});Object.defineProperty($H.prototype,"message",{enumerable:!0});class ow extends LX{constructor(Z,J={}){super(Z);this[S50]=J.data===void 0?null:J.data}get data(){return this[S50]}}Object.defineProperty(ow.prototype,"data",{enumerable:!0});var eh1={addEventListener(Z,J,X={}){for(let $ of this.listeners(Z))if(!X[YH]&&$[G_]===J&&!$[YH])return;let Y;if(Z==="message")Y=function $(Q,K){let W=new ow("message",{data:K?Q:Q.toString()});W[vW]=this,sw(J,this,W)};else if(Z==="close")Y=function $(Q,K){let W=new SW("close",{code:Q,reason:K.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});W[vW]=this,sw(J,this,W)};else if(Z==="error")Y=function $(Q){let K=new $H("error",{error:Q,message:Q.message});K[vW]=this,sw(J,this,K)};else if(Z==="open")Y=function $(){let Q=new LX("open");Q[vW]=this,sw(J,this,Q)};else return;if(Y[YH]=!!X[YH],Y[G_]=J,X.once)this.once(Z,Y);else this.on(Z,Y)},removeEventListener(Z,J){for(let X of this.listeners(Z))if(X[G_]===J&&!X[YH]){this.removeListener(Z,X);break}}};b50.exports={CloseEvent:SW,ErrorEvent:$H,Event:LX,EventTarget:eh1,MessageEvent:ow};function sw(Z,J,X){if(typeof Z==="object"&&Z.handleEvent)Z.handleEvent.call(Z,X);else Z.call(J,X)}});var V_=O((ig6,m50)=>{var{tokenChars:QH}=kW();function g7(Z,J,X){if(Z[J]===void 0)Z[J]=[X];else Z[J].push(X)}function Zf1(Z){let J=Object.create(null),X=Object.create(null),Y=!1,$=!1,Q=!1,K,W,G=-1,V=-1,z=-1,F=0;for(;F<Z.length;F++)if(V=Z.charCodeAt(F),K===void 0)if(z===-1&&QH[V]===1){if(G===-1)G=F}else if(F!==0&&(V===32||V===9)){if(z===-1&&G!==-1)z=F}else if(V===59||V===44){if(G===-1)throw new SyntaxError(`Unexpected character at index ${F}`);if(z===-1)z=F;let q=Z.slice(G,z);if(V===44)g7(J,q,X),X=Object.create(null);else K=q;G=z=-1}else throw new SyntaxError(`Unexpected character at index ${F}`);else if(W===void 0)if(z===-1&&QH[V]===1){if(G===-1)G=F}else if(V===32||V===9){if(z===-1&&G!==-1)z=F}else if(V===59||V===44){if(G===-1)throw new SyntaxError(`Unexpected character at index ${F}`);if(z===-1)z=F;if(g7(X,Z.slice(G,z),!0),V===44)g7(J,K,X),X=Object.create(null),K=void 0;G=z=-1}else if(V===61&&G!==-1&&z===-1)W=Z.slice(G,F),G=z=-1;else throw new SyntaxError(`Unexpected character at index ${F}`);else if($){if(QH[V]!==1)throw new SyntaxError(`Unexpected character at index ${F}`);if(G===-1)G=F;else if(!Y)Y=!0;$=!1}else if(Q)if(QH[V]===1){if(G===-1)G=F}else if(V===34&&G!==-1)Q=!1,z=F;else if(V===92)$=!0;else throw new SyntaxError(`Unexpected character at index ${F}`);else if(V===34&&Z.charCodeAt(F-1)===61)Q=!0;else if(z===-1&&QH[V]===1){if(G===-1)G=F}else if(G!==-1&&(V===32||V===9)){if(z===-1)z=F}else if(V===59||V===44){if(G===-1)throw new SyntaxError(`Unexpected character at index ${F}`);if(z===-1)z=F;let q=Z.slice(G,z);if(Y)q=q.replace(/\\/g,""),Y=!1;if(g7(X,W,q),V===44)g7(J,K,X),X=Object.create(null),K=void 0;W=void 0,G=z=-1}else throw new SyntaxError(`Unexpected character at index ${F}`);if(G===-1||Q||V===32||V===9)throw new SyntaxError("Unexpected end of input");if(z===-1)z=F;let H=Z.slice(G,z);if(K===void 0)g7(J,H,X);else{if(W===void 0)g7(X,H,!0);else if(Y)g7(X,W,H.replace(/\\/g,""));else g7(X,W,H);g7(J,K,X)}return J}function Jf1(Z){return Object.keys(Z).map((J)=>{let X=Z[J];if(!Array.isArray(X))X=[X];return X.map((Y)=>{return[J].concat(Object.keys(Y).map(($)=>{let Q=Y[$];if(!Array.isArray(Q))Q=[Q];return Q.map((K)=>K===!0?$:`${$}=${K}`).join("; ")})).join("; ")}).join(", ")}).join(", ")}m50.exports={format:Jf1,parse:Zf1}});var ZO=O((sg6,t50)=>{var Xf1=m("events"),Yf1=m("https"),$f1=m("http"),c50=m("net"),Qf1=m("tls"),{randomBytes:Kf1,createHash:Wf1}=m("crypto"),{Duplex:ng6,Readable:ag6}=m("stream"),{URL:z_}=m("url"),BX=XH(),Gf1=Q_(),Vf1=W_(),{isBlob:zf1}=kW(),{BINARY_TYPES:u50,EMPTY_BUFFER:rw,GUID:Hf1,kForOnEventAttribute:H_,kListener:Ff1,kStatusCode:qf1,kWebSocket:Y6,NOOP:l50}=cZ(),{EventTarget:{addEventListener:Uf1,removeEventListener:Lf1}}=g50(),{format:Bf1,parse:wf1}=V_(),{toBuffer:Of1}=ZH(),p50=Symbol("kAborted"),F_=[8,13],pZ=["CONNECTING","OPEN","CLOSING","CLOSED"],Rf1=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class g0 extends Xf1{constructor(Z,J,X){super();if(this._binaryType=u50[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=rw,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=g0.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,Z!==null){if(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,J===void 0)J=[];else if(!Array.isArray(J))if(typeof J==="object"&&J!==null)X=J,J=[];else J=[J];i50(this,Z,J,X)}else this._autoPong=X.autoPong,this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(Z){if(!u50.includes(Z))return;if(this._binaryType=Z,this._receiver)this._receiver._binaryType=Z}get bufferedAmount(){if(!this._socket)return this._bufferedAmount;return this._socket._writableState.length+this._sender._bufferedBytes}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(Z,J,X){let Y=new Gf1({allowSynchronousEvents:X.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:X.maxPayload,skipUTF8Validation:X.skipUTF8Validation}),$=new Vf1(Z,this._extensions,X.generateMask);if(this._receiver=Y,this._sender=$,this._socket=Z,Y[Y6]=this,$[Y6]=this,Z[Y6]=this,Y.on("conclude",jf1),Y.on("drain",Df1),Y.on("error",Pf1),Y.on("message",Cf1),Y.on("ping",Tf1),Y.on("pong",Ef1),$.onerror=kf1,Z.setTimeout)Z.setTimeout(0);if(Z.setNoDelay)Z.setNoDelay();if(J.length>0)Z.unshift(J);Z.on("close",s50),Z.on("data",ew),Z.on("end",o50),Z.on("error",r50),this._readyState=g0.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=g0.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}if(this._extensions[BX.extensionName])this._extensions[BX.extensionName].cleanup();this._receiver.removeAllListeners(),this._readyState=g0.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(Z,J){if(this.readyState===g0.CLOSED)return;if(this.readyState===g0.CONNECTING){z9(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===g0.CLOSING){if(this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted))this._socket.end();return}this._readyState=g0.CLOSING,this._sender.close(Z,J,!this._isServer,(X)=>{if(X)return;if(this._closeFrameSent=!0,this._closeFrameReceived||this._receiver._writableState.errorEmitted)this._socket.end()}),a50(this)}pause(){if(this.readyState===g0.CONNECTING||this.readyState===g0.CLOSED)return;this._paused=!0,this._socket.pause()}ping(Z,J,X){if(this.readyState===g0.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof Z==="function")X=Z,Z=J=void 0;else if(typeof J==="function")X=J,J=void 0;if(typeof Z==="number")Z=Z.toString();if(this.readyState!==g0.OPEN){q_(this,Z,X);return}if(J===void 0)J=!this._isServer;this._sender.ping(Z||rw,J,X)}pong(Z,J,X){if(this.readyState===g0.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof Z==="function")X=Z,Z=J=void 0;else if(typeof J==="function")X=J,J=void 0;if(typeof Z==="number")Z=Z.toString();if(this.readyState!==g0.OPEN){q_(this,Z,X);return}if(J===void 0)J=!this._isServer;this._sender.pong(Z||rw,J,X)}resume(){if(this.readyState===g0.CONNECTING||this.readyState===g0.CLOSED)return;if(this._paused=!1,!this._receiver._writableState.needDrain)this._socket.resume()}send(Z,J,X){if(this.readyState===g0.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof J==="function")X=J,J={};if(typeof Z==="number")Z=Z.toString();if(this.readyState!==g0.OPEN){q_(this,Z,X);return}let Y={binary:typeof Z!=="string",mask:!this._isServer,compress:!0,fin:!0,...J};if(!this._extensions[BX.extensionName])Y.compress=!1;this._sender.send(Z||rw,Y,X)}terminate(){if(this.readyState===g0.CLOSED)return;if(this.readyState===g0.CONNECTING){z9(this,this._req,"WebSocket was closed before the connection was established");return}if(this._socket)this._readyState=g0.CLOSING,this._socket.destroy()}}Object.defineProperty(g0,"CONNECTING",{enumerable:!0,value:pZ.indexOf("CONNECTING")});Object.defineProperty(g0.prototype,"CONNECTING",{enumerable:!0,value:pZ.indexOf("CONNECTING")});Object.defineProperty(g0,"OPEN",{enumerable:!0,value:pZ.indexOf("OPEN")});Object.defineProperty(g0.prototype,"OPEN",{enumerable:!0,value:pZ.indexOf("OPEN")});Object.defineProperty(g0,"CLOSING",{enumerable:!0,value:pZ.indexOf("CLOSING")});Object.defineProperty(g0.prototype,"CLOSING",{enumerable:!0,value:pZ.indexOf("CLOSING")});Object.defineProperty(g0,"CLOSED",{enumerable:!0,value:pZ.indexOf("CLOSED")});Object.defineProperty(g0.prototype,"CLOSED",{enumerable:!0,value:pZ.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach((Z)=>{Object.defineProperty(g0.prototype,Z,{enumerable:!0})});["open","error","close","message"].forEach((Z)=>{Object.defineProperty(g0.prototype,`on${Z}`,{enumerable:!0,get(){for(let J of this.listeners(Z))if(J[H_])return J[Ff1];return null},set(J){for(let X of this.listeners(Z))if(X[H_]){this.removeListener(Z,X);break}if(typeof J!=="function")return;this.addEventListener(Z,J,{[H_]:!0})}})});g0.prototype.addEventListener=Uf1;g0.prototype.removeEventListener=Lf1;t50.exports=g0;function i50(Z,J,X,Y){let $={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:F_[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...Y,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(Z._autoPong=$.autoPong,!F_.includes($.protocolVersion))throw new RangeError(`Unsupported protocol version: ${$.protocolVersion} (supported versions: ${F_.join(", ")})`);let Q;if(J instanceof z_)Q=J;else try{Q=new z_(J)}catch(L){throw new SyntaxError(`Invalid URL: ${J}`)}if(Q.protocol==="http:")Q.protocol="ws:";else if(Q.protocol==="https:")Q.protocol="wss:";Z._url=Q.href;let K=Q.protocol==="wss:",W=Q.protocol==="ws+unix:",G;if(Q.protocol!=="ws:"&&!K&&!W)G=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`;else if(W&&!Q.pathname)G="The URL's pathname is empty";else if(Q.hash)G="The URL contains a fragment identifier";if(G){let L=new SyntaxError(G);if(Z._redirects===0)throw L;else{tw(Z,L);return}}let V=K?443:80,z=Kf1(16).toString("base64"),F=K?Yf1.request:$f1.request,H=new Set,q;if($.createConnection=$.createConnection||(K?Nf1:Mf1),$.defaultPort=$.defaultPort||V,$.port=Q.port||V,$.host=Q.hostname.startsWith("[")?Q.hostname.slice(1,-1):Q.hostname,$.headers={...$.headers,"Sec-WebSocket-Version":$.protocolVersion,"Sec-WebSocket-Key":z,Connection:"Upgrade",Upgrade:"websocket"},$.path=Q.pathname+Q.search,$.timeout=$.handshakeTimeout,$.perMessageDeflate)q=new BX($.perMessageDeflate!==!0?$.perMessageDeflate:{},!1,$.maxPayload),$.headers["Sec-WebSocket-Extensions"]=Bf1({[BX.extensionName]:q.offer()});if(X.length){for(let L of X){if(typeof L!=="string"||!Rf1.test(L)||H.has(L))throw new SyntaxError("An invalid or duplicated subprotocol was specified");H.add(L)}$.headers["Sec-WebSocket-Protocol"]=X.join(",")}if($.origin)if($.protocolVersion<13)$.headers["Sec-WebSocket-Origin"]=$.origin;else $.headers.Origin=$.origin;if(Q.username||Q.password)$.auth=`${Q.username}:${Q.password}`;if(W){let L=$.path.split(":");$.socketPath=L[0],$.path=L[1]}let U;if($.followRedirects){if(Z._redirects===0){Z._originalIpc=W,Z._originalSecure=K,Z._originalHostOrSocketPath=W?$.socketPath:Q.host;let L=Y&&Y.headers;if(Y={...Y,headers:{}},L)for(let[B,w]of Object.entries(L))Y.headers[B.toLowerCase()]=w}else if(Z.listenerCount("redirect")===0){let L=W?Z._originalIpc?$.socketPath===Z._originalHostOrSocketPath:!1:Z._originalIpc?!1:Q.host===Z._originalHostOrSocketPath;if(!L||Z._originalSecure&&!K){if(delete $.headers.authorization,delete $.headers.cookie,!L)delete $.headers.host;$.auth=void 0}}if($.auth&&!Y.headers.authorization)Y.headers.authorization="Basic "+Buffer.from($.auth).toString("base64");if(U=Z._req=F($),Z._redirects)Z.emit("redirect",Z.url,U)}else U=Z._req=F($);if($.timeout)U.on("timeout",()=>{z9(Z,U,"Opening handshake has timed out")});if(U.on("error",(L)=>{if(U===null||U[p50])return;U=Z._req=null,tw(Z,L)}),U.on("response",(L)=>{let B=L.headers.location,w=L.statusCode;if(B&&$.followRedirects&&w>=300&&w<400){if(++Z._redirects>$.maxRedirects){z9(Z,U,"Maximum redirects exceeded");return}U.abort();let R;try{R=new z_(B,J)}catch(M){let N=new SyntaxError(`Invalid URL: ${B}`);tw(Z,N);return}i50(Z,R,X,Y)}else if(!Z.emit("unexpected-response",U,L))z9(Z,U,`Unexpected server response: ${L.statusCode}`)}),U.on("upgrade",(L,B,w)=>{if(Z.emit("upgrade",L),Z.readyState!==g0.CONNECTING)return;U=Z._req=null;let R=L.headers.upgrade;if(R===void 0||R.toLowerCase()!=="websocket"){z9(Z,B,"Invalid Upgrade header");return}let M=Wf1("sha1").update(z+Hf1).digest("base64");if(L.headers["sec-websocket-accept"]!==M){z9(Z,B,"Invalid Sec-WebSocket-Accept header");return}let N=L.headers["sec-websocket-protocol"],P;if(N!==void 0){if(!H.size)P="Server sent a subprotocol but none was requested";else if(!H.has(N))P="Server sent an invalid subprotocol"}else if(H.size)P="Server sent no subprotocol";if(P){z9(Z,B,P);return}if(N)Z._protocol=N;let D=L.headers["sec-websocket-extensions"];if(D!==void 0){if(!q){z9(Z,B,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let C;try{C=wf1(D)}catch(E){z9(Z,B,"Invalid Sec-WebSocket-Extensions header");return}let T=Object.keys(C);if(T.length!==1||T[0]!==BX.extensionName){z9(Z,B,"Server indicated an extension that was not requested");return}try{q.accept(C[BX.extensionName])}catch(E){z9(Z,B,"Invalid Sec-WebSocket-Extensions header");return}Z._extensions[BX.extensionName]=q}Z.setSocket(B,w,{allowSynchronousEvents:$.allowSynchronousEvents,generateMask:$.generateMask,maxPayload:$.maxPayload,skipUTF8Validation:$.skipUTF8Validation})}),$.finishRequest)$.finishRequest(U,Z);else U.end()}function tw(Z,J){Z._readyState=g0.CLOSING,Z._errorEmitted=!0,Z.emit("error",J),Z.emitClose()}function Mf1(Z){return Z.path=Z.socketPath,c50.connect(Z)}function Nf1(Z){if(Z.path=void 0,!Z.servername&&Z.servername!=="")Z.servername=c50.isIP(Z.host)?"":Z.host;return Qf1.connect(Z)}function z9(Z,J,X){Z._readyState=g0.CLOSING;let Y=new Error(X);if(Error.captureStackTrace(Y,z9),J.setHeader){if(J[p50]=!0,J.abort(),J.socket&&!J.socket.destroyed)J.socket.destroy();process.nextTick(tw,Z,Y)}else J.destroy(Y),J.once("error",Z.emit.bind(Z,"error")),J.once("close",Z.emitClose.bind(Z))}function q_(Z,J,X){if(J){let Y=zf1(J)?J.size:Of1(J).length;if(Z._socket)Z._sender._bufferedBytes+=Y;else Z._bufferedAmount+=Y}if(X){let Y=new Error(`WebSocket is not open: readyState ${Z.readyState} (${pZ[Z.readyState]})`);process.nextTick(X,Y)}}function jf1(Z,J){let X=this[Y6];if(X._closeFrameReceived=!0,X._closeMessage=J,X._closeCode=Z,X._socket[Y6]===void 0)return;if(X._socket.removeListener("data",ew),process.nextTick(n50,X._socket),Z===1005)X.close();else X.close(Z,J)}function Df1(){let Z=this[Y6];if(!Z.isPaused)Z._socket.resume()}function Pf1(Z){let J=this[Y6];if(J._socket[Y6]!==void 0)J._socket.removeListener("data",ew),process.nextTick(n50,J._socket),J.close(Z[qf1]);if(!J._errorEmitted)J._errorEmitted=!0,J.emit("error",Z)}function d50(){this[Y6].emitClose()}function Cf1(Z,J){this[Y6].emit("message",Z,J)}function Tf1(Z){let J=this[Y6];if(J._autoPong)J.pong(Z,!this._isServer,l50);J.emit("ping",Z)}function Ef1(Z){this[Y6].emit("pong",Z)}function n50(Z){Z.resume()}function kf1(Z){let J=this[Y6];if(J.readyState===g0.CLOSED)return;if(J.readyState===g0.OPEN)J._readyState=g0.CLOSING,a50(J);if(this._socket.end(),!J._errorEmitted)J._errorEmitted=!0,J.emit("error",Z)}function a50(Z){Z._closeTimer=setTimeout(Z._socket.destroy.bind(Z._socket),30000)}function s50(){let Z=this[Y6];this.removeListener("close",s50),this.removeListener("data",ew),this.removeListener("end",o50),Z._readyState=g0.CLOSING;let J;if(!this._readableState.endEmitted&&!Z._closeFrameReceived&&!Z._receiver._writableState.errorEmitted&&(J=Z._socket.read())!==null)Z._receiver.write(J);if(Z._receiver.end(),this[Y6]=void 0,clearTimeout(Z._closeTimer),Z._receiver._writableState.finished||Z._receiver._writableState.errorEmitted)Z.emitClose();else Z._receiver.on("error",d50),Z._receiver.on("finish",d50)}function ew(Z){if(!this[Y6]._receiver.write(Z))this.pause()}function o50(){let Z=this[Y6];Z._readyState=g0.CLOSING,Z._receiver.end(),this.end()}function r50(){let Z=this[Y6];if(this.removeListener("error",r50),this.on("error",l50),Z)Z._readyState=g0.CLOSING,this.destroy()}});var X90=O((rg6,J90)=>{var og6=ZO(),{Duplex:If1}=m("stream");function e50(Z){Z.emit("close")}function _f1(){if(!this.destroyed&&this._writableState.finished)this.destroy()}function Z90(Z){if(this.removeListener("error",Z90),this.destroy(),this.listenerCount("error")===0)this.emit("error",Z)}function vf1(Z,J){let X=!0,Y=new If1({...J,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return Z.on("message",function $(Q,K){let W=!K&&Y._readableState.objectMode?Q.toString():Q;if(!Y.push(W))Z.pause()}),Z.once("error",function $(Q){if(Y.destroyed)return;X=!1,Y.destroy(Q)}),Z.once("close",function $(){if(Y.destroyed)return;Y.push(null)}),Y._destroy=function($,Q){if(Z.readyState===Z.CLOSED){Q($),process.nextTick(e50,Y);return}let K=!1;if(Z.once("error",function W(G){K=!0,Q(G)}),Z.once("close",function W(){if(!K)Q($);process.nextTick(e50,Y)}),X)Z.terminate()},Y._final=function($){if(Z.readyState===Z.CONNECTING){Z.once("open",function Q(){Y._final($)});return}if(Z._socket===null)return;if(Z._socket._writableState.finished){if($(),Y._readableState.endEmitted)Y.destroy()}else Z._socket.once("finish",function Q(){$()}),Z.close()},Y._read=function(){if(Z.isPaused)Z.resume()},Y._write=function($,Q,K){if(Z.readyState===Z.CONNECTING){Z.once("open",function W(){Y._write($,Q,K)});return}Z.send($,K)},Y.on("end",_f1),Y.on("error",Z90),Y}J90.exports=vf1});var $90=O((tg6,Y90)=>{var{tokenChars:Sf1}=kW();function Af1(Z){let J=new Set,X=-1,Y=-1,$=0;for($;$<Z.length;$++){let K=Z.charCodeAt($);if(Y===-1&&Sf1[K]===1){if(X===-1)X=$}else if($!==0&&(K===32||K===9)){if(Y===-1&&X!==-1)Y=$}else if(K===44){if(X===-1)throw new SyntaxError(`Unexpected character at index ${$}`);if(Y===-1)Y=$;let W=Z.slice(X,Y);if(J.has(W))throw new SyntaxError(`The "${W}" subprotocol is duplicated`);J.add(W),X=Y=-1}else throw new SyntaxError(`Unexpected character at index ${$}`)}if(X===-1||Y!==-1)throw new SyntaxError("Unexpected end of input");let Q=Z.slice(X,$);if(J.has(Q))throw new SyntaxError(`The "${Q}" subprotocol is duplicated`);return J.add(Q),J}Y90.exports={parse:Af1}});var V90=O((Zm6,G90)=>{var xf1=m("events"),JO=m("http"),{Duplex:eg6}=m("stream"),{createHash:hf1}=m("crypto"),Q90=V_(),_$=XH(),ff1=$90(),yf1=ZO(),{GUID:bf1,kWebSocket:gf1}=cZ(),mf1=/^[+/0-9A-Za-z]{22}==$/;class W90 extends xf1{constructor(Z,J){super();if(Z={allowSynchronousEvents:!0,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:yf1,...Z},Z.port==null&&!Z.server&&!Z.noServer||Z.port!=null&&(Z.server||Z.noServer)||Z.server&&Z.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(Z.port!=null)this._server=JO.createServer((X,Y)=>{let $=JO.STATUS_CODES[426];Y.writeHead(426,{"Content-Length":$.length,"Content-Type":"text/plain"}),Y.end($)}),this._server.listen(Z.port,Z.host,Z.backlog,J);else if(Z.server)this._server=Z.server;if(this._server){let X=this.emit.bind(this,"connection");this._removeListeners=uf1(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(Y,$,Q)=>{this.handleUpgrade(Y,$,Q,X)}})}if(Z.perMessageDeflate===!0)Z.perMessageDeflate={};if(Z.clientTracking)this.clients=new Set,this._shouldEmitClose=!1;this.options=Z,this._state=0}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');if(!this._server)return null;return this._server.address()}close(Z){if(this._state===2){if(Z)this.once("close",()=>{Z(new Error("The server is not running"))});process.nextTick(KH,this);return}if(Z)this.once("close",Z);if(this._state===1)return;if(this._state=1,this.options.noServer||this.options.server){if(this._server)this._removeListeners(),this._removeListeners=this._server=null;if(this.clients)if(!this.clients.size)process.nextTick(KH,this);else this._shouldEmitClose=!0;else process.nextTick(KH,this)}else{let J=this._server;this._removeListeners(),this._removeListeners=this._server=null,J.close(()=>{KH(this)})}}shouldHandle(Z){if(this.options.path){let J=Z.url.indexOf("?");if((J!==-1?Z.url.slice(0,J):Z.url)!==this.options.path)return!1}return!0}handleUpgrade(Z,J,X,Y){J.on("error",K90);let $=Z.headers["sec-websocket-key"],Q=Z.headers.upgrade,K=+Z.headers["sec-websocket-version"];if(Z.method!=="GET"){v$(this,Z,J,405,"Invalid HTTP method");return}if(Q===void 0||Q.toLowerCase()!=="websocket"){v$(this,Z,J,400,"Invalid Upgrade header");return}if($===void 0||!mf1.test($)){v$(this,Z,J,400,"Missing or invalid Sec-WebSocket-Key header");return}if(K!==13&&K!==8){v$(this,Z,J,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(Z)){WH(J,400);return}let W=Z.headers["sec-websocket-protocol"],G=new Set;if(W!==void 0)try{G=ff1.parse(W)}catch(F){v$(this,Z,J,400,"Invalid Sec-WebSocket-Protocol header");return}let V=Z.headers["sec-websocket-extensions"],z={};if(this.options.perMessageDeflate&&V!==void 0){let F=new _$(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let H=Q90.parse(V);if(H[_$.extensionName])F.accept(H[_$.extensionName]),z[_$.extensionName]=F}catch(H){v$(this,Z,J,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let F={origin:Z.headers[`${K===8?"sec-websocket-origin":"origin"}`],secure:!!(Z.socket.authorized||Z.socket.encrypted),req:Z};if(this.options.verifyClient.length===2){this.options.verifyClient(F,(H,q,U,L)=>{if(!H)return WH(J,q||401,U,L);this.completeUpgrade(z,$,G,Z,J,X,Y)});return}if(!this.options.verifyClient(F))return WH(J,401)}this.completeUpgrade(z,$,G,Z,J,X,Y)}completeUpgrade(Z,J,X,Y,$,Q,K){if(!$.readable||!$.writable)return $.destroy();if($[gf1])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>0)return WH($,503);let G=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${hf1("sha1").update(J+bf1).digest("base64")}`],V=new this.options.WebSocket(null,void 0,this.options);if(X.size){let z=this.options.handleProtocols?this.options.handleProtocols(X,Y):X.values().next().value;if(z)G.push(`Sec-WebSocket-Protocol: ${z}`),V._protocol=z}if(Z[_$.extensionName]){let z=Z[_$.extensionName].params,F=Q90.format({[_$.extensionName]:[z]});G.push(`Sec-WebSocket-Extensions: ${F}`),V._extensions=Z}if(this.emit("headers",G,Y),$.write(G.concat(`\r
29
29
  `).join(`\r
30
30
  `)),$.removeListener("error",K90),V.setSocket($,Q,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients)this.clients.add(V),V.on("close",()=>{if(this.clients.delete(V),this._shouldEmitClose&&!this.clients.size)process.nextTick(KH,this)});K(V,Y)}}G90.exports=W90;function uf1(Z,J){for(let X of Object.keys(J))Z.on(X,J[X]);return function X(){for(let Y of Object.keys(J))Z.removeListener(Y,J[Y])}}function KH(Z){Z._state=2,Z.emit("close")}function K90(){this.destroy()}function WH(Z,J,X,Y){X=X||JO.STATUS_CODES[J],Y={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(X),...Y},Z.once("finish",Z.destroy),Z.end(`HTTP/1.1 ${J} ${JO.STATUS_CODES[J]}\r
31
31
  `+Object.keys(Y).map(($)=>`${$}: ${Y[$]}`).join(`\r
32
32
  `)+`\r
33
33
  \r
34
- `+X)}function v$(Z,J,X,Y,$){if(Z.listenerCount("wsClientError")){let Q=new Error($);Error.captureStackTrace(Q,v$),Z.emit("wsClientError",Q,X,J)}else WH(X,Y,$)}});var F90=O((z90)=>{Object.defineProperty(z90,"__esModule",{value:!0});z90.default=void 0;var Xm6=z90.default="ffffffff-ffff-ffff-ffff-ffffffffffff"});var L90=O((q90)=>{Object.defineProperty(q90,"__esModule",{value:!0});q90.default=void 0;var $m6=q90.default="00000000-0000-0000-0000-000000000000"});var O90=O((B90)=>{Object.defineProperty(B90,"__esModule",{value:!0});B90.default=void 0;var Km6=B90.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});var GH=O((R90)=>{Object.defineProperty(R90,"__esModule",{value:!0});R90.default=void 0;var pf1=if1(O90());function if1(Z){return Z&&Z.__esModule?Z:{default:Z}}function nf1(Z){return typeof Z==="string"&&pf1.default.test(Z)}var Gm6=R90.default=nf1});var VH=O((N90)=>{Object.defineProperty(N90,"__esModule",{value:!0});N90.default=void 0;var af1=sf1(GH());function sf1(Z){return Z&&Z.__esModule?Z:{default:Z}}function of1(Z){if(!af1.default(Z))throw TypeError("Invalid UUID");let J,X=new Uint8Array(16);return X[0]=(J=parseInt(Z.slice(0,8),16))>>>24,X[1]=J>>>16&255,X[2]=J>>>8&255,X[3]=J&255,X[4]=(J=parseInt(Z.slice(9,13),16))>>>8,X[5]=J&255,X[6]=(J=parseInt(Z.slice(14,18),16))>>>8,X[7]=J&255,X[8]=(J=parseInt(Z.slice(19,23),16))>>>8,X[9]=J&255,X[10]=(J=parseInt(Z.slice(24,36),16))/1099511627776&255,X[11]=J/4294967296&255,X[12]=J>>>24&255,X[13]=J>>>16&255,X[14]=J>>>8&255,X[15]=J&255,X}var zm6=N90.default=of1});var iZ=O((P90)=>{Object.defineProperty(P90,"__esModule",{value:!0});P90.default=void 0;P90.unsafeStringify=D90;var rf1=tf1(GH());function tf1(Z){return Z&&Z.__esModule?Z:{default:Z}}var M6=[];for(let Z=0;Z<256;++Z)M6.push((Z+256).toString(16).slice(1));function D90(Z,J=0){return(M6[Z[J+0]]+M6[Z[J+1]]+M6[Z[J+2]]+M6[Z[J+3]]+"-"+M6[Z[J+4]]+M6[Z[J+5]]+"-"+M6[Z[J+6]]+M6[Z[J+7]]+"-"+M6[Z[J+8]]+M6[Z[J+9]]+"-"+M6[Z[J+10]]+M6[Z[J+11]]+M6[Z[J+12]]+M6[Z[J+13]]+M6[Z[J+14]]+M6[Z[J+15]]).toLowerCase()}function ef1(Z,J=0){let X=D90(Z,J);if(!rf1.default(X))throw TypeError("Stringified UUID is invalid");return X}var Fm6=P90.default=ef1});var QO=O((T90)=>{Object.defineProperty(T90,"__esModule",{value:!0});T90.default=Yy1;var Jy1=Xy1(m("node:crypto"));function Xy1(Z){return Z&&Z.__esModule?Z:{default:Z}}var $O=new Uint8Array(256),YO=$O.length;function Yy1(){if(YO>$O.length-16)Jy1.default.randomFillSync($O),YO=0;return $O.slice(YO,YO+=16)}});var O_=O((E90)=>{Object.defineProperty(E90,"__esModule",{value:!0});E90.default=void 0;var Qy1=Wy1(QO()),Ky1=iZ();function Wy1(Z){return Z&&Z.__esModule?Z:{default:Z}}var L_,KO,B_=0,w_=0;function Gy1(Z,J,X){let Y=J&&X||0,$=J||new Array(16);Z=Z||{};let{node:Q,clockseq:K}=Z;if(!Z._v6){if(!Q)Q=L_;if(K==null)K=KO}if(Q==null||K==null){let H=Z.random||(Z.rng||Qy1.default)();if(Q==null){if(Q=[H[0],H[1],H[2],H[3],H[4],H[5]],!L_&&!Z._v6)Q[0]|=1,L_=Q}if(K==null){if(K=(H[6]<<8|H[7])&16383,KO===void 0&&!Z._v6)KO=K}}let W=Z.msecs!==void 0?Z.msecs:Date.now(),G=Z.nsecs!==void 0?Z.nsecs:w_+1,V=W-B_+(G-w_)/1e4;if(V<0&&Z.clockseq===void 0)K=K+1&16383;if((V<0||W>B_)&&Z.nsecs===void 0)G=0;if(G>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");B_=W,w_=G,KO=K,W+=12219292800000;let z=((W&268435455)*1e4+G)%4294967296;$[Y++]=z>>>24&255,$[Y++]=z>>>16&255,$[Y++]=z>>>8&255,$[Y++]=z&255;let F=W/4294967296*1e4&268435455;$[Y++]=F>>>8&255,$[Y++]=F&255,$[Y++]=F>>>24&15|16,$[Y++]=F>>>16&255,$[Y++]=K>>>8|128,$[Y++]=K&255;for(let H=0;H<6;++H)$[Y+H]=Q[H];return J||Ky1.unsafeStringify($)}var Lm6=E90.default=Gy1});var R_=O((I90)=>{Object.defineProperty(I90,"__esModule",{value:!0});I90.default=Fy1;var Vy1=Hy1(VH()),zy1=iZ();function Hy1(Z){return Z&&Z.__esModule?Z:{default:Z}}function Fy1(Z){let J=typeof Z==="string"?Vy1.default(Z):Z,X=qy1(J);return typeof Z==="string"?zy1.unsafeStringify(X):X}function qy1(Z,J=!1){return Uint8Array.of((Z[6]&15)<<4|Z[7]>>4&15,(Z[7]&15)<<4|(Z[4]&240)>>4,(Z[4]&15)<<4|(Z[5]&240)>>4,(Z[5]&15)<<4|(Z[0]&240)>>4,(Z[0]&15)<<4|(Z[1]&240)>>4,(Z[1]&15)<<4|(Z[2]&240)>>4,96|Z[2]&15,Z[3],Z[8],Z[9],Z[10],Z[11],Z[12],Z[13],Z[14],Z[15])}});var M_=O((_90)=>{Object.defineProperty(_90,"__esModule",{value:!0});_90.URL=_90.DNS=void 0;_90.default=Ny1;var Ly1=iZ(),By1=wy1(VH());function wy1(Z){return Z&&Z.__esModule?Z:{default:Z}}function Oy1(Z){Z=unescape(encodeURIComponent(Z));let J=[];for(let X=0;X<Z.length;++X)J.push(Z.charCodeAt(X));return J}var Ry1=_90.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",My1=_90.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Ny1(Z,J,X){function Y($,Q,K,W){var G;if(typeof $==="string")$=Oy1($);if(typeof Q==="string")Q=By1.default(Q);if(((G=Q)===null||G===void 0?void 0:G.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let V=new Uint8Array(16+$.length);if(V.set(Q),V.set($,Q.length),V=X(V),V[6]=V[6]&15|J,V[8]=V[8]&63|128,K){W=W||0;for(let z=0;z<16;++z)K[W+z]=V[z];return K}return Ly1.unsafeStringify(V)}try{Y.name=Z}catch($){}return Y.DNS=Ry1,Y.URL=My1,Y}});var x90=O((S90)=>{Object.defineProperty(S90,"__esModule",{value:!0});S90.default=void 0;var Py1=Cy1(m("node:crypto"));function Cy1(Z){return Z&&Z.__esModule?Z:{default:Z}}function Ty1(Z){if(Array.isArray(Z))Z=Buffer.from(Z);else if(typeof Z==="string")Z=Buffer.from(Z,"utf8");return Py1.default.createHash("md5").update(Z).digest()}var Rm6=S90.default=Ty1});var b90=O((f90)=>{Object.defineProperty(f90,"__esModule",{value:!0});f90.default=void 0;var Ey1=h90(M_()),ky1=h90(x90());function h90(Z){return Z&&Z.__esModule?Z:{default:Z}}var Iy1=Ey1.default("v3",48,ky1.default),Nm6=f90.default=Iy1});var u90=O((g90)=>{Object.defineProperty(g90,"__esModule",{value:!0});g90.default=void 0;var _y1=vy1(m("node:crypto"));function vy1(Z){return Z&&Z.__esModule?Z:{default:Z}}var Dm6=g90.default={randomUUID:_y1.default.randomUUID}});var i90=O((l90)=>{Object.defineProperty(l90,"__esModule",{value:!0});l90.default=void 0;var d90=c90(u90()),Sy1=c90(QO()),Ay1=iZ();function c90(Z){return Z&&Z.__esModule?Z:{default:Z}}function xy1(Z,J,X){if(d90.default.randomUUID&&!J&&!Z)return d90.default.randomUUID();Z=Z||{};let Y=Z.random||(Z.rng||Sy1.default)();if(Y[6]=Y[6]&15|64,Y[8]=Y[8]&63|128,J){X=X||0;for(let $=0;$<16;++$)J[X+$]=Y[$];return J}return Ay1.unsafeStringify(Y)}var Cm6=l90.default=xy1});var s90=O((n90)=>{Object.defineProperty(n90,"__esModule",{value:!0});n90.default=void 0;var hy1=fy1(m("node:crypto"));function fy1(Z){return Z&&Z.__esModule?Z:{default:Z}}function yy1(Z){if(Array.isArray(Z))Z=Buffer.from(Z);else if(typeof Z==="string")Z=Buffer.from(Z,"utf8");return hy1.default.createHash("sha1").update(Z).digest()}var Em6=n90.default=yy1});var e90=O((r90)=>{Object.defineProperty(r90,"__esModule",{value:!0});r90.default=void 0;var by1=o90(M_()),gy1=o90(s90());function o90(Z){return Z&&Z.__esModule?Z:{default:Z}}var my1=by1.default("v5",80,gy1.default),Im6=r90.default=my1});var X40=O((J40)=>{Object.defineProperty(J40,"__esModule",{value:!0});J40.default=ly1;var uy1=iZ(),dy1=Z40(O_()),cy1=Z40(R_());function Z40(Z){return Z&&Z.__esModule?Z:{default:Z}}function ly1(Z={},J,X=0){let Y=dy1.default({...Z,_v6:!0},new Uint8Array(16));if(Y=cy1.default(Y),J){for(let $=0;$<16;$++)J[X+$]=Y[$];return J}return uy1.unsafeStringify(Y)}});var $40=O((Y40)=>{Object.defineProperty(Y40,"__esModule",{value:!0});Y40.default=sy1;var iy1=ay1(VH()),ny1=iZ();function ay1(Z){return Z&&Z.__esModule?Z:{default:Z}}function sy1(Z){let J=typeof Z==="string"?iy1.default(Z):Z,X=oy1(J);return typeof Z==="string"?ny1.unsafeStringify(X):X}function oy1(Z){return Uint8Array.of((Z[3]&15)<<4|Z[4]>>4&15,(Z[4]&15)<<4|(Z[5]&240)>>4,(Z[5]&15)<<4|Z[6]&15,Z[7],(Z[1]&15)<<4|(Z[2]&240)>>4,(Z[2]&15)<<4|(Z[3]&240)>>4,16|(Z[0]&240)>>4,(Z[0]&15)<<4|(Z[1]&240)>>4,Z[8],Z[9],Z[10],Z[11],Z[12],Z[13],Z[14],Z[15])}});var V40=O((W40)=>{Object.defineProperty(W40,"__esModule",{value:!0});W40.default=void 0;var ty1=Zb1(QO()),ey1=iZ();function Zb1(Z){return Z&&Z.__esModule?Z:{default:Z}}var Q40=null,K40=null,c4=0;function Jb1(Z,J,X){Z=Z||{};let Y=J&&X||0,$=J||new Uint8Array(16),Q=Z.random||(Z.rng||ty1.default)(),K=Z.msecs!==void 0?Z.msecs:Date.now(),W=Z.seq!==void 0?Z.seq:null,G=K40,V=Q40;if(K>c4&&Z.msecs===void 0){if(c4=K,W!==null)G=null,V=null}if(W!==null){if(W>2147483647)W=2147483647;G=W>>>19&4095,V=W&524287}if(G===null||V===null)G=Q[6]&127,G=G<<8|Q[7],V=Q[8]&63,V=V<<8|Q[9],V=V<<5|Q[10]>>>3;if(K+1e4>c4&&W===null){if(++V>524287){if(V=0,++G>4095)G=0,c4++}}else c4=K;return K40=G,Q40=V,$[Y++]=c4/1099511627776&255,$[Y++]=c4/4294967296&255,$[Y++]=c4/16777216&255,$[Y++]=c4/65536&255,$[Y++]=c4/256&255,$[Y++]=c4&255,$[Y++]=G>>>4&15|112,$[Y++]=G&255,$[Y++]=V>>>13&63|128,$[Y++]=V>>>5&255,$[Y++]=V<<3&255|Q[10]&7,$[Y++]=Q[11],$[Y++]=Q[12],$[Y++]=Q[13],$[Y++]=Q[14],$[Y++]=Q[15],J||ey1.unsafeStringify($)}var Am6=W40.default=Jb1});var F40=O((z40)=>{Object.defineProperty(z40,"__esModule",{value:!0});z40.default=void 0;var Xb1=Yb1(GH());function Yb1(Z){return Z&&Z.__esModule?Z:{default:Z}}function $b1(Z){if(!Xb1.default(Z))throw TypeError("Invalid UUID");return parseInt(Z.slice(14,15),16)}var hm6=z40.default=$b1});var q40=O((y6)=>{Object.defineProperty(y6,"__esModule",{value:!0});Object.defineProperty(y6,"MAX",{enumerable:!0,get:function(){return Qb1.default}});Object.defineProperty(y6,"NIL",{enumerable:!0,get:function(){return Kb1.default}});Object.defineProperty(y6,"parse",{enumerable:!0,get:function(){return Wb1.default}});Object.defineProperty(y6,"stringify",{enumerable:!0,get:function(){return Gb1.default}});Object.defineProperty(y6,"v1",{enumerable:!0,get:function(){return Vb1.default}});Object.defineProperty(y6,"v1ToV6",{enumerable:!0,get:function(){return zb1.default}});Object.defineProperty(y6,"v3",{enumerable:!0,get:function(){return Hb1.default}});Object.defineProperty(y6,"v4",{enumerable:!0,get:function(){return Fb1.default}});Object.defineProperty(y6,"v5",{enumerable:!0,get:function(){return qb1.default}});Object.defineProperty(y6,"v6",{enumerable:!0,get:function(){return Ub1.default}});Object.defineProperty(y6,"v6ToV1",{enumerable:!0,get:function(){return Lb1.default}});Object.defineProperty(y6,"v7",{enumerable:!0,get:function(){return Bb1.default}});Object.defineProperty(y6,"validate",{enumerable:!0,get:function(){return wb1.default}});Object.defineProperty(y6,"version",{enumerable:!0,get:function(){return Ob1.default}});var Qb1=y5(F90()),Kb1=y5(L90()),Wb1=y5(VH()),Gb1=y5(iZ()),Vb1=y5(O_()),zb1=y5(R_()),Hb1=y5(b90()),Fb1=y5(i90()),qb1=y5(e90()),Ub1=y5(X40()),Lb1=y5($40()),Bb1=y5(V40()),wb1=y5(GH()),Ob1=y5(F40());function y5(Z){return Z&&Z.__esModule?Z:{default:Z}}});var d7=O((Su6,r40)=>{/*!
34
+ `+X)}function v$(Z,J,X,Y,$,Q){if(Z.listenerCount("wsClientError")){let K=new Error($);Error.captureStackTrace(K,v$),Z.emit("wsClientError",K,X,J)}else WH(X,Y,$,Q)}});var F90=O((z90)=>{Object.defineProperty(z90,"__esModule",{value:!0});z90.default=void 0;var Xm6=z90.default="ffffffff-ffff-ffff-ffff-ffffffffffff"});var L90=O((q90)=>{Object.defineProperty(q90,"__esModule",{value:!0});q90.default=void 0;var $m6=q90.default="00000000-0000-0000-0000-000000000000"});var O90=O((B90)=>{Object.defineProperty(B90,"__esModule",{value:!0});B90.default=void 0;var Km6=B90.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});var GH=O((R90)=>{Object.defineProperty(R90,"__esModule",{value:!0});R90.default=void 0;var pf1=if1(O90());function if1(Z){return Z&&Z.__esModule?Z:{default:Z}}function nf1(Z){return typeof Z==="string"&&pf1.default.test(Z)}var Gm6=R90.default=nf1});var VH=O((N90)=>{Object.defineProperty(N90,"__esModule",{value:!0});N90.default=void 0;var af1=sf1(GH());function sf1(Z){return Z&&Z.__esModule?Z:{default:Z}}function of1(Z){if(!af1.default(Z))throw TypeError("Invalid UUID");let J,X=new Uint8Array(16);return X[0]=(J=parseInt(Z.slice(0,8),16))>>>24,X[1]=J>>>16&255,X[2]=J>>>8&255,X[3]=J&255,X[4]=(J=parseInt(Z.slice(9,13),16))>>>8,X[5]=J&255,X[6]=(J=parseInt(Z.slice(14,18),16))>>>8,X[7]=J&255,X[8]=(J=parseInt(Z.slice(19,23),16))>>>8,X[9]=J&255,X[10]=(J=parseInt(Z.slice(24,36),16))/1099511627776&255,X[11]=J/4294967296&255,X[12]=J>>>24&255,X[13]=J>>>16&255,X[14]=J>>>8&255,X[15]=J&255,X}var zm6=N90.default=of1});var iZ=O((P90)=>{Object.defineProperty(P90,"__esModule",{value:!0});P90.default=void 0;P90.unsafeStringify=D90;var rf1=tf1(GH());function tf1(Z){return Z&&Z.__esModule?Z:{default:Z}}var M6=[];for(let Z=0;Z<256;++Z)M6.push((Z+256).toString(16).slice(1));function D90(Z,J=0){return(M6[Z[J+0]]+M6[Z[J+1]]+M6[Z[J+2]]+M6[Z[J+3]]+"-"+M6[Z[J+4]]+M6[Z[J+5]]+"-"+M6[Z[J+6]]+M6[Z[J+7]]+"-"+M6[Z[J+8]]+M6[Z[J+9]]+"-"+M6[Z[J+10]]+M6[Z[J+11]]+M6[Z[J+12]]+M6[Z[J+13]]+M6[Z[J+14]]+M6[Z[J+15]]).toLowerCase()}function ef1(Z,J=0){let X=D90(Z,J);if(!rf1.default(X))throw TypeError("Stringified UUID is invalid");return X}var Fm6=P90.default=ef1});var QO=O((T90)=>{Object.defineProperty(T90,"__esModule",{value:!0});T90.default=Yy1;var Jy1=Xy1(m("node:crypto"));function Xy1(Z){return Z&&Z.__esModule?Z:{default:Z}}var $O=new Uint8Array(256),YO=$O.length;function Yy1(){if(YO>$O.length-16)Jy1.default.randomFillSync($O),YO=0;return $O.slice(YO,YO+=16)}});var O_=O((E90)=>{Object.defineProperty(E90,"__esModule",{value:!0});E90.default=void 0;var Qy1=Wy1(QO()),Ky1=iZ();function Wy1(Z){return Z&&Z.__esModule?Z:{default:Z}}var L_,KO,B_=0,w_=0;function Gy1(Z,J,X){let Y=J&&X||0,$=J||new Array(16);Z=Z||{};let{node:Q,clockseq:K}=Z;if(!Z._v6){if(!Q)Q=L_;if(K==null)K=KO}if(Q==null||K==null){let H=Z.random||(Z.rng||Qy1.default)();if(Q==null){if(Q=[H[0],H[1],H[2],H[3],H[4],H[5]],!L_&&!Z._v6)Q[0]|=1,L_=Q}if(K==null){if(K=(H[6]<<8|H[7])&16383,KO===void 0&&!Z._v6)KO=K}}let W=Z.msecs!==void 0?Z.msecs:Date.now(),G=Z.nsecs!==void 0?Z.nsecs:w_+1,V=W-B_+(G-w_)/1e4;if(V<0&&Z.clockseq===void 0)K=K+1&16383;if((V<0||W>B_)&&Z.nsecs===void 0)G=0;if(G>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");B_=W,w_=G,KO=K,W+=12219292800000;let z=((W&268435455)*1e4+G)%4294967296;$[Y++]=z>>>24&255,$[Y++]=z>>>16&255,$[Y++]=z>>>8&255,$[Y++]=z&255;let F=W/4294967296*1e4&268435455;$[Y++]=F>>>8&255,$[Y++]=F&255,$[Y++]=F>>>24&15|16,$[Y++]=F>>>16&255,$[Y++]=K>>>8|128,$[Y++]=K&255;for(let H=0;H<6;++H)$[Y+H]=Q[H];return J||Ky1.unsafeStringify($)}var Lm6=E90.default=Gy1});var R_=O((I90)=>{Object.defineProperty(I90,"__esModule",{value:!0});I90.default=Fy1;var Vy1=Hy1(VH()),zy1=iZ();function Hy1(Z){return Z&&Z.__esModule?Z:{default:Z}}function Fy1(Z){let J=typeof Z==="string"?Vy1.default(Z):Z,X=qy1(J);return typeof Z==="string"?zy1.unsafeStringify(X):X}function qy1(Z,J=!1){return Uint8Array.of((Z[6]&15)<<4|Z[7]>>4&15,(Z[7]&15)<<4|(Z[4]&240)>>4,(Z[4]&15)<<4|(Z[5]&240)>>4,(Z[5]&15)<<4|(Z[0]&240)>>4,(Z[0]&15)<<4|(Z[1]&240)>>4,(Z[1]&15)<<4|(Z[2]&240)>>4,96|Z[2]&15,Z[3],Z[8],Z[9],Z[10],Z[11],Z[12],Z[13],Z[14],Z[15])}});var M_=O((_90)=>{Object.defineProperty(_90,"__esModule",{value:!0});_90.URL=_90.DNS=void 0;_90.default=Ny1;var Ly1=iZ(),By1=wy1(VH());function wy1(Z){return Z&&Z.__esModule?Z:{default:Z}}function Oy1(Z){Z=unescape(encodeURIComponent(Z));let J=[];for(let X=0;X<Z.length;++X)J.push(Z.charCodeAt(X));return J}var Ry1=_90.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",My1=_90.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Ny1(Z,J,X){function Y($,Q,K,W){var G;if(typeof $==="string")$=Oy1($);if(typeof Q==="string")Q=By1.default(Q);if(((G=Q)===null||G===void 0?void 0:G.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let V=new Uint8Array(16+$.length);if(V.set(Q),V.set($,Q.length),V=X(V),V[6]=V[6]&15|J,V[8]=V[8]&63|128,K){W=W||0;for(let z=0;z<16;++z)K[W+z]=V[z];return K}return Ly1.unsafeStringify(V)}try{Y.name=Z}catch($){}return Y.DNS=Ry1,Y.URL=My1,Y}});var x90=O((S90)=>{Object.defineProperty(S90,"__esModule",{value:!0});S90.default=void 0;var Py1=Cy1(m("node:crypto"));function Cy1(Z){return Z&&Z.__esModule?Z:{default:Z}}function Ty1(Z){if(Array.isArray(Z))Z=Buffer.from(Z);else if(typeof Z==="string")Z=Buffer.from(Z,"utf8");return Py1.default.createHash("md5").update(Z).digest()}var Rm6=S90.default=Ty1});var b90=O((f90)=>{Object.defineProperty(f90,"__esModule",{value:!0});f90.default=void 0;var Ey1=h90(M_()),ky1=h90(x90());function h90(Z){return Z&&Z.__esModule?Z:{default:Z}}var Iy1=Ey1.default("v3",48,ky1.default),Nm6=f90.default=Iy1});var u90=O((g90)=>{Object.defineProperty(g90,"__esModule",{value:!0});g90.default=void 0;var _y1=vy1(m("node:crypto"));function vy1(Z){return Z&&Z.__esModule?Z:{default:Z}}var Dm6=g90.default={randomUUID:_y1.default.randomUUID}});var i90=O((l90)=>{Object.defineProperty(l90,"__esModule",{value:!0});l90.default=void 0;var d90=c90(u90()),Sy1=c90(QO()),Ay1=iZ();function c90(Z){return Z&&Z.__esModule?Z:{default:Z}}function xy1(Z,J,X){if(d90.default.randomUUID&&!J&&!Z)return d90.default.randomUUID();Z=Z||{};let Y=Z.random||(Z.rng||Sy1.default)();if(Y[6]=Y[6]&15|64,Y[8]=Y[8]&63|128,J){X=X||0;for(let $=0;$<16;++$)J[X+$]=Y[$];return J}return Ay1.unsafeStringify(Y)}var Cm6=l90.default=xy1});var s90=O((n90)=>{Object.defineProperty(n90,"__esModule",{value:!0});n90.default=void 0;var hy1=fy1(m("node:crypto"));function fy1(Z){return Z&&Z.__esModule?Z:{default:Z}}function yy1(Z){if(Array.isArray(Z))Z=Buffer.from(Z);else if(typeof Z==="string")Z=Buffer.from(Z,"utf8");return hy1.default.createHash("sha1").update(Z).digest()}var Em6=n90.default=yy1});var e90=O((r90)=>{Object.defineProperty(r90,"__esModule",{value:!0});r90.default=void 0;var by1=o90(M_()),gy1=o90(s90());function o90(Z){return Z&&Z.__esModule?Z:{default:Z}}var my1=by1.default("v5",80,gy1.default),Im6=r90.default=my1});var X40=O((J40)=>{Object.defineProperty(J40,"__esModule",{value:!0});J40.default=ly1;var uy1=iZ(),dy1=Z40(O_()),cy1=Z40(R_());function Z40(Z){return Z&&Z.__esModule?Z:{default:Z}}function ly1(Z={},J,X=0){let Y=dy1.default({...Z,_v6:!0},new Uint8Array(16));if(Y=cy1.default(Y),J){for(let $=0;$<16;$++)J[X+$]=Y[$];return J}return uy1.unsafeStringify(Y)}});var $40=O((Y40)=>{Object.defineProperty(Y40,"__esModule",{value:!0});Y40.default=sy1;var iy1=ay1(VH()),ny1=iZ();function ay1(Z){return Z&&Z.__esModule?Z:{default:Z}}function sy1(Z){let J=typeof Z==="string"?iy1.default(Z):Z,X=oy1(J);return typeof Z==="string"?ny1.unsafeStringify(X):X}function oy1(Z){return Uint8Array.of((Z[3]&15)<<4|Z[4]>>4&15,(Z[4]&15)<<4|(Z[5]&240)>>4,(Z[5]&15)<<4|Z[6]&15,Z[7],(Z[1]&15)<<4|(Z[2]&240)>>4,(Z[2]&15)<<4|(Z[3]&240)>>4,16|(Z[0]&240)>>4,(Z[0]&15)<<4|(Z[1]&240)>>4,Z[8],Z[9],Z[10],Z[11],Z[12],Z[13],Z[14],Z[15])}});var V40=O((W40)=>{Object.defineProperty(W40,"__esModule",{value:!0});W40.default=void 0;var ty1=Zb1(QO()),ey1=iZ();function Zb1(Z){return Z&&Z.__esModule?Z:{default:Z}}var Q40=null,K40=null,c4=0;function Jb1(Z,J,X){Z=Z||{};let Y=J&&X||0,$=J||new Uint8Array(16),Q=Z.random||(Z.rng||ty1.default)(),K=Z.msecs!==void 0?Z.msecs:Date.now(),W=Z.seq!==void 0?Z.seq:null,G=K40,V=Q40;if(K>c4&&Z.msecs===void 0){if(c4=K,W!==null)G=null,V=null}if(W!==null){if(W>2147483647)W=2147483647;G=W>>>19&4095,V=W&524287}if(G===null||V===null)G=Q[6]&127,G=G<<8|Q[7],V=Q[8]&63,V=V<<8|Q[9],V=V<<5|Q[10]>>>3;if(K+1e4>c4&&W===null){if(++V>524287){if(V=0,++G>4095)G=0,c4++}}else c4=K;return K40=G,Q40=V,$[Y++]=c4/1099511627776&255,$[Y++]=c4/4294967296&255,$[Y++]=c4/16777216&255,$[Y++]=c4/65536&255,$[Y++]=c4/256&255,$[Y++]=c4&255,$[Y++]=G>>>4&15|112,$[Y++]=G&255,$[Y++]=V>>>13&63|128,$[Y++]=V>>>5&255,$[Y++]=V<<3&255|Q[10]&7,$[Y++]=Q[11],$[Y++]=Q[12],$[Y++]=Q[13],$[Y++]=Q[14],$[Y++]=Q[15],J||ey1.unsafeStringify($)}var Am6=W40.default=Jb1});var F40=O((z40)=>{Object.defineProperty(z40,"__esModule",{value:!0});z40.default=void 0;var Xb1=Yb1(GH());function Yb1(Z){return Z&&Z.__esModule?Z:{default:Z}}function $b1(Z){if(!Xb1.default(Z))throw TypeError("Invalid UUID");return parseInt(Z.slice(14,15),16)}var hm6=z40.default=$b1});var q40=O((y6)=>{Object.defineProperty(y6,"__esModule",{value:!0});Object.defineProperty(y6,"MAX",{enumerable:!0,get:function(){return Qb1.default}});Object.defineProperty(y6,"NIL",{enumerable:!0,get:function(){return Kb1.default}});Object.defineProperty(y6,"parse",{enumerable:!0,get:function(){return Wb1.default}});Object.defineProperty(y6,"stringify",{enumerable:!0,get:function(){return Gb1.default}});Object.defineProperty(y6,"v1",{enumerable:!0,get:function(){return Vb1.default}});Object.defineProperty(y6,"v1ToV6",{enumerable:!0,get:function(){return zb1.default}});Object.defineProperty(y6,"v3",{enumerable:!0,get:function(){return Hb1.default}});Object.defineProperty(y6,"v4",{enumerable:!0,get:function(){return Fb1.default}});Object.defineProperty(y6,"v5",{enumerable:!0,get:function(){return qb1.default}});Object.defineProperty(y6,"v6",{enumerable:!0,get:function(){return Ub1.default}});Object.defineProperty(y6,"v6ToV1",{enumerable:!0,get:function(){return Lb1.default}});Object.defineProperty(y6,"v7",{enumerable:!0,get:function(){return Bb1.default}});Object.defineProperty(y6,"validate",{enumerable:!0,get:function(){return wb1.default}});Object.defineProperty(y6,"version",{enumerable:!0,get:function(){return Ob1.default}});var Qb1=y5(F90()),Kb1=y5(L90()),Wb1=y5(VH()),Gb1=y5(iZ()),Vb1=y5(O_()),zb1=y5(R_()),Hb1=y5(b90()),Fb1=y5(i90()),qb1=y5(e90()),Ub1=y5(X40()),Lb1=y5($40()),Bb1=y5(V40()),wb1=y5(GH()),Ob1=y5(F40());function y5(Z){return Z&&Z.__esModule?Z:{default:Z}}});var d7=O((Su6,r40)=>{/*!
35
35
  * depd
36
36
  * Copyright(c) 2014-2018 Douglas Christopher Wilson
37
37
  * MIT Licensed
@@ -457,12 +457,12 @@ qYGMwU/HBVHkLAn5XvT2a9xM0mzZ558d+ahbw8qAgRxg7BZ+2PW/bf7F2WRBUk1f
457
457
  xauhAoGBALEspoxQozwohGQnP7EMF0/0JoKNpdNv0b0qCVvNiMo0+N297lI2mFQp
458
458
  6xYlW/1l9afLokklF/J2IsyBrTCZoY7SaEk/lMMrQSyra+y0z71ogZ8A4ny9fxsj
459
459
  0dDYJZGllL+3E/MQfd7k+KnOM/+A+cPoAnci76+L3vdkUb2P8SJk
460
- -----END RSA PRIVATE KEY-----`;var iS=process.env.PORT??8080,nS="0.8.7-prerelease-2",aS;(($)=>{$.READY="WEBSERVER.READY";$.STOPPED="WEBSERVER.STOPPED";$.ERROR="WEBSERVER.ERROR";$.UPGRADE="WEBSERVER.UPGRADE"})(aS||={});class FG extends R0{static instance=new FG;_webserver=jR.default();_internalHttpServer;constructor(){super();this._webserver.use((Z,J,X)=>{J.header("Access-Control-Allow-Origin","*"),X()}),this._webserver.get("/",(Z,J)=>{J.json({status:"OK",version:nS,runtime:"Bun"in globalThis?"bun":("Deno"in globalThis)?"deno":"node"})}),this._webserver.use(jR.default.static("assets"));try{this._webserver.use(jR.default.static(do1.dirname(m.resolve("/Users/arkdev/Desktop/HYTOPIA/hytopia/assets/release/index.js"))))}catch{}}start(){if(!this._internalHttpServer)this._internalHttpServer=process.env.NODE_ENV==="production"?mo1.createServer(this._webserver):uo1.createServer({key:NR.existsSync("assets/certs/localhost.key")?NR.readFileSync("assets/certs/localhost.key"):IK0,cert:NR.existsSync("assets/certs/localhost.crt")?NR.readFileSync("assets/certs/localhost.crt"):kK0},this._webserver),this._internalHttpServer.on("upgrade",this._onUpgrade),this._internalHttpServer.on("error",this._onError),this._internalHttpServer.on("close",this._onStopped);else c.warning("WebServer.start(): server already started!");this._internalHttpServer.listen(iS,this._onStarted),console.info(`WebServer.start(): Server running on port ${iS}.`)}stop(){if(this._internalHttpServer)return new Promise((Z,J)=>{this._internalHttpServer.close((X)=>{if(X)J(X);else Z(!0)})});else return c.warning("WebServer.stop(): server not started."),Promise.resolve(!1)}_onStarted=()=>{this.emitWithGlobal("WEBSERVER.READY",{})};_onUpgrade=async(Z,J,X)=>{let Y=co1.parse(Z.url??"",!0).query,$=Y.connectionId?.toString(),Q=Y.sessionToken?.toString()??"";if($&&s7.instance.isValidConnectionId($))Z.connectionId=$;else{let K=await y7.instance.getPlayerSession(Q);if(K?.error){let W=`${K.error.code}: ${K.error.message}`;J.write(`HTTP/1.1 401 Unauthorized\r
460
+ -----END RSA PRIVATE KEY-----`;var iS=process.env.PORT??8080,nS="0.8.8",aS;(($)=>{$.READY="WEBSERVER.READY";$.STOPPED="WEBSERVER.STOPPED";$.ERROR="WEBSERVER.ERROR";$.UPGRADE="WEBSERVER.UPGRADE"})(aS||={});class FG extends R0{static instance=new FG;_webserver=jR.default();_internalHttpServer;constructor(){super();this._webserver.use((Z,J,X)=>{J.header("Access-Control-Allow-Origin","*"),X()}),this._webserver.get("/",(Z,J)=>{J.json({status:"OK",version:nS,runtime:"Bun"in globalThis?"bun":("Deno"in globalThis)?"deno":"node"})}),this._webserver.use(jR.default.static("assets"));try{this._webserver.use(jR.default.static(do1.dirname(m.resolve("/Users/arkdev/Desktop/HYTOPIA/hytopia/assets/release/index.js"))))}catch{}}start(){if(!this._internalHttpServer)this._internalHttpServer=process.env.NODE_ENV==="production"?mo1.createServer(this._webserver):uo1.createServer({key:NR.existsSync("assets/certs/localhost.key")?NR.readFileSync("assets/certs/localhost.key"):IK0,cert:NR.existsSync("assets/certs/localhost.crt")?NR.readFileSync("assets/certs/localhost.crt"):kK0},this._webserver),this._internalHttpServer.on("upgrade",this._onUpgrade),this._internalHttpServer.on("error",this._onError),this._internalHttpServer.on("close",this._onStopped);else c.warning("WebServer.start(): server already started!");this._internalHttpServer.listen(iS,this._onStarted),console.info(`WebServer.start(): Server running on port ${iS}.`)}stop(){if(this._internalHttpServer)return new Promise((Z,J)=>{this._internalHttpServer.close((X)=>{if(X)J(X);else Z(!0)})});else return c.warning("WebServer.stop(): server not started."),Promise.resolve(!1)}_onStarted=()=>{this.emitWithGlobal("WEBSERVER.READY",{})};_onUpgrade=async(Z,J,X)=>{let Y=co1.parse(Z.url??"",!0).query,$=Y.connectionId?.toString(),Q=Y.sessionToken?.toString()??"";if($&&s7.instance.isValidConnectionId($))Z.connectionId=$;else{let K=await y7.instance.getPlayerSession(Q);if(K?.error){let W=`${K.error.code}: ${K.error.message}`;J.write(`HTTP/1.1 401 Unauthorized\r
461
461
  Content-Type: text/plain\r
462
462
  Content-Length: ${W.length}\r
463
463
  Connection: close\r
464
464
  \r
465
- ${W}`),J.end();return}if(K)Z.session=K}J.setNoDelay(!0),this.emitWithGlobal("WEBSERVER.UPGRADE",{req:Z,socket:J,head:X})};_onError=(Z)=>{c.error(`WebServer._onError(): ${Z.message}`),this.emitWithGlobal("WEBSERVER.ERROR",{error:Z})};_onStopped=()=>{this.emitWithGlobal("WEBSERVER.STOPPED",{})}}class s7 extends R0{static instance=new s7;_connectionIdConnections=new Map;_userIdConnections=new Map;_wss;_wrtcMinPort=process.env.WRTC_MIN_PORT?parseInt(process.env.WRTC_MIN_PORT):40000;_wrtcMaxPort=process.env.WRTC_MAX_PORT?parseInt(process.env.WRTC_MAX_PORT):41023;_wrtcPublicIpv4=process.env.NODE_ENV==="production"?process.env.WRTC_PUBLIC_IPV4:"127.0.0.1";_wrtcPublicIpv6=process.env.NODE_ENV==="production"?process.env.WRTC_PUBLIC_IPV6:"::";_wrtcRouter=null;_wrtcWorker=null;constructor(){super();this._wss=new U_.default({noServer:!0}),this._wss.on("connection",this._onConnection),this._wss.on("error",this._onError),this._initWrtc().catch((Z)=>{c.warning(`Socket._constructor(): Failed to initialize WebRTC, falling back to Websockets. This can be ignored for local development. Error: ${Z.message}`)}),R0.globalInstance.on("WEBSERVER.UPGRADE",({req:Z,socket:J,head:X})=>{this._onUpgrade(Z,J,X)})}get isWrtcEnabled(){return this._wrtcWorker&&!this._wrtcWorker.died&&this._wrtcRouter}get wrtcRouter(){return this._wrtcRouter}async createWrtcTransports(){if(!this.isWrtcEnabled)c.fatalError("Socket.createWrtcTransports(): WebRTC not enabled, unable to create transports.");let Z={listenIps:[{ip:"::",announcedIp:this._wrtcPublicIpv6},{ip:"0.0.0.0",announcedIp:this._wrtcPublicIpv4}],preferUdp:!0,enableSctp:!0,enableTcp:!1},J=await this._wrtcRouter.createDirectTransport(),X=await this._wrtcRouter.createWebRtcTransport(Z),Y=await this._wrtcRouter.createWebRtcTransport(Z);return{directTransport:J,clientServerTransport:X,serverClientTransport:Y}}isValidConnectionId(Z){return this._connectionIdConnections.has(Z)}async _initWrtc(){if(!this._wrtcPublicIpv4||!this._wrtcPublicIpv6)throw new Error("Socket._initWrtc(): WebRTC disabled, falling back to Websockets. Env variables WRTC_PUBLIC_IPV4 and WRTC_PUBLIC_IPV6 must be set in production");let Z=await import("mediasoup");this._wrtcWorker=await Z.createWorker({rtcMinPort:this._wrtcMinPort,rtcMaxPort:this._wrtcMaxPort}),this._wrtcWorker.on("died",this._onWrtcWorkerDied),this._wrtcRouter=await this._wrtcWorker.createRouter({mediaCodecs:[]}),console.log("Socket._initWrtc(): WebRTC enabled and ready!")}_onConnection=(Z,J)=>{let X=J.connectionId,Y=J.session?.user.id,$=(X&&this._connectionIdConnections.get(X))??(Y&&this._userIdConnections.get(Y));if($)$.bindWs(Z);else{let Q=new n4(Z,J);if(Q.on("CONNECTION.CLOSED",()=>{if(this._connectionIdConnections.delete(Q.id),Y)this._userIdConnections.delete(Y)}),this._connectionIdConnections.set(Q.id,Q),Y)this._userIdConnections.set(Y,Q)}};_onError=(Z,J)=>{this.emitWithGlobal("SOCKET.ERROR",{ws:Z,error:J})};_onUpgrade=(Z,J,X)=>{this._wss.handleUpgrade(Z,J,X,(Y)=>{this._wss.emit("connection",Y,Z)})};_onWrtcWorkerDied=(Z)=>{c.warning(`Socket._onWrtcWorkerDied(): WebRTC worker unexpectedly died, falling back to Websockets for all players. Internal error: ${Z}`),U9.instance.getConnectedPlayers().forEach((J)=>{J.connection.closeWrtc()}),this._wrtcRouter?.close(),this._wrtcRouter=null,this._wrtcWorker?.close(),this._wrtcWorker=null}}var Bm={};HK(Bm,{zodErrorsIntegration:()=>Bx,wrapMcpServerWithSentry:()=>Nx,withScope:()=>O9,withMonitor:()=>r7,withIsolationScope:()=>XJ,withActiveSpan:()=>yX,vercelAIIntegration:()=>aj,validateOpenTelemetrySetup:()=>Lm,updateSpanName:()=>zA,trpcMiddleware:()=>Ox,tediousIntegration:()=>dj,suppressTracing:()=>kF,supabaseIntegration:()=>Lx,startSpanManual:()=>EF,startSpan:()=>Z4,startSession:()=>hF,startNewTrace:()=>_A,startInactiveSpan:()=>kA,spotlightIntegration:()=>yj,spanToTraceHeader:()=>OF,spanToJSON:()=>w0,spanToBaggageHeader:()=>OA,setupKoaErrorHandler:()=>fK1,setupHapiErrorHandler:()=>zK1,setupFastifyErrorHandler:()=>DJ1,setupExpressErrorHandler:()=>vZ1,setupConnectErrorHandler:()=>QW1,setUser:()=>mA,setTags:()=>bA,setTag:()=>gA,setNodeAsyncContextStrategy:()=>EN,setMeasurement:()=>TA,setHttpStatus:()=>MG,setExtras:()=>fA,setExtra:()=>yA,setCurrentClient:()=>Zx,setContext:()=>hA,rewriteFramesIntegration:()=>Ux,requestDataIntegration:()=>gF,redisIntegration:()=>Nj,profiler:()=>wx,prismaIntegration:()=>Ej,preloadOpenTelemetry:()=>L31,postgresIntegration:()=>Cj,parameterize:()=>sR,onUnhandledRejectionIntegration:()=>pN,onUncaughtExceptionIntegration:()=>lN,nodeContextIntegration:()=>bN,nativeNodeFetchIntegration:()=>hN,mysqlIntegration:()=>wj,mysql2Integration:()=>Rj,mongooseIntegration:()=>Lj,mongoIntegration:()=>qj,modulesIntegration:()=>cN,makeNodeTransport:()=>JD,lruMemoizerIntegration:()=>Fj,logger:()=>Cx,localVariablesIntegration:()=>dN,linkedErrorsIntegration:()=>bF,lastEventId:()=>uA,koaIntegration:()=>xj,knexIntegration:()=>kW1,kafkaIntegration:()=>Hj,isInitialized:()=>AF,instrumentSupabaseClient:()=>JM,initWithoutDefaultIntegrations:()=>w31,initOpenTelemetry:()=>KD,init:()=>WD,inboundFiltersIntegration:()=>yF,httpIntegration:()=>vN,hapiIntegration:()=>vj,graphqlIntegration:()=>zj,getTraceMetaTags:()=>$x,getTraceData:()=>QJ,getSpanStatusFromHttpCode:()=>RG,getSpanDescendants:()=>RF,getSentryRelease:()=>$D,getRootSpan:()=>p1,getIsolationScope:()=>A0,getGlobalScope:()=>JJ,getDefaultIntegrationsWithoutPerformance:()=>qm,getDefaultIntegrations:()=>Um,getCurrentScope:()=>l0,getClient:()=>$0,getAutoPerformanceIntegrations:()=>tj,getActiveSpan:()=>e4,genericPoolIntegration:()=>cj,generateInstrumentOnce:()=>P0,functionToStringIntegration:()=>fF,fsIntegration:()=>v71,flush:()=>dA,fastifyIntegration:()=>Kj,extraErrorDataIntegration:()=>Vx,expressIntegration:()=>rN,expressErrorHandler:()=>yb,eventFiltersIntegration:()=>rR,endSession:()=>FQ,disableAnrDetectionForCallback:()=>o71,defaultStackParser:()=>QD,dedupeIntegration:()=>Gx,dataloaderIntegration:()=>RG1,cron:()=>D31,createTransport:()=>EG,createSentryWinstonTransport:()=>lG1,createGetModuleFromFilename:()=>YD,continueTrace:()=>IA,contextLinesIntegration:()=>gN,consoleLoggingIntegration:()=>Dx,consoleIntegration:()=>mF,connectIntegration:()=>fj,close:()=>cA,childProcessIntegration:()=>sj,captureSession:()=>pA,captureMessage:()=>TG,captureFeedback:()=>jx,captureException:()=>q1,captureEvent:()=>SF,captureConsoleIntegration:()=>Wx,captureCheckIn:()=>vF,anrIntegration:()=>s71,amqplibIntegration:()=>ij,addIntegration:()=>sA,addEventProcessor:()=>lA,addBreadcrumb:()=>q5,SentryContextManager:()=>rj,Scope:()=>N6,SEMANTIC_ATTRIBUTE_SENTRY_SOURCE:()=>h1,SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE:()=>e9,SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN:()=>I0,SEMANTIC_ATTRIBUTE_SENTRY_OP:()=>M0,SDK_VERSION:()=>L8,NodeClient:()=>GU});var Cx={};HK(Cx,{warn:()=>Ce1,trace:()=>je1,info:()=>Pe1,fmt:()=>Xx,fatal:()=>Ee1,error:()=>Te1,debug:()=>De1});import{format as Ne1}from"node:util";var e=typeof __SENTRY_DEBUG__==="undefined"||__SENTRY_DEBUG__;var L8="9.22.0";var O0=globalThis;function b6(){return TX(O0),O0}function TX(Z){let J=Z.__SENTRY__=Z.__SENTRY__||{};return J.version=J.version||L8,J[L8]=J[L8]||{}}function ZQ(Z,J,X=O0){let Y=X.__SENTRY__=X.__SENTRY__||{},$=Y[L8]=Y[L8]||{};return $[Z]||($[Z]=J())}var _K0=Object.prototype.toString;function a4(Z){switch(_K0.call(Z)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return tZ(Z,Error)}}function DR(Z,J){return _K0.call(Z)===`[object ${J}]`}function vK0(Z){return DR(Z,"ErrorEvent")}function JQ(Z){return DR(Z,"String")}function XQ(Z){return typeof Z==="object"&&Z!==null&&"__sentry_template_string__"in Z&&"__sentry_template_values__"in Z}function qF(Z){return Z===null||XQ(Z)||typeof Z!=="object"&&typeof Z!=="function"}function s9(Z){return DR(Z,"Object")}function SK0(Z){return typeof Event!=="undefined"&&tZ(Z,Event)}function AK0(Z){return typeof Element!=="undefined"&&tZ(Z,Element)}function xK0(Z){return DR(Z,"RegExp")}function o9(Z){return Boolean(Z?.then&&typeof Z.then==="function")}function hK0(Z){return s9(Z)&&"nativeEvent"in Z&&"preventDefault"in Z&&"stopPropagation"in Z}function tZ(Z,J){try{return Z instanceof J}catch(X){return!1}}function PR(Z){return!!(typeof Z==="object"&&Z!==null&&(Z.__isVue||Z._isVue))}var po1=O0,io1=80;function fK0(Z,J={}){if(!Z)return"<unknown>";try{let X=Z,Y=5,$=[],Q=0,K=0,W=" > ",G=W.length,V,z=Array.isArray(J)?J:J.keyAttrs,F=!Array.isArray(J)&&J.maxStringLength||io1;while(X&&Q++<Y){if(V=no1(X,z),V==="html"||Q>1&&K+$.length*G+V.length>=F)break;$.push(V),K+=V.length,X=X.parentNode}return $.reverse().join(W)}catch(X){return"<unknown>"}}function no1(Z,J){let X=Z,Y=[];if(!X?.tagName)return"";if(po1.HTMLElement){if(X instanceof HTMLElement&&X.dataset){if(X.dataset.sentryComponent)return X.dataset.sentryComponent;if(X.dataset.sentryElement)return X.dataset.sentryElement}}Y.push(X.tagName.toLowerCase());let $=J?.length?J.filter((K)=>X.getAttribute(K)).map((K)=>[K,X.getAttribute(K)]):null;if($?.length)$.forEach((K)=>{Y.push(`[${K[0]}="${K[1]}"]`)});else{if(X.id)Y.push(`#${X.id}`);let K=X.className;if(K&&JQ(K)){let W=K.split(/\s+/);for(let G of W)Y.push(`.${G}`)}}let Q=["aria-label","type","name","title","alt"];for(let K of Q){let W=X.getAttribute(K);if(W)Y.push(`[${K}="${W}"]`)}return Y.join("")}var ao1="Sentry Logger ",s4=["debug","info","warn","error","log","assert","trace"],qG={};function $8(Z){if(!("console"in O0))return Z();let J=O0.console,X={},Y=Object.keys(qG);Y.forEach(($)=>{let Q=qG[$];X[$]=J[$],J[$]=Q});try{return Z()}finally{Y.forEach(($)=>{J[$]=X[$]})}}function so1(){let Z=!1,J={enable:()=>{Z=!0},disable:()=>{Z=!1},isEnabled:()=>Z};if(e)s4.forEach((X)=>{J[X]=(...Y)=>{if(Z)$8(()=>{O0.console[X](`${ao1}[${X}]:`,...Y)})}});else s4.forEach((X)=>{J[X]=()=>{return}});return J}var g=ZQ("logger",so1);function c5(Z,J=0){if(typeof Z!=="string"||J===0)return Z;return Z.length<=J?Z:`${Z.slice(0,J)}...`}function sS(Z,J){let X=Z,Y=X.length;if(Y<=150)return X;if(J>Y)J=Y;let $=Math.max(J-60,0);if($<5)$=0;let Q=Math.min($+140,Y);if(Q>Y-5)Q=Y;if(Q===Y)$=Math.max(Q-140,0);if(X=X.slice($,Q),$>0)X=`'{snip} ${X}`;if(Q<Y)X+=" {snip}";return X}function EX(Z,J){if(!Array.isArray(Z))return"";let X=[];for(let Y=0;Y<Z.length;Y++){let $=Z[Y];try{if(PR($))X.push("[VueViewModel]");else X.push(String($))}catch(Q){X.push("[value cannot be serialized]")}}return X.join(J)}function yK0(Z,J,X=!1){if(!JQ(Z))return!1;if(xK0(J))return J.test(Z);if(JQ(J))return X?Z===J:Z.includes(J);return!1}function kX(Z,J=[],X=!1){return J.some((Y)=>yK0(Z,Y,X))}function oS(Z,J,X){if(!(J in Z))return;let Y=Z[J];if(typeof Y!=="function")return;let $=X(Y);if(typeof $==="function")mK0($,Y);try{Z[J]=$}catch{e&&g.log(`Failed to replace method "${J}" in object`,Z)}}function B8(Z,J,X){try{Object.defineProperty(Z,J,{value:X,writable:!0,configurable:!0})}catch(Y){e&&g.log(`Failed to add non-enumerable property "${J}" to object`,Z)}}function mK0(Z,J){try{let X=J.prototype||{};Z.prototype=J.prototype=X,B8(Z,"__sentry_original__",J)}catch(X){}}function rS(Z){return Z.__sentry_original__}function CR(Z){if(a4(Z))return{message:Z.message,name:Z.name,stack:Z.stack,...gK0(Z)};else if(SK0(Z)){let J={type:Z.type,target:bK0(Z.target),currentTarget:bK0(Z.currentTarget),...gK0(Z)};if(typeof CustomEvent!=="undefined"&&tZ(Z,CustomEvent))J.detail=Z.detail;return J}else return Z}function bK0(Z){try{return AK0(Z)?fK0(Z):Object.prototype.toString.call(Z)}catch(J){return"<unknown>"}}function gK0(Z){if(typeof Z==="object"&&Z!==null){let J={};for(let X in Z)if(Object.prototype.hasOwnProperty.call(Z,X))J[X]=Z[X];return J}else return{}}function tS(Z,J=40){let X=Object.keys(CR(Z));X.sort();let Y=X[0];if(!Y)return"[object has no keys]";if(Y.length>=J)return c5(Y,J);for(let $=X.length;$>0;$--){let Q=X.slice(0,$).join(", ");if(Q.length>J)continue;if($===X.length)return Q;return c5(Q,J)}return""}function oo1(){let Z=O0;return Z.crypto||Z.msCrypto}function v8(Z=oo1()){let J=()=>Math.random()*16;try{if(Z?.randomUUID)return Z.randomUUID().replace(/-/g,"");if(Z?.getRandomValues)J=()=>{let X=new Uint8Array(1);return Z.getRandomValues(X),X[0]}}catch(X){}return([1e7]+1000+4000+8000+100000000000).replace(/[018]/g,(X)=>(X^(J()&15)>>X/4).toString(16))}function uK0(Z){return Z.exception?.values?.[0]}function IX(Z){let{message:J,event_id:X}=Z;if(J)return J;let Y=uK0(Z);if(Y){if(Y.type&&Y.value)return`${Y.type}: ${Y.value}`;return Y.type||Y.value||X||"<unknown>"}return X||"<unknown>"}function ZA(Z,J,X){let Y=Z.exception=Z.exception||{},$=Y.values=Y.values||[],Q=$[0]=$[0]||{};if(!Q.value)Q.value=J||"";if(!Q.type)Q.type=X||"Error"}function _X(Z,J){let X=uK0(Z);if(!X)return;let Y={type:"generic",handled:!0},$=X.mechanism;if(X.mechanism={...Y,...$,...J},J&&"data"in J){let Q={...$?.data,...J.data};X.mechanism.data=Q}}var ro1=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function eS(Z){return parseInt(Z||"",10)}function JA(Z){let J=Z.match(ro1)||[],X=eS(J[1]),Y=eS(J[2]),$=eS(J[3]);return{buildmetadata:J[5],major:isNaN(X)?void 0:X,minor:isNaN(Y)?void 0:Y,patch:isNaN($)?void 0:$,prerelease:J[4]}}function TR(Z){if(to1(Z))return!0;try{B8(Z,"__sentry_captured__",!0)}catch(J){}return!1}function to1(Z){try{return Z.__sentry_captured__}catch{}}var dK0=1000;function eZ(){return Date.now()/dK0}function eo1(){let{performance:Z}=O0;if(!Z?.now)return eZ;let J=Date.now()-Z.now(),X=Z.timeOrigin==null?J:Z.timeOrigin;return()=>{return(X+Z.now())/dK0}}var L9=eo1();function cK0(Z){let J=L9(),X={sid:v8(),init:!0,timestamp:J,started:J,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Zr1(X)};if(Z)ZJ(X,Z);return X}function ZJ(Z,J={}){if(J.user){if(!Z.ipAddress&&J.user.ip_address)Z.ipAddress=J.user.ip_address;if(!Z.did&&!J.did)Z.did=J.user.id||J.user.email||J.user.username}if(Z.timestamp=J.timestamp||L9(),J.abnormal_mechanism)Z.abnormal_mechanism=J.abnormal_mechanism;if(J.ignoreDuration)Z.ignoreDuration=J.ignoreDuration;if(J.sid)Z.sid=J.sid.length===32?J.sid:v8();if(J.init!==void 0)Z.init=J.init;if(!Z.did&&J.did)Z.did=`${J.did}`;if(typeof J.started==="number")Z.started=J.started;if(Z.ignoreDuration)Z.duration=void 0;else if(typeof J.duration==="number")Z.duration=J.duration;else{let X=Z.timestamp-Z.started;Z.duration=X>=0?X:0}if(J.release)Z.release=J.release;if(J.environment)Z.environment=J.environment;if(!Z.ipAddress&&J.ipAddress)Z.ipAddress=J.ipAddress;if(!Z.userAgent&&J.userAgent)Z.userAgent=J.userAgent;if(typeof J.errors==="number")Z.errors=J.errors;if(J.status)Z.status=J.status}function lK0(Z,J){let X={};if(J)X={status:J};else if(Z.status==="ok")X={status:"exited"};ZJ(Z,X)}function Zr1(Z){return{sid:`${Z.sid}`,init:Z.init,started:new Date(Z.started*1000).toISOString(),timestamp:new Date(Z.timestamp*1000).toISOString(),status:Z.status,errors:Z.errors,did:typeof Z.did==="number"||typeof Z.did==="string"?`${Z.did}`:void 0,duration:Z.duration,abnormal_mechanism:Z.abnormal_mechanism,attrs:{release:Z.release,environment:Z.environment,ip_address:Z.ipAddress,user_agent:Z.userAgent}}}function vX(Z,J,X=2){if(!J||typeof J!=="object"||X<=0)return J;if(Z&&Object.keys(J).length===0)return Z;let Y={...Z};for(let $ in J)if(Object.prototype.hasOwnProperty.call(J,$))Y[$]=vX(Y[$],J[$],X-1);return Y}var XA="_sentrySpan";function YQ(Z,J){if(J)B8(Z,XA,J);else delete Z[XA]}function o4(Z){return Z[XA]}function B9(){return v8()}function w9(){return v8().substring(16)}var Jr1=100;class N6{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:B9(),sampleRand:Math.random()}}clone(){let Z=new N6;if(Z._breadcrumbs=[...this._breadcrumbs],Z._tags={...this._tags},Z._extra={...this._extra},Z._contexts={...this._contexts},this._contexts.flags)Z._contexts.flags={values:[...this._contexts.flags.values]};return Z._user=this._user,Z._level=this._level,Z._session=this._session,Z._transactionName=this._transactionName,Z._fingerprint=this._fingerprint,Z._eventProcessors=[...this._eventProcessors],Z._attachments=[...this._attachments],Z._sdkProcessingMetadata={...this._sdkProcessingMetadata},Z._propagationContext={...this._propagationContext},Z._client=this._client,Z._lastEventId=this._lastEventId,YQ(Z,o4(this)),Z}setClient(Z){this._client=Z}setLastEventId(Z){this._lastEventId=Z}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(Z){this._scopeListeners.push(Z)}addEventProcessor(Z){return this._eventProcessors.push(Z),this}setUser(Z){if(this._user=Z||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session)ZJ(this._session,{user:Z});return this._notifyScopeListeners(),this}getUser(){return this._user}setTags(Z){return this._tags={...this._tags,...Z},this._notifyScopeListeners(),this}setTag(Z,J){return this._tags={...this._tags,[Z]:J},this._notifyScopeListeners(),this}setExtras(Z){return this._extra={...this._extra,...Z},this._notifyScopeListeners(),this}setExtra(Z,J){return this._extra={...this._extra,[Z]:J},this._notifyScopeListeners(),this}setFingerprint(Z){return this._fingerprint=Z,this._notifyScopeListeners(),this}setLevel(Z){return this._level=Z,this._notifyScopeListeners(),this}setTransactionName(Z){return this._transactionName=Z,this._notifyScopeListeners(),this}setContext(Z,J){if(J===null)delete this._contexts[Z];else this._contexts[Z]=J;return this._notifyScopeListeners(),this}setSession(Z){if(!Z)delete this._session;else this._session=Z;return this._notifyScopeListeners(),this}getSession(){return this._session}update(Z){if(!Z)return this;let J=typeof Z==="function"?Z(this):Z,X=J instanceof N6?J.getScopeData():s9(J)?Z:void 0,{tags:Y,extra:$,user:Q,contexts:K,level:W,fingerprint:G=[],propagationContext:V}=X||{};if(this._tags={...this._tags,...Y},this._extra={...this._extra,...$},this._contexts={...this._contexts,...K},Q&&Object.keys(Q).length)this._user=Q;if(W)this._level=W;if(G.length)this._fingerprint=G;if(V)this._propagationContext=V;return this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,YQ(this,void 0),this._attachments=[],this.setPropagationContext({traceId:B9(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(Z,J){let X=typeof J==="number"?J:Jr1;if(X<=0)return this;let Y={timestamp:eZ(),...Z,message:Z.message?c5(Z.message,2048):Z.message};if(this._breadcrumbs.push(Y),this._breadcrumbs.length>X)this._breadcrumbs=this._breadcrumbs.slice(-X),this._client?.recordDroppedEvent("buffer_overflow","log_item");return this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(Z){return this._attachments.push(Z),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:o4(this)}}setSDKProcessingMetadata(Z){return this._sdkProcessingMetadata=vX(this._sdkProcessingMetadata,Z,2),this}setPropagationContext(Z){return this._propagationContext=Z,this}getPropagationContext(){return this._propagationContext}captureException(Z,J){let X=J?.event_id||v8();if(!this._client)return g.warn("No client configured on scope - will not capture exception!"),X;let Y=new Error("Sentry syntheticException");return this._client.captureException(Z,{originalException:Z,syntheticException:Y,...J,event_id:X},this),X}captureMessage(Z,J,X){let Y=X?.event_id||v8();if(!this._client)return g.warn("No client configured on scope - will not capture message!"),Y;let $=new Error(Z);return this._client.captureMessage(Z,J,{originalException:Z,syntheticException:$,...X,event_id:Y},this),Y}captureEvent(Z,J){let X=J?.event_id||v8();if(!this._client)return g.warn("No client configured on scope - will not capture event!"),X;return this._client.captureEvent(Z,{...J,event_id:X},this),X}_notifyScopeListeners(){if(!this._notifyingListeners)this._notifyingListeners=!0,this._scopeListeners.forEach((Z)=>{Z(this)}),this._notifyingListeners=!1}}function UG(){return ZQ("defaultCurrentScope",()=>new N6)}function r9(){return ZQ("defaultIsolationScope",()=>new N6)}class iK0{constructor(Z,J){let X;if(!Z)X=new N6;else X=Z;let Y;if(!J)Y=new N6;else Y=J;this._stack=[{scope:X}],this._isolationScope=Y}withScope(Z){let J=this._pushScope(),X;try{X=Z(J)}catch(Y){throw this._popScope(),Y}if(o9(X))return X.then((Y)=>{return this._popScope(),Y},(Y)=>{throw this._popScope(),Y});return this._popScope(),X}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let Z=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:Z}),Z}_popScope(){if(this._stack.length<=1)return!1;return!!this._stack.pop()}}function LG(){let Z=b6(),J=TX(Z);return J.stack=J.stack||new iK0(UG(),r9())}function Xr1(Z){return LG().withScope(Z)}function Yr1(Z,J){let X=LG();return X.withScope(()=>{return X.getStackTop().scope=Z,J(Z)})}function pK0(Z){return LG().withScope(()=>{return Z(LG().getIsolationScope())})}function nK0(){return{withIsolationScope:pK0,withScope:Xr1,withSetScope:Yr1,withSetIsolationScope:(Z,J)=>{return pK0(J)},getCurrentScope:()=>LG().getScope(),getIsolationScope:()=>LG().getIsolationScope()}}function YA(Z){let J=b6(),X=TX(J);X.acs=Z}function t9(Z){let J=TX(Z);if(J.acs)return J.acs;return nK0()}function l0(){let Z=b6();return t9(Z).getCurrentScope()}function A0(){let Z=b6();return t9(Z).getIsolationScope()}function JJ(){return ZQ("globalScope",()=>new N6)}function O9(...Z){let J=b6(),X=t9(J);if(Z.length===2){let[Y,$]=Z;if(!Y)return X.withScope($);return X.withSetScope(Y,$)}return X.withScope(Z[0])}function XJ(...Z){let J=b6(),X=t9(J);if(Z.length===2){let[Y,$]=Z;if(!Y)return X.withIsolationScope($);return X.withSetIsolationScope(Y,$)}return X.withIsolationScope(Z[0])}function $0(){return l0().getClient()}function BG(Z){let J=Z.getPropagationContext(),{traceId:X,parentSpanId:Y,propagationSpanId:$}=J,Q={trace_id:X,span_id:$||w9()};if(Y)Q.parent_span_id=Y;return Q}var h1="sentry.source",e9="sentry.sample_rate",$A="sentry.previous_trace_sample_rate",M0="sentry.op",I0="sentry.origin";var ER="sentry.measurement_unit",kR="sentry.measurement_value",r4="sentry.custom_span_name",wG="sentry.profile_id",OG="sentry.exclusive_time",QA="cache.hit",KA="cache.key",WA="cache.item_size";var GA=0,SX=1,l5=2;function RG(Z){if(Z<400&&Z>=100)return{code:1};if(Z>=400&&Z<500)switch(Z){case 401:return{code:2,message:"unauthenticated"};case 403:return{code:2,message:"permission_denied"};case 404:return{code:2,message:"not_found"};case 409:return{code:2,message:"already_exists"};case 413:return{code:2,message:"failed_precondition"};case 429:return{code:2,message:"resource_exhausted"};case 499:return{code:2,message:"cancelled"};default:return{code:2,message:"invalid_argument"}}if(Z>=500&&Z<600)switch(Z){case 501:return{code:2,message:"unimplemented"};case 503:return{code:2,message:"unavailable"};case 504:return{code:2,message:"deadline_exceeded"};default:return{code:2,message:"internal_error"}}return{code:2,message:"unknown_error"}}function MG(Z,J){Z.setAttribute("http.response.status_code",J);let X=RG(J);if(X.message!=="unknown_error")Z.setStatus(X)}var aK0="_sentryScope",sK0="_sentryIsolationScope";function UF(Z,J,X){if(Z)B8(Z,sK0,X),B8(Z,aK0,J)}function t4(Z){return{scope:Z[aK0],isolationScope:Z[sK0]}}function R9(Z){if(typeof Z==="boolean")return Number(Z);let J=typeof Z==="string"?parseFloat(Z):Z;if(typeof J!=="number"||isNaN(J)||J<0||J>1)return;return J}var LF="sentry-",rK0=/^sentry-/,tK0=8192;function AX(Z){let J=$Q(Z);if(!J)return;let X=Object.entries(J).reduce((Y,[$,Q])=>{if($.match(rK0)){let K=$.slice(LF.length);Y[K]=Q}return Y},{});if(Object.keys(X).length>0)return X;else return}function xX(Z){if(!Z)return;let J=Object.entries(Z).reduce((X,[Y,$])=>{if($)X[`${LF}${Y}`]=$;return X},{});return IR(J)}function $Q(Z){if(!Z||!JQ(Z)&&!Array.isArray(Z))return;if(Array.isArray(Z))return Z.reduce((J,X)=>{let Y=oK0(X);return Object.entries(Y).forEach(([$,Q])=>{J[$]=Q}),J},{});return oK0(Z)}function oK0(Z){return Z.split(",").map((J)=>J.split("=").map((X)=>{try{return decodeURIComponent(X.trim())}catch{return}})).reduce((J,[X,Y])=>{if(X&&Y)J[X]=Y;return J},{})}function IR(Z){if(Object.keys(Z).length===0)return;return Object.entries(Z).reduce((J,[X,Y],$)=>{let Q=`${encodeURIComponent(X)}=${encodeURIComponent(Y)}`,K=$===0?Q:`${J},${Q}`;if(K.length>tK0)return e&&g.warn(`Not adding key: ${X} with val: ${Y} to baggage header due to exceeding baggage size limits.`),J;else return K},"")}var BF=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function eK0(Z){if(!Z)return;let J=Z.match(BF);if(!J)return;let X;if(J[3]==="1")X=!0;else if(J[3]==="0")X=!1;return{traceId:J[1],parentSampled:X,parentSpanId:J[2]}}function QQ(Z,J){let X=eK0(Z),Y=AX(J);if(!X?.traceId)return{traceId:B9(),sampleRand:Math.random()};let $=$r1(X,Y);if(Y)Y.sample_rand=$.toString();let{traceId:Q,parentSpanId:K,parentSampled:W}=X;return{traceId:Q,parentSpanId:K,sampled:W,dsc:Y||{},sampleRand:$}}function hX(Z=B9(),J=w9(),X){let Y="";if(X!==void 0)Y=X?"-1":"-0";return`${Z}-${J}${Y}`}function $r1(Z,J){let X=R9(J?.sample_rand);if(X!==void 0)return X;let Y=R9(J?.sample_rate);if(Y&&Z?.parentSampled!==void 0)return Z.parentSampled?Math.random()*Y:Y+Math.random()*(1-Y);else return Math.random()}var _R=0,vR=1,ZW0=!1;function XW0(Z){let{spanId:J,traceId:X}=Z.spanContext(),{data:Y,op:$,parent_span_id:Q,status:K,origin:W,links:G}=w0(Z);return{parent_span_id:Q,span_id:J,trace_id:X,data:Y,op:$,status:K,origin:W,links:G}}function fX(Z){let{spanId:J,traceId:X,isRemote:Y}=Z.spanContext(),$=Y?J:w0(Z).parent_span_id,Q=t4(Z).scope,K=Y?Q?.getPropagationContext().propagationSpanId||w9():J;return{parent_span_id:$,span_id:K,trace_id:X}}function OF(Z){let{traceId:J,spanId:X}=Z.spanContext(),Y=o7(Z);return hX(J,X,Y)}function KQ(Z){if(Z&&Z.length>0)return Z.map(({context:{spanId:J,traceId:X,traceFlags:Y,...$},attributes:Q})=>({span_id:J,trace_id:X,sampled:Y===vR,attributes:Q,...$}));else return}function p5(Z){if(typeof Z==="number")return JW0(Z);if(Array.isArray(Z))return Z[0]+Z[1]/1e9;if(Z instanceof Date)return JW0(Z.getTime());return L9()}function JW0(Z){return Z>9999999999?Z/1000:Z}function w0(Z){if(Kr1(Z))return Z.getSpanJSON();let{spanId:J,traceId:X}=Z.spanContext();if(Qr1(Z)){let{attributes:Y,startTime:$,name:Q,endTime:K,status:W,links:G}=Z,V="parentSpanId"in Z?Z.parentSpanId:("parentSpanContext"in Z)?Z.parentSpanContext?.spanId:void 0;return{span_id:J,trace_id:X,data:Y,description:Q,parent_span_id:V,start_timestamp:p5($),timestamp:p5(K)||void 0,status:WQ(W),op:Y[M0],origin:Y[I0],links:KQ(G)}}return{span_id:J,trace_id:X,start_timestamp:0,data:{}}}function Qr1(Z){let J=Z;return!!J.attributes&&!!J.startTime&&!!J.name&&!!J.endTime&&!!J.status}function Kr1(Z){return typeof Z.getSpanJSON==="function"}function o7(Z){let{traceFlags:J}=Z.spanContext();return J===vR}function WQ(Z){if(!Z||Z.code===GA)return;if(Z.code===SX)return"ok";return Z.message||"unknown_error"}var wF="_sentryChildSpans",VA="_sentryRootSpan";function NG(Z,J){let X=Z[VA]||Z;if(B8(J,VA,X),Z[wF])Z[wF].add(J);else B8(Z,wF,new Set([J]))}function RF(Z){let J=new Set;function X(Y){if(J.has(Y))return;else if(o7(Y)){J.add(Y);let $=Y[wF]?Array.from(Y[wF]):[];for(let Q of $)X(Q)}}return X(Z),Array.from(J)}function p1(Z){return Z[VA]||Z}function e4(){let Z=b6(),J=t9(Z);if(J.getActiveSpan)return J.getActiveSpan();return o4(l0())}function MF(){if(!ZW0)$8(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.")}),ZW0=!0}function zA(Z,J){Z.updateName(J),Z.setAttributes({[h1]:"custom",[r4]:J})}var FA="?",YW0=/\(error: (.*)\)/,$W0=/captureMessage|captureException/;function AR(...Z){let J=Z.sort((X,Y)=>X[0]-Y[0]).map((X)=>X[1]);return(X,Y=0,$=0)=>{let Q=[],K=X.split(`
465
+ ${W}`),J.end();return}if(K)Z.session=K}J.setNoDelay(!0),this.emitWithGlobal("WEBSERVER.UPGRADE",{req:Z,socket:J,head:X})};_onError=(Z)=>{c.error(`WebServer._onError(): ${Z.message}`),this.emitWithGlobal("WEBSERVER.ERROR",{error:Z})};_onStopped=()=>{this.emitWithGlobal("WEBSERVER.STOPPED",{})}}globalThis.addEventListener("unhandledrejection",(Z)=>{let J=Z.reason,X=J?.code??J?.cause?.code;if(X&&["EPIPE","ECONNRESET"].includes(X))Z.preventDefault()});class s7 extends R0{static instance=new s7;_connectionIdConnections=new Map;_userIdConnections=new Map;_wss;_wrtcMinPort=process.env.WRTC_MIN_PORT?parseInt(process.env.WRTC_MIN_PORT):40000;_wrtcMaxPort=process.env.WRTC_MAX_PORT?parseInt(process.env.WRTC_MAX_PORT):41023;_wrtcPublicIpv4=process.env.NODE_ENV==="production"?process.env.WRTC_PUBLIC_IPV4:"127.0.0.1";_wrtcPublicIpv6=process.env.NODE_ENV==="production"?process.env.WRTC_PUBLIC_IPV6:"::";_wrtcRouter=null;_wrtcWorker=null;constructor(){super();this._wss=new U_.default({noServer:!0}),this._wss.on("connection",this._onConnection),this._wss.on("error",this._onError),this._initWrtc().catch((Z)=>{c.warning(`Socket._constructor(): Failed to initialize WebRTC, falling back to Websockets. This can be ignored for local development. Error: ${Z.message}`)}),R0.globalInstance.on("WEBSERVER.UPGRADE",({req:Z,socket:J,head:X})=>{this._onUpgrade(Z,J,X)})}get isWrtcEnabled(){return this._wrtcWorker&&!this._wrtcWorker.died&&this._wrtcRouter}get wrtcRouter(){return this._wrtcRouter}async createWrtcTransports(){if(!this.isWrtcEnabled)c.fatalError("Socket.createWrtcTransports(): WebRTC not enabled, unable to create transports.");let Z={listenIps:[{ip:"::",announcedIp:this._wrtcPublicIpv6},{ip:"0.0.0.0",announcedIp:this._wrtcPublicIpv4}],preferUdp:!0,enableSctp:!0,enableTcp:!1},J=await this._wrtcRouter.createDirectTransport(),X=await this._wrtcRouter.createWebRtcTransport(Z),Y=await this._wrtcRouter.createWebRtcTransport(Z);return{directTransport:J,clientServerTransport:X,serverClientTransport:Y}}isValidConnectionId(Z){return this._connectionIdConnections.has(Z)}async _initWrtc(){if(!this._wrtcPublicIpv4||!this._wrtcPublicIpv6)throw new Error("Socket._initWrtc(): WebRTC disabled, falling back to Websockets. Env variables WRTC_PUBLIC_IPV4 and WRTC_PUBLIC_IPV6 must be set in production");let Z=await import("mediasoup");this._wrtcWorker=await Z.createWorker({rtcMinPort:this._wrtcMinPort,rtcMaxPort:this._wrtcMaxPort}),this._wrtcWorker.on("died",this._onWrtcWorkerDied),this._wrtcRouter=await this._wrtcWorker.createRouter({mediaCodecs:[]}),console.log("Socket._initWrtc(): WebRTC enabled and ready!")}_onConnection=(Z,J)=>{let X=J.connectionId,Y=J.session?.user.id,$=(X&&this._connectionIdConnections.get(X))??(Y&&this._userIdConnections.get(Y));if($)$.bindWs(Z);else{let Q=new n4(Z,J);if(Q.on("CONNECTION.CLOSED",()=>{if(this._connectionIdConnections.delete(Q.id),Y)this._userIdConnections.delete(Y)}),this._connectionIdConnections.set(Q.id,Q),Y)this._userIdConnections.set(Y,Q)}};_onError=(Z,J)=>{this.emitWithGlobal("SOCKET.ERROR",{ws:Z,error:J})};_onUpgrade=(Z,J,X)=>{this._wss.handleUpgrade(Z,J,X,(Y)=>{this._wss.emit("connection",Y,Z)})};_onWrtcWorkerDied=(Z)=>{c.warning(`Socket._onWrtcWorkerDied(): WebRTC worker unexpectedly died, falling back to Websockets for all players. Internal error: ${Z}`),U9.instance.getConnectedPlayers().forEach((J)=>{J.connection.closeWrtc()}),this._wrtcRouter?.close(),this._wrtcRouter=null,this._wrtcWorker?.close(),this._wrtcWorker=null}}var Bm={};HK(Bm,{zodErrorsIntegration:()=>Bx,wrapMcpServerWithSentry:()=>Nx,withScope:()=>O9,withMonitor:()=>r7,withIsolationScope:()=>XJ,withActiveSpan:()=>yX,vercelAIIntegration:()=>aj,validateOpenTelemetrySetup:()=>Lm,updateSpanName:()=>zA,trpcMiddleware:()=>Ox,tediousIntegration:()=>dj,suppressTracing:()=>kF,supabaseIntegration:()=>Lx,startSpanManual:()=>EF,startSpan:()=>Z4,startSession:()=>hF,startNewTrace:()=>_A,startInactiveSpan:()=>kA,spotlightIntegration:()=>yj,spanToTraceHeader:()=>OF,spanToJSON:()=>w0,spanToBaggageHeader:()=>OA,setupKoaErrorHandler:()=>fK1,setupHapiErrorHandler:()=>zK1,setupFastifyErrorHandler:()=>DJ1,setupExpressErrorHandler:()=>vZ1,setupConnectErrorHandler:()=>QW1,setUser:()=>mA,setTags:()=>bA,setTag:()=>gA,setNodeAsyncContextStrategy:()=>EN,setMeasurement:()=>TA,setHttpStatus:()=>MG,setExtras:()=>fA,setExtra:()=>yA,setCurrentClient:()=>Zx,setContext:()=>hA,rewriteFramesIntegration:()=>Ux,requestDataIntegration:()=>gF,redisIntegration:()=>Nj,profiler:()=>wx,prismaIntegration:()=>Ej,preloadOpenTelemetry:()=>L31,postgresIntegration:()=>Cj,parameterize:()=>sR,onUnhandledRejectionIntegration:()=>pN,onUncaughtExceptionIntegration:()=>lN,nodeContextIntegration:()=>bN,nativeNodeFetchIntegration:()=>hN,mysqlIntegration:()=>wj,mysql2Integration:()=>Rj,mongooseIntegration:()=>Lj,mongoIntegration:()=>qj,modulesIntegration:()=>cN,makeNodeTransport:()=>JD,lruMemoizerIntegration:()=>Fj,logger:()=>Cx,localVariablesIntegration:()=>dN,linkedErrorsIntegration:()=>bF,lastEventId:()=>uA,koaIntegration:()=>xj,knexIntegration:()=>kW1,kafkaIntegration:()=>Hj,isInitialized:()=>AF,instrumentSupabaseClient:()=>JM,initWithoutDefaultIntegrations:()=>w31,initOpenTelemetry:()=>KD,init:()=>WD,inboundFiltersIntegration:()=>yF,httpIntegration:()=>vN,hapiIntegration:()=>vj,graphqlIntegration:()=>zj,getTraceMetaTags:()=>$x,getTraceData:()=>QJ,getSpanStatusFromHttpCode:()=>RG,getSpanDescendants:()=>RF,getSentryRelease:()=>$D,getRootSpan:()=>p1,getIsolationScope:()=>A0,getGlobalScope:()=>JJ,getDefaultIntegrationsWithoutPerformance:()=>qm,getDefaultIntegrations:()=>Um,getCurrentScope:()=>l0,getClient:()=>$0,getAutoPerformanceIntegrations:()=>tj,getActiveSpan:()=>e4,genericPoolIntegration:()=>cj,generateInstrumentOnce:()=>P0,functionToStringIntegration:()=>fF,fsIntegration:()=>v71,flush:()=>dA,fastifyIntegration:()=>Kj,extraErrorDataIntegration:()=>Vx,expressIntegration:()=>rN,expressErrorHandler:()=>yb,eventFiltersIntegration:()=>rR,endSession:()=>FQ,disableAnrDetectionForCallback:()=>o71,defaultStackParser:()=>QD,dedupeIntegration:()=>Gx,dataloaderIntegration:()=>RG1,cron:()=>D31,createTransport:()=>EG,createSentryWinstonTransport:()=>lG1,createGetModuleFromFilename:()=>YD,continueTrace:()=>IA,contextLinesIntegration:()=>gN,consoleLoggingIntegration:()=>Dx,consoleIntegration:()=>mF,connectIntegration:()=>fj,close:()=>cA,childProcessIntegration:()=>sj,captureSession:()=>pA,captureMessage:()=>TG,captureFeedback:()=>jx,captureException:()=>q1,captureEvent:()=>SF,captureConsoleIntegration:()=>Wx,captureCheckIn:()=>vF,anrIntegration:()=>s71,amqplibIntegration:()=>ij,addIntegration:()=>sA,addEventProcessor:()=>lA,addBreadcrumb:()=>q5,SentryContextManager:()=>rj,Scope:()=>N6,SEMANTIC_ATTRIBUTE_SENTRY_SOURCE:()=>h1,SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE:()=>e9,SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN:()=>I0,SEMANTIC_ATTRIBUTE_SENTRY_OP:()=>M0,SDK_VERSION:()=>L8,NodeClient:()=>GU});var Cx={};HK(Cx,{warn:()=>Ce1,trace:()=>je1,info:()=>Pe1,fmt:()=>Xx,fatal:()=>Ee1,error:()=>Te1,debug:()=>De1});import{format as Ne1}from"node:util";var e=typeof __SENTRY_DEBUG__==="undefined"||__SENTRY_DEBUG__;var L8="9.22.0";var O0=globalThis;function b6(){return TX(O0),O0}function TX(Z){let J=Z.__SENTRY__=Z.__SENTRY__||{};return J.version=J.version||L8,J[L8]=J[L8]||{}}function ZQ(Z,J,X=O0){let Y=X.__SENTRY__=X.__SENTRY__||{},$=Y[L8]=Y[L8]||{};return $[Z]||($[Z]=J())}var _K0=Object.prototype.toString;function a4(Z){switch(_K0.call(Z)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return tZ(Z,Error)}}function DR(Z,J){return _K0.call(Z)===`[object ${J}]`}function vK0(Z){return DR(Z,"ErrorEvent")}function JQ(Z){return DR(Z,"String")}function XQ(Z){return typeof Z==="object"&&Z!==null&&"__sentry_template_string__"in Z&&"__sentry_template_values__"in Z}function qF(Z){return Z===null||XQ(Z)||typeof Z!=="object"&&typeof Z!=="function"}function s9(Z){return DR(Z,"Object")}function SK0(Z){return typeof Event!=="undefined"&&tZ(Z,Event)}function AK0(Z){return typeof Element!=="undefined"&&tZ(Z,Element)}function xK0(Z){return DR(Z,"RegExp")}function o9(Z){return Boolean(Z?.then&&typeof Z.then==="function")}function hK0(Z){return s9(Z)&&"nativeEvent"in Z&&"preventDefault"in Z&&"stopPropagation"in Z}function tZ(Z,J){try{return Z instanceof J}catch(X){return!1}}function PR(Z){return!!(typeof Z==="object"&&Z!==null&&(Z.__isVue||Z._isVue))}var po1=O0,io1=80;function fK0(Z,J={}){if(!Z)return"<unknown>";try{let X=Z,Y=5,$=[],Q=0,K=0,W=" > ",G=W.length,V,z=Array.isArray(J)?J:J.keyAttrs,F=!Array.isArray(J)&&J.maxStringLength||io1;while(X&&Q++<Y){if(V=no1(X,z),V==="html"||Q>1&&K+$.length*G+V.length>=F)break;$.push(V),K+=V.length,X=X.parentNode}return $.reverse().join(W)}catch(X){return"<unknown>"}}function no1(Z,J){let X=Z,Y=[];if(!X?.tagName)return"";if(po1.HTMLElement){if(X instanceof HTMLElement&&X.dataset){if(X.dataset.sentryComponent)return X.dataset.sentryComponent;if(X.dataset.sentryElement)return X.dataset.sentryElement}}Y.push(X.tagName.toLowerCase());let $=J?.length?J.filter((K)=>X.getAttribute(K)).map((K)=>[K,X.getAttribute(K)]):null;if($?.length)$.forEach((K)=>{Y.push(`[${K[0]}="${K[1]}"]`)});else{if(X.id)Y.push(`#${X.id}`);let K=X.className;if(K&&JQ(K)){let W=K.split(/\s+/);for(let G of W)Y.push(`.${G}`)}}let Q=["aria-label","type","name","title","alt"];for(let K of Q){let W=X.getAttribute(K);if(W)Y.push(`[${K}="${W}"]`)}return Y.join("")}var ao1="Sentry Logger ",s4=["debug","info","warn","error","log","assert","trace"],qG={};function $8(Z){if(!("console"in O0))return Z();let J=O0.console,X={},Y=Object.keys(qG);Y.forEach(($)=>{let Q=qG[$];X[$]=J[$],J[$]=Q});try{return Z()}finally{Y.forEach(($)=>{J[$]=X[$]})}}function so1(){let Z=!1,J={enable:()=>{Z=!0},disable:()=>{Z=!1},isEnabled:()=>Z};if(e)s4.forEach((X)=>{J[X]=(...Y)=>{if(Z)$8(()=>{O0.console[X](`${ao1}[${X}]:`,...Y)})}});else s4.forEach((X)=>{J[X]=()=>{return}});return J}var g=ZQ("logger",so1);function c5(Z,J=0){if(typeof Z!=="string"||J===0)return Z;return Z.length<=J?Z:`${Z.slice(0,J)}...`}function sS(Z,J){let X=Z,Y=X.length;if(Y<=150)return X;if(J>Y)J=Y;let $=Math.max(J-60,0);if($<5)$=0;let Q=Math.min($+140,Y);if(Q>Y-5)Q=Y;if(Q===Y)$=Math.max(Q-140,0);if(X=X.slice($,Q),$>0)X=`'{snip} ${X}`;if(Q<Y)X+=" {snip}";return X}function EX(Z,J){if(!Array.isArray(Z))return"";let X=[];for(let Y=0;Y<Z.length;Y++){let $=Z[Y];try{if(PR($))X.push("[VueViewModel]");else X.push(String($))}catch(Q){X.push("[value cannot be serialized]")}}return X.join(J)}function yK0(Z,J,X=!1){if(!JQ(Z))return!1;if(xK0(J))return J.test(Z);if(JQ(J))return X?Z===J:Z.includes(J);return!1}function kX(Z,J=[],X=!1){return J.some((Y)=>yK0(Z,Y,X))}function oS(Z,J,X){if(!(J in Z))return;let Y=Z[J];if(typeof Y!=="function")return;let $=X(Y);if(typeof $==="function")mK0($,Y);try{Z[J]=$}catch{e&&g.log(`Failed to replace method "${J}" in object`,Z)}}function B8(Z,J,X){try{Object.defineProperty(Z,J,{value:X,writable:!0,configurable:!0})}catch(Y){e&&g.log(`Failed to add non-enumerable property "${J}" to object`,Z)}}function mK0(Z,J){try{let X=J.prototype||{};Z.prototype=J.prototype=X,B8(Z,"__sentry_original__",J)}catch(X){}}function rS(Z){return Z.__sentry_original__}function CR(Z){if(a4(Z))return{message:Z.message,name:Z.name,stack:Z.stack,...gK0(Z)};else if(SK0(Z)){let J={type:Z.type,target:bK0(Z.target),currentTarget:bK0(Z.currentTarget),...gK0(Z)};if(typeof CustomEvent!=="undefined"&&tZ(Z,CustomEvent))J.detail=Z.detail;return J}else return Z}function bK0(Z){try{return AK0(Z)?fK0(Z):Object.prototype.toString.call(Z)}catch(J){return"<unknown>"}}function gK0(Z){if(typeof Z==="object"&&Z!==null){let J={};for(let X in Z)if(Object.prototype.hasOwnProperty.call(Z,X))J[X]=Z[X];return J}else return{}}function tS(Z,J=40){let X=Object.keys(CR(Z));X.sort();let Y=X[0];if(!Y)return"[object has no keys]";if(Y.length>=J)return c5(Y,J);for(let $=X.length;$>0;$--){let Q=X.slice(0,$).join(", ");if(Q.length>J)continue;if($===X.length)return Q;return c5(Q,J)}return""}function oo1(){let Z=O0;return Z.crypto||Z.msCrypto}function v8(Z=oo1()){let J=()=>Math.random()*16;try{if(Z?.randomUUID)return Z.randomUUID().replace(/-/g,"");if(Z?.getRandomValues)J=()=>{let X=new Uint8Array(1);return Z.getRandomValues(X),X[0]}}catch(X){}return([1e7]+1000+4000+8000+100000000000).replace(/[018]/g,(X)=>(X^(J()&15)>>X/4).toString(16))}function uK0(Z){return Z.exception?.values?.[0]}function IX(Z){let{message:J,event_id:X}=Z;if(J)return J;let Y=uK0(Z);if(Y){if(Y.type&&Y.value)return`${Y.type}: ${Y.value}`;return Y.type||Y.value||X||"<unknown>"}return X||"<unknown>"}function ZA(Z,J,X){let Y=Z.exception=Z.exception||{},$=Y.values=Y.values||[],Q=$[0]=$[0]||{};if(!Q.value)Q.value=J||"";if(!Q.type)Q.type=X||"Error"}function _X(Z,J){let X=uK0(Z);if(!X)return;let Y={type:"generic",handled:!0},$=X.mechanism;if(X.mechanism={...Y,...$,...J},J&&"data"in J){let Q={...$?.data,...J.data};X.mechanism.data=Q}}var ro1=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function eS(Z){return parseInt(Z||"",10)}function JA(Z){let J=Z.match(ro1)||[],X=eS(J[1]),Y=eS(J[2]),$=eS(J[3]);return{buildmetadata:J[5],major:isNaN(X)?void 0:X,minor:isNaN(Y)?void 0:Y,patch:isNaN($)?void 0:$,prerelease:J[4]}}function TR(Z){if(to1(Z))return!0;try{B8(Z,"__sentry_captured__",!0)}catch(J){}return!1}function to1(Z){try{return Z.__sentry_captured__}catch{}}var dK0=1000;function eZ(){return Date.now()/dK0}function eo1(){let{performance:Z}=O0;if(!Z?.now)return eZ;let J=Date.now()-Z.now(),X=Z.timeOrigin==null?J:Z.timeOrigin;return()=>{return(X+Z.now())/dK0}}var L9=eo1();function cK0(Z){let J=L9(),X={sid:v8(),init:!0,timestamp:J,started:J,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Zr1(X)};if(Z)ZJ(X,Z);return X}function ZJ(Z,J={}){if(J.user){if(!Z.ipAddress&&J.user.ip_address)Z.ipAddress=J.user.ip_address;if(!Z.did&&!J.did)Z.did=J.user.id||J.user.email||J.user.username}if(Z.timestamp=J.timestamp||L9(),J.abnormal_mechanism)Z.abnormal_mechanism=J.abnormal_mechanism;if(J.ignoreDuration)Z.ignoreDuration=J.ignoreDuration;if(J.sid)Z.sid=J.sid.length===32?J.sid:v8();if(J.init!==void 0)Z.init=J.init;if(!Z.did&&J.did)Z.did=`${J.did}`;if(typeof J.started==="number")Z.started=J.started;if(Z.ignoreDuration)Z.duration=void 0;else if(typeof J.duration==="number")Z.duration=J.duration;else{let X=Z.timestamp-Z.started;Z.duration=X>=0?X:0}if(J.release)Z.release=J.release;if(J.environment)Z.environment=J.environment;if(!Z.ipAddress&&J.ipAddress)Z.ipAddress=J.ipAddress;if(!Z.userAgent&&J.userAgent)Z.userAgent=J.userAgent;if(typeof J.errors==="number")Z.errors=J.errors;if(J.status)Z.status=J.status}function lK0(Z,J){let X={};if(J)X={status:J};else if(Z.status==="ok")X={status:"exited"};ZJ(Z,X)}function Zr1(Z){return{sid:`${Z.sid}`,init:Z.init,started:new Date(Z.started*1000).toISOString(),timestamp:new Date(Z.timestamp*1000).toISOString(),status:Z.status,errors:Z.errors,did:typeof Z.did==="number"||typeof Z.did==="string"?`${Z.did}`:void 0,duration:Z.duration,abnormal_mechanism:Z.abnormal_mechanism,attrs:{release:Z.release,environment:Z.environment,ip_address:Z.ipAddress,user_agent:Z.userAgent}}}function vX(Z,J,X=2){if(!J||typeof J!=="object"||X<=0)return J;if(Z&&Object.keys(J).length===0)return Z;let Y={...Z};for(let $ in J)if(Object.prototype.hasOwnProperty.call(J,$))Y[$]=vX(Y[$],J[$],X-1);return Y}var XA="_sentrySpan";function YQ(Z,J){if(J)B8(Z,XA,J);else delete Z[XA]}function o4(Z){return Z[XA]}function B9(){return v8()}function w9(){return v8().substring(16)}var Jr1=100;class N6{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:B9(),sampleRand:Math.random()}}clone(){let Z=new N6;if(Z._breadcrumbs=[...this._breadcrumbs],Z._tags={...this._tags},Z._extra={...this._extra},Z._contexts={...this._contexts},this._contexts.flags)Z._contexts.flags={values:[...this._contexts.flags.values]};return Z._user=this._user,Z._level=this._level,Z._session=this._session,Z._transactionName=this._transactionName,Z._fingerprint=this._fingerprint,Z._eventProcessors=[...this._eventProcessors],Z._attachments=[...this._attachments],Z._sdkProcessingMetadata={...this._sdkProcessingMetadata},Z._propagationContext={...this._propagationContext},Z._client=this._client,Z._lastEventId=this._lastEventId,YQ(Z,o4(this)),Z}setClient(Z){this._client=Z}setLastEventId(Z){this._lastEventId=Z}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(Z){this._scopeListeners.push(Z)}addEventProcessor(Z){return this._eventProcessors.push(Z),this}setUser(Z){if(this._user=Z||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session)ZJ(this._session,{user:Z});return this._notifyScopeListeners(),this}getUser(){return this._user}setTags(Z){return this._tags={...this._tags,...Z},this._notifyScopeListeners(),this}setTag(Z,J){return this._tags={...this._tags,[Z]:J},this._notifyScopeListeners(),this}setExtras(Z){return this._extra={...this._extra,...Z},this._notifyScopeListeners(),this}setExtra(Z,J){return this._extra={...this._extra,[Z]:J},this._notifyScopeListeners(),this}setFingerprint(Z){return this._fingerprint=Z,this._notifyScopeListeners(),this}setLevel(Z){return this._level=Z,this._notifyScopeListeners(),this}setTransactionName(Z){return this._transactionName=Z,this._notifyScopeListeners(),this}setContext(Z,J){if(J===null)delete this._contexts[Z];else this._contexts[Z]=J;return this._notifyScopeListeners(),this}setSession(Z){if(!Z)delete this._session;else this._session=Z;return this._notifyScopeListeners(),this}getSession(){return this._session}update(Z){if(!Z)return this;let J=typeof Z==="function"?Z(this):Z,X=J instanceof N6?J.getScopeData():s9(J)?Z:void 0,{tags:Y,extra:$,user:Q,contexts:K,level:W,fingerprint:G=[],propagationContext:V}=X||{};if(this._tags={...this._tags,...Y},this._extra={...this._extra,...$},this._contexts={...this._contexts,...K},Q&&Object.keys(Q).length)this._user=Q;if(W)this._level=W;if(G.length)this._fingerprint=G;if(V)this._propagationContext=V;return this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,YQ(this,void 0),this._attachments=[],this.setPropagationContext({traceId:B9(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(Z,J){let X=typeof J==="number"?J:Jr1;if(X<=0)return this;let Y={timestamp:eZ(),...Z,message:Z.message?c5(Z.message,2048):Z.message};if(this._breadcrumbs.push(Y),this._breadcrumbs.length>X)this._breadcrumbs=this._breadcrumbs.slice(-X),this._client?.recordDroppedEvent("buffer_overflow","log_item");return this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(Z){return this._attachments.push(Z),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:o4(this)}}setSDKProcessingMetadata(Z){return this._sdkProcessingMetadata=vX(this._sdkProcessingMetadata,Z,2),this}setPropagationContext(Z){return this._propagationContext=Z,this}getPropagationContext(){return this._propagationContext}captureException(Z,J){let X=J?.event_id||v8();if(!this._client)return g.warn("No client configured on scope - will not capture exception!"),X;let Y=new Error("Sentry syntheticException");return this._client.captureException(Z,{originalException:Z,syntheticException:Y,...J,event_id:X},this),X}captureMessage(Z,J,X){let Y=X?.event_id||v8();if(!this._client)return g.warn("No client configured on scope - will not capture message!"),Y;let $=new Error(Z);return this._client.captureMessage(Z,J,{originalException:Z,syntheticException:$,...X,event_id:Y},this),Y}captureEvent(Z,J){let X=J?.event_id||v8();if(!this._client)return g.warn("No client configured on scope - will not capture event!"),X;return this._client.captureEvent(Z,{...J,event_id:X},this),X}_notifyScopeListeners(){if(!this._notifyingListeners)this._notifyingListeners=!0,this._scopeListeners.forEach((Z)=>{Z(this)}),this._notifyingListeners=!1}}function UG(){return ZQ("defaultCurrentScope",()=>new N6)}function r9(){return ZQ("defaultIsolationScope",()=>new N6)}class iK0{constructor(Z,J){let X;if(!Z)X=new N6;else X=Z;let Y;if(!J)Y=new N6;else Y=J;this._stack=[{scope:X}],this._isolationScope=Y}withScope(Z){let J=this._pushScope(),X;try{X=Z(J)}catch(Y){throw this._popScope(),Y}if(o9(X))return X.then((Y)=>{return this._popScope(),Y},(Y)=>{throw this._popScope(),Y});return this._popScope(),X}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let Z=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:Z}),Z}_popScope(){if(this._stack.length<=1)return!1;return!!this._stack.pop()}}function LG(){let Z=b6(),J=TX(Z);return J.stack=J.stack||new iK0(UG(),r9())}function Xr1(Z){return LG().withScope(Z)}function Yr1(Z,J){let X=LG();return X.withScope(()=>{return X.getStackTop().scope=Z,J(Z)})}function pK0(Z){return LG().withScope(()=>{return Z(LG().getIsolationScope())})}function nK0(){return{withIsolationScope:pK0,withScope:Xr1,withSetScope:Yr1,withSetIsolationScope:(Z,J)=>{return pK0(J)},getCurrentScope:()=>LG().getScope(),getIsolationScope:()=>LG().getIsolationScope()}}function YA(Z){let J=b6(),X=TX(J);X.acs=Z}function t9(Z){let J=TX(Z);if(J.acs)return J.acs;return nK0()}function l0(){let Z=b6();return t9(Z).getCurrentScope()}function A0(){let Z=b6();return t9(Z).getIsolationScope()}function JJ(){return ZQ("globalScope",()=>new N6)}function O9(...Z){let J=b6(),X=t9(J);if(Z.length===2){let[Y,$]=Z;if(!Y)return X.withScope($);return X.withSetScope(Y,$)}return X.withScope(Z[0])}function XJ(...Z){let J=b6(),X=t9(J);if(Z.length===2){let[Y,$]=Z;if(!Y)return X.withIsolationScope($);return X.withSetIsolationScope(Y,$)}return X.withIsolationScope(Z[0])}function $0(){return l0().getClient()}function BG(Z){let J=Z.getPropagationContext(),{traceId:X,parentSpanId:Y,propagationSpanId:$}=J,Q={trace_id:X,span_id:$||w9()};if(Y)Q.parent_span_id=Y;return Q}var h1="sentry.source",e9="sentry.sample_rate",$A="sentry.previous_trace_sample_rate",M0="sentry.op",I0="sentry.origin";var ER="sentry.measurement_unit",kR="sentry.measurement_value",r4="sentry.custom_span_name",wG="sentry.profile_id",OG="sentry.exclusive_time",QA="cache.hit",KA="cache.key",WA="cache.item_size";var GA=0,SX=1,l5=2;function RG(Z){if(Z<400&&Z>=100)return{code:1};if(Z>=400&&Z<500)switch(Z){case 401:return{code:2,message:"unauthenticated"};case 403:return{code:2,message:"permission_denied"};case 404:return{code:2,message:"not_found"};case 409:return{code:2,message:"already_exists"};case 413:return{code:2,message:"failed_precondition"};case 429:return{code:2,message:"resource_exhausted"};case 499:return{code:2,message:"cancelled"};default:return{code:2,message:"invalid_argument"}}if(Z>=500&&Z<600)switch(Z){case 501:return{code:2,message:"unimplemented"};case 503:return{code:2,message:"unavailable"};case 504:return{code:2,message:"deadline_exceeded"};default:return{code:2,message:"internal_error"}}return{code:2,message:"unknown_error"}}function MG(Z,J){Z.setAttribute("http.response.status_code",J);let X=RG(J);if(X.message!=="unknown_error")Z.setStatus(X)}var aK0="_sentryScope",sK0="_sentryIsolationScope";function UF(Z,J,X){if(Z)B8(Z,sK0,X),B8(Z,aK0,J)}function t4(Z){return{scope:Z[aK0],isolationScope:Z[sK0]}}function R9(Z){if(typeof Z==="boolean")return Number(Z);let J=typeof Z==="string"?parseFloat(Z):Z;if(typeof J!=="number"||isNaN(J)||J<0||J>1)return;return J}var LF="sentry-",rK0=/^sentry-/,tK0=8192;function AX(Z){let J=$Q(Z);if(!J)return;let X=Object.entries(J).reduce((Y,[$,Q])=>{if($.match(rK0)){let K=$.slice(LF.length);Y[K]=Q}return Y},{});if(Object.keys(X).length>0)return X;else return}function xX(Z){if(!Z)return;let J=Object.entries(Z).reduce((X,[Y,$])=>{if($)X[`${LF}${Y}`]=$;return X},{});return IR(J)}function $Q(Z){if(!Z||!JQ(Z)&&!Array.isArray(Z))return;if(Array.isArray(Z))return Z.reduce((J,X)=>{let Y=oK0(X);return Object.entries(Y).forEach(([$,Q])=>{J[$]=Q}),J},{});return oK0(Z)}function oK0(Z){return Z.split(",").map((J)=>J.split("=").map((X)=>{try{return decodeURIComponent(X.trim())}catch{return}})).reduce((J,[X,Y])=>{if(X&&Y)J[X]=Y;return J},{})}function IR(Z){if(Object.keys(Z).length===0)return;return Object.entries(Z).reduce((J,[X,Y],$)=>{let Q=`${encodeURIComponent(X)}=${encodeURIComponent(Y)}`,K=$===0?Q:`${J},${Q}`;if(K.length>tK0)return e&&g.warn(`Not adding key: ${X} with val: ${Y} to baggage header due to exceeding baggage size limits.`),J;else return K},"")}var BF=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function eK0(Z){if(!Z)return;let J=Z.match(BF);if(!J)return;let X;if(J[3]==="1")X=!0;else if(J[3]==="0")X=!1;return{traceId:J[1],parentSampled:X,parentSpanId:J[2]}}function QQ(Z,J){let X=eK0(Z),Y=AX(J);if(!X?.traceId)return{traceId:B9(),sampleRand:Math.random()};let $=$r1(X,Y);if(Y)Y.sample_rand=$.toString();let{traceId:Q,parentSpanId:K,parentSampled:W}=X;return{traceId:Q,parentSpanId:K,sampled:W,dsc:Y||{},sampleRand:$}}function hX(Z=B9(),J=w9(),X){let Y="";if(X!==void 0)Y=X?"-1":"-0";return`${Z}-${J}${Y}`}function $r1(Z,J){let X=R9(J?.sample_rand);if(X!==void 0)return X;let Y=R9(J?.sample_rate);if(Y&&Z?.parentSampled!==void 0)return Z.parentSampled?Math.random()*Y:Y+Math.random()*(1-Y);else return Math.random()}var _R=0,vR=1,ZW0=!1;function XW0(Z){let{spanId:J,traceId:X}=Z.spanContext(),{data:Y,op:$,parent_span_id:Q,status:K,origin:W,links:G}=w0(Z);return{parent_span_id:Q,span_id:J,trace_id:X,data:Y,op:$,status:K,origin:W,links:G}}function fX(Z){let{spanId:J,traceId:X,isRemote:Y}=Z.spanContext(),$=Y?J:w0(Z).parent_span_id,Q=t4(Z).scope,K=Y?Q?.getPropagationContext().propagationSpanId||w9():J;return{parent_span_id:$,span_id:K,trace_id:X}}function OF(Z){let{traceId:J,spanId:X}=Z.spanContext(),Y=o7(Z);return hX(J,X,Y)}function KQ(Z){if(Z&&Z.length>0)return Z.map(({context:{spanId:J,traceId:X,traceFlags:Y,...$},attributes:Q})=>({span_id:J,trace_id:X,sampled:Y===vR,attributes:Q,...$}));else return}function p5(Z){if(typeof Z==="number")return JW0(Z);if(Array.isArray(Z))return Z[0]+Z[1]/1e9;if(Z instanceof Date)return JW0(Z.getTime());return L9()}function JW0(Z){return Z>9999999999?Z/1000:Z}function w0(Z){if(Kr1(Z))return Z.getSpanJSON();let{spanId:J,traceId:X}=Z.spanContext();if(Qr1(Z)){let{attributes:Y,startTime:$,name:Q,endTime:K,status:W,links:G}=Z,V="parentSpanId"in Z?Z.parentSpanId:("parentSpanContext"in Z)?Z.parentSpanContext?.spanId:void 0;return{span_id:J,trace_id:X,data:Y,description:Q,parent_span_id:V,start_timestamp:p5($),timestamp:p5(K)||void 0,status:WQ(W),op:Y[M0],origin:Y[I0],links:KQ(G)}}return{span_id:J,trace_id:X,start_timestamp:0,data:{}}}function Qr1(Z){let J=Z;return!!J.attributes&&!!J.startTime&&!!J.name&&!!J.endTime&&!!J.status}function Kr1(Z){return typeof Z.getSpanJSON==="function"}function o7(Z){let{traceFlags:J}=Z.spanContext();return J===vR}function WQ(Z){if(!Z||Z.code===GA)return;if(Z.code===SX)return"ok";return Z.message||"unknown_error"}var wF="_sentryChildSpans",VA="_sentryRootSpan";function NG(Z,J){let X=Z[VA]||Z;if(B8(J,VA,X),Z[wF])Z[wF].add(J);else B8(Z,wF,new Set([J]))}function RF(Z){let J=new Set;function X(Y){if(J.has(Y))return;else if(o7(Y)){J.add(Y);let $=Y[wF]?Array.from(Y[wF]):[];for(let Q of $)X(Q)}}return X(Z),Array.from(J)}function p1(Z){return Z[VA]||Z}function e4(){let Z=b6(),J=t9(Z);if(J.getActiveSpan)return J.getActiveSpan();return o4(l0())}function MF(){if(!ZW0)$8(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.")}),ZW0=!0}function zA(Z,J){Z.updateName(J),Z.setAttributes({[h1]:"custom",[r4]:J})}var FA="?",YW0=/\(error: (.*)\)/,$W0=/captureMessage|captureException/;function AR(...Z){let J=Z.sort((X,Y)=>X[0]-Y[0]).map((X)=>X[1]);return(X,Y=0,$=0)=>{let Q=[],K=X.split(`
466
466
  `);for(let W=Y;W<K.length;W++){let G=K[W];if(G.length>1024)continue;let V=YW0.test(G)?G.replace(YW0,"$1"):G;if(V.match(/\S*Error: /))continue;for(let z of J){let F=z(V);if(F){Q.push(F);break}}if(Q.length>=50+$)break}return QW0(Q.slice($))}}function qA(Z){if(Array.isArray(Z))return AR(...Z);return Z}function QW0(Z){if(!Z.length)return[];let J=Array.from(Z);if(/sentryWrapped/.test(SR(J).function||""))J.pop();if(J.reverse(),$W0.test(SR(J).function||"")){if(J.pop(),$W0.test(SR(J).function||""))J.pop()}return J.slice(0,50).map((X)=>({...X,filename:X.filename||SR(J).filename,function:X.function||"?"}))}function SR(Z){return Z[Z.length-1]||{}}var HA="<anonymous>";function NF(Z){try{if(!Z||typeof Z!=="function")return HA;return Z.name||HA}catch(J){return HA}}function xR(Z){let J=Z.exception;if(J){let X=[];try{return J.values.forEach((Y)=>{if(Y.stacktrace.frames)X.push(...Y.stacktrace.frames)}),X}catch(Y){return}}return}var hR={},KW0={};function jG(Z,J){hR[Z]=hR[Z]||[],hR[Z].push(J)}function DG(Z,J){if(!KW0[Z]){KW0[Z]=!0;try{J()}catch(X){e&&g.error(`Error while instrumenting ${Z}`,X)}}}function PG(Z,J){let X=Z&&hR[Z];if(!X)return;for(let Y of X)try{Y(J)}catch($){e&&g.error(`Error while triggering instrumentation handler.
467
467
  Type: ${Z}
468
468
  Name: ${NF(Y)}