@f2c/mcp 0.4.7 → 0.4.9
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/dist/cli.js +46 -513
- package/dist/cli.js.map +60 -30
- package/dist/stdio.js +46 -513
- package/dist/stdio.js.map +60 -30
- package/dist/streamable-http.js +115 -577
- package/dist/streamable-http.js.map +64 -33
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,515 +1,48 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var eJ=Object.create;var{getPrototypeOf:v6,defineProperty:C0,getOwnPropertyNames:f6}=Object;var Q6=Object.prototype.hasOwnProperty;var x1=(f,v,h)=>{h=f!=null?eJ(v6(f)):{};let J=v||!f||!f.__esModule?C0(h,"default",{value:f,enumerable:!0}):h;for(let Q of f6(f))if(!Q6.call(J,Q))C0(J,Q,{get:()=>f[Q],enumerable:!0});return J};var n=(f,v)=>()=>(v||f((v={exports:{}}).exports,v),v.exports);var $X=(f,v)=>{for(var h in v)C0(f,h,{get:v[h],enumerable:!0,configurable:!0,set:(J)=>v[h]=()=>J})};var T0=(f,v)=>()=>(f&&(v=f(f=0)),v);function J6(f){fh=f}function Z1(){return fh}function g(f,v){let h=Z1(),J=r1({issueData:v,data:f.data,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,h,h===ef?void 0:ef].filter((Q)=>!!Q)});f.common.issues.push(J)}class Rv{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(f,v){let h=[];for(let J of v){if(J.status==="aborted")return p;if(J.status==="dirty")f.dirty();h.push(J.value)}return{status:f.value,value:h}}static async mergeObjectAsync(f,v){let h=[];for(let J of v){let Q=await J.key,W=await J.value;h.push({key:Q,value:W})}return Rv.mergeObjectSync(f,h)}static mergeObjectSync(f,v){let h={};for(let J of v){let{key:Q,value:W}=J;if(Q.status==="aborted")return p;if(W.status==="aborted")return p;if(Q.status==="dirty")f.dirty();if(W.status==="dirty")f.dirty();if(Q.value!=="__proto__"&&(typeof W.value!=="undefined"||J.alwaysSet))h[Q.value]=W.value}return{status:f.value,value:h}}}function u1(f,v,h,J){if(h==="a"&&!J)throw new TypeError("Private accessor was defined without a getter");if(typeof v==="function"?f!==v||!J:!v.has(f))throw new TypeError("Cannot read private member from an object whose class did not declare it");return h==="m"?J:h==="a"?J.call(f):J?J.value:v.get(f)}function Qh(f,v,h,J,Q){if(J==="m")throw new TypeError("Private method is not writable");if(J==="a"&&!Q)throw new TypeError("Private accessor was defined without a setter");if(typeof v==="function"?f!==v||!Q:!v.has(f))throw new TypeError("Cannot write private member to an object whose class did not declare it");return J==="a"?Q.call(f,h):Q?Q.value=h:v.set(f,h),h}class ff{constructor(f,v,h,J){this._cachedPath=[],this.parent=f,this.data=v,this._path=h,this._key=J}get path(){if(!this._cachedPath.length)if(this._key instanceof Array)this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function d(f){if(!f)return{};let{errorMap:v,invalid_type_error:h,required_error:J,description:Q}=f;if(v&&(h||J))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(v)return{errorMap:v,description:Q};return{errorMap:(X,Y)=>{var B,q;let{message:D}=f;if(X.code==="invalid_enum_value")return{message:D!==null&&D!==void 0?D:Y.defaultError};if(typeof Y.data==="undefined")return{message:(B=D!==null&&D!==void 0?D:J)!==null&&B!==void 0?B:Y.defaultError};if(X.code!=="invalid_type")return{message:Y.defaultError};return{message:(q=D!==null&&D!==void 0?D:h)!==null&&q!==void 0?q:Y.defaultError}},description:Q}}class i{get description(){return this._def.description}_getType(f){return Kf(f.data)}_getOrReturnCtx(f,v){return v||{common:f.parent.common,data:f.data,parsedType:Kf(f.data),schemaErrorMap:this._def.errorMap,path:f.path,parent:f.parent}}_processInputParams(f){return{status:new Rv,ctx:{common:f.parent.common,data:f.data,parsedType:Kf(f.data),schemaErrorMap:this._def.errorMap,path:f.path,parent:f.parent}}}_parseSync(f){let v=this._parse(f);if(M1(v))throw new Error("Synchronous parse encountered promise.");return v}_parseAsync(f){let v=this._parse(f);return Promise.resolve(v)}parse(f,v){let h=this.safeParse(f,v);if(h.success)return h.data;throw h.error}safeParse(f,v){var h;let J={common:{issues:[],async:(h=v===null||v===void 0?void 0:v.async)!==null&&h!==void 0?h:!1,contextualErrorMap:v===null||v===void 0?void 0:v.errorMap},path:(v===null||v===void 0?void 0:v.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:f,parsedType:Kf(f)},Q=this._parseSync({data:f,path:J.path,parent:J});return oQ(J,Q)}"~validate"(f){var v,h;let J={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:f,parsedType:Kf(f)};if(!this["~standard"].async)try{let Q=this._parseSync({data:f,path:[],parent:J});return gf(Q)?{value:Q.value}:{issues:J.common.issues}}catch(Q){if((h=(v=Q===null||Q===void 0?void 0:Q.message)===null||v===void 0?void 0:v.toLowerCase())===null||h===void 0?void 0:h.includes("encountered"))this["~standard"].async=!0;J.common={issues:[],async:!0}}return this._parseAsync({data:f,path:[],parent:J}).then((Q)=>gf(Q)?{value:Q.value}:{issues:J.common.issues})}async parseAsync(f,v){let h=await this.safeParseAsync(f,v);if(h.success)return h.data;throw h.error}async safeParseAsync(f,v){let h={common:{issues:[],contextualErrorMap:v===null||v===void 0?void 0:v.errorMap,async:!0},path:(v===null||v===void 0?void 0:v.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:f,parsedType:Kf(f)},J=this._parse({data:f,path:h.path,parent:h}),Q=await(M1(J)?J:Promise.resolve(J));return oQ(h,Q)}refine(f,v){let h=(J)=>{if(typeof v==="string"||typeof v==="undefined")return{message:v};else if(typeof v==="function")return v(J);else return v};return this._refinement((J,Q)=>{let W=f(J),X=()=>Q.addIssue({code:U.custom,...h(J)});if(typeof Promise!=="undefined"&&W instanceof Promise)return W.then((Y)=>{if(!Y)return X(),!1;else return!0});if(!W)return X(),!1;else return!0})}refinement(f,v){return this._refinement((h,J)=>{if(!f(h))return J.addIssue(typeof v==="function"?v(h,J):v),!1;else return!0})}_refinement(f){return new iv({schema:this,typeName:z.ZodEffects,effect:{type:"refinement",refinement:f}})}superRefine(f){return this._refinement(f)}constructor(f){this.spa=this.safeParseAsync,this._def=f,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(v)=>this["~validate"](v)}}optional(){return mv.create(this,this._def)}nullable(){return $f.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return vf.create(this)}promise(){return Tf.create(this,this._def)}or(f){return h1.create([this,f],this._def)}and(f){return J1.create(this,f,this._def)}transform(f){return new iv({...d(this._def),schema:this,typeName:z.ZodEffects,effect:{type:"transform",transform:f}})}default(f){let v=typeof f==="function"?f:()=>f;return new Y1({...d(this._def),innerType:this,defaultValue:v,typeName:z.ZodDefault})}brand(){return new a1({typeName:z.ZodBranded,type:this,...d(this._def)})}catch(f){let v=typeof f==="function"?f:()=>f;return new B1({...d(this._def),innerType:this,catchValue:v,typeName:z.ZodCatch})}describe(f){return new this.constructor({...this._def,description:f})}pipe(f){return z1.create(this,f)}readonly(){return G1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function Jh(f){let v="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";if(f.precision)v=`${v}\\.\\d{${f.precision}}`;else if(f.precision==null)v=`${v}(\\.\\d+)?`;return v}function V6(f){return new RegExp(`^${Jh(f)}$`)}function Wh(f){let v=`${hh}T${Jh(f)}`,h=[];if(h.push(f.local?"Z?":"Z"),f.offset)h.push("([+-]\\d{2}:?\\d{2})");return v=`${v}(${h.join("|")})`,new RegExp(`^${v}$`)}function F6(f,v){if((v==="v4"||!v)&&O6.test(f))return!0;if((v==="v6"||!v)&&$6.test(f))return!0;return!1}function N6(f,v){if(!w6.test(f))return!1;try{let[h]=f.split("."),J=h.replace(/-/g,"+").replace(/_/g,"/").padEnd(h.length+(4-h.length%4)%4,"="),Q=JSON.parse(atob(J));if(typeof Q!=="object"||Q===null)return!1;if(!Q.typ||!Q.alg)return!1;if(v&&Q.alg!==v)return!1;return!0}catch(h){return!1}}function U6(f,v){if((v==="v4"||!v)&&K6.test(f))return!0;if((v==="v6"||!v)&&j6.test(f))return!0;return!1}function z6(f,v){let h=(f.toString().split(".")[1]||"").length,J=(v.toString().split(".")[1]||"").length,Q=h>J?h:J,W=parseInt(f.toFixed(Q).replace(".","")),X=parseInt(v.toFixed(Q).replace(".",""));return W%X/Math.pow(10,Q)}function tf(f){if(f instanceof $v){let v={};for(let h in f.shape){let J=f.shape[h];v[h]=mv.create(tf(J))}return new $v({...f._def,shape:()=>v})}else if(f instanceof vf)return new vf({...f._def,type:tf(f.element)});else if(f instanceof mv)return mv.create(tf(f.unwrap()));else if(f instanceof $f)return $f.create(tf(f.unwrap()));else if(f instanceof Yf)return Yf.create(f.items.map((v)=>tf(v)));else return f}function m0(f,v){let h=Kf(f),J=Kf(v);if(f===v)return{valid:!0,data:f};else if(h===I.object&&J===I.object){let Q=hv.objectKeys(v),W=hv.objectKeys(f).filter((Y)=>Q.indexOf(Y)!==-1),X={...f,...v};for(let Y of W){let B=m0(f[Y],v[Y]);if(!B.valid)return{valid:!1};X[Y]=B.data}return{valid:!0,data:X}}else if(h===I.array&&J===I.array){if(f.length!==v.length)return{valid:!1};let Q=[];for(let W=0;W<f.length;W++){let X=f[W],Y=v[W],B=m0(X,Y);if(!B.valid)return{valid:!1};Q.push(B.data)}return{valid:!0,data:Q}}else if(h===I.date&&J===I.date&&+f===+v)return{valid:!0,data:f};else return{valid:!1}}function Ph(f,v){return new Nf({values:f,typeName:z.ZodEnum,...d(v)})}function eQ(f,v){let h=typeof f==="function"?f(v):typeof f==="string"?{message:f}:f;return typeof h==="string"?{message:h}:h}function Xh(f,v={},h){if(f)return If.create().superRefine((J,Q)=>{var W,X;let Y=f(J);if(Y instanceof Promise)return Y.then((B)=>{var q,D;if(!B){let j=eQ(v,J),L=(D=(q=j.fatal)!==null&&q!==void 0?q:h)!==null&&D!==void 0?D:!0;Q.addIssue({code:"custom",...j,fatal:L})}});if(!Y){let B=eQ(v,J),q=(X=(W=B.fatal)!==null&&W!==void 0?W:h)!==null&&X!==void 0?X:!0;Q.addIssue({code:"custom",...B,fatal:q})}return});return If.create()}var hv,Z0,I,Kf=(f)=>{switch(typeof f){case"undefined":return I.undefined;case"string":return I.string;case"number":return isNaN(f)?I.nan:I.number;case"boolean":return I.boolean;case"function":return I.function;case"bigint":return I.bigint;case"symbol":return I.symbol;case"object":if(Array.isArray(f))return I.array;if(f===null)return I.null;if(f.then&&typeof f.then==="function"&&f.catch&&typeof f.catch==="function")return I.promise;if(typeof Map!=="undefined"&&f instanceof Map)return I.map;if(typeof Set!=="undefined"&&f instanceof Set)return I.set;if(typeof Date!=="undefined"&&f instanceof Date)return I.date;return I.object;default:return I.unknown}},U,h6=(f)=>{return JSON.stringify(f,null,2).replace(/"([^"]+)":/g,"$1:")},uv,ef=(f,v)=>{let h;switch(f.code){case U.invalid_type:if(f.received===I.undefined)h="Required";else h=`Expected ${f.expected}, received ${f.received}`;break;case U.invalid_literal:h=`Invalid literal value, expected ${JSON.stringify(f.expected,hv.jsonStringifyReplacer)}`;break;case U.unrecognized_keys:h=`Unrecognized key(s) in object: ${hv.joinValues(f.keys,", ")}`;break;case U.invalid_union:h="Invalid input";break;case U.invalid_union_discriminator:h=`Invalid discriminator value. Expected ${hv.joinValues(f.options)}`;break;case U.invalid_enum_value:h=`Invalid enum value. Expected ${hv.joinValues(f.options)}, received '${f.received}'`;break;case U.invalid_arguments:h="Invalid function arguments";break;case U.invalid_return_type:h="Invalid function return type";break;case U.invalid_date:h="Invalid date";break;case U.invalid_string:if(typeof f.validation==="object")if("includes"in f.validation){if(h=`Invalid input: must include "${f.validation.includes}"`,typeof f.validation.position==="number")h=`${h} at one or more positions greater than or equal to ${f.validation.position}`}else if("startsWith"in f.validation)h=`Invalid input: must start with "${f.validation.startsWith}"`;else if("endsWith"in f.validation)h=`Invalid input: must end with "${f.validation.endsWith}"`;else hv.assertNever(f.validation);else if(f.validation!=="regex")h=`Invalid ${f.validation}`;else h="Invalid";break;case U.too_small:if(f.type==="array")h=`Array must contain ${f.exact?"exactly":f.inclusive?"at least":"more than"} ${f.minimum} element(s)`;else if(f.type==="string")h=`String must contain ${f.exact?"exactly":f.inclusive?"at least":"over"} ${f.minimum} character(s)`;else if(f.type==="number")h=`Number must be ${f.exact?"exactly equal to ":f.inclusive?"greater than or equal to ":"greater than "}${f.minimum}`;else if(f.type==="date")h=`Date must be ${f.exact?"exactly equal to ":f.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(f.minimum))}`;else h="Invalid input";break;case U.too_big:if(f.type==="array")h=`Array must contain ${f.exact?"exactly":f.inclusive?"at most":"less than"} ${f.maximum} element(s)`;else if(f.type==="string")h=`String must contain ${f.exact?"exactly":f.inclusive?"at most":"under"} ${f.maximum} character(s)`;else if(f.type==="number")h=`Number must be ${f.exact?"exactly":f.inclusive?"less than or equal to":"less than"} ${f.maximum}`;else if(f.type==="bigint")h=`BigInt must be ${f.exact?"exactly":f.inclusive?"less than or equal to":"less than"} ${f.maximum}`;else if(f.type==="date")h=`Date must be ${f.exact?"exactly":f.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(f.maximum))}`;else h="Invalid input";break;case U.custom:h="Invalid input";break;case U.invalid_intersection_types:h="Intersection results could not be merged";break;case U.not_multiple_of:h=`Number must be a multiple of ${f.multipleOf}`;break;case U.not_finite:h="Number must be finite";break;default:h=v.defaultError,hv.assertNever(f)}return{message:h}},fh,r1=(f)=>{let{data:v,path:h,errorMaps:J,issueData:Q}=f,W=[...h,...Q.path||[]],X={...Q,path:W};if(Q.message!==void 0)return{...Q,path:W,message:Q.message};let Y="",B=J.filter((q)=>!!q).slice().reverse();for(let q of B)Y=q(X,{data:v,defaultError:Y}).message;return{...Q,path:W,message:Y}},W6,p,sf=(f)=>({status:"dirty",value:f}),gv=(f)=>({status:"valid",value:f}),r0=(f)=>f.status==="aborted",u0=(f)=>f.status==="dirty",gf=(f)=>f.status==="valid",M1=(f)=>typeof Promise!=="undefined"&&f instanceof Promise,u,j1,L1,oQ=(f,v)=>{if(gf(v))return{success:!0,data:v.value};else{if(!f.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let h=new uv(f.common.issues);return this._error=h,this._error}}}},P6,X6,Y6,B6,G6,w6,q6,D6,H6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",x0,O6,K6,$6,j6,L6,M6,hh="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",E6,ev,Vf,Ff,v1,yf,E1,f1,Q1,If,Ef,Xf,V1,vf,$v,h1,Of=(f)=>{if(f instanceof W1)return Of(f.schema);else if(f instanceof iv)return Of(f.innerType());else if(f instanceof P1)return[f.value];else if(f instanceof Nf)return f.options;else if(f instanceof X1)return hv.objectValues(f.enum);else if(f instanceof Y1)return Of(f._def.innerType);else if(f instanceof f1)return[void 0];else if(f instanceof Q1)return[null];else if(f instanceof mv)return[void 0,...Of(f.unwrap())];else if(f instanceof $f)return[null,...Of(f.unwrap())];else if(f instanceof a1)return Of(f.unwrap());else if(f instanceof G1)return Of(f.unwrap());else if(f instanceof B1)return Of(f._def.innerType);else return[]},m1,J1,Yf,F1,N1,Cf,of,W1,P1,Nf,X1,Tf,iv,mv,$f,Y1,B1,U1,A6,a1,z1,G1,S6,z,b6=(f,v={message:`Input not instance of ${f.name}`})=>Xh((h)=>h instanceof f,v),Yh,Bh,R6,_6,Gh,l6,k6,g6,y6,I6,C6,T6,x6,Z6,r6,u6,m6,a6,c6,p6,n6,i6,d6,t6,s6,o6,e6,vW,fW,vh,QW,hW,JW,WW,PW=()=>Yh().optional(),XW=()=>Bh().optional(),YW=()=>Gh().optional(),BW,GW,P;var av=T0(()=>{(function(f){f.assertEqual=(Q)=>Q;function v(Q){}f.assertIs=v;function h(Q){throw new Error}f.assertNever=h,f.arrayToEnum=(Q)=>{let W={};for(let X of Q)W[X]=X;return W},f.getValidEnumValues=(Q)=>{let W=f.objectKeys(Q).filter((Y)=>typeof Q[Q[Y]]!=="number"),X={};for(let Y of W)X[Y]=Q[Y];return f.objectValues(X)},f.objectValues=(Q)=>{return f.objectKeys(Q).map(function(W){return Q[W]})},f.objectKeys=typeof Object.keys==="function"?(Q)=>Object.keys(Q):(Q)=>{let W=[];for(let X in Q)if(Object.prototype.hasOwnProperty.call(Q,X))W.push(X);return W},f.find=(Q,W)=>{for(let X of Q)if(W(X))return X;return},f.isInteger=typeof Number.isInteger==="function"?(Q)=>Number.isInteger(Q):(Q)=>typeof Q==="number"&&isFinite(Q)&&Math.floor(Q)===Q;function J(Q,W=" | "){return Q.map((X)=>typeof X==="string"?`'${X}'`:X).join(W)}f.joinValues=J,f.jsonStringifyReplacer=(Q,W)=>{if(typeof W==="bigint")return W.toString();return W}})(hv||(hv={}));(function(f){f.mergeShapes=(v,h)=>{return{...v,...h}}})(Z0||(Z0={}));I=hv.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),U=hv.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);uv=class uv extends Error{get errors(){return this.issues}constructor(f){super();this.issues=[],this.addIssue=(h)=>{this.issues=[...this.issues,h]},this.addIssues=(h=[])=>{this.issues=[...this.issues,...h]};let v=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,v);else this.__proto__=v;this.name="ZodError",this.issues=f}format(f){let v=f||function(Q){return Q.message},h={_errors:[]},J=(Q)=>{for(let W of Q.issues)if(W.code==="invalid_union")W.unionErrors.map(J);else if(W.code==="invalid_return_type")J(W.returnTypeError);else if(W.code==="invalid_arguments")J(W.argumentsError);else if(W.path.length===0)h._errors.push(v(W));else{let X=h,Y=0;while(Y<W.path.length){let B=W.path[Y];if(Y!==W.path.length-1)X[B]=X[B]||{_errors:[]};else X[B]=X[B]||{_errors:[]},X[B]._errors.push(v(W));X=X[B],Y++}}};return J(this),h}static assert(f){if(!(f instanceof uv))throw new Error(`Not a ZodError: ${f}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,hv.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(f=(v)=>v.message){let v={},h=[];for(let J of this.issues)if(J.path.length>0)v[J.path[0]]=v[J.path[0]]||[],v[J.path[0]].push(f(J));else h.push(f(J));return{formErrors:h,fieldErrors:v}}get formErrors(){return this.flatten()}};uv.create=(f)=>{return new uv(f)};fh=ef;W6=[];p=Object.freeze({status:"aborted"});(function(f){f.errToObj=(v)=>typeof v==="string"?{message:v}:v||{},f.toString=(v)=>typeof v==="string"?v:v===null||v===void 0?void 0:v.message})(u||(u={}));P6=/^c[^\s-]{8,}$/i,X6=/^[0-9a-z]+$/,Y6=/^[0-9A-HJKMNP-TV-Z]{26}$/i,B6=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,G6=/^[a-z0-9_-]{21}$/i,w6=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,q6=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,D6=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,O6=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,K6=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,$6=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,j6=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,L6=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,M6=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,E6=new RegExp(`^${hh}$`);ev=class ev extends i{_parse(f){if(this._def.coerce)f.data=String(f.data);if(this._getType(f)!==I.string){let Q=this._getOrReturnCtx(f);return g(Q,{code:U.invalid_type,expected:I.string,received:Q.parsedType}),p}let h=new Rv,J=void 0;for(let Q of this._def.checks)if(Q.kind==="min"){if(f.data.length<Q.value)J=this._getOrReturnCtx(f,J),g(J,{code:U.too_small,minimum:Q.value,type:"string",inclusive:!0,exact:!1,message:Q.message}),h.dirty()}else if(Q.kind==="max"){if(f.data.length>Q.value)J=this._getOrReturnCtx(f,J),g(J,{code:U.too_big,maximum:Q.value,type:"string",inclusive:!0,exact:!1,message:Q.message}),h.dirty()}else if(Q.kind==="length"){let W=f.data.length>Q.value,X=f.data.length<Q.value;if(W||X){if(J=this._getOrReturnCtx(f,J),W)g(J,{code:U.too_big,maximum:Q.value,type:"string",inclusive:!0,exact:!0,message:Q.message});else if(X)g(J,{code:U.too_small,minimum:Q.value,type:"string",inclusive:!0,exact:!0,message:Q.message});h.dirty()}}else if(Q.kind==="email"){if(!D6.test(f.data))J=this._getOrReturnCtx(f,J),g(J,{validation:"email",code:U.invalid_string,message:Q.message}),h.dirty()}else if(Q.kind==="emoji"){if(!x0)x0=new RegExp(H6,"u");if(!x0.test(f.data))J=this._getOrReturnCtx(f,J),g(J,{validation:"emoji",code:U.invalid_string,message:Q.message}),h.dirty()}else if(Q.kind==="uuid"){if(!B6.test(f.data))J=this._getOrReturnCtx(f,J),g(J,{validation:"uuid",code:U.invalid_string,message:Q.message}),h.dirty()}else if(Q.kind==="nanoid"){if(!G6.test(f.data))J=this._getOrReturnCtx(f,J),g(J,{validation:"nanoid",code:U.invalid_string,message:Q.message}),h.dirty()}else if(Q.kind==="cuid"){if(!P6.test(f.data))J=this._getOrReturnCtx(f,J),g(J,{validation:"cuid",code:U.invalid_string,message:Q.message}),h.dirty()}else if(Q.kind==="cuid2"){if(!X6.test(f.data))J=this._getOrReturnCtx(f,J),g(J,{validation:"cuid2",code:U.invalid_string,message:Q.message}),h.dirty()}else if(Q.kind==="ulid"){if(!Y6.test(f.data))J=this._getOrReturnCtx(f,J),g(J,{validation:"ulid",code:U.invalid_string,message:Q.message}),h.dirty()}else if(Q.kind==="url")try{new URL(f.data)}catch(W){J=this._getOrReturnCtx(f,J),g(J,{validation:"url",code:U.invalid_string,message:Q.message}),h.dirty()}else if(Q.kind==="regex"){if(Q.regex.lastIndex=0,!Q.regex.test(f.data))J=this._getOrReturnCtx(f,J),g(J,{validation:"regex",code:U.invalid_string,message:Q.message}),h.dirty()}else if(Q.kind==="trim")f.data=f.data.trim();else if(Q.kind==="includes"){if(!f.data.includes(Q.value,Q.position))J=this._getOrReturnCtx(f,J),g(J,{code:U.invalid_string,validation:{includes:Q.value,position:Q.position},message:Q.message}),h.dirty()}else if(Q.kind==="toLowerCase")f.data=f.data.toLowerCase();else if(Q.kind==="toUpperCase")f.data=f.data.toUpperCase();else if(Q.kind==="startsWith"){if(!f.data.startsWith(Q.value))J=this._getOrReturnCtx(f,J),g(J,{code:U.invalid_string,validation:{startsWith:Q.value},message:Q.message}),h.dirty()}else if(Q.kind==="endsWith"){if(!f.data.endsWith(Q.value))J=this._getOrReturnCtx(f,J),g(J,{code:U.invalid_string,validation:{endsWith:Q.value},message:Q.message}),h.dirty()}else if(Q.kind==="datetime"){if(!Wh(Q).test(f.data))J=this._getOrReturnCtx(f,J),g(J,{code:U.invalid_string,validation:"datetime",message:Q.message}),h.dirty()}else if(Q.kind==="date"){if(!E6.test(f.data))J=this._getOrReturnCtx(f,J),g(J,{code:U.invalid_string,validation:"date",message:Q.message}),h.dirty()}else if(Q.kind==="time"){if(!V6(Q).test(f.data))J=this._getOrReturnCtx(f,J),g(J,{code:U.invalid_string,validation:"time",message:Q.message}),h.dirty()}else if(Q.kind==="duration"){if(!q6.test(f.data))J=this._getOrReturnCtx(f,J),g(J,{validation:"duration",code:U.invalid_string,message:Q.message}),h.dirty()}else if(Q.kind==="ip"){if(!F6(f.data,Q.version))J=this._getOrReturnCtx(f,J),g(J,{validation:"ip",code:U.invalid_string,message:Q.message}),h.dirty()}else if(Q.kind==="jwt"){if(!N6(f.data,Q.alg))J=this._getOrReturnCtx(f,J),g(J,{validation:"jwt",code:U.invalid_string,message:Q.message}),h.dirty()}else if(Q.kind==="cidr"){if(!U6(f.data,Q.version))J=this._getOrReturnCtx(f,J),g(J,{validation:"cidr",code:U.invalid_string,message:Q.message}),h.dirty()}else if(Q.kind==="base64"){if(!L6.test(f.data))J=this._getOrReturnCtx(f,J),g(J,{validation:"base64",code:U.invalid_string,message:Q.message}),h.dirty()}else if(Q.kind==="base64url"){if(!M6.test(f.data))J=this._getOrReturnCtx(f,J),g(J,{validation:"base64url",code:U.invalid_string,message:Q.message}),h.dirty()}else hv.assertNever(Q);return{status:h.value,value:f.data}}_regex(f,v,h){return this.refinement((J)=>f.test(J),{validation:v,code:U.invalid_string,...u.errToObj(h)})}_addCheck(f){return new ev({...this._def,checks:[...this._def.checks,f]})}email(f){return this._addCheck({kind:"email",...u.errToObj(f)})}url(f){return this._addCheck({kind:"url",...u.errToObj(f)})}emoji(f){return this._addCheck({kind:"emoji",...u.errToObj(f)})}uuid(f){return this._addCheck({kind:"uuid",...u.errToObj(f)})}nanoid(f){return this._addCheck({kind:"nanoid",...u.errToObj(f)})}cuid(f){return this._addCheck({kind:"cuid",...u.errToObj(f)})}cuid2(f){return this._addCheck({kind:"cuid2",...u.errToObj(f)})}ulid(f){return this._addCheck({kind:"ulid",...u.errToObj(f)})}base64(f){return this._addCheck({kind:"base64",...u.errToObj(f)})}base64url(f){return this._addCheck({kind:"base64url",...u.errToObj(f)})}jwt(f){return this._addCheck({kind:"jwt",...u.errToObj(f)})}ip(f){return this._addCheck({kind:"ip",...u.errToObj(f)})}cidr(f){return this._addCheck({kind:"cidr",...u.errToObj(f)})}datetime(f){var v,h;if(typeof f==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:f});return this._addCheck({kind:"datetime",precision:typeof(f===null||f===void 0?void 0:f.precision)==="undefined"?null:f===null||f===void 0?void 0:f.precision,offset:(v=f===null||f===void 0?void 0:f.offset)!==null&&v!==void 0?v:!1,local:(h=f===null||f===void 0?void 0:f.local)!==null&&h!==void 0?h:!1,...u.errToObj(f===null||f===void 0?void 0:f.message)})}date(f){return this._addCheck({kind:"date",message:f})}time(f){if(typeof f==="string")return this._addCheck({kind:"time",precision:null,message:f});return this._addCheck({kind:"time",precision:typeof(f===null||f===void 0?void 0:f.precision)==="undefined"?null:f===null||f===void 0?void 0:f.precision,...u.errToObj(f===null||f===void 0?void 0:f.message)})}duration(f){return this._addCheck({kind:"duration",...u.errToObj(f)})}regex(f,v){return this._addCheck({kind:"regex",regex:f,...u.errToObj(v)})}includes(f,v){return this._addCheck({kind:"includes",value:f,position:v===null||v===void 0?void 0:v.position,...u.errToObj(v===null||v===void 0?void 0:v.message)})}startsWith(f,v){return this._addCheck({kind:"startsWith",value:f,...u.errToObj(v)})}endsWith(f,v){return this._addCheck({kind:"endsWith",value:f,...u.errToObj(v)})}min(f,v){return this._addCheck({kind:"min",value:f,...u.errToObj(v)})}max(f,v){return this._addCheck({kind:"max",value:f,...u.errToObj(v)})}length(f,v){return this._addCheck({kind:"length",value:f,...u.errToObj(v)})}nonempty(f){return this.min(1,u.errToObj(f))}trim(){return new ev({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ev({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ev({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((f)=>f.kind==="datetime")}get isDate(){return!!this._def.checks.find((f)=>f.kind==="date")}get isTime(){return!!this._def.checks.find((f)=>f.kind==="time")}get isDuration(){return!!this._def.checks.find((f)=>f.kind==="duration")}get isEmail(){return!!this._def.checks.find((f)=>f.kind==="email")}get isURL(){return!!this._def.checks.find((f)=>f.kind==="url")}get isEmoji(){return!!this._def.checks.find((f)=>f.kind==="emoji")}get isUUID(){return!!this._def.checks.find((f)=>f.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((f)=>f.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((f)=>f.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((f)=>f.kind==="cuid2")}get isULID(){return!!this._def.checks.find((f)=>f.kind==="ulid")}get isIP(){return!!this._def.checks.find((f)=>f.kind==="ip")}get isCIDR(){return!!this._def.checks.find((f)=>f.kind==="cidr")}get isBase64(){return!!this._def.checks.find((f)=>f.kind==="base64")}get isBase64url(){return!!this._def.checks.find((f)=>f.kind==="base64url")}get minLength(){let f=null;for(let v of this._def.checks)if(v.kind==="min"){if(f===null||v.value>f)f=v.value}return f}get maxLength(){let f=null;for(let v of this._def.checks)if(v.kind==="max"){if(f===null||v.value<f)f=v.value}return f}};ev.create=(f)=>{var v;return new ev({checks:[],typeName:z.ZodString,coerce:(v=f===null||f===void 0?void 0:f.coerce)!==null&&v!==void 0?v:!1,...d(f)})};Vf=class Vf extends i{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(f){if(this._def.coerce)f.data=Number(f.data);if(this._getType(f)!==I.number){let Q=this._getOrReturnCtx(f);return g(Q,{code:U.invalid_type,expected:I.number,received:Q.parsedType}),p}let h=void 0,J=new Rv;for(let Q of this._def.checks)if(Q.kind==="int"){if(!hv.isInteger(f.data))h=this._getOrReturnCtx(f,h),g(h,{code:U.invalid_type,expected:"integer",received:"float",message:Q.message}),J.dirty()}else if(Q.kind==="min"){if(Q.inclusive?f.data<Q.value:f.data<=Q.value)h=this._getOrReturnCtx(f,h),g(h,{code:U.too_small,minimum:Q.value,type:"number",inclusive:Q.inclusive,exact:!1,message:Q.message}),J.dirty()}else if(Q.kind==="max"){if(Q.inclusive?f.data>Q.value:f.data>=Q.value)h=this._getOrReturnCtx(f,h),g(h,{code:U.too_big,maximum:Q.value,type:"number",inclusive:Q.inclusive,exact:!1,message:Q.message}),J.dirty()}else if(Q.kind==="multipleOf"){if(z6(f.data,Q.value)!==0)h=this._getOrReturnCtx(f,h),g(h,{code:U.not_multiple_of,multipleOf:Q.value,message:Q.message}),J.dirty()}else if(Q.kind==="finite"){if(!Number.isFinite(f.data))h=this._getOrReturnCtx(f,h),g(h,{code:U.not_finite,message:Q.message}),J.dirty()}else hv.assertNever(Q);return{status:J.value,value:f.data}}gte(f,v){return this.setLimit("min",f,!0,u.toString(v))}gt(f,v){return this.setLimit("min",f,!1,u.toString(v))}lte(f,v){return this.setLimit("max",f,!0,u.toString(v))}lt(f,v){return this.setLimit("max",f,!1,u.toString(v))}setLimit(f,v,h,J){return new Vf({...this._def,checks:[...this._def.checks,{kind:f,value:v,inclusive:h,message:u.toString(J)}]})}_addCheck(f){return new Vf({...this._def,checks:[...this._def.checks,f]})}int(f){return this._addCheck({kind:"int",message:u.toString(f)})}positive(f){return this._addCheck({kind:"min",value:0,inclusive:!1,message:u.toString(f)})}negative(f){return this._addCheck({kind:"max",value:0,inclusive:!1,message:u.toString(f)})}nonpositive(f){return this._addCheck({kind:"max",value:0,inclusive:!0,message:u.toString(f)})}nonnegative(f){return this._addCheck({kind:"min",value:0,inclusive:!0,message:u.toString(f)})}multipleOf(f,v){return this._addCheck({kind:"multipleOf",value:f,message:u.toString(v)})}finite(f){return this._addCheck({kind:"finite",message:u.toString(f)})}safe(f){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:u.toString(f)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:u.toString(f)})}get minValue(){let f=null;for(let v of this._def.checks)if(v.kind==="min"){if(f===null||v.value>f)f=v.value}return f}get maxValue(){let f=null;for(let v of this._def.checks)if(v.kind==="max"){if(f===null||v.value<f)f=v.value}return f}get isInt(){return!!this._def.checks.find((f)=>f.kind==="int"||f.kind==="multipleOf"&&hv.isInteger(f.value))}get isFinite(){let f=null,v=null;for(let h of this._def.checks)if(h.kind==="finite"||h.kind==="int"||h.kind==="multipleOf")return!0;else if(h.kind==="min"){if(v===null||h.value>v)v=h.value}else if(h.kind==="max"){if(f===null||h.value<f)f=h.value}return Number.isFinite(v)&&Number.isFinite(f)}};Vf.create=(f)=>{return new Vf({checks:[],typeName:z.ZodNumber,coerce:(f===null||f===void 0?void 0:f.coerce)||!1,...d(f)})};Ff=class Ff extends i{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(f){if(this._def.coerce)try{f.data=BigInt(f.data)}catch(Q){return this._getInvalidInput(f)}if(this._getType(f)!==I.bigint)return this._getInvalidInput(f);let h=void 0,J=new Rv;for(let Q of this._def.checks)if(Q.kind==="min"){if(Q.inclusive?f.data<Q.value:f.data<=Q.value)h=this._getOrReturnCtx(f,h),g(h,{code:U.too_small,type:"bigint",minimum:Q.value,inclusive:Q.inclusive,message:Q.message}),J.dirty()}else if(Q.kind==="max"){if(Q.inclusive?f.data>Q.value:f.data>=Q.value)h=this._getOrReturnCtx(f,h),g(h,{code:U.too_big,type:"bigint",maximum:Q.value,inclusive:Q.inclusive,message:Q.message}),J.dirty()}else if(Q.kind==="multipleOf"){if(f.data%Q.value!==BigInt(0))h=this._getOrReturnCtx(f,h),g(h,{code:U.not_multiple_of,multipleOf:Q.value,message:Q.message}),J.dirty()}else hv.assertNever(Q);return{status:J.value,value:f.data}}_getInvalidInput(f){let v=this._getOrReturnCtx(f);return g(v,{code:U.invalid_type,expected:I.bigint,received:v.parsedType}),p}gte(f,v){return this.setLimit("min",f,!0,u.toString(v))}gt(f,v){return this.setLimit("min",f,!1,u.toString(v))}lte(f,v){return this.setLimit("max",f,!0,u.toString(v))}lt(f,v){return this.setLimit("max",f,!1,u.toString(v))}setLimit(f,v,h,J){return new Ff({...this._def,checks:[...this._def.checks,{kind:f,value:v,inclusive:h,message:u.toString(J)}]})}_addCheck(f){return new Ff({...this._def,checks:[...this._def.checks,f]})}positive(f){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:u.toString(f)})}negative(f){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:u.toString(f)})}nonpositive(f){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:u.toString(f)})}nonnegative(f){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:u.toString(f)})}multipleOf(f,v){return this._addCheck({kind:"multipleOf",value:f,message:u.toString(v)})}get minValue(){let f=null;for(let v of this._def.checks)if(v.kind==="min"){if(f===null||v.value>f)f=v.value}return f}get maxValue(){let f=null;for(let v of this._def.checks)if(v.kind==="max"){if(f===null||v.value<f)f=v.value}return f}};Ff.create=(f)=>{var v;return new Ff({checks:[],typeName:z.ZodBigInt,coerce:(v=f===null||f===void 0?void 0:f.coerce)!==null&&v!==void 0?v:!1,...d(f)})};v1=class v1 extends i{_parse(f){if(this._def.coerce)f.data=Boolean(f.data);if(this._getType(f)!==I.boolean){let h=this._getOrReturnCtx(f);return g(h,{code:U.invalid_type,expected:I.boolean,received:h.parsedType}),p}return gv(f.data)}};v1.create=(f)=>{return new v1({typeName:z.ZodBoolean,coerce:(f===null||f===void 0?void 0:f.coerce)||!1,...d(f)})};yf=class yf extends i{_parse(f){if(this._def.coerce)f.data=new Date(f.data);if(this._getType(f)!==I.date){let Q=this._getOrReturnCtx(f);return g(Q,{code:U.invalid_type,expected:I.date,received:Q.parsedType}),p}if(isNaN(f.data.getTime())){let Q=this._getOrReturnCtx(f);return g(Q,{code:U.invalid_date}),p}let h=new Rv,J=void 0;for(let Q of this._def.checks)if(Q.kind==="min"){if(f.data.getTime()<Q.value)J=this._getOrReturnCtx(f,J),g(J,{code:U.too_small,message:Q.message,inclusive:!0,exact:!1,minimum:Q.value,type:"date"}),h.dirty()}else if(Q.kind==="max"){if(f.data.getTime()>Q.value)J=this._getOrReturnCtx(f,J),g(J,{code:U.too_big,message:Q.message,inclusive:!0,exact:!1,maximum:Q.value,type:"date"}),h.dirty()}else hv.assertNever(Q);return{status:h.value,value:new Date(f.data.getTime())}}_addCheck(f){return new yf({...this._def,checks:[...this._def.checks,f]})}min(f,v){return this._addCheck({kind:"min",value:f.getTime(),message:u.toString(v)})}max(f,v){return this._addCheck({kind:"max",value:f.getTime(),message:u.toString(v)})}get minDate(){let f=null;for(let v of this._def.checks)if(v.kind==="min"){if(f===null||v.value>f)f=v.value}return f!=null?new Date(f):null}get maxDate(){let f=null;for(let v of this._def.checks)if(v.kind==="max"){if(f===null||v.value<f)f=v.value}return f!=null?new Date(f):null}};yf.create=(f)=>{return new yf({checks:[],coerce:(f===null||f===void 0?void 0:f.coerce)||!1,typeName:z.ZodDate,...d(f)})};E1=class E1 extends i{_parse(f){if(this._getType(f)!==I.symbol){let h=this._getOrReturnCtx(f);return g(h,{code:U.invalid_type,expected:I.symbol,received:h.parsedType}),p}return gv(f.data)}};E1.create=(f)=>{return new E1({typeName:z.ZodSymbol,...d(f)})};f1=class f1 extends i{_parse(f){if(this._getType(f)!==I.undefined){let h=this._getOrReturnCtx(f);return g(h,{code:U.invalid_type,expected:I.undefined,received:h.parsedType}),p}return gv(f.data)}};f1.create=(f)=>{return new f1({typeName:z.ZodUndefined,...d(f)})};Q1=class Q1 extends i{_parse(f){if(this._getType(f)!==I.null){let h=this._getOrReturnCtx(f);return g(h,{code:U.invalid_type,expected:I.null,received:h.parsedType}),p}return gv(f.data)}};Q1.create=(f)=>{return new Q1({typeName:z.ZodNull,...d(f)})};If=class If extends i{constructor(){super(...arguments);this._any=!0}_parse(f){return gv(f.data)}};If.create=(f)=>{return new If({typeName:z.ZodAny,...d(f)})};Ef=class Ef extends i{constructor(){super(...arguments);this._unknown=!0}_parse(f){return gv(f.data)}};Ef.create=(f)=>{return new Ef({typeName:z.ZodUnknown,...d(f)})};Xf=class Xf extends i{_parse(f){let v=this._getOrReturnCtx(f);return g(v,{code:U.invalid_type,expected:I.never,received:v.parsedType}),p}};Xf.create=(f)=>{return new Xf({typeName:z.ZodNever,...d(f)})};V1=class V1 extends i{_parse(f){if(this._getType(f)!==I.undefined){let h=this._getOrReturnCtx(f);return g(h,{code:U.invalid_type,expected:I.void,received:h.parsedType}),p}return gv(f.data)}};V1.create=(f)=>{return new V1({typeName:z.ZodVoid,...d(f)})};vf=class vf extends i{_parse(f){let{ctx:v,status:h}=this._processInputParams(f),J=this._def;if(v.parsedType!==I.array)return g(v,{code:U.invalid_type,expected:I.array,received:v.parsedType}),p;if(J.exactLength!==null){let W=v.data.length>J.exactLength.value,X=v.data.length<J.exactLength.value;if(W||X)g(v,{code:W?U.too_big:U.too_small,minimum:X?J.exactLength.value:void 0,maximum:W?J.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:J.exactLength.message}),h.dirty()}if(J.minLength!==null){if(v.data.length<J.minLength.value)g(v,{code:U.too_small,minimum:J.minLength.value,type:"array",inclusive:!0,exact:!1,message:J.minLength.message}),h.dirty()}if(J.maxLength!==null){if(v.data.length>J.maxLength.value)g(v,{code:U.too_big,maximum:J.maxLength.value,type:"array",inclusive:!0,exact:!1,message:J.maxLength.message}),h.dirty()}if(v.common.async)return Promise.all([...v.data].map((W,X)=>{return J.type._parseAsync(new ff(v,W,v.path,X))})).then((W)=>{return Rv.mergeArray(h,W)});let Q=[...v.data].map((W,X)=>{return J.type._parseSync(new ff(v,W,v.path,X))});return Rv.mergeArray(h,Q)}get element(){return this._def.type}min(f,v){return new vf({...this._def,minLength:{value:f,message:u.toString(v)}})}max(f,v){return new vf({...this._def,maxLength:{value:f,message:u.toString(v)}})}length(f,v){return new vf({...this._def,exactLength:{value:f,message:u.toString(v)}})}nonempty(f){return this.min(1,f)}};vf.create=(f,v)=>{return new vf({type:f,minLength:null,maxLength:null,exactLength:null,typeName:z.ZodArray,...d(v)})};$v=class $v extends i{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let f=this._def.shape(),v=hv.objectKeys(f);return this._cached={shape:f,keys:v}}_parse(f){if(this._getType(f)!==I.object){let B=this._getOrReturnCtx(f);return g(B,{code:U.invalid_type,expected:I.object,received:B.parsedType}),p}let{status:h,ctx:J}=this._processInputParams(f),{shape:Q,keys:W}=this._getCached(),X=[];if(!(this._def.catchall instanceof Xf&&this._def.unknownKeys==="strip")){for(let B in J.data)if(!W.includes(B))X.push(B)}let Y=[];for(let B of W){let q=Q[B],D=J.data[B];Y.push({key:{status:"valid",value:B},value:q._parse(new ff(J,D,J.path,B)),alwaysSet:B in J.data})}if(this._def.catchall instanceof Xf){let B=this._def.unknownKeys;if(B==="passthrough")for(let q of X)Y.push({key:{status:"valid",value:q},value:{status:"valid",value:J.data[q]}});else if(B==="strict"){if(X.length>0)g(J,{code:U.unrecognized_keys,keys:X}),h.dirty()}else if(B==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let B=this._def.catchall;for(let q of X){let D=J.data[q];Y.push({key:{status:"valid",value:q},value:B._parse(new ff(J,D,J.path,q)),alwaysSet:q in J.data})}}if(J.common.async)return Promise.resolve().then(async()=>{let B=[];for(let q of Y){let D=await q.key,j=await q.value;B.push({key:D,value:j,alwaysSet:q.alwaysSet})}return B}).then((B)=>{return Rv.mergeObjectSync(h,B)});else return Rv.mergeObjectSync(h,Y)}get shape(){return this._def.shape()}strict(f){return u.errToObj,new $v({...this._def,unknownKeys:"strict",...f!==void 0?{errorMap:(v,h)=>{var J,Q,W,X;let Y=(W=(Q=(J=this._def).errorMap)===null||Q===void 0?void 0:Q.call(J,v,h).message)!==null&&W!==void 0?W:h.defaultError;if(v.code==="unrecognized_keys")return{message:(X=u.errToObj(f).message)!==null&&X!==void 0?X:Y};return{message:Y}}}:{}})}strip(){return new $v({...this._def,unknownKeys:"strip"})}passthrough(){return new $v({...this._def,unknownKeys:"passthrough"})}extend(f){return new $v({...this._def,shape:()=>({...this._def.shape(),...f})})}merge(f){return new $v({unknownKeys:f._def.unknownKeys,catchall:f._def.catchall,shape:()=>({...this._def.shape(),...f._def.shape()}),typeName:z.ZodObject})}setKey(f,v){return this.augment({[f]:v})}catchall(f){return new $v({...this._def,catchall:f})}pick(f){let v={};return hv.objectKeys(f).forEach((h)=>{if(f[h]&&this.shape[h])v[h]=this.shape[h]}),new $v({...this._def,shape:()=>v})}omit(f){let v={};return hv.objectKeys(this.shape).forEach((h)=>{if(!f[h])v[h]=this.shape[h]}),new $v({...this._def,shape:()=>v})}deepPartial(){return tf(this)}partial(f){let v={};return hv.objectKeys(this.shape).forEach((h)=>{let J=this.shape[h];if(f&&!f[h])v[h]=J;else v[h]=J.optional()}),new $v({...this._def,shape:()=>v})}required(f){let v={};return hv.objectKeys(this.shape).forEach((h)=>{if(f&&!f[h])v[h]=this.shape[h];else{let Q=this.shape[h];while(Q instanceof mv)Q=Q._def.innerType;v[h]=Q}}),new $v({...this._def,shape:()=>v})}keyof(){return Ph(hv.objectKeys(this.shape))}};$v.create=(f,v)=>{return new $v({shape:()=>f,unknownKeys:"strip",catchall:Xf.create(),typeName:z.ZodObject,...d(v)})};$v.strictCreate=(f,v)=>{return new $v({shape:()=>f,unknownKeys:"strict",catchall:Xf.create(),typeName:z.ZodObject,...d(v)})};$v.lazycreate=(f,v)=>{return new $v({shape:f,unknownKeys:"strip",catchall:Xf.create(),typeName:z.ZodObject,...d(v)})};h1=class h1 extends i{_parse(f){let{ctx:v}=this._processInputParams(f),h=this._def.options;function J(Q){for(let X of Q)if(X.result.status==="valid")return X.result;for(let X of Q)if(X.result.status==="dirty")return v.common.issues.push(...X.ctx.common.issues),X.result;let W=Q.map((X)=>new uv(X.ctx.common.issues));return g(v,{code:U.invalid_union,unionErrors:W}),p}if(v.common.async)return Promise.all(h.map(async(Q)=>{let W={...v,common:{...v.common,issues:[]},parent:null};return{result:await Q._parseAsync({data:v.data,path:v.path,parent:W}),ctx:W}})).then(J);else{let Q=void 0,W=[];for(let Y of h){let B={...v,common:{...v.common,issues:[]},parent:null},q=Y._parseSync({data:v.data,path:v.path,parent:B});if(q.status==="valid")return q;else if(q.status==="dirty"&&!Q)Q={result:q,ctx:B};if(B.common.issues.length)W.push(B.common.issues)}if(Q)return v.common.issues.push(...Q.ctx.common.issues),Q.result;let X=W.map((Y)=>new uv(Y));return g(v,{code:U.invalid_union,unionErrors:X}),p}}get options(){return this._def.options}};h1.create=(f,v)=>{return new h1({options:f,typeName:z.ZodUnion,...d(v)})};m1=class m1 extends i{_parse(f){let{ctx:v}=this._processInputParams(f);if(v.parsedType!==I.object)return g(v,{code:U.invalid_type,expected:I.object,received:v.parsedType}),p;let h=this.discriminator,J=v.data[h],Q=this.optionsMap.get(J);if(!Q)return g(v,{code:U.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[h]}),p;if(v.common.async)return Q._parseAsync({data:v.data,path:v.path,parent:v});else return Q._parseSync({data:v.data,path:v.path,parent:v})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(f,v,h){let J=new Map;for(let Q of v){let W=Of(Q.shape[f]);if(!W.length)throw new Error(`A discriminator value for key \`${f}\` could not be extracted from all schema options`);for(let X of W){if(J.has(X))throw new Error(`Discriminator property ${String(f)} has duplicate value ${String(X)}`);J.set(X,Q)}}return new m1({typeName:z.ZodDiscriminatedUnion,discriminator:f,options:v,optionsMap:J,...d(h)})}};J1=class J1 extends i{_parse(f){let{status:v,ctx:h}=this._processInputParams(f),J=(Q,W)=>{if(r0(Q)||r0(W))return p;let X=m0(Q.value,W.value);if(!X.valid)return g(h,{code:U.invalid_intersection_types}),p;if(u0(Q)||u0(W))v.dirty();return{status:v.value,value:X.data}};if(h.common.async)return Promise.all([this._def.left._parseAsync({data:h.data,path:h.path,parent:h}),this._def.right._parseAsync({data:h.data,path:h.path,parent:h})]).then(([Q,W])=>J(Q,W));else return J(this._def.left._parseSync({data:h.data,path:h.path,parent:h}),this._def.right._parseSync({data:h.data,path:h.path,parent:h}))}};J1.create=(f,v,h)=>{return new J1({left:f,right:v,typeName:z.ZodIntersection,...d(h)})};Yf=class Yf extends i{_parse(f){let{status:v,ctx:h}=this._processInputParams(f);if(h.parsedType!==I.array)return g(h,{code:U.invalid_type,expected:I.array,received:h.parsedType}),p;if(h.data.length<this._def.items.length)return g(h,{code:U.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),p;if(!this._def.rest&&h.data.length>this._def.items.length)g(h,{code:U.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),v.dirty();let Q=[...h.data].map((W,X)=>{let Y=this._def.items[X]||this._def.rest;if(!Y)return null;return Y._parse(new ff(h,W,h.path,X))}).filter((W)=>!!W);if(h.common.async)return Promise.all(Q).then((W)=>{return Rv.mergeArray(v,W)});else return Rv.mergeArray(v,Q)}get items(){return this._def.items}rest(f){return new Yf({...this._def,rest:f})}};Yf.create=(f,v)=>{if(!Array.isArray(f))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Yf({items:f,typeName:z.ZodTuple,rest:null,...d(v)})};F1=class F1 extends i{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(f){let{status:v,ctx:h}=this._processInputParams(f);if(h.parsedType!==I.object)return g(h,{code:U.invalid_type,expected:I.object,received:h.parsedType}),p;let J=[],Q=this._def.keyType,W=this._def.valueType;for(let X in h.data)J.push({key:Q._parse(new ff(h,X,h.path,X)),value:W._parse(new ff(h,h.data[X],h.path,X)),alwaysSet:X in h.data});if(h.common.async)return Rv.mergeObjectAsync(v,J);else return Rv.mergeObjectSync(v,J)}get element(){return this._def.valueType}static create(f,v,h){if(v instanceof i)return new F1({keyType:f,valueType:v,typeName:z.ZodRecord,...d(h)});return new F1({keyType:ev.create(),valueType:f,typeName:z.ZodRecord,...d(v)})}};N1=class N1 extends i{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(f){let{status:v,ctx:h}=this._processInputParams(f);if(h.parsedType!==I.map)return g(h,{code:U.invalid_type,expected:I.map,received:h.parsedType}),p;let J=this._def.keyType,Q=this._def.valueType,W=[...h.data.entries()].map(([X,Y],B)=>{return{key:J._parse(new ff(h,X,h.path,[B,"key"])),value:Q._parse(new ff(h,Y,h.path,[B,"value"]))}});if(h.common.async){let X=new Map;return Promise.resolve().then(async()=>{for(let Y of W){let B=await Y.key,q=await Y.value;if(B.status==="aborted"||q.status==="aborted")return p;if(B.status==="dirty"||q.status==="dirty")v.dirty();X.set(B.value,q.value)}return{status:v.value,value:X}})}else{let X=new Map;for(let Y of W){let{key:B,value:q}=Y;if(B.status==="aborted"||q.status==="aborted")return p;if(B.status==="dirty"||q.status==="dirty")v.dirty();X.set(B.value,q.value)}return{status:v.value,value:X}}}};N1.create=(f,v,h)=>{return new N1({valueType:v,keyType:f,typeName:z.ZodMap,...d(h)})};Cf=class Cf extends i{_parse(f){let{status:v,ctx:h}=this._processInputParams(f);if(h.parsedType!==I.set)return g(h,{code:U.invalid_type,expected:I.set,received:h.parsedType}),p;let J=this._def;if(J.minSize!==null){if(h.data.size<J.minSize.value)g(h,{code:U.too_small,minimum:J.minSize.value,type:"set",inclusive:!0,exact:!1,message:J.minSize.message}),v.dirty()}if(J.maxSize!==null){if(h.data.size>J.maxSize.value)g(h,{code:U.too_big,maximum:J.maxSize.value,type:"set",inclusive:!0,exact:!1,message:J.maxSize.message}),v.dirty()}let Q=this._def.valueType;function W(Y){let B=new Set;for(let q of Y){if(q.status==="aborted")return p;if(q.status==="dirty")v.dirty();B.add(q.value)}return{status:v.value,value:B}}let X=[...h.data.values()].map((Y,B)=>Q._parse(new ff(h,Y,h.path,B)));if(h.common.async)return Promise.all(X).then((Y)=>W(Y));else return W(X)}min(f,v){return new Cf({...this._def,minSize:{value:f,message:u.toString(v)}})}max(f,v){return new Cf({...this._def,maxSize:{value:f,message:u.toString(v)}})}size(f,v){return this.min(f,v).max(f,v)}nonempty(f){return this.min(1,f)}};Cf.create=(f,v)=>{return new Cf({valueType:f,minSize:null,maxSize:null,typeName:z.ZodSet,...d(v)})};of=class of extends i{constructor(){super(...arguments);this.validate=this.implement}_parse(f){let{ctx:v}=this._processInputParams(f);if(v.parsedType!==I.function)return g(v,{code:U.invalid_type,expected:I.function,received:v.parsedType}),p;function h(X,Y){return r1({data:X,path:v.path,errorMaps:[v.common.contextualErrorMap,v.schemaErrorMap,Z1(),ef].filter((B)=>!!B),issueData:{code:U.invalid_arguments,argumentsError:Y}})}function J(X,Y){return r1({data:X,path:v.path,errorMaps:[v.common.contextualErrorMap,v.schemaErrorMap,Z1(),ef].filter((B)=>!!B),issueData:{code:U.invalid_return_type,returnTypeError:Y}})}let Q={errorMap:v.common.contextualErrorMap},W=v.data;if(this._def.returns instanceof Tf){let X=this;return gv(async function(...Y){let B=new uv([]),q=await X._def.args.parseAsync(Y,Q).catch((L)=>{throw B.addIssue(h(Y,L)),B}),D=await Reflect.apply(W,this,q);return await X._def.returns._def.type.parseAsync(D,Q).catch((L)=>{throw B.addIssue(J(D,L)),B})})}else{let X=this;return gv(function(...Y){let B=X._def.args.safeParse(Y,Q);if(!B.success)throw new uv([h(Y,B.error)]);let q=Reflect.apply(W,this,B.data),D=X._def.returns.safeParse(q,Q);if(!D.success)throw new uv([J(q,D.error)]);return D.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...f){return new of({...this._def,args:Yf.create(f).rest(Ef.create())})}returns(f){return new of({...this._def,returns:f})}implement(f){return this.parse(f)}strictImplement(f){return this.parse(f)}static create(f,v,h){return new of({args:f?f:Yf.create([]).rest(Ef.create()),returns:v||Ef.create(),typeName:z.ZodFunction,...d(h)})}};W1=class W1 extends i{get schema(){return this._def.getter()}_parse(f){let{ctx:v}=this._processInputParams(f);return this._def.getter()._parse({data:v.data,path:v.path,parent:v})}};W1.create=(f,v)=>{return new W1({getter:f,typeName:z.ZodLazy,...d(v)})};P1=class P1 extends i{_parse(f){if(f.data!==this._def.value){let v=this._getOrReturnCtx(f);return g(v,{received:v.data,code:U.invalid_literal,expected:this._def.value}),p}return{status:"valid",value:f.data}}get value(){return this._def.value}};P1.create=(f,v)=>{return new P1({value:f,typeName:z.ZodLiteral,...d(v)})};Nf=class Nf extends i{constructor(){super(...arguments);j1.set(this,void 0)}_parse(f){if(typeof f.data!=="string"){let v=this._getOrReturnCtx(f),h=this._def.values;return g(v,{expected:hv.joinValues(h),received:v.parsedType,code:U.invalid_type}),p}if(!u1(this,j1,"f"))Qh(this,j1,new Set(this._def.values),"f");if(!u1(this,j1,"f").has(f.data)){let v=this._getOrReturnCtx(f),h=this._def.values;return g(v,{received:v.data,code:U.invalid_enum_value,options:h}),p}return gv(f.data)}get options(){return this._def.values}get enum(){let f={};for(let v of this._def.values)f[v]=v;return f}get Values(){let f={};for(let v of this._def.values)f[v]=v;return f}get Enum(){let f={};for(let v of this._def.values)f[v]=v;return f}extract(f,v=this._def){return Nf.create(f,{...this._def,...v})}exclude(f,v=this._def){return Nf.create(this.options.filter((h)=>!f.includes(h)),{...this._def,...v})}};j1=new WeakMap;Nf.create=Ph;X1=class X1 extends i{constructor(){super(...arguments);L1.set(this,void 0)}_parse(f){let v=hv.getValidEnumValues(this._def.values),h=this._getOrReturnCtx(f);if(h.parsedType!==I.string&&h.parsedType!==I.number){let J=hv.objectValues(v);return g(h,{expected:hv.joinValues(J),received:h.parsedType,code:U.invalid_type}),p}if(!u1(this,L1,"f"))Qh(this,L1,new Set(hv.getValidEnumValues(this._def.values)),"f");if(!u1(this,L1,"f").has(f.data)){let J=hv.objectValues(v);return g(h,{received:h.data,code:U.invalid_enum_value,options:J}),p}return gv(f.data)}get enum(){return this._def.values}};L1=new WeakMap;X1.create=(f,v)=>{return new X1({values:f,typeName:z.ZodNativeEnum,...d(v)})};Tf=class Tf extends i{unwrap(){return this._def.type}_parse(f){let{ctx:v}=this._processInputParams(f);if(v.parsedType!==I.promise&&v.common.async===!1)return g(v,{code:U.invalid_type,expected:I.promise,received:v.parsedType}),p;let h=v.parsedType===I.promise?v.data:Promise.resolve(v.data);return gv(h.then((J)=>{return this._def.type.parseAsync(J,{path:v.path,errorMap:v.common.contextualErrorMap})}))}};Tf.create=(f,v)=>{return new Tf({type:f,typeName:z.ZodPromise,...d(v)})};iv=class iv extends i{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===z.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(f){let{status:v,ctx:h}=this._processInputParams(f),J=this._def.effect||null,Q={addIssue:(W)=>{if(g(h,W),W.fatal)v.abort();else v.dirty()},get path(){return h.path}};if(Q.addIssue=Q.addIssue.bind(Q),J.type==="preprocess"){let W=J.transform(h.data,Q);if(h.common.async)return Promise.resolve(W).then(async(X)=>{if(v.value==="aborted")return p;let Y=await this._def.schema._parseAsync({data:X,path:h.path,parent:h});if(Y.status==="aborted")return p;if(Y.status==="dirty")return sf(Y.value);if(v.value==="dirty")return sf(Y.value);return Y});else{if(v.value==="aborted")return p;let X=this._def.schema._parseSync({data:W,path:h.path,parent:h});if(X.status==="aborted")return p;if(X.status==="dirty")return sf(X.value);if(v.value==="dirty")return sf(X.value);return X}}if(J.type==="refinement"){let W=(X)=>{let Y=J.refinement(X,Q);if(h.common.async)return Promise.resolve(Y);if(Y instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return X};if(h.common.async===!1){let X=this._def.schema._parseSync({data:h.data,path:h.path,parent:h});if(X.status==="aborted")return p;if(X.status==="dirty")v.dirty();return W(X.value),{status:v.value,value:X.value}}else return this._def.schema._parseAsync({data:h.data,path:h.path,parent:h}).then((X)=>{if(X.status==="aborted")return p;if(X.status==="dirty")v.dirty();return W(X.value).then(()=>{return{status:v.value,value:X.value}})})}if(J.type==="transform")if(h.common.async===!1){let W=this._def.schema._parseSync({data:h.data,path:h.path,parent:h});if(!gf(W))return W;let X=J.transform(W.value,Q);if(X instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:v.value,value:X}}else return this._def.schema._parseAsync({data:h.data,path:h.path,parent:h}).then((W)=>{if(!gf(W))return W;return Promise.resolve(J.transform(W.value,Q)).then((X)=>({status:v.value,value:X}))});hv.assertNever(J)}};iv.create=(f,v,h)=>{return new iv({schema:f,typeName:z.ZodEffects,effect:v,...d(h)})};iv.createWithPreprocess=(f,v,h)=>{return new iv({schema:v,effect:{type:"preprocess",transform:f},typeName:z.ZodEffects,...d(h)})};mv=class mv extends i{_parse(f){if(this._getType(f)===I.undefined)return gv(void 0);return this._def.innerType._parse(f)}unwrap(){return this._def.innerType}};mv.create=(f,v)=>{return new mv({innerType:f,typeName:z.ZodOptional,...d(v)})};$f=class $f extends i{_parse(f){if(this._getType(f)===I.null)return gv(null);return this._def.innerType._parse(f)}unwrap(){return this._def.innerType}};$f.create=(f,v)=>{return new $f({innerType:f,typeName:z.ZodNullable,...d(v)})};Y1=class Y1 extends i{_parse(f){let{ctx:v}=this._processInputParams(f),h=v.data;if(v.parsedType===I.undefined)h=this._def.defaultValue();return this._def.innerType._parse({data:h,path:v.path,parent:v})}removeDefault(){return this._def.innerType}};Y1.create=(f,v)=>{return new Y1({innerType:f,typeName:z.ZodDefault,defaultValue:typeof v.default==="function"?v.default:()=>v.default,...d(v)})};B1=class B1 extends i{_parse(f){let{ctx:v}=this._processInputParams(f),h={...v,common:{...v.common,issues:[]}},J=this._def.innerType._parse({data:h.data,path:h.path,parent:{...h}});if(M1(J))return J.then((Q)=>{return{status:"valid",value:Q.status==="valid"?Q.value:this._def.catchValue({get error(){return new uv(h.common.issues)},input:h.data})}});else return{status:"valid",value:J.status==="valid"?J.value:this._def.catchValue({get error(){return new uv(h.common.issues)},input:h.data})}}removeCatch(){return this._def.innerType}};B1.create=(f,v)=>{return new B1({innerType:f,typeName:z.ZodCatch,catchValue:typeof v.catch==="function"?v.catch:()=>v.catch,...d(v)})};U1=class U1 extends i{_parse(f){if(this._getType(f)!==I.nan){let h=this._getOrReturnCtx(f);return g(h,{code:U.invalid_type,expected:I.nan,received:h.parsedType}),p}return{status:"valid",value:f.data}}};U1.create=(f)=>{return new U1({typeName:z.ZodNaN,...d(f)})};A6=Symbol("zod_brand");a1=class a1 extends i{_parse(f){let{ctx:v}=this._processInputParams(f),h=v.data;return this._def.type._parse({data:h,path:v.path,parent:v})}unwrap(){return this._def.type}};z1=class z1 extends i{_parse(f){let{status:v,ctx:h}=this._processInputParams(f);if(h.common.async)return(async()=>{let Q=await this._def.in._parseAsync({data:h.data,path:h.path,parent:h});if(Q.status==="aborted")return p;if(Q.status==="dirty")return v.dirty(),sf(Q.value);else return this._def.out._parseAsync({data:Q.value,path:h.path,parent:h})})();else{let J=this._def.in._parseSync({data:h.data,path:h.path,parent:h});if(J.status==="aborted")return p;if(J.status==="dirty")return v.dirty(),{status:"dirty",value:J.value};else return this._def.out._parseSync({data:J.value,path:h.path,parent:h})}}static create(f,v){return new z1({in:f,out:v,typeName:z.ZodPipeline})}};G1=class G1 extends i{_parse(f){let v=this._def.innerType._parse(f),h=(J)=>{if(gf(J))J.value=Object.freeze(J.value);return J};return M1(v)?v.then((J)=>h(J)):h(v)}unwrap(){return this._def.innerType}};G1.create=(f,v)=>{return new G1({innerType:f,typeName:z.ZodReadonly,...d(v)})};S6={object:$v.lazycreate};(function(f){f.ZodString="ZodString",f.ZodNumber="ZodNumber",f.ZodNaN="ZodNaN",f.ZodBigInt="ZodBigInt",f.ZodBoolean="ZodBoolean",f.ZodDate="ZodDate",f.ZodSymbol="ZodSymbol",f.ZodUndefined="ZodUndefined",f.ZodNull="ZodNull",f.ZodAny="ZodAny",f.ZodUnknown="ZodUnknown",f.ZodNever="ZodNever",f.ZodVoid="ZodVoid",f.ZodArray="ZodArray",f.ZodObject="ZodObject",f.ZodUnion="ZodUnion",f.ZodDiscriminatedUnion="ZodDiscriminatedUnion",f.ZodIntersection="ZodIntersection",f.ZodTuple="ZodTuple",f.ZodRecord="ZodRecord",f.ZodMap="ZodMap",f.ZodSet="ZodSet",f.ZodFunction="ZodFunction",f.ZodLazy="ZodLazy",f.ZodLiteral="ZodLiteral",f.ZodEnum="ZodEnum",f.ZodEffects="ZodEffects",f.ZodNativeEnum="ZodNativeEnum",f.ZodOptional="ZodOptional",f.ZodNullable="ZodNullable",f.ZodDefault="ZodDefault",f.ZodCatch="ZodCatch",f.ZodPromise="ZodPromise",f.ZodBranded="ZodBranded",f.ZodPipeline="ZodPipeline",f.ZodReadonly="ZodReadonly"})(z||(z={}));Yh=ev.create,Bh=Vf.create,R6=U1.create,_6=Ff.create,Gh=v1.create,l6=yf.create,k6=E1.create,g6=f1.create,y6=Q1.create,I6=If.create,C6=Ef.create,T6=Xf.create,x6=V1.create,Z6=vf.create,r6=$v.create,u6=$v.strictCreate,m6=h1.create,a6=m1.create,c6=J1.create,p6=Yf.create,n6=F1.create,i6=N1.create,d6=Cf.create,t6=of.create,s6=W1.create,o6=P1.create,e6=Nf.create,vW=X1.create,fW=Tf.create,vh=iv.create,QW=mv.create,hW=$f.create,JW=iv.createWithPreprocess,WW=z1.create,BW={string:(f)=>ev.create({...f,coerce:!0}),number:(f)=>Vf.create({...f,coerce:!0}),boolean:(f)=>v1.create({...f,coerce:!0}),bigint:(f)=>Ff.create({...f,coerce:!0}),date:(f)=>yf.create({...f,coerce:!0})},GW=p,P=Object.freeze({__proto__:null,defaultErrorMap:ef,setErrorMap:J6,getErrorMap:Z1,makeIssue:r1,EMPTY_PATH:W6,addIssueToContext:g,ParseStatus:Rv,INVALID:p,DIRTY:sf,OK:gv,isAborted:r0,isDirty:u0,isValid:gf,isAsync:M1,get util(){return hv},get objectUtil(){return Z0},ZodParsedType:I,getParsedType:Kf,ZodType:i,datetimeRegex:Wh,ZodString:ev,ZodNumber:Vf,ZodBigInt:Ff,ZodBoolean:v1,ZodDate:yf,ZodSymbol:E1,ZodUndefined:f1,ZodNull:Q1,ZodAny:If,ZodUnknown:Ef,ZodNever:Xf,ZodVoid:V1,ZodArray:vf,ZodObject:$v,ZodUnion:h1,ZodDiscriminatedUnion:m1,ZodIntersection:J1,ZodTuple:Yf,ZodRecord:F1,ZodMap:N1,ZodSet:Cf,ZodFunction:of,ZodLazy:W1,ZodLiteral:P1,ZodEnum:Nf,ZodNativeEnum:X1,ZodPromise:Tf,ZodEffects:iv,ZodTransformer:iv,ZodOptional:mv,ZodNullable:$f,ZodDefault:Y1,ZodCatch:B1,ZodNaN:U1,BRAND:A6,ZodBranded:a1,ZodPipeline:z1,ZodReadonly:G1,custom:Xh,Schema:i,ZodSchema:i,late:S6,get ZodFirstPartyTypeKind(){return z},coerce:BW,any:I6,array:Z6,bigint:_6,boolean:Gh,date:l6,discriminatedUnion:a6,effect:vh,enum:e6,function:t6,instanceof:b6,intersection:c6,lazy:s6,literal:o6,map:i6,nan:R6,nativeEnum:vW,never:T6,null:y6,nullable:hW,number:Bh,object:r6,oboolean:YW,onumber:XW,optional:QW,ostring:PW,pipeline:WW,preprocess:JW,promise:fW,record:n6,set:d6,strictObject:u6,string:Yh,symbol:k6,transformer:vh,tuple:p6,undefined:g6,union:m6,unknown:C6,void:x6,NEVER:GW,ZodIssueCode:U,quotelessJson:h6,ZodError:uv})});var a0="2025-06-18",EX="2025-03-26",wh,c1="2.0",qh,Dh,wW,dv,Tv,A1,Bf,tv,p1,Hh,Oh=(f)=>Hh.safeParse(f).success,Kh,$h=(f)=>Kh.safeParse(f).success,jh,c0=(f)=>jh.safeParse(f).success,qv,Lh,Mh=(f)=>Lh.safeParse(f).success,Eh,n1,i1,S1,Vh,qW,d1,VX=(f)=>d1.safeParse(f).success,DW,HW,p0,t1,OW,s1,o1,e1,Fh,Nh,n0,Uh,zh,KW,v0,$W,f0,jW,Q0,LW,MW,EW,VW,FW,NW,UW,h0,zW,J0,i0,d0,t0,AW,SW,Ah,bW,RW,_W,lW,kW,W0,gW,Sh,FX,P0,yW,bh,IW,CW,TW,xW,ZW,rW,s0,uW,mW,aW,cW,pW,nW,o0,iW,dW,X0,tW,sW,oW,e0,eW,NX,UX,zX,AX,SX,bX,Dv;var b1=T0(()=>{av();wh=[a0,"2025-03-26","2024-11-05","2024-10-07"],qh=P.union([P.string(),P.number().int()]),Dh=P.string(),wW=P.object({progressToken:P.optional(qh)}).passthrough(),dv=P.object({_meta:P.optional(wW)}).passthrough(),Tv=P.object({method:P.string(),params:P.optional(dv)}),A1=P.object({_meta:P.optional(P.object({}).passthrough())}).passthrough(),Bf=P.object({method:P.string(),params:P.optional(A1)}),tv=P.object({_meta:P.optional(P.object({}).passthrough())}).passthrough(),p1=P.union([P.string(),P.number().int()]),Hh=P.object({jsonrpc:P.literal(c1),id:p1}).merge(Tv).strict(),Kh=P.object({jsonrpc:P.literal(c1)}).merge(Bf).strict(),jh=P.object({jsonrpc:P.literal(c1),id:p1,result:tv}).strict();(function(f){f[f.ConnectionClosed=-32000]="ConnectionClosed",f[f.RequestTimeout=-32001]="RequestTimeout",f[f.ParseError=-32700]="ParseError",f[f.InvalidRequest=-32600]="InvalidRequest",f[f.MethodNotFound=-32601]="MethodNotFound",f[f.InvalidParams=-32602]="InvalidParams",f[f.InternalError=-32603]="InternalError"})(qv||(qv={}));Lh=P.object({jsonrpc:P.literal(c1),id:p1,error:P.object({code:P.number().int(),message:P.string(),data:P.optional(P.unknown())})}).strict(),Eh=P.union([Hh,Kh,jh,Lh]),n1=tv.strict(),i1=Bf.extend({method:P.literal("notifications/cancelled"),params:A1.extend({requestId:p1,reason:P.string().optional()})}),S1=P.object({name:P.string(),title:P.optional(P.string())}).passthrough(),Vh=S1.extend({version:P.string()}),qW=P.object({experimental:P.optional(P.object({}).passthrough()),sampling:P.optional(P.object({}).passthrough()),elicitation:P.optional(P.object({}).passthrough()),roots:P.optional(P.object({listChanged:P.optional(P.boolean())}).passthrough())}).passthrough(),d1=Tv.extend({method:P.literal("initialize"),params:dv.extend({protocolVersion:P.string(),capabilities:qW,clientInfo:Vh})}),DW=P.object({experimental:P.optional(P.object({}).passthrough()),logging:P.optional(P.object({}).passthrough()),completions:P.optional(P.object({}).passthrough()),prompts:P.optional(P.object({listChanged:P.optional(P.boolean())}).passthrough()),resources:P.optional(P.object({subscribe:P.optional(P.boolean()),listChanged:P.optional(P.boolean())}).passthrough()),tools:P.optional(P.object({listChanged:P.optional(P.boolean())}).passthrough())}).passthrough(),HW=tv.extend({protocolVersion:P.string(),capabilities:DW,serverInfo:Vh,instructions:P.optional(P.string())}),p0=Bf.extend({method:P.literal("notifications/initialized")}),t1=Tv.extend({method:P.literal("ping")}),OW=P.object({progress:P.number(),total:P.optional(P.number()),message:P.optional(P.string())}).passthrough(),s1=Bf.extend({method:P.literal("notifications/progress"),params:A1.merge(OW).extend({progressToken:qh})}),o1=Tv.extend({params:dv.extend({cursor:P.optional(Dh)}).optional()}),e1=tv.extend({nextCursor:P.optional(Dh)}),Fh=P.object({uri:P.string(),mimeType:P.optional(P.string()),_meta:P.optional(P.object({}).passthrough())}).passthrough(),Nh=Fh.extend({text:P.string()}),n0=P.string().refine((f)=>{try{return atob(f),!0}catch(v){return!1}},{message:"Invalid Base64 string"}),Uh=Fh.extend({blob:n0}),zh=S1.extend({uri:P.string(),description:P.optional(P.string()),mimeType:P.optional(P.string()),_meta:P.optional(P.object({}).passthrough())}),KW=S1.extend({uriTemplate:P.string(),description:P.optional(P.string()),mimeType:P.optional(P.string()),_meta:P.optional(P.object({}).passthrough())}),v0=o1.extend({method:P.literal("resources/list")}),$W=e1.extend({resources:P.array(zh)}),f0=o1.extend({method:P.literal("resources/templates/list")}),jW=e1.extend({resourceTemplates:P.array(KW)}),Q0=Tv.extend({method:P.literal("resources/read"),params:dv.extend({uri:P.string()})}),LW=tv.extend({contents:P.array(P.union([Nh,Uh]))}),MW=Bf.extend({method:P.literal("notifications/resources/list_changed")}),EW=Tv.extend({method:P.literal("resources/subscribe"),params:dv.extend({uri:P.string()})}),VW=Tv.extend({method:P.literal("resources/unsubscribe"),params:dv.extend({uri:P.string()})}),FW=Bf.extend({method:P.literal("notifications/resources/updated"),params:A1.extend({uri:P.string()})}),NW=P.object({name:P.string(),description:P.optional(P.string()),required:P.optional(P.boolean())}).passthrough(),UW=S1.extend({description:P.optional(P.string()),arguments:P.optional(P.array(NW)),_meta:P.optional(P.object({}).passthrough())}),h0=o1.extend({method:P.literal("prompts/list")}),zW=e1.extend({prompts:P.array(UW)}),J0=Tv.extend({method:P.literal("prompts/get"),params:dv.extend({name:P.string(),arguments:P.optional(P.record(P.string()))})}),i0=P.object({type:P.literal("text"),text:P.string(),_meta:P.optional(P.object({}).passthrough())}).passthrough(),d0=P.object({type:P.literal("image"),data:n0,mimeType:P.string(),_meta:P.optional(P.object({}).passthrough())}).passthrough(),t0=P.object({type:P.literal("audio"),data:n0,mimeType:P.string(),_meta:P.optional(P.object({}).passthrough())}).passthrough(),AW=P.object({type:P.literal("resource"),resource:P.union([Nh,Uh]),_meta:P.optional(P.object({}).passthrough())}).passthrough(),SW=zh.extend({type:P.literal("resource_link")}),Ah=P.union([i0,d0,t0,SW,AW]),bW=P.object({role:P.enum(["user","assistant"]),content:Ah}).passthrough(),RW=tv.extend({description:P.optional(P.string()),messages:P.array(bW)}),_W=Bf.extend({method:P.literal("notifications/prompts/list_changed")}),lW=P.object({title:P.optional(P.string()),readOnlyHint:P.optional(P.boolean()),destructiveHint:P.optional(P.boolean()),idempotentHint:P.optional(P.boolean()),openWorldHint:P.optional(P.boolean())}).passthrough(),kW=S1.extend({description:P.optional(P.string()),inputSchema:P.object({type:P.literal("object"),properties:P.optional(P.object({}).passthrough()),required:P.optional(P.array(P.string()))}).passthrough(),outputSchema:P.optional(P.object({type:P.literal("object"),properties:P.optional(P.object({}).passthrough()),required:P.optional(P.array(P.string()))}).passthrough()),annotations:P.optional(lW),_meta:P.optional(P.object({}).passthrough())}),W0=o1.extend({method:P.literal("tools/list")}),gW=e1.extend({tools:P.array(kW)}),Sh=tv.extend({content:P.array(Ah).default([]),structuredContent:P.object({}).passthrough().optional(),isError:P.optional(P.boolean())}),FX=Sh.or(tv.extend({toolResult:P.unknown()})),P0=Tv.extend({method:P.literal("tools/call"),params:dv.extend({name:P.string(),arguments:P.optional(P.record(P.unknown()))})}),yW=Bf.extend({method:P.literal("notifications/tools/list_changed")}),bh=P.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),IW=Tv.extend({method:P.literal("logging/setLevel"),params:dv.extend({level:bh})}),CW=Bf.extend({method:P.literal("notifications/message"),params:A1.extend({level:bh,logger:P.optional(P.string()),data:P.unknown()})}),TW=P.object({name:P.string().optional()}).passthrough(),xW=P.object({hints:P.optional(P.array(TW)),costPriority:P.optional(P.number().min(0).max(1)),speedPriority:P.optional(P.number().min(0).max(1)),intelligencePriority:P.optional(P.number().min(0).max(1))}).passthrough(),ZW=P.object({role:P.enum(["user","assistant"]),content:P.union([i0,d0,t0])}).passthrough(),rW=Tv.extend({method:P.literal("sampling/createMessage"),params:dv.extend({messages:P.array(ZW),systemPrompt:P.optional(P.string()),includeContext:P.optional(P.enum(["none","thisServer","allServers"])),temperature:P.optional(P.number()),maxTokens:P.number().int(),stopSequences:P.optional(P.array(P.string())),metadata:P.optional(P.object({}).passthrough()),modelPreferences:P.optional(xW)})}),s0=tv.extend({model:P.string(),stopReason:P.optional(P.enum(["endTurn","stopSequence","maxTokens"]).or(P.string())),role:P.enum(["user","assistant"]),content:P.discriminatedUnion("type",[i0,d0,t0])}),uW=P.object({type:P.literal("boolean"),title:P.optional(P.string()),description:P.optional(P.string()),default:P.optional(P.boolean())}).passthrough(),mW=P.object({type:P.literal("string"),title:P.optional(P.string()),description:P.optional(P.string()),minLength:P.optional(P.number()),maxLength:P.optional(P.number()),format:P.optional(P.enum(["email","uri","date","date-time"]))}).passthrough(),aW=P.object({type:P.enum(["number","integer"]),title:P.optional(P.string()),description:P.optional(P.string()),minimum:P.optional(P.number()),maximum:P.optional(P.number())}).passthrough(),cW=P.object({type:P.literal("string"),title:P.optional(P.string()),description:P.optional(P.string()),enum:P.array(P.string()),enumNames:P.optional(P.array(P.string()))}).passthrough(),pW=P.union([uW,mW,aW,cW]),nW=Tv.extend({method:P.literal("elicitation/create"),params:dv.extend({message:P.string(),requestedSchema:P.object({type:P.literal("object"),properties:P.record(P.string(),pW),required:P.optional(P.array(P.string()))}).passthrough()})}),o0=tv.extend({action:P.enum(["accept","decline","cancel"]),content:P.optional(P.record(P.string(),P.unknown()))}),iW=P.object({type:P.literal("ref/resource"),uri:P.string()}).passthrough(),dW=P.object({type:P.literal("ref/prompt"),name:P.string()}).passthrough(),X0=Tv.extend({method:P.literal("completion/complete"),params:dv.extend({ref:P.union([dW,iW]),argument:P.object({name:P.string(),value:P.string()}).passthrough(),context:P.optional(P.object({arguments:P.optional(P.record(P.string(),P.string()))}))})}),tW=tv.extend({completion:P.object({values:P.array(P.string()).max(100),total:P.optional(P.number().int()),hasMore:P.optional(P.boolean())}).passthrough()}),sW=P.object({uri:P.string().startsWith("file://"),name:P.optional(P.string()),_meta:P.optional(P.object({}).passthrough())}).passthrough(),oW=Tv.extend({method:P.literal("roots/list")}),e0=tv.extend({roots:P.array(sW)}),eW=Bf.extend({method:P.literal("notifications/roots/list_changed")}),NX=P.union([t1,d1,X0,IW,J0,h0,v0,f0,Q0,EW,VW,P0,W0]),UX=P.union([i1,s1,p0,eW]),zX=P.union([n1,s0,o0,e0]),AX=P.union([t1,rW,nW,oW]),SX=P.union([i1,s1,CW,FW,MW,yW,_W]),bX=P.union([n1,HW,tW,RW,zW,$W,jW,LW,Sh,gW]);Dv=class Dv extends Error{constructor(f,v,h){super(`MCP error ${f}: ${v}`);this.code=f,this.data=h,this.name="McpError"}}});var lh=n((Y0,_h)=>{(function(f,v){typeof Y0==="object"&&typeof _h!=="undefined"?v(Y0):typeof define==="function"&&define.amd?define(["exports"],v):v(f.URI=f.URI||{})})(Y0,function(f){function v(){for(var H=arguments.length,w=Array(H),$=0;$<H;$++)w[$]=arguments[$];if(w.length>1){w[0]=w[0].slice(0,-1);var E=w.length-1;for(var V=1;V<E;++V)w[V]=w[V].slice(1,-1);return w[E]=w[E].slice(1),w.join("")}else return w[0]}function h(H){return"(?:"+H+")"}function J(H){return H===void 0?"undefined":H===null?"null":Object.prototype.toString.call(H).split(" ").pop().split("]").shift().toLowerCase()}function Q(H){return H.toUpperCase()}function W(H){return H!==void 0&&H!==null?H instanceof Array?H:typeof H.length!=="number"||H.split||H.setInterval||H.call?[H]:Array.prototype.slice.call(H):[]}function X(H,w){var $=H;if(w)for(var E in w)$[E]=w[E];return $}function Y(H){var w="[A-Za-z]",$="[\\x0D]",E="[0-9]",V="[\\x22]",y=v(E,"[A-Fa-f]"),t="[\\x0A]",Jv="[\\x20]",Yv=h(h("%[EFef]"+y+"%"+y+y+"%"+y+y)+"|"+h("%[89A-Fa-f]"+y+"%"+y+y)+"|"+h("%"+y+y)),Nv="[\\:\\/\\?\\#\\[\\]\\@]",Qv="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",Ov=v(Nv,Qv),Uv=H?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",Hv=H?"[\\uE000-\\uF8FF]":"[]",Pv=v(w,E,"[\\-\\.\\_\\~]",Uv),Kv=h(w+v(w,E,"[\\+\\-\\.]")+"*"),Gv=h(h(Yv+"|"+v(Pv,Qv,"[\\:]"))+"*"),_f=h(h("25[0-5]")+"|"+h("2[0-4]"+E)+"|"+h("1"+E+E)+"|"+h("[1-9]"+E)+"|"+E),Zv=h(h("25[0-5]")+"|"+h("2[0-4]"+E)+"|"+h("1"+E+E)+"|"+h("0?[1-9]"+E)+"|0?0?"+E),pv=h(Zv+"\\."+Zv+"\\."+Zv+"\\."+Zv),wv=h(y+"{1,4}"),rv=h(h(wv+"\\:"+wv)+"|"+pv),nv=h(h(wv+"\\:")+"{6}"+rv),Pf=h("\\:\\:"+h(wv+"\\:")+"{5}"+rv),lf=h(h(wv)+"?\\:\\:"+h(wv+"\\:")+"{4}"+rv),qf=h(h(h(wv+"\\:")+"{0,1}"+wv)+"?\\:\\:"+h(wv+"\\:")+"{3}"+rv),D1=h(h(h(wv+"\\:")+"{0,2}"+wv)+"?\\:\\:"+h(wv+"\\:")+"{2}"+rv),I1=h(h(h(wv+"\\:")+"{0,3}"+wv)+"?\\:\\:"+wv+"\\:"+rv),C1=h(h(h(wv+"\\:")+"{0,4}"+wv)+"?\\:\\:"+rv),mf=h(h(h(wv+"\\:")+"{0,5}"+wv)+"?\\:\\:"+wv),af=h(h(h(wv+"\\:")+"{0,6}"+wv)+"?\\:\\:"),Df=h([nv,Pf,lf,qf,D1,I1,C1,mf,af].join("|")),cf=h(h(Pv+"|"+Yv)+"+"),y0=h(Df+"\\%25"+cf),kf=h(Df+h("\\%25|\\%(?!"+y+"{2})")+cf),pJ=h("[vV]"+y+"+\\."+v(Pv,Qv,"[\\:]")+"+"),nJ=h("\\["+h(kf+"|"+Df+"|"+pJ)+"\\]"),iQ=h(h(Yv+"|"+v(Pv,Qv))+"*"),H1=h(nJ+"|"+pv+"(?!"+iQ+")|"+iQ),O1=h(E+"*"),dQ=h(h(Gv+"@")+"?"+H1+h("\\:"+O1)+"?"),K1=h(Yv+"|"+v(Pv,Qv,"[\\:\\@]")),iJ=h(K1+"*"),tQ=h(K1+"+"),dJ=h(h(Yv+"|"+v(Pv,Qv,"[\\@]"))+"+"),Hf=h(h("\\/"+iJ)+"*"),pf=h("\\/"+h(tQ+Hf)+"?"),I0=h(dJ+Hf),T1=h(tQ+Hf),nf="(?!"+K1+")",BX=h(Hf+"|"+pf+"|"+I0+"|"+T1+"|"+nf),df=h(h(K1+"|"+v("[\\/\\?]",Hv))+"*"),$1=h(h(K1+"|[\\/\\?]")+"*"),sQ=h(h("\\/\\/"+dQ+Hf)+"|"+pf+"|"+T1+"|"+nf),tJ=h(Kv+"\\:"+sQ+h("\\?"+df)+"?"+h("\\#"+$1)+"?"),sJ=h(h("\\/\\/"+dQ+Hf)+"|"+pf+"|"+I0+"|"+nf),oJ=h(sJ+h("\\?"+df)+"?"+h("\\#"+$1)+"?"),GX=h(tJ+"|"+oJ),wX=h(Kv+"\\:"+sQ+h("\\?"+df)+"?"),qX="^("+Kv+")\\:"+h(h("\\/\\/("+h("("+Gv+")@")+"?("+H1+")"+h("\\:("+O1+")")+"?)")+"?("+Hf+"|"+pf+"|"+T1+"|"+nf+")")+h("\\?("+df+")")+"?"+h("\\#("+$1+")")+"?$",DX="^(){0}"+h(h("\\/\\/("+h("("+Gv+")@")+"?("+H1+")"+h("\\:("+O1+")")+"?)")+"?("+Hf+"|"+pf+"|"+I0+"|"+nf+")")+h("\\?("+df+")")+"?"+h("\\#("+$1+")")+"?$",HX="^("+Kv+")\\:"+h(h("\\/\\/("+h("("+Gv+")@")+"?("+H1+")"+h("\\:("+O1+")")+"?)")+"?("+Hf+"|"+pf+"|"+T1+"|"+nf+")")+h("\\?("+df+")")+"?$",OX="^"+h("\\#("+$1+")")+"?$",KX="^"+h("("+Gv+")@")+"?("+H1+")"+h("\\:("+O1+")")+"?$";return{NOT_SCHEME:new RegExp(v("[^]",w,E,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(v("[^\\%\\:]",Pv,Qv),"g"),NOT_HOST:new RegExp(v("[^\\%\\[\\]\\:]",Pv,Qv),"g"),NOT_PATH:new RegExp(v("[^\\%\\/\\:\\@]",Pv,Qv),"g"),NOT_PATH_NOSCHEME:new RegExp(v("[^\\%\\/\\@]",Pv,Qv),"g"),NOT_QUERY:new RegExp(v("[^\\%]",Pv,Qv,"[\\:\\@\\/\\?]",Hv),"g"),NOT_FRAGMENT:new RegExp(v("[^\\%]",Pv,Qv,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(v("[^]",Pv,Qv),"g"),UNRESERVED:new RegExp(Pv,"g"),OTHER_CHARS:new RegExp(v("[^\\%]",Pv,Ov),"g"),PCT_ENCODED:new RegExp(Yv,"g"),IPV4ADDRESS:new RegExp("^("+pv+")$"),IPV6ADDRESS:new RegExp("^\\[?("+Df+")"+h(h("\\%25|\\%(?!"+y+"{2})")+"("+cf+")")+"?\\]?$")}}var B=Y(!1),q=Y(!0),D=function(){function H(w,$){var E=[],V=!0,y=!1,t=void 0;try{for(var Jv=w[Symbol.iterator](),Yv;!(V=(Yv=Jv.next()).done);V=!0)if(E.push(Yv.value),$&&E.length===$)break}catch(Nv){y=!0,t=Nv}finally{try{if(!V&&Jv.return)Jv.return()}finally{if(y)throw t}}return E}return function(w,$){if(Array.isArray(w))return w;else if(Symbol.iterator in Object(w))return H(w,$);else throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),j=function(H){if(Array.isArray(H)){for(var w=0,$=Array(H.length);w<H.length;w++)$[w]=H[w];return $}else return Array.from(H)},L=2147483647,G=36,O=1,M=26,K=38,F=700,S=72,N=128,A="-",b=/^xn--/,k=/[^\0-\x7E]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,Z={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=G-O,r=Math.floor,x=String.fromCharCode;function C(H){throw new RangeError(Z[H])}function R(H,w){var $=[],E=H.length;while(E--)$[E]=w(H[E]);return $}function l(H,w){var $=H.split("@"),E="";if($.length>1)E=$[0]+"@",H=$[1];H=H.replace(m,".");var V=H.split("."),y=R(V,w).join(".");return E+y}function T(H){var w=[],$=0,E=H.length;while($<E){var V=H.charCodeAt($++);if(V>=55296&&V<=56319&&$<E){var y=H.charCodeAt($++);if((y&64512)==56320)w.push(((V&1023)<<10)+(y&1023)+65536);else w.push(V),$--}else w.push(V)}return w}var Bv=function H(w){return String.fromCodePoint.apply(String,j(w))},e=function H(w){if(w-48<10)return w-22;if(w-65<26)return w-65;if(w-97<26)return w-97;return G},fv=function H(w,$){return w+22+75*(w<26)-(($!=0)<<5)},o=function H(w,$,E){var V=0;w=E?r(w/F):w>>1,w+=r(w/$);for(;w>_*M>>1;V+=G)w=r(w/_);return r(V+(_+1)*w/(w+K))},a=function H(w){var $=[],E=w.length,V=0,y=N,t=S,Jv=w.lastIndexOf(A);if(Jv<0)Jv=0;for(var Yv=0;Yv<Jv;++Yv){if(w.charCodeAt(Yv)>=128)C("not-basic");$.push(w.charCodeAt(Yv))}for(var Nv=Jv>0?Jv+1:0;Nv<E;){var Qv=V;for(var Ov=1,Uv=G;;Uv+=G){if(Nv>=E)C("invalid-input");var Hv=e(w.charCodeAt(Nv++));if(Hv>=G||Hv>r((L-V)/Ov))C("overflow");V+=Hv*Ov;var Pv=Uv<=t?O:Uv>=t+M?M:Uv-t;if(Hv<Pv)break;var Kv=G-Pv;if(Ov>r(L/Kv))C("overflow");Ov*=Kv}var Gv=$.length+1;if(t=o(V-Qv,Gv,Qv==0),r(V/Gv)>L-y)C("overflow");y+=r(V/Gv),V%=Gv,$.splice(V++,0,y)}return String.fromCodePoint.apply(String,$)},jv=function H(w){var $=[];w=T(w);var E=w.length,V=N,y=0,t=S,Jv=!0,Yv=!1,Nv=void 0;try{for(var Qv=w[Symbol.iterator](),Ov;!(Jv=(Ov=Qv.next()).done);Jv=!0){var Uv=Ov.value;if(Uv<128)$.push(x(Uv))}}catch(kf){Yv=!0,Nv=kf}finally{try{if(!Jv&&Qv.return)Qv.return()}finally{if(Yv)throw Nv}}var Hv=$.length,Pv=Hv;if(Hv)$.push(A);while(Pv<E){var Kv=L,Gv=!0,_f=!1,Zv=void 0;try{for(var pv=w[Symbol.iterator](),wv;!(Gv=(wv=pv.next()).done);Gv=!0){var rv=wv.value;if(rv>=V&&rv<Kv)Kv=rv}}catch(kf){_f=!0,Zv=kf}finally{try{if(!Gv&&pv.return)pv.return()}finally{if(_f)throw Zv}}var nv=Pv+1;if(Kv-V>r((L-y)/nv))C("overflow");y+=(Kv-V)*nv,V=Kv;var Pf=!0,lf=!1,qf=void 0;try{for(var D1=w[Symbol.iterator](),I1;!(Pf=(I1=D1.next()).done);Pf=!0){var C1=I1.value;if(C1<V&&++y>L)C("overflow");if(C1==V){var mf=y;for(var af=G;;af+=G){var Df=af<=t?O:af>=t+M?M:af-t;if(mf<Df)break;var cf=mf-Df,y0=G-Df;$.push(x(fv(Df+cf%y0,0))),mf=r(cf/y0)}$.push(x(fv(mf,0))),t=o(y,nv,Pv==Hv),y=0,++Pv}}}catch(kf){lf=!0,qf=kf}finally{try{if(!Pf&&D1.return)D1.return()}finally{if(lf)throw qf}}++y,++V}return $.join("")},Sv=function H(w){return l(w,function($){return b.test($)?a($.slice(4).toLowerCase()):$})},_v=function H(w){return l(w,function($){return k.test($)?"xn--"+jv($):$})},Wv={version:"2.1.0",ucs2:{decode:T,encode:Bv},decode:a,encode:jv,toASCII:_v,toUnicode:Sv},Vv={};function zv(H){var w=H.charCodeAt(0),$=void 0;if(w<16)$="%0"+w.toString(16).toUpperCase();else if(w<128)$="%"+w.toString(16).toUpperCase();else if(w<2048)$="%"+(w>>6|192).toString(16).toUpperCase()+"%"+(w&63|128).toString(16).toUpperCase();else $="%"+(w>>12|224).toString(16).toUpperCase()+"%"+(w>>6&63|128).toString(16).toUpperCase()+"%"+(w&63|128).toString(16).toUpperCase();return $}function lv(H){var w="",$=0,E=H.length;while($<E){var V=parseInt(H.substr($+1,2),16);if(V<128)w+=String.fromCharCode(V),$+=3;else if(V>=194&&V<224){if(E-$>=6){var y=parseInt(H.substr($+4,2),16);w+=String.fromCharCode((V&31)<<6|y&63)}else w+=H.substr($,6);$+=6}else if(V>=224){if(E-$>=9){var t=parseInt(H.substr($+4,2),16),Jv=parseInt(H.substr($+7,2),16);w+=String.fromCharCode((V&15)<<12|(t&63)<<6|Jv&63)}else w+=H.substr($,9);$+=9}else w+=H.substr($,3),$+=3}return w}function Lf(H,w){function $(E){var V=lv(E);return!V.match(w.UNRESERVED)?E:V}if(H.scheme)H.scheme=String(H.scheme).replace(w.PCT_ENCODED,$).toLowerCase().replace(w.NOT_SCHEME,"");if(H.userinfo!==void 0)H.userinfo=String(H.userinfo).replace(w.PCT_ENCODED,$).replace(w.NOT_USERINFO,zv).replace(w.PCT_ENCODED,Q);if(H.host!==void 0)H.host=String(H.host).replace(w.PCT_ENCODED,$).toLowerCase().replace(w.NOT_HOST,zv).replace(w.PCT_ENCODED,Q);if(H.path!==void 0)H.path=String(H.path).replace(w.PCT_ENCODED,$).replace(H.scheme?w.NOT_PATH:w.NOT_PATH_NOSCHEME,zv).replace(w.PCT_ENCODED,Q);if(H.query!==void 0)H.query=String(H.query).replace(w.PCT_ENCODED,$).replace(w.NOT_QUERY,zv).replace(w.PCT_ENCODED,Q);if(H.fragment!==void 0)H.fragment=String(H.fragment).replace(w.PCT_ENCODED,$).replace(w.NOT_FRAGMENT,zv).replace(w.PCT_ENCODED,Q);return H}function Gf(H){return H.replace(/^0*(.*)/,"$1")||"0"}function Fv(H,w){var $=H.match(w.IPV4ADDRESS)||[],E=D($,2),V=E[1];if(V)return V.split(".").map(Gf).join(".");else return H}function Lv(H,w){var $=H.match(w.IPV6ADDRESS)||[],E=D($,3),V=E[1],y=E[2];if(V){var t=V.toLowerCase().split("::").reverse(),Jv=D(t,2),Yv=Jv[0],Nv=Jv[1],Qv=Nv?Nv.split(":").map(Gf):[],Ov=Yv.split(":").map(Gf),Uv=w.IPV4ADDRESS.test(Ov[Ov.length-1]),Hv=Uv?7:8,Pv=Ov.length-Hv,Kv=Array(Hv);for(var Gv=0;Gv<Hv;++Gv)Kv[Gv]=Qv[Gv]||Ov[Pv+Gv]||"";if(Uv)Kv[Hv-1]=Fv(Kv[Hv-1],w);var _f=Kv.reduce(function(nv,Pf,lf){if(!Pf||Pf==="0"){var qf=nv[nv.length-1];if(qf&&qf.index+qf.length===lf)qf.length++;else nv.push({index:lf,length:1})}return nv},[]),Zv=_f.sort(function(nv,Pf){return Pf.length-nv.length})[0],pv=void 0;if(Zv&&Zv.length>1){var wv=Kv.slice(0,Zv.index),rv=Kv.slice(Zv.index+Zv.length);pv=wv.join(":")+"::"+rv.join(":")}else pv=Kv.join(":");if(y)pv+="%"+y;return pv}else return H}var Sf=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,bv="".match(/(){0}/)[1]===void 0;function Xv(H){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$={},E=w.iri!==!1?q:B;if(w.reference==="suffix")H=(w.scheme?w.scheme+":":"")+"//"+H;var V=H.match(Sf);if(V){if(bv){if($.scheme=V[1],$.userinfo=V[3],$.host=V[4],$.port=parseInt(V[5],10),$.path=V[6]||"",$.query=V[7],$.fragment=V[8],isNaN($.port))$.port=V[5]}else if($.scheme=V[1]||void 0,$.userinfo=H.indexOf("@")!==-1?V[3]:void 0,$.host=H.indexOf("//")!==-1?V[4]:void 0,$.port=parseInt(V[5],10),$.path=V[6]||"",$.query=H.indexOf("?")!==-1?V[7]:void 0,$.fragment=H.indexOf("#")!==-1?V[8]:void 0,isNaN($.port))$.port=H.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?V[4]:void 0;if($.host)$.host=Lv(Fv($.host,E),E);if($.scheme===void 0&&$.userinfo===void 0&&$.host===void 0&&$.port===void 0&&!$.path&&$.query===void 0)$.reference="same-document";else if($.scheme===void 0)$.reference="relative";else if($.fragment===void 0)$.reference="absolute";else $.reference="uri";if(w.reference&&w.reference!=="suffix"&&w.reference!==$.reference)$.error=$.error||"URI is not a "+w.reference+" reference.";var y=Vv[(w.scheme||$.scheme||"").toLowerCase()];if(!w.unicodeSupport&&(!y||!y.unicodeSupport)){if($.host&&(w.domainHost||y&&y.domainHost))try{$.host=Wv.toASCII($.host.replace(E.PCT_ENCODED,lv).toLowerCase())}catch(t){$.error=$.error||"Host's domain name can not be converted to ASCII via punycode: "+t}Lf($,B)}else Lf($,E);if(y&&y.parse)y.parse($,w)}else $.error=$.error||"URI can not be parsed.";return $}function Mf(H,w){var $=w.iri!==!1?q:B,E=[];if(H.userinfo!==void 0)E.push(H.userinfo),E.push("@");if(H.host!==void 0)E.push(Lv(Fv(String(H.host),$),$).replace($.IPV6ADDRESS,function(V,y,t){return"["+y+(t?"%25"+t:"")+"]"}));if(typeof H.port==="number"||typeof H.port==="string")E.push(":"),E.push(String(H.port));return E.length?E.join(""):void 0}var wf=/^\.\.?\//,bf=/^\/\.(\/|$)/,Rf=/^\/\.\.(\/|$)/,Av=/^\/?(?:.|\n)*?(?=\/|$)/;function cv(H){var w=[];while(H.length)if(H.match(wf))H=H.replace(wf,"");else if(H.match(bf))H=H.replace(bf,"/");else if(H.match(Rf))H=H.replace(Rf,"/"),w.pop();else if(H==="."||H==="..")H="";else{var $=H.match(Av);if($){var E=$[0];H=H.slice(E.length),w.push(E)}else throw new Error("Unexpected dot segment condition")}return w.join("")}function Cv(H){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=w.iri?q:B,E=[],V=Vv[(w.scheme||H.scheme||"").toLowerCase()];if(V&&V.serialize)V.serialize(H,w);if(H.host){if($.IPV6ADDRESS.test(H.host));else if(w.domainHost||V&&V.domainHost)try{H.host=!w.iri?Wv.toASCII(H.host.replace($.PCT_ENCODED,lv).toLowerCase()):Wv.toUnicode(H.host)}catch(Jv){H.error=H.error||"Host's domain name can not be converted to "+(!w.iri?"ASCII":"Unicode")+" via punycode: "+Jv}}if(Lf(H,$),w.reference!=="suffix"&&H.scheme)E.push(H.scheme),E.push(":");var y=Mf(H,w);if(y!==void 0){if(w.reference!=="suffix")E.push("//");if(E.push(y),H.path&&H.path.charAt(0)!=="/")E.push("/")}if(H.path!==void 0){var t=H.path;if(!w.absolutePath&&(!V||!V.absolutePath))t=cv(t);if(y===void 0)t=t.replace(/^\/\//,"/%2F");E.push(t)}if(H.query!==void 0)E.push("?"),E.push(H.query);if(H.fragment!==void 0)E.push("#"),E.push(H.fragment);return E.join("")}function kv(H,w){var $=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},E=arguments[3],V={};if(!E)H=Xv(Cv(H,$),$),w=Xv(Cv(w,$),$);if($=$||{},!$.tolerant&&w.scheme)V.scheme=w.scheme,V.userinfo=w.userinfo,V.host=w.host,V.port=w.port,V.path=cv(w.path||""),V.query=w.query;else{if(w.userinfo!==void 0||w.host!==void 0||w.port!==void 0)V.userinfo=w.userinfo,V.host=w.host,V.port=w.port,V.path=cv(w.path||""),V.query=w.query;else{if(!w.path)if(V.path=H.path,w.query!==void 0)V.query=w.query;else V.query=H.query;else{if(w.path.charAt(0)==="/")V.path=cv(w.path);else{if((H.userinfo!==void 0||H.host!==void 0||H.port!==void 0)&&!H.path)V.path="/"+w.path;else if(!H.path)V.path=w.path;else V.path=H.path.slice(0,H.path.lastIndexOf("/")+1)+w.path;V.path=cv(V.path)}V.query=w.query}V.userinfo=H.userinfo,V.host=H.host,V.port=H.port}V.scheme=H.scheme}return V.fragment=w.fragment,V}function Jf(H,w,$){var E=X({scheme:"null"},$);return Cv(kv(Xv(H,E),Xv(w,E),E,!0),E)}function xv(H,w){if(typeof H==="string")H=Cv(Xv(H,w),w);else if(J(H)==="object")H=Xv(Cv(H,w),w);return H}function y1(H,w,$){if(typeof H==="string")H=Cv(Xv(H,$),$);else if(J(H)==="object")H=Cv(H,$);if(typeof w==="string")w=Cv(Xv(w,$),$);else if(J(w)==="object")w=Cv(w,$);return H===w}function k0(H,w){return H&&H.toString().replace(!w||!w.iri?B.ESCAPE:q.ESCAPE,zv)}function ov(H,w){return H&&H.toString().replace(!w||!w.iri?B.PCT_ENCODED:q.PCT_ENCODED,lv)}var w1={scheme:"http",domainHost:!0,parse:function H(w,$){if(!w.host)w.error=w.error||"HTTP URIs must have a host.";return w},serialize:function H(w,$){var E=String(w.scheme).toLowerCase()==="https";if(w.port===(E?443:80)||w.port==="")w.port=void 0;if(!w.path)w.path="/";return w}},ZQ={scheme:"https",domainHost:w1.domainHost,parse:w1.parse,serialize:w1.serialize};function rQ(H){return typeof H.secure==="boolean"?H.secure:String(H.scheme).toLowerCase()==="wss"}var q1={scheme:"ws",domainHost:!0,parse:function H(w,$){var E=w;return E.secure=rQ(E),E.resourceName=(E.path||"/")+(E.query?"?"+E.query:""),E.path=void 0,E.query=void 0,E},serialize:function H(w,$){if(w.port===(rQ(w)?443:80)||w.port==="")w.port=void 0;if(typeof w.secure==="boolean")w.scheme=w.secure?"wss":"ws",w.secure=void 0;if(w.resourceName){var E=w.resourceName.split("?"),V=D(E,2),y=V[0],t=V[1];w.path=y&&y!=="/"?y:void 0,w.query=t,w.resourceName=void 0}return w.fragment=void 0,w}},uQ={scheme:"wss",domainHost:q1.domainHost,parse:q1.parse,serialize:q1.serialize},gJ={},yJ=!0,mQ="[A-Za-z0-9\\-\\.\\_\\~"+(yJ?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",Wf="[0-9A-Fa-f]",IJ=h(h("%[EFef]"+Wf+"%"+Wf+Wf+"%"+Wf+Wf)+"|"+h("%[89A-Fa-f]"+Wf+"%"+Wf+Wf)+"|"+h("%"+Wf+Wf)),CJ="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",TJ="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",xJ=v(TJ,"[\\\"\\\\]"),ZJ="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",rJ=new RegExp(mQ,"g"),uf=new RegExp(IJ,"g"),uJ=new RegExp(v("[^]",CJ,"[\\.]","[\\\"]",xJ),"g"),aQ=new RegExp(v("[^]",mQ,ZJ),"g"),mJ=aQ;function g0(H){var w=lv(H);return!w.match(rJ)?H:w}var cQ={scheme:"mailto",parse:function H(w,$){var E=w,V=E.to=E.path?E.path.split(","):[];if(E.path=void 0,E.query){var y=!1,t={},Jv=E.query.split("&");for(var Yv=0,Nv=Jv.length;Yv<Nv;++Yv){var Qv=Jv[Yv].split("=");switch(Qv[0]){case"to":var Ov=Qv[1].split(",");for(var Uv=0,Hv=Ov.length;Uv<Hv;++Uv)V.push(Ov[Uv]);break;case"subject":E.subject=ov(Qv[1],$);break;case"body":E.body=ov(Qv[1],$);break;default:y=!0,t[ov(Qv[0],$)]=ov(Qv[1],$);break}}if(y)E.headers=t}E.query=void 0;for(var Pv=0,Kv=V.length;Pv<Kv;++Pv){var Gv=V[Pv].split("@");if(Gv[0]=ov(Gv[0]),!$.unicodeSupport)try{Gv[1]=Wv.toASCII(ov(Gv[1],$).toLowerCase())}catch(_f){E.error=E.error||"Email address's domain name can not be converted to ASCII via punycode: "+_f}else Gv[1]=ov(Gv[1],$).toLowerCase();V[Pv]=Gv.join("@")}return E},serialize:function H(w,$){var E=w,V=W(w.to);if(V){for(var y=0,t=V.length;y<t;++y){var Jv=String(V[y]),Yv=Jv.lastIndexOf("@"),Nv=Jv.slice(0,Yv).replace(uf,g0).replace(uf,Q).replace(uJ,zv),Qv=Jv.slice(Yv+1);try{Qv=!$.iri?Wv.toASCII(ov(Qv,$).toLowerCase()):Wv.toUnicode(Qv)}catch(Pv){E.error=E.error||"Email address's domain name can not be converted to "+(!$.iri?"ASCII":"Unicode")+" via punycode: "+Pv}V[y]=Nv+"@"+Qv}E.path=V.join(",")}var Ov=w.headers=w.headers||{};if(w.subject)Ov.subject=w.subject;if(w.body)Ov.body=w.body;var Uv=[];for(var Hv in Ov)if(Ov[Hv]!==gJ[Hv])Uv.push(Hv.replace(uf,g0).replace(uf,Q).replace(aQ,zv)+"="+Ov[Hv].replace(uf,g0).replace(uf,Q).replace(mJ,zv));if(Uv.length)E.query=Uv.join("&");return E}},aJ=/^([^\:]+)\:(.*)/,pQ={scheme:"urn",parse:function H(w,$){var E=w.path&&w.path.match(aJ),V=w;if(E){var y=$.scheme||V.scheme||"urn",t=E[1].toLowerCase(),Jv=E[2],Yv=y+":"+($.nid||t),Nv=Vv[Yv];if(V.nid=t,V.nss=Jv,V.path=void 0,Nv)V=Nv.parse(V,$)}else V.error=V.error||"URN can not be parsed.";return V},serialize:function H(w,$){var E=$.scheme||w.scheme||"urn",V=w.nid,y=E+":"+($.nid||V),t=Vv[y];if(t)w=t.serialize(w,$);var Jv=w,Yv=w.nss;return Jv.path=(V||$.nid)+":"+Yv,Jv}},cJ=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,nQ={scheme:"urn:uuid",parse:function H(w,$){var E=w;if(E.uuid=E.nss,E.nss=void 0,!$.tolerant&&(!E.uuid||!E.uuid.match(cJ)))E.error=E.error||"UUID is not valid.";return E},serialize:function H(w,$){var E=w;return E.nss=(w.uuid||"").toLowerCase(),E}};Vv[w1.scheme]=w1,Vv[ZQ.scheme]=ZQ,Vv[q1.scheme]=q1,Vv[uQ.scheme]=uQ,Vv[cQ.scheme]=cQ,Vv[pQ.scheme]=pQ,Vv[nQ.scheme]=nQ,f.SCHEMES=Vv,f.pctEncChar=zv,f.pctDecChars=lv,f.parse=Xv,f.removeDotSegments=cv,f.serialize=Cv,f.resolveComponents=kv,f.resolve=Jf,f.normalize=xv,f.equal=y1,f.escapeComponent=k0,f.unescapeComponent=ov,Object.defineProperty(f,"__esModule",{value:!0})})});var B0=n((kX,kh)=>{kh.exports=function f(v,h){if(v===h)return!0;if(v&&h&&typeof v=="object"&&typeof h=="object"){if(v.constructor!==h.constructor)return!1;var J,Q,W;if(Array.isArray(v)){if(J=v.length,J!=h.length)return!1;for(Q=J;Q--!==0;)if(!f(v[Q],h[Q]))return!1;return!0}if(v.constructor===RegExp)return v.source===h.source&&v.flags===h.flags;if(v.valueOf!==Object.prototype.valueOf)return v.valueOf()===h.valueOf();if(v.toString!==Object.prototype.toString)return v.toString()===h.toString();if(W=Object.keys(v),J=W.length,J!==Object.keys(h).length)return!1;for(Q=J;Q--!==0;)if(!Object.prototype.hasOwnProperty.call(h,W[Q]))return!1;for(Q=J;Q--!==0;){var X=W[Q];if(!f(v[X],h[X]))return!1}return!0}return v!==v&&h!==h}});var yh=n((gX,gh)=>{gh.exports=function f(v){var h=0,J=v.length,Q=0,W;while(Q<J)if(h++,W=v.charCodeAt(Q++),W>=55296&&W<=56319&&Q<J){if(W=v.charCodeAt(Q),(W&64512)==56320)Q++}return h}});var xf=n((yX,Th)=>{Th.exports={copy:fP,checkDataType:fQ,checkDataTypes:QP,coerceToTypes:hP,toHash:hQ,getProperty:JQ,escapeQuotes:WQ,equal:B0(),ucs2length:yh(),varOccurences:PP,varReplace:XP,schemaHasRules:YP,schemaHasRulesExcept:BP,schemaUnknownRules:GP,toQuotedString:QQ,getPathExpr:wP,getPath:qP,getData:OP,unescapeFragment:KP,unescapeJsonPointer:XQ,escapeFragment:$P,escapeJsonPointer:PQ};function fP(f,v){v=v||{};for(var h in f)v[h]=f[h];return v}function fQ(f,v,h,J){var Q=J?" !== ":" === ",W=J?" || ":" && ",X=J?"!":"",Y=J?"":"!";switch(f){case"null":return v+Q+"null";case"array":return X+"Array.isArray("+v+")";case"object":return"("+X+v+W+"typeof "+v+Q+'"object"'+W+Y+"Array.isArray("+v+"))";case"integer":return"(typeof "+v+Q+'"number"'+W+Y+"("+v+" % 1)"+W+v+Q+v+(h?W+X+"isFinite("+v+")":"")+")";case"number":return"(typeof "+v+Q+'"'+f+'"'+(h?W+X+"isFinite("+v+")":"")+")";default:return"typeof "+v+Q+'"'+f+'"'}}function QP(f,v,h){switch(f.length){case 1:return fQ(f[0],v,h,!0);default:var J="",Q=hQ(f);if(Q.array&&Q.object)J=Q.null?"(":"(!"+v+" || ",J+="typeof "+v+' !== "object")',delete Q.null,delete Q.array,delete Q.object;if(Q.number)delete Q.integer;for(var W in Q)J+=(J?" && ":"")+fQ(W,v,h,!0);return J}}var Ih=hQ(["string","number","integer","boolean","null"]);function hP(f,v){if(Array.isArray(v)){var h=[];for(var J=0;J<v.length;J++){var Q=v[J];if(Ih[Q])h[h.length]=Q;else if(f==="array"&&Q==="array")h[h.length]=Q}if(h.length)return h}else if(Ih[v])return[v];else if(f==="array"&&v==="array")return["array"]}function hQ(f){var v={};for(var h=0;h<f.length;h++)v[f[h]]=!0;return v}var JP=/^[a-z$_][a-z$_0-9]*$/i,WP=/'|\\/g;function JQ(f){return typeof f=="number"?"["+f+"]":JP.test(f)?"."+f:"['"+WQ(f)+"']"}function WQ(f){return f.replace(WP,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function PP(f,v){v+="[^0-9]";var h=f.match(new RegExp(v,"g"));return h?h.length:0}function XP(f,v,h){return v+="([^0-9])",h=h.replace(/\$/g,"$$$$"),f.replace(new RegExp(v,"g"),h+"$1")}function YP(f,v){if(typeof f=="boolean")return!f;for(var h in f)if(v[h])return!0}function BP(f,v,h){if(typeof f=="boolean")return!f&&h!="not";for(var J in f)if(J!=h&&v[J])return!0}function GP(f,v){if(typeof f=="boolean")return;for(var h in f)if(!v[h])return h}function QQ(f){return"'"+WQ(f)+"'"}function wP(f,v,h,J){var Q=h?"'/' + "+v+(J?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):J?"'[' + "+v+" + ']'":"'[\\'' + "+v+" + '\\']'";return Ch(f,Q)}function qP(f,v,h){var J=h?QQ("/"+PQ(v)):QQ(JQ(v));return Ch(f,J)}var DP=/^\/(?:[^~]|~0|~1)*$/,HP=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function OP(f,v,h){var J,Q,W,X;if(f==="")return"rootData";if(f[0]=="/"){if(!DP.test(f))throw new Error("Invalid JSON-pointer: "+f);Q=f,W="rootData"}else{if(X=f.match(HP),!X)throw new Error("Invalid JSON-pointer: "+f);if(J=+X[1],Q=X[2],Q=="#"){if(J>=v)throw new Error("Cannot access property/index "+J+" levels up, current level is "+v);return h[v-J]}if(J>v)throw new Error("Cannot access data "+J+" levels up, current level is "+v);if(W="data"+(v-J||""),!Q)return W}var Y=W,B=Q.split("/");for(var q=0;q<B.length;q++){var D=B[q];if(D)W+=JQ(XQ(D)),Y+=" && "+W}return Y}function Ch(f,v){if(f=='""')return v;return(f+" + "+v).replace(/([^\\])' \+ '/g,"$1")}function KP(f){return XQ(decodeURIComponent(f))}function $P(f){return encodeURIComponent(PQ(f))}function PQ(f){return f.replace(/~/g,"~0").replace(/\//g,"~1")}function XQ(f){return f.replace(/~1/g,"/").replace(/~0/g,"~")}});var YQ=n((IX,xh)=>{var jP=xf();xh.exports=LP;function LP(f){jP.copy(f,this)}});var rh=n((CX,Zh)=>{var Uf=Zh.exports=function(f,v,h){if(typeof v=="function")h=v,v={};h=v.cb||h;var J=typeof h=="function"?h:h.pre||function(){},Q=h.post||function(){};G0(v,J,Q,f,"",f)};Uf.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0};Uf.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Uf.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Uf.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 G0(f,v,h,J,Q,W,X,Y,B,q){if(J&&typeof J=="object"&&!Array.isArray(J)){v(J,Q,W,X,Y,B,q);for(var D in J){var j=J[D];if(Array.isArray(j)){if(D in Uf.arrayKeywords)for(var L=0;L<j.length;L++)G0(f,v,h,j[L],Q+"/"+D+"/"+L,W,Q,D,J,L)}else if(D in Uf.propsKeywords){if(j&&typeof j=="object")for(var G in j)G0(f,v,h,j[G],Q+"/"+D+"/"+MP(G),W,Q,D,J,G)}else if(D in Uf.keywords||f.allKeys&&!(D in Uf.skipKeywords))G0(f,v,h,j,Q+"/"+D,W,Q,D,J)}h(J,Q,W,X,Y,B,q)}}function MP(f){return f.replace(/~/g,"~0").replace(/\//g,"~1")}});var K0=n((TX,ch)=>{var R1=lh(),uh=B0(),H0=xf(),w0=YQ(),EP=rh();ch.exports=Af;Af.normalizeId=zf;Af.fullPath=q0;Af.url=D0;Af.ids=zP;Af.inlineRef=BQ;Af.schema=O0;function Af(f,v,h){var J=this._refs[h];if(typeof J=="string")if(this._refs[J])J=this._refs[J];else return Af.call(this,f,v,J);if(J=J||this._schemas[h],J instanceof w0)return BQ(J.schema,this._opts.inlineRefs)?J.schema:J.validate||this._compile(J);var Q=O0.call(this,v,h),W,X,Y;if(Q)W=Q.schema,v=Q.root,Y=Q.baseId;if(W instanceof w0)X=W.validate||f.call(this,W.schema,v,void 0,Y);else if(W!==void 0)X=BQ(W,this._opts.inlineRefs)?W:f.call(this,W,v,void 0,Y);return X}function O0(f,v){var h=R1.parse(v),J=ah(h),Q=q0(this._getId(f.schema));if(Object.keys(f.schema).length===0||J!==Q){var W=zf(J),X=this._refs[W];if(typeof X=="string")return VP.call(this,f,X,h);else if(X instanceof w0){if(!X.validate)this._compile(X);f=X}else if(X=this._schemas[W],X instanceof w0){if(!X.validate)this._compile(X);if(W==zf(v))return{schema:X,root:f,baseId:Q};f=X}else return;if(!f.schema)return;Q=q0(this._getId(f.schema))}return mh.call(this,h,Q,f.schema,f)}function VP(f,v,h){var J=O0.call(this,f,v);if(J){var{schema:Q,baseId:W}=J;f=J.root;var X=this._getId(Q);if(X)W=D0(W,X);return mh.call(this,h,W,Q,f)}}var FP=H0.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function mh(f,v,h,J){if(f.fragment=f.fragment||"",f.fragment.slice(0,1)!="/")return;var Q=f.fragment.split("/");for(var W=1;W<Q.length;W++){var X=Q[W];if(X){if(X=H0.unescapeFragment(X),h=h[X],h===void 0)break;var Y;if(!FP[X]){if(Y=this._getId(h),Y)v=D0(v,Y);if(h.$ref){var B=D0(v,h.$ref),q=O0.call(this,J,B);if(q)h=q.schema,J=q.root,v=q.baseId}}}}if(h!==void 0&&h!==J.schema)return{schema:h,root:J,baseId:v}}var NP=H0.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function BQ(f,v){if(v===!1)return!1;if(v===void 0||v===!0)return GQ(f);else if(v)return wQ(f)<=v}function GQ(f){var v;if(Array.isArray(f)){for(var h=0;h<f.length;h++)if(v=f[h],typeof v=="object"&&!GQ(v))return!1}else for(var J in f){if(J=="$ref")return!1;if(v=f[J],typeof v=="object"&&!GQ(v))return!1}return!0}function wQ(f){var v=0,h;if(Array.isArray(f))for(var J=0;J<f.length;J++){if(h=f[J],typeof h=="object")v+=wQ(h);if(v==1/0)return 1/0}else for(var Q in f){if(Q=="$ref")return 1/0;if(NP[Q])v++;else{if(h=f[Q],typeof h=="object")v+=wQ(h)+1;if(v==1/0)return 1/0}}return v}function q0(f,v){if(v!==!1)f=zf(f);var h=R1.parse(f);return ah(h)}function ah(f){return R1.serialize(f).split("#")[0]+"#"}var UP=/#\/?$/;function zf(f){return f?f.replace(UP,""):""}function D0(f,v){return v=zf(v),R1.resolve(f,v)}function zP(f){var v=zf(this._getId(f)),h={"":v},J={"":q0(v,!1)},Q={},W=this;return EP(f,{allKeys:!0},function(X,Y,B,q,D,j,L){if(Y==="")return;var G=W._getId(X),O=h[q],M=J[q]+"/"+D;if(L!==void 0)M+="/"+(typeof L=="number"?L:H0.escapeFragment(L));if(typeof G=="string"){G=O=zf(O?R1.resolve(O,G):G);var K=W._refs[G];if(typeof K=="string")K=W._refs[K];if(K&&K.schema){if(!uh(X,K.schema))throw new Error('id "'+G+'" resolves to more than one schema')}else if(G!=zf(M))if(G[0]=="#"){if(Q[G]&&!uh(X,Q[G]))throw new Error('id "'+G+'" resolves to more than one schema');Q[G]=X}else W._refs[G]=M}h[Y]=O,J[Y]=M}),Q}});var $0=n((xX,nh)=>{var qQ=K0();nh.exports={Validation:ph(AP),MissingRef:ph(DQ)};function AP(f){this.message="validation failed",this.errors=f,this.ajv=this.validation=!0}DQ.message=function(f,v){return"can't resolve reference "+v+" from id "+f};function DQ(f,v,h){this.message=h||DQ.message(f,v),this.missingRef=qQ.url(f,v),this.missingSchema=qQ.normalizeId(qQ.fullPath(this.missingRef))}function ph(f){return f.prototype=Object.create(Error.prototype),f.prototype.constructor=f,f}});var HQ=n((ZX,ih)=>{ih.exports=function(f,v){if(!v)v={};if(typeof v==="function")v={cmp:v};var h=typeof v.cycles==="boolean"?v.cycles:!1,J=v.cmp&&function(W){return function(X){return function(Y,B){var q={key:Y,value:X[Y]},D={key:B,value:X[B]};return W(q,D)}}}(v.cmp),Q=[];return function W(X){if(X&&X.toJSON&&typeof X.toJSON==="function")X=X.toJSON();if(X===void 0)return;if(typeof X=="number")return isFinite(X)?""+X:"null";if(typeof X!=="object")return JSON.stringify(X);var Y,B;if(Array.isArray(X)){B="[";for(Y=0;Y<X.length;Y++){if(Y)B+=",";B+=W(X[Y])||"null"}return B+"]"}if(X===null)return"null";if(Q.indexOf(X)!==-1){if(h)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var q=Q.push(X)-1,D=Object.keys(X).sort(J&&J(X));B="";for(Y=0;Y<D.length;Y++){var j=D[Y],L=W(X[j]);if(!L)continue;if(B)B+=",";B+=JSON.stringify(j)+":"+L}return Q.splice(q,1),"{"+B+"}"}(f)}});var OQ=n((rX,dh)=>{dh.exports=function f(v,h,J){var Q="",W=v.schema.$async===!0,X=v.util.schemaHasRulesExcept(v.schema,v.RULES.all,"$ref"),Y=v.self._getId(v.schema);if(v.opts.strictKeywords){var B=v.util.schemaUnknownRules(v.schema,v.RULES.keywords);if(B){var q="unknown keyword: "+B;if(v.opts.strictKeywords==="log")v.logger.warn(q);else throw new Error(q)}}if(v.isTop){if(Q+=" var validate = ",W)v.async=!0,Q+="async ";if(Q+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",Y&&(v.opts.sourceCode||v.opts.processCode))Q+=" "+("/*# sourceURL="+Y+" */")+" "}if(typeof v.schema=="boolean"||!(X||v.schema.$ref)){var h="false schema",D=v.level,j=v.dataLevel,L=v.schema[h],G=v.schemaPath+v.util.getProperty(h),O=v.errSchemaPath+"/"+h,b=!v.opts.allErrors,Z,M="data"+(j||""),A="valid"+D;if(v.schema===!1){if(v.isTop)b=!0;else Q+=" var "+A+" = false; ";var K=K||[];if(K.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(Z||"false schema")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(O)+" , params: {} ",v.opts.messages!==!1)Q+=" , message: 'boolean schema is false' ";if(v.opts.verbose)Q+=" , schema: false , parentSchema: validate.schema"+v.schemaPath+" , data: "+M+" ";Q+=" } "}else Q+=" {} ";var F=Q;if(Q=K.pop(),!v.compositeRule&&b)if(v.async)Q+=" throw new ValidationError(["+F+"]); ";else Q+=" validate.errors = ["+F+"]; return false; ";else Q+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else if(v.isTop)if(W)Q+=" return data; ";else Q+=" validate.errors = null; return true; ";else Q+=" var "+A+" = true; ";if(v.isTop)Q+=" }; return validate; ";return Q}if(v.isTop){var S=v.isTop,D=v.level=0,j=v.dataLevel=0,M="data";if(v.rootId=v.resolve.fullPath(v.self._getId(v.root.schema)),v.baseId=v.baseId||v.rootId,delete v.isTop,v.dataPathArr=[""],v.schema.default!==void 0&&v.opts.useDefaults&&v.opts.strictDefaults){var N="default is ignored in the schema root";if(v.opts.strictDefaults==="log")v.logger.warn(N);else throw new Error(N)}Q+=" var vErrors = null; ",Q+=" var errors = 0; ",Q+=" if (rootData === undefined) rootData = data; "}else{var{level:D,dataLevel:j}=v,M="data"+(j||"");if(Y)v.baseId=v.resolve.url(v.baseId,Y);if(W&&!v.async)throw new Error("async schema in sync schema");Q+=" var errs_"+D+" = errors;"}var A="valid"+D,b=!v.opts.allErrors,k="",m="",Z,_=v.schema.type,r=Array.isArray(_);if(_&&v.opts.nullable&&v.schema.nullable===!0){if(r){if(_.indexOf("null")==-1)_=_.concat("null")}else if(_!="null")_=[_,"null"],r=!0}if(r&&_.length==1)_=_[0],r=!1;if(v.schema.$ref&&X){if(v.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+v.errSchemaPath+'" (see option extendRefs)');else if(v.opts.extendRefs!==!0)X=!1,v.logger.warn('$ref: keywords ignored in schema at path "'+v.errSchemaPath+'"')}if(v.schema.$comment&&v.opts.$comment)Q+=" "+v.RULES.all.$comment.code(v,"$comment");if(_){if(v.opts.coerceTypes)var x=v.util.coerceToTypes(v.opts.coerceTypes,_);var C=v.RULES.types[_];if(x||r||C===!0||C&&!Av(C)){var G=v.schemaPath+".type",O=v.errSchemaPath+"/type",G=v.schemaPath+".type",O=v.errSchemaPath+"/type",R=r?"checkDataTypes":"checkDataType";if(Q+=" if ("+v.util[R](_,M,v.opts.strictNumbers,!0)+") { ",x){var l="dataType"+D,T="coerced"+D;if(Q+=" var "+l+" = typeof "+M+"; var "+T+" = undefined; ",v.opts.coerceTypes=="array")Q+=" if ("+l+" == 'object' && Array.isArray("+M+") && "+M+".length == 1) { "+M+" = "+M+"[0]; "+l+" = typeof "+M+"; if ("+v.util.checkDataType(v.schema.type,M,v.opts.strictNumbers)+") "+T+" = "+M+"; } ";Q+=" if ("+T+" !== undefined) ; ";var Bv=x;if(Bv){var e,fv=-1,o=Bv.length-1;while(fv<o)if(e=Bv[fv+=1],e=="string")Q+=" else if ("+l+" == 'number' || "+l+" == 'boolean') "+T+" = '' + "+M+"; else if ("+M+" === null) "+T+" = ''; ";else if(e=="number"||e=="integer"){if(Q+=" else if ("+l+" == 'boolean' || "+M+" === null || ("+l+" == 'string' && "+M+" && "+M+" == +"+M+" ",e=="integer")Q+=" && !("+M+" % 1)";Q+=")) "+T+" = +"+M+"; "}else if(e=="boolean")Q+=" else if ("+M+" === 'false' || "+M+" === 0 || "+M+" === null) "+T+" = false; else if ("+M+" === 'true' || "+M+" === 1) "+T+" = true; ";else if(e=="null")Q+=" else if ("+M+" === '' || "+M+" === 0 || "+M+" === false) "+T+" = null; ";else if(v.opts.coerceTypes=="array"&&e=="array")Q+=" else if ("+l+" == 'string' || "+l+" == 'number' || "+l+" == 'boolean' || "+M+" == null) "+T+" = ["+M+"]; "}Q+=" else { ";var K=K||[];if(K.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(Z||"type")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(O)+" , params: { type: '",r)Q+=""+_.join(",");else Q+=""+_;if(Q+="' } ",v.opts.messages!==!1){if(Q+=" , message: 'should be ",r)Q+=""+_.join(",");else Q+=""+_;Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+G+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+M+" ";Q+=" } "}else Q+=" {} ";var F=Q;if(Q=K.pop(),!v.compositeRule&&b)if(v.async)Q+=" throw new ValidationError(["+F+"]); ";else Q+=" validate.errors = ["+F+"]; return false; ";else Q+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";Q+=" } if ("+T+" !== undefined) { ";var a=j?"data"+(j-1||""):"parentData",jv=j?v.dataPathArr[j]:"parentDataProperty";if(Q+=" "+M+" = "+T+"; ",!j)Q+="if ("+a+" !== undefined)";Q+=" "+a+"["+jv+"] = "+T+"; } "}else{var K=K||[];if(K.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(Z||"type")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(O)+" , params: { type: '",r)Q+=""+_.join(",");else Q+=""+_;if(Q+="' } ",v.opts.messages!==!1){if(Q+=" , message: 'should be ",r)Q+=""+_.join(",");else Q+=""+_;Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+G+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+M+" ";Q+=" } "}else Q+=" {} ";var F=Q;if(Q=K.pop(),!v.compositeRule&&b)if(v.async)Q+=" throw new ValidationError(["+F+"]); ";else Q+=" validate.errors = ["+F+"]; return false; ";else Q+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}Q+=" } "}}if(v.schema.$ref&&!X){if(Q+=" "+v.RULES.all.$ref.code(v,"$ref")+" ",b){if(Q+=" } if (errors === ",S)Q+="0";else Q+="errs_"+D;Q+=") { ",m+="}"}}else{var Sv=v.RULES;if(Sv){var C,_v=-1,Wv=Sv.length-1;while(_v<Wv)if(C=Sv[_v+=1],Av(C)){if(C.type)Q+=" if ("+v.util.checkDataType(C.type,M,v.opts.strictNumbers)+") { ";if(v.opts.useDefaults){if(C.type=="object"&&v.schema.properties){var L=v.schema.properties,Vv=Object.keys(L),zv=Vv;if(zv){var lv,Lf=-1,Gf=zv.length-1;while(Lf<Gf){lv=zv[Lf+=1];var Fv=L[lv];if(Fv.default!==void 0){var Lv=M+v.util.getProperty(lv);if(v.compositeRule){if(v.opts.strictDefaults){var N="default is ignored for: "+Lv;if(v.opts.strictDefaults==="log")v.logger.warn(N);else throw new Error(N)}}else{if(Q+=" if ("+Lv+" === undefined ",v.opts.useDefaults=="empty")Q+=" || "+Lv+" === null || "+Lv+" === '' ";if(Q+=" ) "+Lv+" = ",v.opts.useDefaults=="shared")Q+=" "+v.useDefault(Fv.default)+" ";else Q+=" "+JSON.stringify(Fv.default)+" ";Q+="; "}}}}}else if(C.type=="array"&&Array.isArray(v.schema.items)){var Sf=v.schema.items;if(Sf){var Fv,fv=-1,bv=Sf.length-1;while(fv<bv)if(Fv=Sf[fv+=1],Fv.default!==void 0){var Lv=M+"["+fv+"]";if(v.compositeRule){if(v.opts.strictDefaults){var N="default is ignored for: "+Lv;if(v.opts.strictDefaults==="log")v.logger.warn(N);else throw new Error(N)}}else{if(Q+=" if ("+Lv+" === undefined ",v.opts.useDefaults=="empty")Q+=" || "+Lv+" === null || "+Lv+" === '' ";if(Q+=" ) "+Lv+" = ",v.opts.useDefaults=="shared")Q+=" "+v.useDefault(Fv.default)+" ";else Q+=" "+JSON.stringify(Fv.default)+" ";Q+="; "}}}}}var Xv=C.rules;if(Xv){var Mf,wf=-1,bf=Xv.length-1;while(wf<bf)if(Mf=Xv[wf+=1],cv(Mf)){var Rf=Mf.code(v,Mf.keyword,C.type);if(Rf){if(Q+=" "+Rf+" ",b)k+="}"}}}if(b)Q+=" "+k+" ",k="";if(C.type){if(Q+=" } ",_&&_===C.type&&!x){Q+=" else { ";var G=v.schemaPath+".type",O=v.errSchemaPath+"/type",K=K||[];if(K.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(Z||"type")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(O)+" , params: { type: '",r)Q+=""+_.join(",");else Q+=""+_;if(Q+="' } ",v.opts.messages!==!1){if(Q+=" , message: 'should be ",r)Q+=""+_.join(",");else Q+=""+_;Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+G+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+M+" ";Q+=" } "}else Q+=" {} ";var F=Q;if(Q=K.pop(),!v.compositeRule&&b)if(v.async)Q+=" throw new ValidationError(["+F+"]); ";else Q+=" validate.errors = ["+F+"]; return false; ";else Q+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";Q+=" } "}}if(b){if(Q+=" if (errors === ",S)Q+="0";else Q+="errs_"+D;Q+=") { ",m+="}"}}}}if(b)Q+=" "+m+" ";if(S){if(W)Q+=" if (errors === 0) return data; ",Q+=" else throw new ValidationError(vErrors); ";else Q+=" validate.errors = vErrors; ",Q+=" return errors === 0; ";Q+=" }; return validate;"}else Q+=" var "+A+" = errors === errs_"+D+";";function Av(kv){var Jf=kv.rules;for(var xv=0;xv<Jf.length;xv++)if(cv(Jf[xv]))return!0}function cv(kv){return v.schema[kv.keyword]!==void 0||kv.implements&&Cv(kv)}function Cv(kv){var Jf=kv.implements;for(var xv=0;xv<Jf.length;xv++)if(v.schema[Jf[xv]]!==void 0)return!0}return Q}});var v9=n((uX,eh)=>{var j0=K0(),M0=xf(),sh=$0(),SP=HQ(),th=OQ(),bP=M0.ucs2length,RP=B0(),_P=sh.Validation;eh.exports=KQ;function KQ(f,v,h,J){var Q=this,W=this._opts,X=[void 0],Y={},B=[],q={},D=[],j={},L=[];v=v||{schema:f,refVal:X,refs:Y};var G=lP.call(this,f,v,J),O=this._compilations[G.index];if(G.compiling)return O.callValidate=N;var M=this._formats,K=this.RULES;try{var F=A(f,v,h,J);O.validate=F;var S=O.callValidate;if(S){if(S.schema=F.schema,S.errors=null,S.refs=F.refs,S.refVal=F.refVal,S.root=F.root,S.$async=F.$async,W.sourceCode)S.source=F.source}return F}finally{kP.call(this,f,v,J)}function N(){var R=O.validate,l=R.apply(this,arguments);return N.errors=R.errors,l}function A(R,l,T,Bv){var e=!l||l&&l.schema==R;if(l.schema!=v.schema)return KQ.call(Q,R,l,T,Bv);var fv=R.$async===!0,o=th({isTop:!0,schema:R,isRoot:e,baseId:Bv,root:l,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:sh.MissingRef,RULES:K,validate:th,util:M0,resolve:j0,resolveRef:b,usePattern:r,useDefault:x,useCustomRule:C,opts:W,formats:M,logger:Q.logger,self:Q});if(o=L0(X,IP)+L0(B,gP)+L0(D,yP)+L0(L,CP)+o,W.processCode)o=W.processCode(o,R);var a;try{var jv=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",o);a=jv(Q,K,M,v,X,D,L,RP,bP,_P),X[0]=a}catch(Sv){throw Q.logger.error("Error compiling schema, function code:",o),Sv}if(a.schema=R,a.errors=null,a.refs=Y,a.refVal=X,a.root=e?a:l,fv)a.$async=!0;if(W.sourceCode===!0)a.source={code:o,patterns:B,defaults:D};return a}function b(R,l,T){l=j0.url(R,l);var Bv=Y[l],e,fv;if(Bv!==void 0)return e=X[Bv],fv="refVal["+Bv+"]",_(e,fv);if(!T&&v.refs){var o=v.refs[l];if(o!==void 0)return e=v.refVal[o],fv=k(l,e),_(e,fv)}fv=k(l);var a=j0.call(Q,A,v,l);if(a===void 0){var jv=h&&h[l];if(jv)a=j0.inlineRef(jv,W.inlineRefs)?jv:KQ.call(Q,jv,v,h,R)}if(a===void 0)m(l);else return Z(l,a),_(a,fv)}function k(R,l){var T=X.length;return X[T]=l,Y[R]=T,"refVal"+T}function m(R){delete Y[R]}function Z(R,l){var T=Y[R];X[T]=l}function _(R,l){return typeof R=="object"||typeof R=="boolean"?{code:l,schema:R,inline:!0}:{code:l,$async:R&&!!R.$async}}function r(R){var l=q[R];if(l===void 0)l=q[R]=B.length,B[l]=R;return"pattern"+l}function x(R){switch(typeof R){case"boolean":case"number":return""+R;case"string":return M0.toQuotedString(R);case"object":if(R===null)return"null";var l=SP(R),T=j[l];if(T===void 0)T=j[l]=D.length,D[T]=R;return"default"+T}}function C(R,l,T,Bv){if(Q._opts.validateSchema!==!1){var e=R.definition.dependencies;if(e&&!e.every(function(zv){return Object.prototype.hasOwnProperty.call(T,zv)}))throw new Error("parent schema must have all required keywords: "+e.join(","));var fv=R.definition.validateSchema;if(fv){var o=fv(l);if(!o){var a="keyword schema is invalid: "+Q.errorsText(fv.errors);if(Q._opts.validateSchema=="log")Q.logger.error(a);else throw new Error(a)}}}var jv=R.definition.compile,Sv=R.definition.inline,_v=R.definition.macro,Wv;if(jv)Wv=jv.call(Q,l,T,Bv);else if(_v){if(Wv=_v.call(Q,l,T,Bv),W.validateSchema!==!1)Q.validateSchema(Wv,!0)}else if(Sv)Wv=Sv.call(Q,Bv,R.keyword,l,T);else if(Wv=R.definition.validate,!Wv)return;if(Wv===void 0)throw new Error('custom keyword "'+R.keyword+'"failed to compile');var Vv=L.length;return L[Vv]=Wv,{code:"customRule"+Vv,validate:Wv}}}function lP(f,v,h){var J=oh.call(this,f,v,h);if(J>=0)return{index:J,compiling:!0};return J=this._compilations.length,this._compilations[J]={schema:f,root:v,baseId:h},{index:J,compiling:!1}}function kP(f,v,h){var J=oh.call(this,f,v,h);if(J>=0)this._compilations.splice(J,1)}function oh(f,v,h){for(var J=0;J<this._compilations.length;J++){var Q=this._compilations[J];if(Q.schema==f&&Q.root==v&&Q.baseId==h)return J}return-1}function gP(f,v){return"var pattern"+f+" = new RegExp("+M0.toQuotedString(v[f])+");"}function yP(f){return"var default"+f+" = defaults["+f+"];"}function IP(f,v){return v[f]===void 0?"":"var refVal"+f+" = refVal["+f+"];"}function CP(f){return"var customRule"+f+" = customRules["+f+"];"}function L0(f,v){if(!f.length)return"";var h="";for(var J=0;J<f.length;J++)h+=v(J,f);return h}});var Q9=n((mX,f9)=>{var E0=f9.exports=function f(){this._cache={}};E0.prototype.put=function f(v,h){this._cache[v]=h};E0.prototype.get=function f(v){return this._cache[v]};E0.prototype.del=function f(v){delete this._cache[v]};E0.prototype.clear=function f(){this._cache={}}});var H9=n((aX,D9)=>{var TP=xf(),xP=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,ZP=[0,31,28,31,30,31,30,31,31,30,31,30,31],rP=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,h9=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,uP=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,mP=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,J9=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,W9=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,P9=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,X9=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Y9=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,B9=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;D9.exports=V0;function V0(f){return f=f=="full"?"full":"fast",TP.copy(V0[f])}V0.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":J9,url:W9,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:h9,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:q9,uuid:P9,"json-pointer":X9,"json-pointer-uri-fragment":Y9,"relative-json-pointer":B9};V0.full={date:G9,time:w9,"date-time":pP,uri:iP,"uri-reference":mP,"uri-template":J9,url:W9,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:h9,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:q9,uuid:P9,"json-pointer":X9,"json-pointer-uri-fragment":Y9,"relative-json-pointer":B9};function aP(f){return f%4===0&&(f%100!==0||f%400===0)}function G9(f){var v=f.match(xP);if(!v)return!1;var h=+v[1],J=+v[2],Q=+v[3];return J>=1&&J<=12&&Q>=1&&Q<=(J==2&&aP(h)?29:ZP[J])}function w9(f,v){var h=f.match(rP);if(!h)return!1;var J=h[1],Q=h[2],W=h[3],X=h[5];return(J<=23&&Q<=59&&W<=59||J==23&&Q==59&&W==60)&&(!v||X)}var cP=/t|\s/i;function pP(f){var v=f.split(cP);return v.length==2&&G9(v[0])&&w9(v[1],!0)}var nP=/\/|:/;function iP(f){return nP.test(f)&&uP.test(f)}var dP=/[^\\]\\Z/;function q9(f){if(dP.test(f))return!1;try{return new RegExp(f),!0}catch(v){return!1}}});var K9=n((cX,O9)=>{O9.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.errSchemaPath+"/"+h,q=!v.opts.allErrors,D="data"+(X||""),j="valid"+W,L,G;if(Y=="#"||Y=="#/")if(v.isRoot)L=v.async,G="validate";else L=v.root.schema.$async===!0,G="root.refVal[0]";else{var O=v.resolveRef(v.baseId,Y,v.isRoot);if(O===void 0){var M=v.MissingRefError.message(v.baseId,Y);if(v.opts.missingRefs=="fail"){v.logger.error(M);var K=K||[];if(K.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(B)+" , params: { ref: '"+v.util.escapeQuotes(Y)+"' } ",v.opts.messages!==!1)Q+=" , message: 'can\\'t resolve reference "+v.util.escapeQuotes(Y)+"' ";if(v.opts.verbose)Q+=" , schema: "+v.util.toQuotedString(Y)+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+D+" ";Q+=" } "}else Q+=" {} ";var F=Q;if(Q=K.pop(),!v.compositeRule&&q)if(v.async)Q+=" throw new ValidationError(["+F+"]); ";else Q+=" validate.errors = ["+F+"]; return false; ";else Q+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(q)Q+=" if (false) { "}else if(v.opts.missingRefs=="ignore"){if(v.logger.warn(M),q)Q+=" if (true) { "}else throw new v.MissingRefError(v.baseId,Y,M)}else if(O.inline){var S=v.util.copy(v);S.level++;var N="valid"+S.level;S.schema=O.schema,S.schemaPath="",S.errSchemaPath=Y;var A=v.validate(S).replace(/validate\.schema/g,O.code);if(Q+=" "+A+" ",q)Q+=" if ("+N+") { "}else L=O.$async===!0||v.async&&O.$async!==!1,G=O.code}if(G){var K=K||[];if(K.push(Q),Q="",v.opts.passContext)Q+=" "+G+".call(this, ";else Q+=" "+G+"( ";if(Q+=" "+D+", (dataPath || '')",v.errorPath!='""')Q+=" + "+v.errorPath;var b=X?"data"+(X-1||""):"parentData",k=X?v.dataPathArr[X]:"parentDataProperty";Q+=" , "+b+" , "+k+", rootData) ";var m=Q;if(Q=K.pop(),L){if(!v.async)throw new Error("async schema referenced by sync schema");if(q)Q+=" var "+j+"; ";if(Q+=" try { await "+m+"; ",q)Q+=" "+j+" = true; ";if(Q+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",q)Q+=" "+j+" = false; ";if(Q+=" } ",q)Q+=" if ("+j+") { "}else if(Q+=" if (!"+m+") { if (vErrors === null) vErrors = "+G+".errors; else vErrors = vErrors.concat("+G+".errors); errors = vErrors.length; } ",q)Q+=" else { "}return Q}});var j9=n((pX,$9)=>{$9.exports=function f(v,h,J){var Q=" ",W=v.schema[h],X=v.schemaPath+v.util.getProperty(h),Y=v.errSchemaPath+"/"+h,B=!v.opts.allErrors,q=v.util.copy(v),D="";q.level++;var j="valid"+q.level,L=q.baseId,G=!0,O=W;if(O){var M,K=-1,F=O.length-1;while(K<F)if(M=O[K+=1],v.opts.strictKeywords?typeof M=="object"&&Object.keys(M).length>0||M===!1:v.util.schemaHasRules(M,v.RULES.all)){if(G=!1,q.schema=M,q.schemaPath=X+"["+K+"]",q.errSchemaPath=Y+"/"+K,Q+=" "+v.validate(q)+" ",q.baseId=L,B)Q+=" if ("+j+") { ",D+="}"}}if(B)if(G)Q+=" if (true) { ";else Q+=" "+D.slice(0,-1)+" ";return Q}});var M9=n((nX,L9)=>{L9.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.schemaPath+v.util.getProperty(h),q=v.errSchemaPath+"/"+h,D=!v.opts.allErrors,j="data"+(X||""),L="valid"+W,G="errs__"+W,O=v.util.copy(v),M="";O.level++;var K="valid"+O.level,F=Y.every(function(Z){return v.opts.strictKeywords?typeof Z=="object"&&Object.keys(Z).length>0||Z===!1:v.util.schemaHasRules(Z,v.RULES.all)});if(F){var S=O.baseId;Q+=" var "+G+" = errors; var "+L+" = false; ";var N=v.compositeRule;v.compositeRule=O.compositeRule=!0;var A=Y;if(A){var b,k=-1,m=A.length-1;while(k<m)b=A[k+=1],O.schema=b,O.schemaPath=B+"["+k+"]",O.errSchemaPath=q+"/"+k,Q+=" "+v.validate(O)+" ",O.baseId=S,Q+=" "+L+" = "+L+" || "+K+"; if (!"+L+") { ",M+="}"}if(v.compositeRule=O.compositeRule=N,Q+=" "+M+" if (!"+L+") { var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: {} ",v.opts.messages!==!1)Q+=" , message: 'should match some schema in anyOf' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" ";Q+=" } "}else Q+=" {} ";if(Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(vErrors); ";else Q+=" validate.errors = vErrors; return false; ";if(Q+=" } else { errors = "+G+"; if (vErrors !== null) { if ("+G+") vErrors.length = "+G+"; else vErrors = null; } ",v.opts.allErrors)Q+=" } "}else if(D)Q+=" if (true) { ";return Q}});var V9=n((iX,E9)=>{E9.exports=function f(v,h,J){var Q=" ",W=v.schema[h],X=v.errSchemaPath+"/"+h,Y=!v.opts.allErrors,B=v.util.toQuotedString(W);if(v.opts.$comment===!0)Q+=" console.log("+B+");";else if(typeof v.opts.$comment=="function")Q+=" self._opts.$comment("+B+", "+v.util.toQuotedString(X)+", validate.root.schema);";return Q}});var N9=n((dX,F9)=>{F9.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.schemaPath+v.util.getProperty(h),q=v.errSchemaPath+"/"+h,D=!v.opts.allErrors,j="data"+(X||""),L="valid"+W,G=v.opts.$data&&Y&&Y.$data,O;if(G)Q+=" var schema"+W+" = "+v.util.getData(Y.$data,X,v.dataPathArr)+"; ",O="schema"+W;else O=Y;if(!G)Q+=" var schema"+W+" = validate.schema"+B+";";Q+="var "+L+" = equal("+j+", schema"+W+"); if (!"+L+") { ";var M=M||[];if(M.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'const' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { allowedValue: schema"+W+" } ",v.opts.messages!==!1)Q+=" , message: 'should be equal to constant' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" ";Q+=" } "}else Q+=" {} ";var K=Q;if(Q=M.pop(),!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(["+K+"]); ";else Q+=" validate.errors = ["+K+"]; return false; ";else Q+=" var err = "+K+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" }",D)Q+=" else { ";return Q}});var z9=n((tX,U9)=>{U9.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.schemaPath+v.util.getProperty(h),q=v.errSchemaPath+"/"+h,D=!v.opts.allErrors,j="data"+(X||""),L="valid"+W,G="errs__"+W,O=v.util.copy(v),M="";O.level++;var K="valid"+O.level,F="i"+W,S=O.dataLevel=v.dataLevel+1,N="data"+S,A=v.baseId,b=v.opts.strictKeywords?typeof Y=="object"&&Object.keys(Y).length>0||Y===!1:v.util.schemaHasRules(Y,v.RULES.all);if(Q+="var "+G+" = errors;var "+L+";",b){var k=v.compositeRule;v.compositeRule=O.compositeRule=!0,O.schema=Y,O.schemaPath=B,O.errSchemaPath=q,Q+=" var "+K+" = false; for (var "+F+" = 0; "+F+" < "+j+".length; "+F+"++) { ",O.errorPath=v.util.getPathExpr(v.errorPath,F,v.opts.jsonPointers,!0);var m=j+"["+F+"]";O.dataPathArr[S]=F;var Z=v.validate(O);if(O.baseId=A,v.util.varOccurences(Z,N)<2)Q+=" "+v.util.varReplace(Z,N,m)+" ";else Q+=" var "+N+" = "+m+"; "+Z+" ";Q+=" if ("+K+") break; } ",v.compositeRule=O.compositeRule=k,Q+=" "+M+" if (!"+K+") {"}else Q+=" if ("+j+".length == 0) {";var _=_||[];if(_.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: {} ",v.opts.messages!==!1)Q+=" , message: 'should contain a valid item' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" ";Q+=" } "}else Q+=" {} ";var r=Q;if(Q=_.pop(),!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(["+r+"]); ";else Q+=" validate.errors = ["+r+"]; return false; ";else Q+=" var err = "+r+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" } else { ",b)Q+=" errors = "+G+"; if (vErrors !== null) { if ("+G+") vErrors.length = "+G+"; else vErrors = null; } ";if(v.opts.allErrors)Q+=" } ";return Q}});var S9=n((sX,A9)=>{A9.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.schemaPath+v.util.getProperty(h),q=v.errSchemaPath+"/"+h,D=!v.opts.allErrors,j="data"+(X||""),L="errs__"+W,G=v.util.copy(v),O="";G.level++;var M="valid"+G.level,K={},F={},S=v.opts.ownProperties;for(k in Y){if(k=="__proto__")continue;var N=Y[k],A=Array.isArray(N)?F:K;A[k]=N}Q+="var "+L+" = errors;";var b=v.errorPath;Q+="var missing"+W+";";for(var k in F)if(A=F[k],A.length){if(Q+=" if ( "+j+v.util.getProperty(k)+" !== undefined ",S)Q+=" && Object.prototype.hasOwnProperty.call("+j+", '"+v.util.escapeQuotes(k)+"') ";if(D){Q+=" && ( ";var m=A;if(m){var Z,_=-1,r=m.length-1;while(_<r){if(Z=m[_+=1],_)Q+=" || ";var x=v.util.getProperty(Z),C=j+x;if(Q+=" ( ( "+C+" === undefined ",S)Q+=" || ! Object.prototype.hasOwnProperty.call("+j+", '"+v.util.escapeQuotes(Z)+"') ";Q+=") && (missing"+W+" = "+v.util.toQuotedString(v.opts.jsonPointers?Z:x)+") ) "}}Q+=")) { ";var R="missing"+W,l="' + "+R+" + '";if(v.opts._errorDataPathProperty)v.errorPath=v.opts.jsonPointers?v.util.getPathExpr(b,R,!0):b+" + "+R;var T=T||[];if(T.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { property: '"+v.util.escapeQuotes(k)+"', missingProperty: '"+l+"', depsCount: "+A.length+", deps: '"+v.util.escapeQuotes(A.length==1?A[0]:A.join(", "))+"' } ",v.opts.messages!==!1){if(Q+=" , message: 'should have ",A.length==1)Q+="property "+v.util.escapeQuotes(A[0]);else Q+="properties "+v.util.escapeQuotes(A.join(", "));Q+=" when property "+v.util.escapeQuotes(k)+" is present' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" ";Q+=" } "}else Q+=" {} ";var Bv=Q;if(Q=T.pop(),!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(["+Bv+"]); ";else Q+=" validate.errors = ["+Bv+"]; return false; ";else Q+=" var err = "+Bv+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{Q+=" ) { ";var e=A;if(e){var Z,fv=-1,o=e.length-1;while(fv<o){Z=e[fv+=1];var x=v.util.getProperty(Z),l=v.util.escapeQuotes(Z),C=j+x;if(v.opts._errorDataPathProperty)v.errorPath=v.util.getPath(b,Z,v.opts.jsonPointers);if(Q+=" if ( "+C+" === undefined ",S)Q+=" || ! Object.prototype.hasOwnProperty.call("+j+", '"+v.util.escapeQuotes(Z)+"') ";if(Q+=") { var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { property: '"+v.util.escapeQuotes(k)+"', missingProperty: '"+l+"', depsCount: "+A.length+", deps: '"+v.util.escapeQuotes(A.length==1?A[0]:A.join(", "))+"' } ",v.opts.messages!==!1){if(Q+=" , message: 'should have ",A.length==1)Q+="property "+v.util.escapeQuotes(A[0]);else Q+="properties "+v.util.escapeQuotes(A.join(", "));Q+=" when property "+v.util.escapeQuotes(k)+" is present' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" ";Q+=" } "}else Q+=" {} ";Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}}if(Q+=" } ",D)O+="}",Q+=" else { "}v.errorPath=b;var a=G.baseId;for(var k in K){var N=K[k];if(v.opts.strictKeywords?typeof N=="object"&&Object.keys(N).length>0||N===!1:v.util.schemaHasRules(N,v.RULES.all)){if(Q+=" "+M+" = true; if ( "+j+v.util.getProperty(k)+" !== undefined ",S)Q+=" && Object.prototype.hasOwnProperty.call("+j+", '"+v.util.escapeQuotes(k)+"') ";if(Q+=") { ",G.schema=N,G.schemaPath=B+v.util.getProperty(k),G.errSchemaPath=q+"/"+v.util.escapeFragment(k),Q+=" "+v.validate(G)+" ",G.baseId=a,Q+=" } ",D)Q+=" if ("+M+") { ",O+="}"}}if(D)Q+=" "+O+" if ("+L+" == errors) {";return Q}});var R9=n((oX,b9)=>{b9.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.schemaPath+v.util.getProperty(h),q=v.errSchemaPath+"/"+h,D=!v.opts.allErrors,j="data"+(X||""),L="valid"+W,G=v.opts.$data&&Y&&Y.$data,O;if(G)Q+=" var schema"+W+" = "+v.util.getData(Y.$data,X,v.dataPathArr)+"; ",O="schema"+W;else O=Y;var M="i"+W,K="schema"+W;if(!G)Q+=" var "+K+" = validate.schema"+B+";";if(Q+="var "+L+";",G)Q+=" if (schema"+W+" === undefined) "+L+" = true; else if (!Array.isArray(schema"+W+")) "+L+" = false; else {";if(Q+=""+L+" = false;for (var "+M+"=0; "+M+"<"+K+".length; "+M+"++) if (equal("+j+", "+K+"["+M+"])) { "+L+" = true; break; }",G)Q+=" } ";Q+=" if (!"+L+") { ";var F=F||[];if(F.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { allowedValues: schema"+W+" } ",v.opts.messages!==!1)Q+=" , message: 'should be equal to one of the allowed values' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" ";Q+=" } "}else Q+=" {} ";var S=Q;if(Q=F.pop(),!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(["+S+"]); ";else Q+=" validate.errors = ["+S+"]; return false; ";else Q+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" }",D)Q+=" else { ";return Q}});var l9=n((eX,_9)=>{_9.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.schemaPath+v.util.getProperty(h),q=v.errSchemaPath+"/"+h,D=!v.opts.allErrors,j="data"+(X||"");if(v.opts.format===!1){if(D)Q+=" if (true) { ";return Q}var L=v.opts.$data&&Y&&Y.$data,G;if(L)Q+=" var schema"+W+" = "+v.util.getData(Y.$data,X,v.dataPathArr)+"; ",G="schema"+W;else G=Y;var O=v.opts.unknownFormats,M=Array.isArray(O);if(L){var K="format"+W,F="isObject"+W,S="formatType"+W;if(Q+=" var "+K+" = formats["+G+"]; var "+F+" = typeof "+K+" == 'object' && !("+K+" instanceof RegExp) && "+K+".validate; var "+S+" = "+F+" && "+K+".type || 'string'; if ("+F+") { ",v.async)Q+=" var async"+W+" = "+K+".async; ";if(Q+=" "+K+" = "+K+".validate; } if ( ",L)Q+=" ("+G+" !== undefined && typeof "+G+" != 'string') || ";if(Q+=" (",O!="ignore"){if(Q+=" ("+G+" && !"+K+" ",M)Q+=" && self._opts.unknownFormats.indexOf("+G+") == -1 ";Q+=") || "}if(Q+=" ("+K+" && "+S+" == '"+J+"' && !(typeof "+K+" == 'function' ? ",v.async)Q+=" (async"+W+" ? await "+K+"("+j+") : "+K+"("+j+")) ";else Q+=" "+K+"("+j+") ";Q+=" : "+K+".test("+j+"))))) {"}else{var K=v.formats[Y];if(!K)if(O=="ignore"){if(v.logger.warn('unknown format "'+Y+'" ignored in schema at path "'+v.errSchemaPath+'"'),D)Q+=" if (true) { ";return Q}else if(M&&O.indexOf(Y)>=0){if(D)Q+=" if (true) { ";return Q}else throw new Error('unknown format "'+Y+'" is used in schema at path "'+v.errSchemaPath+'"');var F=typeof K=="object"&&!(K instanceof RegExp)&&K.validate,S=F&&K.type||"string";if(F){var N=K.async===!0;K=K.validate}if(S!=J){if(D)Q+=" if (true) { ";return Q}if(N){if(!v.async)throw new Error("async format in sync schema");var A="formats"+v.util.getProperty(Y)+".validate";Q+=" if (!(await "+A+"("+j+"))) { "}else{Q+=" if (! ";var A="formats"+v.util.getProperty(Y);if(F)A+=".validate";if(typeof K=="function")Q+=" "+A+"("+j+") ";else Q+=" "+A+".test("+j+") ";Q+=") { "}}var b=b||[];if(b.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'format' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { format: ",L)Q+=""+G;else Q+=""+v.util.toQuotedString(Y);if(Q+=" } ",v.opts.messages!==!1){if(Q+=` , message: 'should match format "`,L)Q+="' + "+G+" + '";else Q+=""+v.util.escapeQuotes(Y);Q+=`"' `}if(v.opts.verbose){if(Q+=" , schema: ",L)Q+="validate.schema"+B;else Q+=""+v.util.toQuotedString(Y);Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" "}Q+=" } "}else Q+=" {} ";var k=Q;if(Q=b.pop(),!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(["+k+"]); ";else Q+=" validate.errors = ["+k+"]; return false; ";else Q+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" } ",D)Q+=" else { ";return Q}});var g9=n((vY,k9)=>{k9.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.schemaPath+v.util.getProperty(h),q=v.errSchemaPath+"/"+h,D=!v.opts.allErrors,j="data"+(X||""),L="valid"+W,G="errs__"+W,O=v.util.copy(v);O.level++;var M="valid"+O.level,K=v.schema.then,F=v.schema.else,S=K!==void 0&&(v.opts.strictKeywords?typeof K=="object"&&Object.keys(K).length>0||K===!1:v.util.schemaHasRules(K,v.RULES.all)),N=F!==void 0&&(v.opts.strictKeywords?typeof F=="object"&&Object.keys(F).length>0||F===!1:v.util.schemaHasRules(F,v.RULES.all)),A=O.baseId;if(S||N){var b;O.createErrors=!1,O.schema=Y,O.schemaPath=B,O.errSchemaPath=q,Q+=" var "+G+" = errors; var "+L+" = true; ";var k=v.compositeRule;if(v.compositeRule=O.compositeRule=!0,Q+=" "+v.validate(O)+" ",O.baseId=A,O.createErrors=!0,Q+=" errors = "+G+"; if (vErrors !== null) { if ("+G+") vErrors.length = "+G+"; else vErrors = null; } ",v.compositeRule=O.compositeRule=k,S){if(Q+=" if ("+M+") { ",O.schema=v.schema.then,O.schemaPath=v.schemaPath+".then",O.errSchemaPath=v.errSchemaPath+"/then",Q+=" "+v.validate(O)+" ",O.baseId=A,Q+=" "+L+" = "+M+"; ",S&&N)b="ifClause"+W,Q+=" var "+b+" = 'then'; ";else b="'then'";if(Q+=" } ",N)Q+=" else { "}else Q+=" if (!"+M+") { ";if(N){if(O.schema=v.schema.else,O.schemaPath=v.schemaPath+".else",O.errSchemaPath=v.errSchemaPath+"/else",Q+=" "+v.validate(O)+" ",O.baseId=A,Q+=" "+L+" = "+M+"; ",S&&N)b="ifClause"+W,Q+=" var "+b+" = 'else'; ";else b="'else'";Q+=" } "}if(Q+=" if (!"+L+") { var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'if' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { failingKeyword: "+b+" } ",v.opts.messages!==!1)Q+=` , message: 'should match "' + `+b+` + '" schema' `;if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" ";Q+=" } "}else Q+=" {} ";if(Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(vErrors); ";else Q+=" validate.errors = vErrors; return false; ";if(Q+=" } ",D)Q+=" else { "}else if(D)Q+=" if (true) { ";return Q}});var I9=n((fY,y9)=>{y9.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.schemaPath+v.util.getProperty(h),q=v.errSchemaPath+"/"+h,D=!v.opts.allErrors,j="data"+(X||""),L="valid"+W,G="errs__"+W,O=v.util.copy(v),M="";O.level++;var K="valid"+O.level,F="i"+W,S=O.dataLevel=v.dataLevel+1,N="data"+S,A=v.baseId;if(Q+="var "+G+" = errors;var "+L+";",Array.isArray(Y)){var b=v.schema.additionalItems;if(b===!1){Q+=" "+L+" = "+j+".length <= "+Y.length+"; ";var k=q;q=v.errSchemaPath+"/additionalItems",Q+=" if (!"+L+") { ";var m=m||[];if(m.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { limit: "+Y.length+" } ",v.opts.messages!==!1)Q+=" , message: 'should NOT have more than "+Y.length+" items' ";if(v.opts.verbose)Q+=" , schema: false , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" ";Q+=" } "}else Q+=" {} ";var Z=Q;if(Q=m.pop(),!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(["+Z+"]); ";else Q+=" validate.errors = ["+Z+"]; return false; ";else Q+=" var err = "+Z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" } ",q=k,D)M+="}",Q+=" else { "}var _=Y;if(_){var r,x=-1,C=_.length-1;while(x<C)if(r=_[x+=1],v.opts.strictKeywords?typeof r=="object"&&Object.keys(r).length>0||r===!1:v.util.schemaHasRules(r,v.RULES.all)){Q+=" "+K+" = true; if ("+j+".length > "+x+") { ";var R=j+"["+x+"]";O.schema=r,O.schemaPath=B+"["+x+"]",O.errSchemaPath=q+"/"+x,O.errorPath=v.util.getPathExpr(v.errorPath,x,v.opts.jsonPointers,!0),O.dataPathArr[S]=x;var l=v.validate(O);if(O.baseId=A,v.util.varOccurences(l,N)<2)Q+=" "+v.util.varReplace(l,N,R)+" ";else Q+=" var "+N+" = "+R+"; "+l+" ";if(Q+=" } ",D)Q+=" if ("+K+") { ",M+="}"}}if(typeof b=="object"&&(v.opts.strictKeywords?typeof b=="object"&&Object.keys(b).length>0||b===!1:v.util.schemaHasRules(b,v.RULES.all))){O.schema=b,O.schemaPath=v.schemaPath+".additionalItems",O.errSchemaPath=v.errSchemaPath+"/additionalItems",Q+=" "+K+" = true; if ("+j+".length > "+Y.length+") { for (var "+F+" = "+Y.length+"; "+F+" < "+j+".length; "+F+"++) { ",O.errorPath=v.util.getPathExpr(v.errorPath,F,v.opts.jsonPointers,!0);var R=j+"["+F+"]";O.dataPathArr[S]=F;var l=v.validate(O);if(O.baseId=A,v.util.varOccurences(l,N)<2)Q+=" "+v.util.varReplace(l,N,R)+" ";else Q+=" var "+N+" = "+R+"; "+l+" ";if(D)Q+=" if (!"+K+") break; ";if(Q+=" } } ",D)Q+=" if ("+K+") { ",M+="}"}}else if(v.opts.strictKeywords?typeof Y=="object"&&Object.keys(Y).length>0||Y===!1:v.util.schemaHasRules(Y,v.RULES.all)){O.schema=Y,O.schemaPath=B,O.errSchemaPath=q,Q+=" for (var "+F+" = 0; "+F+" < "+j+".length; "+F+"++) { ",O.errorPath=v.util.getPathExpr(v.errorPath,F,v.opts.jsonPointers,!0);var R=j+"["+F+"]";O.dataPathArr[S]=F;var l=v.validate(O);if(O.baseId=A,v.util.varOccurences(l,N)<2)Q+=" "+v.util.varReplace(l,N,R)+" ";else Q+=" var "+N+" = "+R+"; "+l+" ";if(D)Q+=" if (!"+K+") break; ";Q+=" }"}if(D)Q+=" "+M+" if ("+G+" == errors) {";return Q}});var $Q=n((QY,C9)=>{C9.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.schemaPath+v.util.getProperty(h),q=v.errSchemaPath+"/"+h,D=!v.opts.allErrors,A,j="data"+(X||""),L=v.opts.$data&&Y&&Y.$data,G;if(L)Q+=" var schema"+W+" = "+v.util.getData(Y.$data,X,v.dataPathArr)+"; ",G="schema"+W;else G=Y;var O=h=="maximum",M=O?"exclusiveMaximum":"exclusiveMinimum",K=v.schema[M],F=v.opts.$data&&K&&K.$data,S=O?"<":">",N=O?">":"<",A=void 0;if(!(L||typeof Y=="number"||Y===void 0))throw new Error(h+" must be number");if(!(F||K===void 0||typeof K=="number"||typeof K=="boolean"))throw new Error(M+" must be number or boolean");if(F){var b=v.util.getData(K.$data,X,v.dataPathArr),k="exclusive"+W,m="exclType"+W,Z="exclIsNumber"+W,_="op"+W,r="' + "+_+" + '";Q+=" var schemaExcl"+W+" = "+b+"; ",b="schemaExcl"+W,Q+=" var "+k+"; var "+m+" = typeof "+b+"; if ("+m+" != 'boolean' && "+m+" != 'undefined' && "+m+" != 'number') { ";var A=M,x=x||[];if(x.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(A||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: {} ",v.opts.messages!==!1)Q+=" , message: '"+M+" should be boolean' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" ";Q+=" } "}else Q+=" {} ";var C=Q;if(Q=x.pop(),!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(["+C+"]); ";else Q+=" validate.errors = ["+C+"]; return false; ";else Q+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" } else if ( ",L)Q+=" ("+G+" !== undefined && typeof "+G+" != 'number') || ";if(Q+=" "+m+" == 'number' ? ( ("+k+" = "+G+" === undefined || "+b+" "+S+"= "+G+") ? "+j+" "+N+"= "+b+" : "+j+" "+N+" "+G+" ) : ( ("+k+" = "+b+" === true) ? "+j+" "+N+"= "+G+" : "+j+" "+N+" "+G+" ) || "+j+" !== "+j+") { var op"+W+" = "+k+" ? '"+S+"' : '"+S+"='; ",Y===void 0)A=M,q=v.errSchemaPath+"/"+M,G=b,L=F}else{var Z=typeof K=="number",r=S;if(Z&&L){var _="'"+r+"'";if(Q+=" if ( ",L)Q+=" ("+G+" !== undefined && typeof "+G+" != 'number') || ";Q+=" ( "+G+" === undefined || "+K+" "+S+"= "+G+" ? "+j+" "+N+"= "+K+" : "+j+" "+N+" "+G+" ) || "+j+" !== "+j+") { "}else{if(Z&&Y===void 0)k=!0,A=M,q=v.errSchemaPath+"/"+M,G=K,N+="=";else{if(Z)G=Math[O?"min":"max"](K,Y);if(K===(Z?G:!0))k=!0,A=M,q=v.errSchemaPath+"/"+M,N+="=";else k=!1,r+="="}var _="'"+r+"'";if(Q+=" if ( ",L)Q+=" ("+G+" !== undefined && typeof "+G+" != 'number') || ";Q+=" "+j+" "+N+" "+G+" || "+j+" !== "+j+") { "}}A=A||h;var x=x||[];if(x.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(A||"_limit")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { comparison: "+_+", limit: "+G+", exclusive: "+k+" } ",v.opts.messages!==!1)if(Q+=" , message: 'should be "+r+" ",L)Q+="' + "+G;else Q+=""+G+"'";if(v.opts.verbose){if(Q+=" , schema: ",L)Q+="validate.schema"+B;else Q+=""+Y;Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" "}Q+=" } "}else Q+=" {} ";var C=Q;if(Q=x.pop(),!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(["+C+"]); ";else Q+=" validate.errors = ["+C+"]; return false; ";else Q+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" } ",D)Q+=" else { ";return Q}});var jQ=n((hY,T9)=>{T9.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.schemaPath+v.util.getProperty(h),q=v.errSchemaPath+"/"+h,D=!v.opts.allErrors,M,j="data"+(X||""),L=v.opts.$data&&Y&&Y.$data,G;if(L)Q+=" var schema"+W+" = "+v.util.getData(Y.$data,X,v.dataPathArr)+"; ",G="schema"+W;else G=Y;if(!(L||typeof Y=="number"))throw new Error(h+" must be number");var O=h=="maxItems"?">":"<";if(Q+="if ( ",L)Q+=" ("+G+" !== undefined && typeof "+G+" != 'number') || ";Q+=" "+j+".length "+O+" "+G+") { ";var M=h,K=K||[];if(K.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(M||"_limitItems")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { limit: "+G+" } ",v.opts.messages!==!1){if(Q+=" , message: 'should NOT have ",h=="maxItems")Q+="more";else Q+="fewer";if(Q+=" than ",L)Q+="' + "+G+" + '";else Q+=""+Y;Q+=" items' "}if(v.opts.verbose){if(Q+=" , schema: ",L)Q+="validate.schema"+B;else Q+=""+Y;Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" "}Q+=" } "}else Q+=" {} ";var F=Q;if(Q=K.pop(),!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(["+F+"]); ";else Q+=" validate.errors = ["+F+"]; return false; ";else Q+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+="} ",D)Q+=" else { ";return Q}});var LQ=n((JY,x9)=>{x9.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.schemaPath+v.util.getProperty(h),q=v.errSchemaPath+"/"+h,D=!v.opts.allErrors,M,j="data"+(X||""),L=v.opts.$data&&Y&&Y.$data,G;if(L)Q+=" var schema"+W+" = "+v.util.getData(Y.$data,X,v.dataPathArr)+"; ",G="schema"+W;else G=Y;if(!(L||typeof Y=="number"))throw new Error(h+" must be number");var O=h=="maxLength"?">":"<";if(Q+="if ( ",L)Q+=" ("+G+" !== undefined && typeof "+G+" != 'number') || ";if(v.opts.unicode===!1)Q+=" "+j+".length ";else Q+=" ucs2length("+j+") ";Q+=" "+O+" "+G+") { ";var M=h,K=K||[];if(K.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(M||"_limitLength")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { limit: "+G+" } ",v.opts.messages!==!1){if(Q+=" , message: 'should NOT be ",h=="maxLength")Q+="longer";else Q+="shorter";if(Q+=" than ",L)Q+="' + "+G+" + '";else Q+=""+Y;Q+=" characters' "}if(v.opts.verbose){if(Q+=" , schema: ",L)Q+="validate.schema"+B;else Q+=""+Y;Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" "}Q+=" } "}else Q+=" {} ";var F=Q;if(Q=K.pop(),!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(["+F+"]); ";else Q+=" validate.errors = ["+F+"]; return false; ";else Q+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+="} ",D)Q+=" else { ";return Q}});var MQ=n((WY,Z9)=>{Z9.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.schemaPath+v.util.getProperty(h),q=v.errSchemaPath+"/"+h,D=!v.opts.allErrors,M,j="data"+(X||""),L=v.opts.$data&&Y&&Y.$data,G;if(L)Q+=" var schema"+W+" = "+v.util.getData(Y.$data,X,v.dataPathArr)+"; ",G="schema"+W;else G=Y;if(!(L||typeof Y=="number"))throw new Error(h+" must be number");var O=h=="maxProperties"?">":"<";if(Q+="if ( ",L)Q+=" ("+G+" !== undefined && typeof "+G+" != 'number') || ";Q+=" Object.keys("+j+").length "+O+" "+G+") { ";var M=h,K=K||[];if(K.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(M||"_limitProperties")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { limit: "+G+" } ",v.opts.messages!==!1){if(Q+=" , message: 'should NOT have ",h=="maxProperties")Q+="more";else Q+="fewer";if(Q+=" than ",L)Q+="' + "+G+" + '";else Q+=""+Y;Q+=" properties' "}if(v.opts.verbose){if(Q+=" , schema: ",L)Q+="validate.schema"+B;else Q+=""+Y;Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" "}Q+=" } "}else Q+=" {} ";var F=Q;if(Q=K.pop(),!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(["+F+"]); ";else Q+=" validate.errors = ["+F+"]; return false; ";else Q+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+="} ",D)Q+=" else { ";return Q}});var u9=n((PY,r9)=>{r9.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.schemaPath+v.util.getProperty(h),q=v.errSchemaPath+"/"+h,D=!v.opts.allErrors,j="data"+(X||""),L=v.opts.$data&&Y&&Y.$data,G;if(L)Q+=" var schema"+W+" = "+v.util.getData(Y.$data,X,v.dataPathArr)+"; ",G="schema"+W;else G=Y;if(!(L||typeof Y=="number"))throw new Error(h+" must be number");if(Q+="var division"+W+";if (",L)Q+=" "+G+" !== undefined && ( typeof "+G+" != 'number' || ";if(Q+=" (division"+W+" = "+j+" / "+G+", ",v.opts.multipleOfPrecision)Q+=" Math.abs(Math.round(division"+W+") - division"+W+") > 1e-"+v.opts.multipleOfPrecision+" ";else Q+=" division"+W+" !== parseInt(division"+W+") ";if(Q+=" ) ",L)Q+=" ) ";Q+=" ) { ";var O=O||[];if(O.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { multipleOf: "+G+" } ",v.opts.messages!==!1)if(Q+=" , message: 'should be multiple of ",L)Q+="' + "+G;else Q+=""+G+"'";if(v.opts.verbose){if(Q+=" , schema: ",L)Q+="validate.schema"+B;else Q+=""+Y;Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" "}Q+=" } "}else Q+=" {} ";var M=Q;if(Q=O.pop(),!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(["+M+"]); ";else Q+=" validate.errors = ["+M+"]; return false; ";else Q+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+="} ",D)Q+=" else { ";return Q}});var a9=n((XY,m9)=>{m9.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.schemaPath+v.util.getProperty(h),q=v.errSchemaPath+"/"+h,D=!v.opts.allErrors,j="data"+(X||""),L="errs__"+W,G=v.util.copy(v);G.level++;var O="valid"+G.level;if(v.opts.strictKeywords?typeof Y=="object"&&Object.keys(Y).length>0||Y===!1:v.util.schemaHasRules(Y,v.RULES.all)){G.schema=Y,G.schemaPath=B,G.errSchemaPath=q,Q+=" var "+L+" = errors; ";var M=v.compositeRule;v.compositeRule=G.compositeRule=!0,G.createErrors=!1;var K;if(G.opts.allErrors)K=G.opts.allErrors,G.opts.allErrors=!1;if(Q+=" "+v.validate(G)+" ",G.createErrors=!0,K)G.opts.allErrors=K;v.compositeRule=G.compositeRule=M,Q+=" if ("+O+") { ";var F=F||[];if(F.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'not' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: {} ",v.opts.messages!==!1)Q+=" , message: 'should NOT be valid' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" ";Q+=" } "}else Q+=" {} ";var S=Q;if(Q=F.pop(),!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(["+S+"]); ";else Q+=" validate.errors = ["+S+"]; return false; ";else Q+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" } else { errors = "+L+"; if (vErrors !== null) { if ("+L+") vErrors.length = "+L+"; else vErrors = null; } ",v.opts.allErrors)Q+=" } "}else{if(Q+=" var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'not' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: {} ",v.opts.messages!==!1)Q+=" , message: 'should NOT be valid' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" ";Q+=" } "}else Q+=" {} ";if(Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",D)Q+=" if (false) { "}return Q}});var p9=n((YY,c9)=>{c9.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.schemaPath+v.util.getProperty(h),q=v.errSchemaPath+"/"+h,D=!v.opts.allErrors,j="data"+(X||""),L="valid"+W,G="errs__"+W,O=v.util.copy(v),M="";O.level++;var K="valid"+O.level,F=O.baseId,S="prevValid"+W,N="passingSchemas"+W;Q+="var "+G+" = errors , "+S+" = false , "+L+" = false , "+N+" = null; ";var A=v.compositeRule;v.compositeRule=O.compositeRule=!0;var b=Y;if(b){var k,m=-1,Z=b.length-1;while(m<Z){if(k=b[m+=1],v.opts.strictKeywords?typeof k=="object"&&Object.keys(k).length>0||k===!1:v.util.schemaHasRules(k,v.RULES.all))O.schema=k,O.schemaPath=B+"["+m+"]",O.errSchemaPath=q+"/"+m,Q+=" "+v.validate(O)+" ",O.baseId=F;else Q+=" var "+K+" = true; ";if(m)Q+=" if ("+K+" && "+S+") { "+L+" = false; "+N+" = ["+N+", "+m+"]; } else { ",M+="}";Q+=" if ("+K+") { "+L+" = "+S+" = true; "+N+" = "+m+"; }"}}if(v.compositeRule=O.compositeRule=A,Q+=""+M+"if (!"+L+") { var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { passingSchemas: "+N+" } ",v.opts.messages!==!1)Q+=" , message: 'should match exactly one schema in oneOf' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" ";Q+=" } "}else Q+=" {} ";if(Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(vErrors); ";else Q+=" validate.errors = vErrors; return false; ";if(Q+="} else { errors = "+G+"; if (vErrors !== null) { if ("+G+") vErrors.length = "+G+"; else vErrors = null; }",v.opts.allErrors)Q+=" } ";return Q}});var i9=n((BY,n9)=>{n9.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.schemaPath+v.util.getProperty(h),q=v.errSchemaPath+"/"+h,D=!v.opts.allErrors,j="data"+(X||""),L=v.opts.$data&&Y&&Y.$data,G;if(L)Q+=" var schema"+W+" = "+v.util.getData(Y.$data,X,v.dataPathArr)+"; ",G="schema"+W;else G=Y;var O=L?"(new RegExp("+G+"))":v.usePattern(Y);if(Q+="if ( ",L)Q+=" ("+G+" !== undefined && typeof "+G+" != 'string') || ";Q+=" !"+O+".test("+j+") ) { ";var M=M||[];if(M.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { pattern: ",L)Q+=""+G;else Q+=""+v.util.toQuotedString(Y);if(Q+=" } ",v.opts.messages!==!1){if(Q+=` , message: 'should match pattern "`,L)Q+="' + "+G+" + '";else Q+=""+v.util.escapeQuotes(Y);Q+=`"' `}if(v.opts.verbose){if(Q+=" , schema: ",L)Q+="validate.schema"+B;else Q+=""+v.util.toQuotedString(Y);Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" "}Q+=" } "}else Q+=" {} ";var K=Q;if(Q=M.pop(),!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(["+K+"]); ";else Q+=" validate.errors = ["+K+"]; return false; ";else Q+=" var err = "+K+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+="} ",D)Q+=" else { ";return Q}});var t9=n((GY,d9)=>{d9.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.schemaPath+v.util.getProperty(h),q=v.errSchemaPath+"/"+h,D=!v.opts.allErrors,j="data"+(X||""),L="errs__"+W,G=v.util.copy(v),O="";G.level++;var M="valid"+G.level,K="key"+W,F="idx"+W,S=G.dataLevel=v.dataLevel+1,N="data"+S,A="dataProperties"+W,b=Object.keys(Y||{}).filter(fv),k=v.schema.patternProperties||{},m=Object.keys(k).filter(fv),Z=v.schema.additionalProperties,_=b.length||m.length,r=Z===!1,x=typeof Z=="object"&&Object.keys(Z).length,C=v.opts.removeAdditional,R=r||x||C,l=v.opts.ownProperties,T=v.baseId,Bv=v.schema.required;if(Bv&&!(v.opts.$data&&Bv.$data)&&Bv.length<v.opts.loopRequired)var e=v.util.toHash(Bv);function fv(ov){return ov!=="__proto__"}if(Q+="var "+L+" = errors;var "+M+" = true;",l)Q+=" var "+A+" = undefined;";if(R){if(l)Q+=" "+A+" = "+A+" || Object.keys("+j+"); for (var "+F+"=0; "+F+"<"+A+".length; "+F+"++) { var "+K+" = "+A+"["+F+"]; ";else Q+=" for (var "+K+" in "+j+") { ";if(_){if(Q+=" var isAdditional"+W+" = !(false ",b.length)if(b.length>8)Q+=" || validate.schema"+B+".hasOwnProperty("+K+") ";else{var o=b;if(o){var a,jv=-1,Sv=o.length-1;while(jv<Sv)a=o[jv+=1],Q+=" || "+K+" == "+v.util.toQuotedString(a)+" "}}if(m.length){var _v=m;if(_v){var Wv,Vv=-1,zv=_v.length-1;while(Vv<zv)Wv=_v[Vv+=1],Q+=" || "+v.usePattern(Wv)+".test("+K+") "}}Q+=" ); if (isAdditional"+W+") { "}if(C=="all")Q+=" delete "+j+"["+K+"]; ";else{var lv=v.errorPath,Lf="' + "+K+" + '";if(v.opts._errorDataPathProperty)v.errorPath=v.util.getPathExpr(v.errorPath,K,v.opts.jsonPointers);if(r)if(C)Q+=" delete "+j+"["+K+"]; ";else{Q+=" "+M+" = false; ";var Gf=q;q=v.errSchemaPath+"/additionalProperties";var Fv=Fv||[];if(Fv.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { additionalProperty: '"+Lf+"' } ",v.opts.messages!==!1){if(Q+=" , message: '",v.opts._errorDataPathProperty)Q+="is an invalid additional property";else Q+="should NOT have additional properties";Q+="' "}if(v.opts.verbose)Q+=" , schema: false , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" ";Q+=" } "}else Q+=" {} ";var Lv=Q;if(Q=Fv.pop(),!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(["+Lv+"]); ";else Q+=" validate.errors = ["+Lv+"]; return false; ";else Q+=" var err = "+Lv+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(q=Gf,D)Q+=" break; "}else if(x)if(C=="failing"){Q+=" var "+L+" = errors; ";var Sf=v.compositeRule;v.compositeRule=G.compositeRule=!0,G.schema=Z,G.schemaPath=v.schemaPath+".additionalProperties",G.errSchemaPath=v.errSchemaPath+"/additionalProperties",G.errorPath=v.opts._errorDataPathProperty?v.errorPath:v.util.getPathExpr(v.errorPath,K,v.opts.jsonPointers);var bv=j+"["+K+"]";G.dataPathArr[S]=K;var Xv=v.validate(G);if(G.baseId=T,v.util.varOccurences(Xv,N)<2)Q+=" "+v.util.varReplace(Xv,N,bv)+" ";else Q+=" var "+N+" = "+bv+"; "+Xv+" ";Q+=" if (!"+M+") { errors = "+L+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+j+"["+K+"]; } ",v.compositeRule=G.compositeRule=Sf}else{G.schema=Z,G.schemaPath=v.schemaPath+".additionalProperties",G.errSchemaPath=v.errSchemaPath+"/additionalProperties",G.errorPath=v.opts._errorDataPathProperty?v.errorPath:v.util.getPathExpr(v.errorPath,K,v.opts.jsonPointers);var bv=j+"["+K+"]";G.dataPathArr[S]=K;var Xv=v.validate(G);if(G.baseId=T,v.util.varOccurences(Xv,N)<2)Q+=" "+v.util.varReplace(Xv,N,bv)+" ";else Q+=" var "+N+" = "+bv+"; "+Xv+" ";if(D)Q+=" if (!"+M+") break; "}v.errorPath=lv}if(_)Q+=" } ";if(Q+=" } ",D)Q+=" if ("+M+") { ",O+="}"}var Mf=v.opts.useDefaults&&!v.compositeRule;if(b.length){var wf=b;if(wf){var a,bf=-1,Rf=wf.length-1;while(bf<Rf){a=wf[bf+=1];var Av=Y[a];if(v.opts.strictKeywords?typeof Av=="object"&&Object.keys(Av).length>0||Av===!1:v.util.schemaHasRules(Av,v.RULES.all)){var cv=v.util.getProperty(a),bv=j+cv,Cv=Mf&&Av.default!==void 0;G.schema=Av,G.schemaPath=B+cv,G.errSchemaPath=q+"/"+v.util.escapeFragment(a),G.errorPath=v.util.getPath(v.errorPath,a,v.opts.jsonPointers),G.dataPathArr[S]=v.util.toQuotedString(a);var Xv=v.validate(G);if(G.baseId=T,v.util.varOccurences(Xv,N)<2){Xv=v.util.varReplace(Xv,N,bv);var kv=bv}else{var kv=N;Q+=" var "+N+" = "+bv+"; "}if(Cv)Q+=" "+Xv+" ";else{if(e&&e[a]){if(Q+=" if ( "+kv+" === undefined ",l)Q+=" || ! Object.prototype.hasOwnProperty.call("+j+", '"+v.util.escapeQuotes(a)+"') ";Q+=") { "+M+" = false; ";var lv=v.errorPath,Gf=q,Jf=v.util.escapeQuotes(a);if(v.opts._errorDataPathProperty)v.errorPath=v.util.getPath(lv,a,v.opts.jsonPointers);q=v.errSchemaPath+"/required";var Fv=Fv||[];if(Fv.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'required' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { missingProperty: '"+Jf+"' } ",v.opts.messages!==!1){if(Q+=" , message: '",v.opts._errorDataPathProperty)Q+="is a required property";else Q+="should have required property \\'"+Jf+"\\'";Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" ";Q+=" } "}else Q+=" {} ";var Lv=Q;if(Q=Fv.pop(),!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(["+Lv+"]); ";else Q+=" validate.errors = ["+Lv+"]; return false; ";else Q+=" var err = "+Lv+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";q=Gf,v.errorPath=lv,Q+=" } else { "}else if(D){if(Q+=" if ( "+kv+" === undefined ",l)Q+=" || ! Object.prototype.hasOwnProperty.call("+j+", '"+v.util.escapeQuotes(a)+"') ";Q+=") { "+M+" = true; } else { "}else{if(Q+=" if ("+kv+" !== undefined ",l)Q+=" && Object.prototype.hasOwnProperty.call("+j+", '"+v.util.escapeQuotes(a)+"') ";Q+=" ) { "}Q+=" "+Xv+" } "}}if(D)Q+=" if ("+M+") { ",O+="}"}}}if(m.length){var xv=m;if(xv){var Wv,y1=-1,k0=xv.length-1;while(y1<k0){Wv=xv[y1+=1];var Av=k[Wv];if(v.opts.strictKeywords?typeof Av=="object"&&Object.keys(Av).length>0||Av===!1:v.util.schemaHasRules(Av,v.RULES.all)){if(G.schema=Av,G.schemaPath=v.schemaPath+".patternProperties"+v.util.getProperty(Wv),G.errSchemaPath=v.errSchemaPath+"/patternProperties/"+v.util.escapeFragment(Wv),l)Q+=" "+A+" = "+A+" || Object.keys("+j+"); for (var "+F+"=0; "+F+"<"+A+".length; "+F+"++) { var "+K+" = "+A+"["+F+"]; ";else Q+=" for (var "+K+" in "+j+") { ";Q+=" if ("+v.usePattern(Wv)+".test("+K+")) { ",G.errorPath=v.util.getPathExpr(v.errorPath,K,v.opts.jsonPointers);var bv=j+"["+K+"]";G.dataPathArr[S]=K;var Xv=v.validate(G);if(G.baseId=T,v.util.varOccurences(Xv,N)<2)Q+=" "+v.util.varReplace(Xv,N,bv)+" ";else Q+=" var "+N+" = "+bv+"; "+Xv+" ";if(D)Q+=" if (!"+M+") break; ";if(Q+=" } ",D)Q+=" else "+M+" = true; ";if(Q+=" } ",D)Q+=" if ("+M+") { ",O+="}"}}}}if(D)Q+=" "+O+" if ("+L+" == errors) {";return Q}});var o9=n((wY,s9)=>{s9.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.schemaPath+v.util.getProperty(h),q=v.errSchemaPath+"/"+h,D=!v.opts.allErrors,j="data"+(X||""),L="errs__"+W,G=v.util.copy(v),O="";G.level++;var M="valid"+G.level;if(Q+="var "+L+" = errors;",v.opts.strictKeywords?typeof Y=="object"&&Object.keys(Y).length>0||Y===!1:v.util.schemaHasRules(Y,v.RULES.all)){G.schema=Y,G.schemaPath=B,G.errSchemaPath=q;var K="key"+W,F="idx"+W,S="i"+W,N="' + "+K+" + '",A=G.dataLevel=v.dataLevel+1,b="data"+A,k="dataProperties"+W,m=v.opts.ownProperties,Z=v.baseId;if(m)Q+=" var "+k+" = undefined; ";if(m)Q+=" "+k+" = "+k+" || Object.keys("+j+"); for (var "+F+"=0; "+F+"<"+k+".length; "+F+"++) { var "+K+" = "+k+"["+F+"]; ";else Q+=" for (var "+K+" in "+j+") { ";Q+=" var startErrs"+W+" = errors; ";var _=K,r=v.compositeRule;v.compositeRule=G.compositeRule=!0;var x=v.validate(G);if(G.baseId=Z,v.util.varOccurences(x,b)<2)Q+=" "+v.util.varReplace(x,b,_)+" ";else Q+=" var "+b+" = "+_+"; "+x+" ";if(v.compositeRule=G.compositeRule=r,Q+=" if (!"+M+") { for (var "+S+"=startErrs"+W+"; "+S+"<errors; "+S+"++) { vErrors["+S+"].propertyName = "+K+"; } var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { propertyName: '"+N+"' } ",v.opts.messages!==!1)Q+=" , message: 'property name \\'"+N+"\\' is invalid' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" ";Q+=" } "}else Q+=" {} ";if(Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(vErrors); ";else Q+=" validate.errors = vErrors; return false; ";if(D)Q+=" break; ";Q+=" } }"}if(D)Q+=" "+O+" if ("+L+" == errors) {";return Q}});var v8=n((qY,e9)=>{e9.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.schemaPath+v.util.getProperty(h),q=v.errSchemaPath+"/"+h,D=!v.opts.allErrors,j="data"+(X||""),L="valid"+W,G=v.opts.$data&&Y&&Y.$data,O;if(G)Q+=" var schema"+W+" = "+v.util.getData(Y.$data,X,v.dataPathArr)+"; ",O="schema"+W;else O=Y;var M="schema"+W;if(!G)if(Y.length<v.opts.loopRequired&&v.schema.properties&&Object.keys(v.schema.properties).length){var K=[],F=Y;if(F){var S,N=-1,A=F.length-1;while(N<A){S=F[N+=1];var b=v.schema.properties[S];if(!(b&&(v.opts.strictKeywords?typeof b=="object"&&Object.keys(b).length>0||b===!1:v.util.schemaHasRules(b,v.RULES.all))))K[K.length]=S}}}else var K=Y;if(G||K.length){var k=v.errorPath,m=G||K.length>=v.opts.loopRequired,Z=v.opts.ownProperties;if(D)if(Q+=" var missing"+W+"; ",m){if(!G)Q+=" var "+M+" = validate.schema"+B+"; ";var _="i"+W,r="schema"+W+"["+_+"]",x="' + "+r+" + '";if(v.opts._errorDataPathProperty)v.errorPath=v.util.getPathExpr(k,r,v.opts.jsonPointers);if(Q+=" var "+L+" = true; ",G)Q+=" if (schema"+W+" === undefined) "+L+" = true; else if (!Array.isArray(schema"+W+")) "+L+" = false; else {";if(Q+=" for (var "+_+" = 0; "+_+" < "+M+".length; "+_+"++) { "+L+" = "+j+"["+M+"["+_+"]] !== undefined ",Z)Q+=" && Object.prototype.hasOwnProperty.call("+j+", "+M+"["+_+"]) ";if(Q+="; if (!"+L+") break; } ",G)Q+=" } ";Q+=" if (!"+L+") { ";var C=C||[];if(C.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'required' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { missingProperty: '"+x+"' } ",v.opts.messages!==!1){if(Q+=" , message: '",v.opts._errorDataPathProperty)Q+="is a required property";else Q+="should have required property \\'"+x+"\\'";Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" ";Q+=" } "}else Q+=" {} ";var R=Q;if(Q=C.pop(),!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(["+R+"]); ";else Q+=" validate.errors = ["+R+"]; return false; ";else Q+=" var err = "+R+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";Q+=" } else { "}else{Q+=" if ( ";var l=K;if(l){var T,_=-1,Bv=l.length-1;while(_<Bv){if(T=l[_+=1],_)Q+=" || ";var e=v.util.getProperty(T),fv=j+e;if(Q+=" ( ( "+fv+" === undefined ",Z)Q+=" || ! Object.prototype.hasOwnProperty.call("+j+", '"+v.util.escapeQuotes(T)+"') ";Q+=") && (missing"+W+" = "+v.util.toQuotedString(v.opts.jsonPointers?T:e)+") ) "}}Q+=") { ";var r="missing"+W,x="' + "+r+" + '";if(v.opts._errorDataPathProperty)v.errorPath=v.opts.jsonPointers?v.util.getPathExpr(k,r,!0):k+" + "+r;var C=C||[];if(C.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'required' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { missingProperty: '"+x+"' } ",v.opts.messages!==!1){if(Q+=" , message: '",v.opts._errorDataPathProperty)Q+="is a required property";else Q+="should have required property \\'"+x+"\\'";Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" ";Q+=" } "}else Q+=" {} ";var R=Q;if(Q=C.pop(),!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(["+R+"]); ";else Q+=" validate.errors = ["+R+"]; return false; ";else Q+=" var err = "+R+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";Q+=" } else { "}else if(m){if(!G)Q+=" var "+M+" = validate.schema"+B+"; ";var _="i"+W,r="schema"+W+"["+_+"]",x="' + "+r+" + '";if(v.opts._errorDataPathProperty)v.errorPath=v.util.getPathExpr(k,r,v.opts.jsonPointers);if(G){if(Q+=" if ("+M+" && !Array.isArray("+M+")) { var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'required' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { missingProperty: '"+x+"' } ",v.opts.messages!==!1){if(Q+=" , message: '",v.opts._errorDataPathProperty)Q+="is a required property";else Q+="should have required property \\'"+x+"\\'";Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" ";Q+=" } "}else Q+=" {} ";Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+M+" !== undefined) { "}if(Q+=" for (var "+_+" = 0; "+_+" < "+M+".length; "+_+"++) { if ("+j+"["+M+"["+_+"]] === undefined ",Z)Q+=" || ! Object.prototype.hasOwnProperty.call("+j+", "+M+"["+_+"]) ";if(Q+=") { var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'required' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { missingProperty: '"+x+"' } ",v.opts.messages!==!1){if(Q+=" , message: '",v.opts._errorDataPathProperty)Q+="is a required property";else Q+="should have required property \\'"+x+"\\'";Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" ";Q+=" } "}else Q+=" {} ";if(Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",G)Q+=" } "}else{var o=K;if(o){var T,a=-1,jv=o.length-1;while(a<jv){T=o[a+=1];var e=v.util.getProperty(T),x=v.util.escapeQuotes(T),fv=j+e;if(v.opts._errorDataPathProperty)v.errorPath=v.util.getPath(k,T,v.opts.jsonPointers);if(Q+=" if ( "+fv+" === undefined ",Z)Q+=" || ! Object.prototype.hasOwnProperty.call("+j+", '"+v.util.escapeQuotes(T)+"') ";if(Q+=") { var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'required' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { missingProperty: '"+x+"' } ",v.opts.messages!==!1){if(Q+=" , message: '",v.opts._errorDataPathProperty)Q+="is a required property";else Q+="should have required property \\'"+x+"\\'";Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" ";Q+=" } "}else Q+=" {} ";Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}}v.errorPath=k}else if(D)Q+=" if (true) {";return Q}});var Q8=n((DY,f8)=>{f8.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.schemaPath+v.util.getProperty(h),q=v.errSchemaPath+"/"+h,D=!v.opts.allErrors,j="data"+(X||""),L="valid"+W,G=v.opts.$data&&Y&&Y.$data,O;if(G)Q+=" var schema"+W+" = "+v.util.getData(Y.$data,X,v.dataPathArr)+"; ",O="schema"+W;else O=Y;if((Y||G)&&v.opts.uniqueItems!==!1){if(G)Q+=" var "+L+"; if ("+O+" === false || "+O+" === undefined) "+L+" = true; else if (typeof "+O+" != 'boolean') "+L+" = false; else { ";Q+=" var i = "+j+".length , "+L+" = true , j; if (i > 1) { ";var M=v.schema.items&&v.schema.items.type,K=Array.isArray(M);if(!M||M=="object"||M=="array"||K&&(M.indexOf("object")>=0||M.indexOf("array")>=0))Q+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+j+"[i], "+j+"[j])) { "+L+" = false; break outer; } } } ";else{Q+=" var itemIndices = {}, item; for (;i--;) { var item = "+j+"[i]; ";var F="checkDataType"+(K?"s":"");if(Q+=" if ("+v.util[F](M,"item",v.opts.strictNumbers,!0)+") continue; ",K)Q+=` if (typeof item == 'string') item = '"' + item; `;Q+=" if (typeof itemIndices[item] == 'number') { "+L+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}if(Q+=" } ",G)Q+=" } ";Q+=" if (!"+L+") { ";var S=S||[];if(S.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { i: i, j: j } ",v.opts.messages!==!1)Q+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' ";if(v.opts.verbose){if(Q+=" , schema: ",G)Q+="validate.schema"+B;else Q+=""+Y;Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+j+" "}Q+=" } "}else Q+=" {} ";var N=Q;if(Q=S.pop(),!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(["+N+"]); ";else Q+=" validate.errors = ["+N+"]; return false; ";else Q+=" var err = "+N+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" } ",D)Q+=" else { "}else if(D)Q+=" if (true) { ";return Q}});var J8=n((HY,h8)=>{h8.exports={$ref:K9(),allOf:j9(),anyOf:M9(),$comment:V9(),const:N9(),contains:z9(),dependencies:S9(),enum:R9(),format:l9(),if:g9(),items:I9(),maximum:$Q(),minimum:$Q(),maxItems:jQ(),minItems:jQ(),maxLength:LQ(),minLength:LQ(),maxProperties:MQ(),minProperties:MQ(),multipleOf:u9(),not:a9(),oneOf:p9(),pattern:i9(),properties:t9(),propertyNames:o9(),required:v8(),uniqueItems:Q8(),validate:OQ()}});var X8=n((OY,P8)=>{var W8=J8(),EQ=xf().toHash;P8.exports=function f(){var v=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],h=["type","$comment"],J=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],Q=["number","integer","string","array","object","boolean","null"];return v.all=EQ(h),v.types=EQ(Q),v.forEach(function(W){if(W.rules=W.rules.map(function(X){var Y;if(typeof X=="object"){var B=Object.keys(X)[0];Y=X[B],X=B,Y.forEach(function(D){h.push(D),v.all[D]=!0})}h.push(X);var q=v.all[X]={keyword:X,code:W8[X],implements:Y};return q}),v.all.$comment={keyword:"$comment",code:W8.$comment},W.type)v.types[W.type]=W}),v.keywords=EQ(h.concat(J)),v.custom={},v}});var G8=n((KY,B8)=>{var Y8=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];B8.exports=function(f,v){for(var h=0;h<v.length;h++){f=JSON.parse(JSON.stringify(f));var J=v[h].split("/"),Q=f,W;for(W=1;W<J.length;W++)Q=Q[J[W]];for(W=0;W<Y8.length;W++){var X=Y8[W],Y=Q[X];if(Y)Q[X]={anyOf:[Y,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}}}return f}});var D8=n(($Y,q8)=>{var tP=$0().MissingRef;q8.exports=w8;function w8(f,v,h){var J=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");if(typeof v=="function")h=v,v=void 0;var Q=W(f).then(function(){var Y=J._addSchema(f,void 0,v);return Y.validate||X(Y)});if(h)Q.then(function(Y){h(null,Y)},h);return Q;function W(Y){var B=Y.$schema;return B&&!J.getSchema(B)?w8.call(J,{$ref:B},!0):Promise.resolve()}function X(Y){try{return J._compile(Y)}catch(q){if(q instanceof tP)return B(q);throw q}function B(q){var D=q.missingSchema;if(G(D))throw new Error("Schema "+D+" is loaded but "+q.missingRef+" cannot be resolved");var j=J._loadingSchemas[D];if(!j)j=J._loadingSchemas[D]=J._opts.loadSchema(D),j.then(L,L);return j.then(function(O){if(!G(D))return W(O).then(function(){if(!G(D))J.addSchema(O,D,void 0,v)})}).then(function(){return X(Y)});function L(){delete J._loadingSchemas[D]}function G(O){return J._refs[O]||J._schemas[O]}}}}});var O8=n((jY,H8)=>{H8.exports=function f(v,h,J){var Q=" ",W=v.level,X=v.dataLevel,Y=v.schema[h],B=v.schemaPath+v.util.getProperty(h),q=v.errSchemaPath+"/"+h,D=!v.opts.allErrors,j,L="data"+(X||""),G="valid"+W,O="errs__"+W,M=v.opts.$data&&Y&&Y.$data,K;if(M)Q+=" var schema"+W+" = "+v.util.getData(Y.$data,X,v.dataPathArr)+"; ",K="schema"+W;else K=Y;var F=this,S="definition"+W,N=F.definition,A="",b,k,m,Z,_;if(M&&N.$data){_="keywordValidate"+W;var r=N.validateSchema;Q+=" var "+S+" = RULES.custom['"+h+"'].definition; var "+_+" = "+S+".validate;"}else{if(Z=v.useCustomRule(F,Y,v.schema,v),!Z)return;K="validate.schema"+B,_=Z.code,b=N.compile,k=N.inline,m=N.macro}var x=_+".errors",C="i"+W,R="ruleErr"+W,l=N.async;if(l&&!v.async)throw new Error("async keyword in sync schema");if(!(k||m))Q+=""+x+" = null;";if(Q+="var "+O+" = errors;var "+G+";",M&&N.$data){if(A+="}",Q+=" if ("+K+" === undefined) { "+G+" = true; } else { ",r)A+="}",Q+=" "+G+" = "+S+".validateSchema("+K+"); if ("+G+") { "}if(k)if(N.statements)Q+=" "+Z.validate+" ";else Q+=" "+G+" = "+Z.validate+"; ";else if(m){var T=v.util.copy(v),A="";T.level++;var Bv="valid"+T.level;T.schema=Z.validate,T.schemaPath="";var e=v.compositeRule;v.compositeRule=T.compositeRule=!0;var fv=v.validate(T).replace(/validate\.schema/g,_);v.compositeRule=T.compositeRule=e,Q+=" "+fv}else{var o=o||[];if(o.push(Q),Q="",Q+=" "+_+".call( ",v.opts.passContext)Q+="this";else Q+="self";if(b||N.schema===!1)Q+=" , "+L+" ";else Q+=" , "+K+" , "+L+" , validate.schema"+v.schemaPath+" ";if(Q+=" , (dataPath || '')",v.errorPath!='""')Q+=" + "+v.errorPath;var a=X?"data"+(X-1||""):"parentData",jv=X?v.dataPathArr[X]:"parentDataProperty";Q+=" , "+a+" , "+jv+" , rootData ) ";var Sv=Q;if(Q=o.pop(),N.errors===!1){if(Q+=" "+G+" = ",l)Q+="await ";Q+=""+Sv+"; "}else if(l)x="customErrors"+W,Q+=" var "+x+" = null; try { "+G+" = await "+Sv+"; } catch (e) { "+G+" = false; if (e instanceof ValidationError) "+x+" = e.errors; else throw e; } ";else Q+=" "+x+" = null; "+G+" = "+Sv+"; "}if(N.modifying)Q+=" if ("+a+") "+L+" = "+a+"["+jv+"];";if(Q+=""+A,N.valid){if(D)Q+=" if (true) { "}else{if(Q+=" if ( ",N.valid===void 0)if(Q+=" !",m)Q+=""+Bv;else Q+=""+G;else Q+=" "+!N.valid+" ";Q+=") { ",j=F.keyword;var o=o||[];o.push(Q),Q="";var o=o||[];if(o.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(j||"custom")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { keyword: '"+F.keyword+"' } ",v.opts.messages!==!1)Q+=` , message: 'should pass "`+F.keyword+`" keyword validation' `;if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+L+" ";Q+=" } "}else Q+=" {} ";var _v=Q;if(Q=o.pop(),!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(["+_v+"]); ";else Q+=" validate.errors = ["+_v+"]; return false; ";else Q+=" var err = "+_v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var Wv=Q;if(Q=o.pop(),k)if(N.errors){if(N.errors!="full"){if(Q+=" for (var "+C+"="+O+"; "+C+"<errors; "+C+"++) { var "+R+" = vErrors["+C+"]; if ("+R+".dataPath === undefined) "+R+".dataPath = (dataPath || '') + "+v.errorPath+"; if ("+R+".schemaPath === undefined) { "+R+'.schemaPath = "'+q+'"; } ',v.opts.verbose)Q+=" "+R+".schema = "+K+"; "+R+".data = "+L+"; ";Q+=" } "}}else if(N.errors===!1)Q+=" "+Wv+" ";else{if(Q+=" if ("+O+" == errors) { "+Wv+" } else { for (var "+C+"="+O+"; "+C+"<errors; "+C+"++) { var "+R+" = vErrors["+C+"]; if ("+R+".dataPath === undefined) "+R+".dataPath = (dataPath || '') + "+v.errorPath+"; if ("+R+".schemaPath === undefined) { "+R+'.schemaPath = "'+q+'"; } ',v.opts.verbose)Q+=" "+R+".schema = "+K+"; "+R+".data = "+L+"; ";Q+=" } } "}else if(m){if(Q+=" var err = ",v.createErrors!==!1){if(Q+=" { keyword: '"+(j||"custom")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(q)+" , params: { keyword: '"+F.keyword+"' } ",v.opts.messages!==!1)Q+=` , message: 'should pass "`+F.keyword+`" keyword validation' `;if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+L+" ";Q+=" } "}else Q+=" {} ";if(Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(vErrors); ";else Q+=" validate.errors = vErrors; return false; "}else if(N.errors===!1)Q+=" "+Wv+" ";else{if(Q+=" if (Array.isArray("+x+")) { if (vErrors === null) vErrors = "+x+"; else vErrors = vErrors.concat("+x+"); errors = vErrors.length; for (var "+C+"="+O+"; "+C+"<errors; "+C+"++) { var "+R+" = vErrors["+C+"]; if ("+R+".dataPath === undefined) "+R+".dataPath = (dataPath || '') + "+v.errorPath+"; "+R+'.schemaPath = "'+q+'"; ',v.opts.verbose)Q+=" "+R+".schema = "+K+"; "+R+".data = "+L+"; ";Q+=" } } else { "+Wv+" } "}if(Q+=" } ",D)Q+=" else { "}return Q}});var VQ=n((LY,sP)=>{sP.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 j8=n((MY,$8)=>{var K8=VQ();$8.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:K8.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:K8.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}});var M8=n((EY,L8)=>{var oP=/^[a-z_$][a-z0-9_$-]*$/i,eP=O8(),v5=j8();L8.exports={add:f5,get:Q5,remove:h5,validate:FQ};function f5(f,v){var h=this.RULES;if(h.keywords[f])throw new Error("Keyword "+f+" is already defined");if(!oP.test(f))throw new Error("Keyword "+f+" is not a valid identifier");if(v){this.validateKeyword(v,!0);var J=v.type;if(Array.isArray(J))for(var Q=0;Q<J.length;Q++)X(f,J[Q],v);else X(f,J,v);var W=v.metaSchema;if(W){if(v.$data&&this._opts.$data)W={anyOf:[W,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]};v.validateSchema=this.compile(W,!0)}}h.keywords[f]=h.all[f]=!0;function X(Y,B,q){var D;for(var j=0;j<h.length;j++){var L=h[j];if(L.type==B){D=L;break}}if(!D)D={type:B,rules:[]},h.push(D);var G={keyword:Y,definition:q,custom:!0,code:eP,implements:q.implements};D.rules.push(G),h.custom[Y]=G}return this}function Q5(f){var v=this.RULES.custom[f];return v?v.definition:this.RULES.keywords[f]||!1}function h5(f){var v=this.RULES;delete v.keywords[f],delete v.all[f],delete v.custom[f];for(var h=0;h<v.length;h++){var J=v[h].rules;for(var Q=0;Q<J.length;Q++)if(J[Q].keyword==f){J.splice(Q,1);break}}return this}function FQ(f,v){FQ.errors=null;var h=this._validateKeyword=this._validateKeyword||this.compile(v5,!0);if(h(f))return!0;if(FQ.errors=h.errors,v)throw new Error("custom keyword definition is invalid: "+this.errorsText(h.errors));else return!1}});var E8=n((VY,J5)=>{J5.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var _8=n((FY,R8)=>{var F8=v9(),Zf=K0(),W5=Q9(),N8=YQ(),P5=HQ(),X5=H9(),Y5=X8(),U8=G8(),z8=xf();R8.exports=Mv;Mv.prototype.validate=G5;Mv.prototype.compile=w5;Mv.prototype.addSchema=q5;Mv.prototype.addMetaSchema=D5;Mv.prototype.validateSchema=H5;Mv.prototype.getSchema=K5;Mv.prototype.removeSchema=j5;Mv.prototype.addFormat=z5;Mv.prototype.errorsText=U5;Mv.prototype._addSchema=L5;Mv.prototype._compile=M5;Mv.prototype.compileAsync=D8();var U0=M8();Mv.prototype.addKeyword=U0.add;Mv.prototype.getKeyword=U0.get;Mv.prototype.removeKeyword=U0.remove;Mv.prototype.validateKeyword=U0.validate;var A8=$0();Mv.ValidationError=A8.Validation;Mv.MissingRefError=A8.MissingRef;Mv.$dataMetaSchema=U8;var N0="http://json-schema.org/draft-07/schema",V8=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],B5=["/properties"];function Mv(f){if(!(this instanceof Mv))return new Mv(f);if(f=this._opts=z8.copy(f)||{},l5(this),this._schemas={},this._refs={},this._fragments={},this._formats=X5(f.format),this._cache=f.cache||new W5,this._loadingSchemas={},this._compilations=[],this.RULES=Y5(),this._getId=E5(f),f.loopRequired=f.loopRequired||1/0,f.errorDataPath=="property")f._errorDataPathProperty=!0;if(f.serialize===void 0)f.serialize=P5;if(this._metaOpts=_5(this),f.formats)b5(this);if(f.keywords)R5(this);if(A5(this),typeof f.meta=="object")this.addMetaSchema(f.meta);if(f.nullable)this.addKeyword("nullable",{metaSchema:{type:"boolean"}});S5(this)}function G5(f,v){var h;if(typeof f=="string"){if(h=this.getSchema(f),!h)throw new Error('no schema with key or ref "'+f+'"')}else{var J=this._addSchema(f);h=J.validate||this._compile(J)}var Q=h(v);if(h.$async!==!0)this.errors=h.errors;return Q}function w5(f,v){var h=this._addSchema(f,void 0,v);return h.validate||this._compile(h)}function q5(f,v,h,J){if(Array.isArray(f)){for(var Q=0;Q<f.length;Q++)this.addSchema(f[Q],void 0,h,J);return this}var W=this._getId(f);if(W!==void 0&&typeof W!="string")throw new Error("schema id must be string");return v=Zf.normalizeId(v||W),b8(this,v),this._schemas[v]=this._addSchema(f,h,J,!0),this}function D5(f,v,h){return this.addSchema(f,v,h,!0),this}function H5(f,v){var h=f.$schema;if(h!==void 0&&typeof h!="string")throw new Error("$schema must be a string");if(h=h||this._opts.defaultMeta||O5(this),!h)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var J=this.validate(h,f);if(!J&&v){var Q="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(Q);else throw new Error(Q)}return J}function O5(f){var v=f._opts.meta;return f._opts.defaultMeta=typeof v=="object"?f._getId(v)||v:f.getSchema(N0)?N0:void 0,f._opts.defaultMeta}function K5(f){var v=S8(this,f);switch(typeof v){case"object":return v.validate||this._compile(v);case"string":return this.getSchema(v);case"undefined":return $5(this,f)}}function $5(f,v){var h=Zf.schema.call(f,{schema:{}},v);if(h){var{schema:J,root:Q,baseId:W}=h,X=F8.call(f,J,Q,void 0,W);return f._fragments[v]=new N8({ref:v,fragment:!0,schema:J,root:Q,baseId:W,validate:X}),X}}function S8(f,v){return v=Zf.normalizeId(v),f._schemas[v]||f._refs[v]||f._fragments[v]}function j5(f){if(f instanceof RegExp)return F0(this,this._schemas,f),F0(this,this._refs,f),this;switch(typeof f){case"undefined":return F0(this,this._schemas),F0(this,this._refs),this._cache.clear(),this;case"string":var v=S8(this,f);if(v)this._cache.del(v.cacheKey);return delete this._schemas[f],delete this._refs[f],this;case"object":var h=this._opts.serialize,J=h?h(f):f;this._cache.del(J);var Q=this._getId(f);if(Q)Q=Zf.normalizeId(Q),delete this._schemas[Q],delete this._refs[Q]}return this}function F0(f,v,h){for(var J in v){var Q=v[J];if(!Q.meta&&(!h||h.test(J)))f._cache.del(Q.cacheKey),delete v[J]}}function L5(f,v,h,J){if(typeof f!="object"&&typeof f!="boolean")throw new Error("schema should be object or boolean");var Q=this._opts.serialize,W=Q?Q(f):f,X=this._cache.get(W);if(X)return X;J=J||this._opts.addUsedSchema!==!1;var Y=Zf.normalizeId(this._getId(f));if(Y&&J)b8(this,Y);var B=this._opts.validateSchema!==!1&&!v,q;if(B&&!(q=Y&&Y==Zf.normalizeId(f.$schema)))this.validateSchema(f,!0);var D=Zf.ids.call(this,f),j=new N8({id:Y,schema:f,localRefs:D,cacheKey:W,meta:h});if(Y[0]!="#"&&J)this._refs[Y]=j;if(this._cache.put(W,j),B&&q)this.validateSchema(f,!0);return j}function M5(f,v){if(f.compiling){if(f.validate=Q,Q.schema=f.schema,Q.errors=null,Q.root=v?v:Q,f.schema.$async===!0)Q.$async=!0;return Q}f.compiling=!0;var h;if(f.meta)h=this._opts,this._opts=this._metaOpts;var J;try{J=F8.call(this,f.schema,v,f.localRefs)}catch(W){throw delete f.validate,W}finally{if(f.compiling=!1,f.meta)this._opts=h}return f.validate=J,f.refs=J.refs,f.refVal=J.refVal,f.root=J.root,J;function Q(){var W=f.validate,X=W.apply(this,arguments);return Q.errors=W.errors,X}}function E5(f){switch(f.schemaId){case"auto":return N5;case"id":return V5;default:return F5}}function V5(f){if(f.$id)this.logger.warn("schema $id ignored",f.$id);return f.id}function F5(f){if(f.id)this.logger.warn("schema id ignored",f.id);return f.$id}function N5(f){if(f.$id&&f.id&&f.$id!=f.id)throw new Error("schema $id is different from id");return f.$id||f.id}function U5(f,v){if(f=f||this.errors,!f)return"No errors";v=v||{};var h=v.separator===void 0?", ":v.separator,J=v.dataVar===void 0?"data":v.dataVar,Q="";for(var W=0;W<f.length;W++){var X=f[W];if(X)Q+=J+X.dataPath+" "+X.message+h}return Q.slice(0,-h.length)}function z5(f,v){if(typeof v=="string")v=new RegExp(v);return this._formats[f]=v,this}function A5(f){var v;if(f._opts.$data)v=E8(),f.addMetaSchema(v,v.$id,!0);if(f._opts.meta===!1)return;var h=VQ();if(f._opts.$data)h=U8(h,B5);f.addMetaSchema(h,N0,!0),f._refs["http://json-schema.org/schema"]=N0}function S5(f){var v=f._opts.schemas;if(!v)return;if(Array.isArray(v))f.addSchema(v);else for(var h in v)f.addSchema(v[h],h)}function b5(f){for(var v in f._opts.formats){var h=f._opts.formats[v];f.addFormat(v,h)}}function R5(f){for(var v in f._opts.keywords){var h=f._opts.keywords[v];f.addKeyword(v,h)}}function b8(f,v){if(f._schemas[v]||f._refs[v])throw new Error('schema with key or id "'+v+'" already exists')}function _5(f){var v=z8.copy(f._opts);for(var h=0;h<V8.length;h++)delete v[V8[h]];return v}function l5(f){var v=f._opts.logger;if(v===!1)f.logger={log:NQ,warn:NQ,error:NQ};else{if(v===void 0)v=console;if(!(typeof v=="object"&&v.log&&v.warn&&v.error))throw new Error("logger must implement log, warn and error methods");f.logger=v}}function NQ(){}});function p5(){let f=process.argv.join(" ");return f.includes("streamable-http.js")||f.includes("streamable-http.ts")}class KJ{context;level;constructor(f,v=1){this.context=f,this.level=v}setLevel(f){this.level=f}log(...f){if(OJ)console.log(...f);else console.error(...f)}logWarn(...f){if(OJ)console.warn(...f);else console.error(...f)}debug(...f){if(this.level<=0)this.log(`[DEBUG] [${this.context}]`,...f)}info(...f){if(this.level<=1)this.log(`[INFO] [${this.context}]`,...f)}warn(...f){if(this.level<=2)this.logWarn(`[WARN] [${this.context}]`,...f)}error(...f){if(this.level<=3)console.error(`[ERROR] [${this.context}]`,...f)}}var OJ,sv=(f,v=1)=>new KJ(f,v);var rf=T0(()=>{OJ=p5()});b1();var vP=60000;class vQ{constructor(f){this._options=f,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(i1,(v)=>{let h=this._requestHandlerAbortControllers.get(v.params.requestId);h===null||h===void 0||h.abort(v.params.reason)}),this.setNotificationHandler(s1,(v)=>{this._onprogress(v)}),this.setRequestHandler(t1,(v)=>({}))}_setupTimeout(f,v,h,J,Q=!1){this._timeoutInfo.set(f,{timeoutId:setTimeout(J,v),startTime:Date.now(),timeout:v,maxTotalTimeout:h,resetTimeoutOnProgress:Q,onTimeout:J})}_resetTimeout(f){let v=this._timeoutInfo.get(f);if(!v)return!1;let h=Date.now()-v.startTime;if(v.maxTotalTimeout&&h>=v.maxTotalTimeout)throw this._timeoutInfo.delete(f),new Dv(qv.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:v.maxTotalTimeout,totalElapsed:h});return clearTimeout(v.timeoutId),v.timeoutId=setTimeout(v.onTimeout,v.timeout),!0}_cleanupTimeout(f){let v=this._timeoutInfo.get(f);if(v)clearTimeout(v.timeoutId),this._timeoutInfo.delete(f)}async connect(f){var v,h,J;this._transport=f;let Q=(v=this.transport)===null||v===void 0?void 0:v.onclose;this._transport.onclose=()=>{Q===null||Q===void 0||Q(),this._onclose()};let W=(h=this.transport)===null||h===void 0?void 0:h.onerror;this._transport.onerror=(Y)=>{W===null||W===void 0||W(Y),this._onerror(Y)};let X=(J=this._transport)===null||J===void 0?void 0:J.onmessage;this._transport.onmessage=(Y,B)=>{if(X===null||X===void 0||X(Y,B),c0(Y)||Mh(Y))this._onresponse(Y);else if(Oh(Y))this._onrequest(Y,B);else if($h(Y))this._onnotification(Y);else this._onerror(new Error(`Unknown message type: ${JSON.stringify(Y)}`))},await this._transport.start()}_onclose(){var f;let v=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,(f=this.onclose)===null||f===void 0||f.call(this);let h=new Dv(qv.ConnectionClosed,"Connection closed");for(let J of v.values())J(h)}_onerror(f){var v;(v=this.onerror)===null||v===void 0||v.call(this,f)}_onnotification(f){var v;let h=(v=this._notificationHandlers.get(f.method))!==null&&v!==void 0?v:this.fallbackNotificationHandler;if(h===void 0)return;Promise.resolve().then(()=>h(f)).catch((J)=>this._onerror(new Error(`Uncaught error in notification handler: ${J}`)))}_onrequest(f,v){var h,J;let Q=(h=this._requestHandlers.get(f.method))!==null&&h!==void 0?h:this.fallbackRequestHandler,W=this._transport;if(Q===void 0){W===null||W===void 0||W.send({jsonrpc:"2.0",id:f.id,error:{code:qv.MethodNotFound,message:"Method not found"}}).catch((B)=>this._onerror(new Error(`Failed to send an error response: ${B}`)));return}let X=new AbortController;this._requestHandlerAbortControllers.set(f.id,X);let Y={signal:X.signal,sessionId:W===null||W===void 0?void 0:W.sessionId,_meta:(J=f.params)===null||J===void 0?void 0:J._meta,sendNotification:(B)=>this.notification(B,{relatedRequestId:f.id}),sendRequest:(B,q,D)=>this.request(B,q,{...D,relatedRequestId:f.id}),authInfo:v===null||v===void 0?void 0:v.authInfo,requestId:f.id,requestInfo:v===null||v===void 0?void 0:v.requestInfo};Promise.resolve().then(()=>Q(f,Y)).then((B)=>{if(X.signal.aborted)return;return W===null||W===void 0?void 0:W.send({result:B,jsonrpc:"2.0",id:f.id})},(B)=>{var q;if(X.signal.aborted)return;return W===null||W===void 0?void 0:W.send({jsonrpc:"2.0",id:f.id,error:{code:Number.isSafeInteger(B.code)?B.code:qv.InternalError,message:(q=B.message)!==null&&q!==void 0?q:"Internal error"}})}).catch((B)=>this._onerror(new Error(`Failed to send response: ${B}`))).finally(()=>{this._requestHandlerAbortControllers.delete(f.id)})}_onprogress(f){let{progressToken:v,...h}=f.params,J=Number(v),Q=this._progressHandlers.get(J);if(!Q){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(f)}`));return}let W=this._responseHandlers.get(J),X=this._timeoutInfo.get(J);if(X&&W&&X.resetTimeoutOnProgress)try{this._resetTimeout(J)}catch(Y){W(Y);return}Q(h)}_onresponse(f){let v=Number(f.id),h=this._responseHandlers.get(v);if(h===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(f)}`));return}if(this._responseHandlers.delete(v),this._progressHandlers.delete(v),this._cleanupTimeout(v),c0(f))h(f);else{let J=new Dv(f.error.code,f.error.message,f.error.data);h(J)}}get transport(){return this._transport}async close(){var f;await((f=this._transport)===null||f===void 0?void 0:f.close())}request(f,v,h){let{relatedRequestId:J,resumptionToken:Q,onresumptiontoken:W}=h!==null&&h!==void 0?h:{};return new Promise((X,Y)=>{var B,q,D,j,L,G;if(!this._transport){Y(new Error("Not connected"));return}if(((B=this._options)===null||B===void 0?void 0:B.enforceStrictCapabilities)===!0)this.assertCapabilityForMethod(f.method);(q=h===null||h===void 0?void 0:h.signal)===null||q===void 0||q.throwIfAborted();let O=this._requestMessageId++,M={...f,jsonrpc:"2.0",id:O};if(h===null||h===void 0?void 0:h.onprogress)this._progressHandlers.set(O,h.onprogress),M.params={...f.params,_meta:{...((D=f.params)===null||D===void 0?void 0:D._meta)||{},progressToken:O}};let K=(N)=>{var A;this._responseHandlers.delete(O),this._progressHandlers.delete(O),this._cleanupTimeout(O),(A=this._transport)===null||A===void 0||A.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:O,reason:String(N)}},{relatedRequestId:J,resumptionToken:Q,onresumptiontoken:W}).catch((b)=>this._onerror(new Error(`Failed to send cancellation: ${b}`))),Y(N)};this._responseHandlers.set(O,(N)=>{var A;if((A=h===null||h===void 0?void 0:h.signal)===null||A===void 0?void 0:A.aborted)return;if(N instanceof Error)return Y(N);try{let b=v.parse(N.result);X(b)}catch(b){Y(b)}}),(j=h===null||h===void 0?void 0:h.signal)===null||j===void 0||j.addEventListener("abort",()=>{var N;K((N=h===null||h===void 0?void 0:h.signal)===null||N===void 0?void 0:N.reason)});let F=(L=h===null||h===void 0?void 0:h.timeout)!==null&&L!==void 0?L:vP,S=()=>K(new Dv(qv.RequestTimeout,"Request timed out",{timeout:F}));this._setupTimeout(O,F,h===null||h===void 0?void 0:h.maxTotalTimeout,S,(G=h===null||h===void 0?void 0:h.resetTimeoutOnProgress)!==null&&G!==void 0?G:!1),this._transport.send(M,{relatedRequestId:J,resumptionToken:Q,onresumptiontoken:W}).catch((N)=>{this._cleanupTimeout(O),Y(N)})})}async notification(f,v){var h,J;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(f.method),((J=(h=this._options)===null||h===void 0?void 0:h.debouncedNotificationMethods)!==null&&J!==void 0?J:[]).includes(f.method)&&!f.params&&!(v===null||v===void 0?void 0:v.relatedRequestId)){if(this._pendingDebouncedNotifications.has(f.method))return;this._pendingDebouncedNotifications.add(f.method),Promise.resolve().then(()=>{var Y;if(this._pendingDebouncedNotifications.delete(f.method),!this._transport)return;let B={...f,jsonrpc:"2.0"};(Y=this._transport)===null||Y===void 0||Y.send(B,v).catch((q)=>this._onerror(q))});return}let X={...f,jsonrpc:"2.0"};await this._transport.send(X,v)}setRequestHandler(f,v){let h=f.shape.method.value;this.assertRequestHandlerCapability(h),this._requestHandlers.set(h,(J,Q)=>{return Promise.resolve(v(f.parse(J),Q))})}removeRequestHandler(f){this._requestHandlers.delete(f)}assertCanSetRequestHandler(f){if(this._requestHandlers.has(f))throw new Error(`A request handler for ${f} already exists, which would be overridden`)}setNotificationHandler(f,v){this._notificationHandlers.set(f.shape.method.value,(h)=>Promise.resolve(v(f.parse(h))))}removeNotificationHandler(f){this._notificationHandlers.delete(f)}}function Rh(f,v){return Object.entries(v).reduce((h,[J,Q])=>{if(Q&&typeof Q==="object")h[J]=h[J]?{...h[J],...Q}:Q;else h[J]=Q;return h},{...f})}b1();var l8=x1(_8());class UQ extends vQ{constructor(f,v){var h;super(v);this._serverInfo=f,this._capabilities=(h=v===null||v===void 0?void 0:v.capabilities)!==null&&h!==void 0?h:{},this._instructions=v===null||v===void 0?void 0:v.instructions,this.setRequestHandler(d1,(J)=>this._oninitialize(J)),this.setNotificationHandler(p0,()=>{var J;return(J=this.oninitialized)===null||J===void 0?void 0:J.call(this)})}registerCapabilities(f){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Rh(this._capabilities,f)}assertCapabilityForMethod(f){var v,h,J;switch(f){case"sampling/createMessage":if(!((v=this._clientCapabilities)===null||v===void 0?void 0:v.sampling))throw new Error(`Client does not support sampling (required for ${f})`);break;case"elicitation/create":if(!((h=this._clientCapabilities)===null||h===void 0?void 0:h.elicitation))throw new Error(`Client does not support elicitation (required for ${f})`);break;case"roots/list":if(!((J=this._clientCapabilities)===null||J===void 0?void 0:J.roots))throw new Error(`Client does not support listing roots (required for ${f})`);break;case"ping":break}}assertNotificationCapability(f){switch(f){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${f})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${f})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${f})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${f})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(f){switch(f){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Server does not support sampling (required for ${f})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${f})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${f})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${f})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${f})`);break;case"ping":case"initialize":break}}async _oninitialize(f){let v=f.params.protocolVersion;return this._clientCapabilities=f.params.capabilities,this._clientVersion=f.params.clientInfo,{protocolVersion:wh.includes(v)?v:a0,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},n1)}async createMessage(f,v){return this.request({method:"sampling/createMessage",params:f},s0,v)}async elicitInput(f,v){let h=await this.request({method:"elicitation/create",params:f},o0,v);if(h.action==="accept"&&h.content)try{let J=new l8.default,Q=J.compile(f.requestedSchema);if(!Q(h.content))throw new Dv(qv.InvalidParams,`Elicitation response content does not match requested schema: ${J.errorsText(Q.errors)}`)}catch(J){if(J instanceof Dv)throw J;throw new Dv(qv.InternalError,`Error validating elicitation response: ${J}`)}return h}async listRoots(f,v){return this.request({method:"roots/list",params:f},e0,v)}async sendLoggingMessage(f){return this.notification({method:"notifications/message",params:f})}async sendResourceUpdated(f){return this.notification({method:"notifications/resources/updated",params:f})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}var g8=Symbol("Let zodToJsonSchema decide on which parser to use");var k8={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},y8=(f)=>typeof f==="string"?{...k8,name:f}:{...k8,...f};var I8=(f)=>{let v=y8(f),h=v.name!==void 0?[...v.basePath,v.definitionPath,v.name]:v.basePath;return{...v,currentPath:h,propertyPath:void 0,seen:new Map(Object.entries(v.definitions).map(([J,Q])=>[Q._def,{def:Q._def,path:[...v.basePath,v.definitionPath,J],jsonSchema:void 0}]))}};function zQ(f,v,h,J){if(!J?.errorMessages)return;if(h)f.errorMessage={...f.errorMessage,[v]:h}}function vv(f,v,h,J,Q){f[v]=h,zQ(f,v,J,Q)}av();function C8(){return{}}av();function T8(f,v){let h={type:"array"};if(f.type?._def&&f.type?._def?.typeName!==z.ZodAny)h.items=c(f.type._def,{...v,currentPath:[...v.currentPath,"items"]});if(f.minLength)vv(h,"minItems",f.minLength.value,f.minLength.message,v);if(f.maxLength)vv(h,"maxItems",f.maxLength.value,f.maxLength.message,v);if(f.exactLength)vv(h,"minItems",f.exactLength.value,f.exactLength.message,v),vv(h,"maxItems",f.exactLength.value,f.exactLength.message,v);return h}function x8(f,v){let h={type:"integer",format:"int64"};if(!f.checks)return h;for(let J of f.checks)switch(J.kind){case"min":if(v.target==="jsonSchema7")if(J.inclusive)vv(h,"minimum",J.value,J.message,v);else vv(h,"exclusiveMinimum",J.value,J.message,v);else{if(!J.inclusive)h.exclusiveMinimum=!0;vv(h,"minimum",J.value,J.message,v)}break;case"max":if(v.target==="jsonSchema7")if(J.inclusive)vv(h,"maximum",J.value,J.message,v);else vv(h,"exclusiveMaximum",J.value,J.message,v);else{if(!J.inclusive)h.exclusiveMaximum=!0;vv(h,"maximum",J.value,J.message,v)}break;case"multipleOf":vv(h,"multipleOf",J.value,J.message,v);break}return h}function Z8(){return{type:"boolean"}}function z0(f,v){return c(f.type._def,v)}var r8=(f,v)=>{return c(f.innerType._def,v)};function AQ(f,v,h){let J=h??v.dateStrategy;if(Array.isArray(J))return{anyOf:J.map((Q,W)=>AQ(f,v,Q))};switch(J){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return k5(f,v)}}var k5=(f,v)=>{let h={type:"integer",format:"unix-time"};if(v.target==="openApi3")return h;for(let J of f.checks)switch(J.kind){case"min":vv(h,"minimum",J.value,J.message,v);break;case"max":vv(h,"maximum",J.value,J.message,v);break}return h};function u8(f,v){return{...c(f.innerType._def,v),default:f.defaultValue()}}function m8(f,v){return v.effectStrategy==="input"?c(f.schema._def,v):{}}function a8(f){return{type:"string",enum:Array.from(f.values)}}var g5=(f)=>{if("type"in f&&f.type==="string")return!1;return"allOf"in f};function c8(f,v){let h=[c(f.left._def,{...v,currentPath:[...v.currentPath,"allOf","0"]}),c(f.right._def,{...v,currentPath:[...v.currentPath,"allOf","1"]})].filter((W)=>!!W),J=v.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,Q=[];return h.forEach((W)=>{if(g5(W)){if(Q.push(...W.allOf),W.unevaluatedProperties===void 0)J=void 0}else{let X=W;if("additionalProperties"in W&&W.additionalProperties===!1){let{additionalProperties:Y,...B}=W;X=B}else J=void 0;Q.push(X)}}),Q.length?{allOf:Q,...J}:void 0}function p8(f,v){let h=typeof f.value;if(h!=="bigint"&&h!=="number"&&h!=="boolean"&&h!=="string")return{type:Array.isArray(f.value)?"array":"object"};if(v.target==="openApi3")return{type:h==="bigint"?"integer":h,enum:[f.value]};return{type:h==="bigint"?"integer":h,const:f.value}}av();var SQ=void 0,Qf={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>{if(SQ===void 0)SQ=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return SQ},uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function A0(f,v){let h={type:"string"};if(f.checks)for(let J of f.checks)switch(J.kind){case"min":vv(h,"minLength",typeof h.minLength==="number"?Math.max(h.minLength,J.value):J.value,J.message,v);break;case"max":vv(h,"maxLength",typeof h.maxLength==="number"?Math.min(h.maxLength,J.value):J.value,J.message,v);break;case"email":switch(v.emailStrategy){case"format:email":hf(h,"email",J.message,v);break;case"format:idn-email":hf(h,"idn-email",J.message,v);break;case"pattern:zod":yv(h,Qf.email,J.message,v);break}break;case"url":hf(h,"uri",J.message,v);break;case"uuid":hf(h,"uuid",J.message,v);break;case"regex":yv(h,J.regex,J.message,v);break;case"cuid":yv(h,Qf.cuid,J.message,v);break;case"cuid2":yv(h,Qf.cuid2,J.message,v);break;case"startsWith":yv(h,RegExp(`^${bQ(J.value,v)}`),J.message,v);break;case"endsWith":yv(h,RegExp(`${bQ(J.value,v)}$`),J.message,v);break;case"datetime":hf(h,"date-time",J.message,v);break;case"date":hf(h,"date",J.message,v);break;case"time":hf(h,"time",J.message,v);break;case"duration":hf(h,"duration",J.message,v);break;case"length":vv(h,"minLength",typeof h.minLength==="number"?Math.max(h.minLength,J.value):J.value,J.message,v),vv(h,"maxLength",typeof h.maxLength==="number"?Math.min(h.maxLength,J.value):J.value,J.message,v);break;case"includes":{yv(h,RegExp(bQ(J.value,v)),J.message,v);break}case"ip":{if(J.version!=="v6")hf(h,"ipv4",J.message,v);if(J.version!=="v4")hf(h,"ipv6",J.message,v);break}case"base64url":yv(h,Qf.base64url,J.message,v);break;case"jwt":yv(h,Qf.jwt,J.message,v);break;case"cidr":{if(J.version!=="v6")yv(h,Qf.ipv4Cidr,J.message,v);if(J.version!=="v4")yv(h,Qf.ipv6Cidr,J.message,v);break}case"emoji":yv(h,Qf.emoji(),J.message,v);break;case"ulid":{yv(h,Qf.ulid,J.message,v);break}case"base64":{switch(v.base64Strategy){case"format:binary":{hf(h,"binary",J.message,v);break}case"contentEncoding:base64":{vv(h,"contentEncoding","base64",J.message,v);break}case"pattern:zod":{yv(h,Qf.base64,J.message,v);break}}break}case"nanoid":yv(h,Qf.nanoid,J.message,v);case"toLowerCase":case"toUpperCase":case"trim":break;default:((Q)=>{})(J)}return h}function bQ(f,v){return v.patternStrategy==="escape"?I5(f):f}var y5=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function I5(f){let v="";for(let h=0;h<f.length;h++){if(!y5.has(f[h]))v+="\\";v+=f[h]}return v}function hf(f,v,h,J){if(f.format||f.anyOf?.some((Q)=>Q.format)){if(!f.anyOf)f.anyOf=[];if(f.format){if(f.anyOf.push({format:f.format,...f.errorMessage&&J.errorMessages&&{errorMessage:{format:f.errorMessage.format}}}),delete f.format,f.errorMessage){if(delete f.errorMessage.format,Object.keys(f.errorMessage).length===0)delete f.errorMessage}}f.anyOf.push({format:v,...h&&J.errorMessages&&{errorMessage:{format:h}}})}else vv(f,"format",v,h,J)}function yv(f,v,h,J){if(f.pattern||f.allOf?.some((Q)=>Q.pattern)){if(!f.allOf)f.allOf=[];if(f.pattern){if(f.allOf.push({pattern:f.pattern,...f.errorMessage&&J.errorMessages&&{errorMessage:{pattern:f.errorMessage.pattern}}}),delete f.pattern,f.errorMessage){if(delete f.errorMessage.pattern,Object.keys(f.errorMessage).length===0)delete f.errorMessage}}f.allOf.push({pattern:n8(v,J),...h&&J.errorMessages&&{errorMessage:{pattern:h}}})}else vv(f,"pattern",n8(v,J),h,J)}function n8(f,v){if(!v.applyRegexFlags||!f.flags)return f.source;let h={i:f.flags.includes("i"),m:f.flags.includes("m"),s:f.flags.includes("s")},J=h.i?f.source.toLowerCase():f.source,Q="",W=!1,X=!1,Y=!1;for(let B=0;B<J.length;B++){if(W){Q+=J[B],W=!1;continue}if(h.i){if(X){if(J[B].match(/[a-z]/)){if(Y)Q+=J[B],Q+=`${J[B-2]}-${J[B]}`.toUpperCase(),Y=!1;else if(J[B+1]==="-"&&J[B+2]?.match(/[a-z]/))Q+=J[B],Y=!0;else Q+=`${J[B]}${J[B].toUpperCase()}`;continue}}else if(J[B].match(/[a-z]/)){Q+=`[${J[B]}${J[B].toUpperCase()}]`;continue}}if(h.m){if(J[B]==="^"){Q+=`(^|(?<=[\r
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
]`;continue}if(Q+=J[B],J[B]==="\\")W=!0;else if(X&&J[B]==="]")X=!1;else if(!X&&J[B]==="[")X=!0}try{new RegExp(Q)}catch{return console.warn(`Could not convert regex pattern at ${v.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),f.source}return Q}function S0(f,v){if(v.target==="openAi")console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");if(v.target==="openApi3"&&f.keyType?._def.typeName===z.ZodEnum)return{type:"object",required:f.keyType._def.values,properties:f.keyType._def.values.reduce((J,Q)=>({...J,[Q]:c(f.valueType._def,{...v,currentPath:[...v.currentPath,"properties",Q]})??{}}),{}),additionalProperties:v.rejectedAdditionalProperties};let h={type:"object",additionalProperties:c(f.valueType._def,{...v,currentPath:[...v.currentPath,"additionalProperties"]})??v.allowedAdditionalProperties};if(v.target==="openApi3")return h;if(f.keyType?._def.typeName===z.ZodString&&f.keyType._def.checks?.length){let{type:J,...Q}=A0(f.keyType._def,v);return{...h,propertyNames:Q}}else if(f.keyType?._def.typeName===z.ZodEnum)return{...h,propertyNames:{enum:f.keyType._def.values}};else if(f.keyType?._def.typeName===z.ZodBranded&&f.keyType._def.type._def.typeName===z.ZodString&&f.keyType._def.type._def.checks?.length){let{type:J,...Q}=z0(f.keyType._def,v);return{...h,propertyNames:Q}}return h}function i8(f,v){if(v.mapStrategy==="record")return S0(f,v);let h=c(f.keyType._def,{...v,currentPath:[...v.currentPath,"items","items","0"]})||{},J=c(f.valueType._def,{...v,currentPath:[...v.currentPath,"items","items","1"]})||{};return{type:"array",maxItems:125,items:{type:"array",items:[h,J],minItems:2,maxItems:2}}}function d8(f){let v=f.values,J=Object.keys(f.values).filter((W)=>{return typeof v[v[W]]!=="number"}).map((W)=>v[W]),Q=Array.from(new Set(J.map((W)=>typeof W)));return{type:Q.length===1?Q[0]==="string"?"string":"number":["string","number"],enum:J}}function t8(){return{not:{}}}function s8(f){return f.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var _1={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function e8(f,v){if(v.target==="openApi3")return o8(f,v);let h=f.options instanceof Map?Array.from(f.options.values()):f.options;if(h.every((J)=>(J._def.typeName in _1)&&(!J._def.checks||!J._def.checks.length))){let J=h.reduce((Q,W)=>{let X=_1[W._def.typeName];return X&&!Q.includes(X)?[...Q,X]:Q},[]);return{type:J.length>1?J:J[0]}}else if(h.every((J)=>J._def.typeName==="ZodLiteral"&&!J.description)){let J=h.reduce((Q,W)=>{let X=typeof W._def.value;switch(X){case"string":case"number":case"boolean":return[...Q,X];case"bigint":return[...Q,"integer"];case"object":if(W._def.value===null)return[...Q,"null"];case"symbol":case"undefined":case"function":default:return Q}},[]);if(J.length===h.length){let Q=J.filter((W,X,Y)=>Y.indexOf(W)===X);return{type:Q.length>1?Q:Q[0],enum:h.reduce((W,X)=>{return W.includes(X._def.value)?W:[...W,X._def.value]},[])}}}else if(h.every((J)=>J._def.typeName==="ZodEnum"))return{type:"string",enum:h.reduce((J,Q)=>[...J,...Q._def.values.filter((W)=>!J.includes(W))],[])};return o8(f,v)}var o8=(f,v)=>{let h=(f.options instanceof Map?Array.from(f.options.values()):f.options).map((J,Q)=>c(J._def,{...v,currentPath:[...v.currentPath,"anyOf",`${Q}`]})).filter((J)=>!!J&&(!v.strictUnions||typeof J==="object"&&Object.keys(J).length>0));return h.length?{anyOf:h}:void 0};function vJ(f,v){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(f.innerType._def.typeName)&&(!f.innerType._def.checks||!f.innerType._def.checks.length)){if(v.target==="openApi3")return{type:_1[f.innerType._def.typeName],nullable:!0};return{type:[_1[f.innerType._def.typeName],"null"]}}if(v.target==="openApi3"){let J=c(f.innerType._def,{...v,currentPath:[...v.currentPath]});if(J&&"$ref"in J)return{allOf:[J],nullable:!0};return J&&{...J,nullable:!0}}let h=c(f.innerType._def,{...v,currentPath:[...v.currentPath,"anyOf","0"]});return h&&{anyOf:[h,{type:"null"}]}}function fJ(f,v){let h={type:"number"};if(!f.checks)return h;for(let J of f.checks)switch(J.kind){case"int":h.type="integer",zQ(h,"type",J.message,v);break;case"min":if(v.target==="jsonSchema7")if(J.inclusive)vv(h,"minimum",J.value,J.message,v);else vv(h,"exclusiveMinimum",J.value,J.message,v);else{if(!J.inclusive)h.exclusiveMinimum=!0;vv(h,"minimum",J.value,J.message,v)}break;case"max":if(v.target==="jsonSchema7")if(J.inclusive)vv(h,"maximum",J.value,J.message,v);else vv(h,"exclusiveMaximum",J.value,J.message,v);else{if(!J.inclusive)h.exclusiveMaximum=!0;vv(h,"maximum",J.value,J.message,v)}break;case"multipleOf":vv(h,"multipleOf",J.value,J.message,v);break}return h}av();function QJ(f,v){let h=v.target==="openAi",J={type:"object",properties:{}},Q=[],W=f.shape();for(let Y in W){let B=W[Y];if(B===void 0||B._def===void 0)continue;let q=T5(B);if(q&&h){if(B instanceof mv)B=B._def.innerType;if(!B.isNullable())B=B.nullable();q=!1}let D=c(B._def,{...v,currentPath:[...v.currentPath,"properties",Y],propertyPath:[...v.currentPath,"properties",Y]});if(D===void 0)continue;if(J.properties[Y]=D,!q)Q.push(Y)}if(Q.length)J.required=Q;let X=C5(f,v);if(X!==void 0)J.additionalProperties=X;return J}function C5(f,v){if(f.catchall._def.typeName!=="ZodNever")return c(f.catchall._def,{...v,currentPath:[...v.currentPath,"additionalProperties"]});switch(f.unknownKeys){case"passthrough":return v.allowedAdditionalProperties;case"strict":return v.rejectedAdditionalProperties;case"strip":return v.removeAdditionalStrategy==="strict"?v.allowedAdditionalProperties:v.rejectedAdditionalProperties}}function T5(f){try{return f.isOptional()}catch{return!0}}var hJ=(f,v)=>{if(v.currentPath.toString()===v.propertyPath?.toString())return c(f.innerType._def,v);let h=c(f.innerType._def,{...v,currentPath:[...v.currentPath,"anyOf","1"]});return h?{anyOf:[{not:{}},h]}:{}};var JJ=(f,v)=>{if(v.pipeStrategy==="input")return c(f.in._def,v);else if(v.pipeStrategy==="output")return c(f.out._def,v);let h=c(f.in._def,{...v,currentPath:[...v.currentPath,"allOf","0"]}),J=c(f.out._def,{...v,currentPath:[...v.currentPath,"allOf",h?"1":"0"]});return{allOf:[h,J].filter((Q)=>Q!==void 0)}};function WJ(f,v){return c(f.type._def,v)}function PJ(f,v){let J={type:"array",uniqueItems:!0,items:c(f.valueType._def,{...v,currentPath:[...v.currentPath,"items"]})};if(f.minSize)vv(J,"minItems",f.minSize.value,f.minSize.message,v);if(f.maxSize)vv(J,"maxItems",f.maxSize.value,f.maxSize.message,v);return J}function XJ(f,v){if(f.rest)return{type:"array",minItems:f.items.length,items:f.items.map((h,J)=>c(h._def,{...v,currentPath:[...v.currentPath,"items",`${J}`]})).reduce((h,J)=>J===void 0?h:[...h,J],[]),additionalItems:c(f.rest._def,{...v,currentPath:[...v.currentPath,"additionalItems"]})};else return{type:"array",minItems:f.items.length,maxItems:f.items.length,items:f.items.map((h,J)=>c(h._def,{...v,currentPath:[...v.currentPath,"items",`${J}`]})).reduce((h,J)=>J===void 0?h:[...h,J],[])}}function YJ(){return{not:{}}}function BJ(){return{}}var GJ=(f,v)=>{return c(f.innerType._def,v)};var wJ=(f,v,h)=>{switch(v){case z.ZodString:return A0(f,h);case z.ZodNumber:return fJ(f,h);case z.ZodObject:return QJ(f,h);case z.ZodBigInt:return x8(f,h);case z.ZodBoolean:return Z8();case z.ZodDate:return AQ(f,h);case z.ZodUndefined:return YJ();case z.ZodNull:return s8(h);case z.ZodArray:return T8(f,h);case z.ZodUnion:case z.ZodDiscriminatedUnion:return e8(f,h);case z.ZodIntersection:return c8(f,h);case z.ZodTuple:return XJ(f,h);case z.ZodRecord:return S0(f,h);case z.ZodLiteral:return p8(f,h);case z.ZodEnum:return a8(f);case z.ZodNativeEnum:return d8(f);case z.ZodNullable:return vJ(f,h);case z.ZodOptional:return hJ(f,h);case z.ZodMap:return i8(f,h);case z.ZodSet:return PJ(f,h);case z.ZodLazy:return()=>f.getter()._def;case z.ZodPromise:return WJ(f,h);case z.ZodNaN:case z.ZodNever:return t8();case z.ZodEffects:return m8(f,h);case z.ZodAny:return C8();case z.ZodUnknown:return BJ();case z.ZodDefault:return u8(f,h);case z.ZodBranded:return z0(f,h);case z.ZodReadonly:return GJ(f,h);case z.ZodCatch:return r8(f,h);case z.ZodPipeline:return JJ(f,h);case z.ZodFunction:case z.ZodVoid:case z.ZodSymbol:return;default:return((J)=>{return})(v)}};function c(f,v,h=!1){let J=v.seen.get(f);if(v.override){let Y=v.override?.(f,v,J,h);if(Y!==g8)return Y}if(J&&!h){let Y=x5(J,v);if(Y!==void 0)return Y}let Q={def:f,path:v.currentPath,jsonSchema:void 0};v.seen.set(f,Q);let W=wJ(f,f.typeName,v),X=typeof W==="function"?c(W(),v):W;if(X)r5(f,v,X);if(v.postProcess){let Y=v.postProcess(X,f,v);return Q.jsonSchema=X,Y}return Q.jsonSchema=X,X}var x5=(f,v)=>{switch(v.$refStrategy){case"root":return{$ref:f.path.join("/")};case"relative":return{$ref:Z5(v.currentPath,f.path)};case"none":case"seen":{if(f.path.length<v.currentPath.length&&f.path.every((h,J)=>v.currentPath[J]===h))return console.warn(`Recursive reference detected at ${v.currentPath.join("/")}! Defaulting to any`),{};return v.$refStrategy==="seen"?{}:void 0}}},Z5=(f,v)=>{let h=0;for(;h<f.length&&h<v.length;h++)if(f[h]!==v[h])break;return[(f.length-h).toString(),...v.slice(h)].join("/")},r5=(f,v,h)=>{if(f.description){if(h.description=f.description,v.markdownDescription)h.markdownDescription=f.description}return h};var b0=(f,v)=>{let h=I8(v),J=typeof v==="object"&&v.definitions?Object.entries(v.definitions).reduce((B,[q,D])=>({...B,[q]:c(D._def,{...h,currentPath:[...h.basePath,h.definitionPath,q]},!0)??{}}),{}):void 0,Q=typeof v==="string"?v:v?.nameStrategy==="title"?void 0:v?.name,W=c(f._def,Q===void 0?h:{...h,currentPath:[...h.basePath,h.definitionPath,Q]},!1)??{},X=typeof v==="object"&&v.name!==void 0&&v.nameStrategy==="title"?v.name:void 0;if(X!==void 0)W.title=X;let Y=Q===void 0?J?{...W,[h.definitionPath]:J}:W:{$ref:[...h.$refStrategy==="relative"?[]:h.basePath,h.definitionPath,Q].join("/"),[h.definitionPath]:{...J,[Q]:W}};if(h.target==="jsonSchema7")Y.$schema="http://json-schema.org/draft-07/schema#";else if(h.target==="jsonSchema2019-09"||h.target==="openAi")Y.$schema="https://json-schema.org/draft/2019-09/schema#";if(h.target==="openAi"&&(("anyOf"in Y)||("oneOf"in Y)||("allOf"in Y)||("type"in Y)&&Array.isArray(Y.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return Y};av();b1();av();var RQ;(function(f){f.Completable="McpCompletable"})(RQ||(RQ={}));class l1 extends i{_parse(f){let{ctx:v}=this._processInputParams(f),h=v.data;return this._def.type._parse({data:h,path:v.path,parent:v})}unwrap(){return this._def.type}}l1.create=(f,v)=>{return new l1({type:f,typeName:RQ.Completable,complete:v.complete,...u5(v)})};function u5(f){if(!f)return{};let{errorMap:v,invalid_type_error:h,required_error:J,description:Q}=f;if(v&&(h||J))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(v)return{errorMap:v,description:Q};return{errorMap:(X,Y)=>{var B,q;let{message:D}=f;if(X.code==="invalid_enum_value")return{message:D!==null&&D!==void 0?D:Y.defaultError};if(typeof Y.data==="undefined")return{message:(B=D!==null&&D!==void 0?D:J)!==null&&B!==void 0?B:Y.defaultError};if(X.code!=="invalid_type")return{message:Y.defaultError};return{message:(q=D!==null&&D!==void 0?D:h)!==null&&q!==void 0?q:Y.defaultError}},description:Q}}class _Q{constructor(f,v){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new UQ(f,v)}async connect(f){return await this.server.connect(f)}async close(){await this.server.close()}setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler(W0.shape.method.value),this.server.assertCanSetRequestHandler(P0.shape.method.value),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(W0,()=>({tools:Object.entries(this._registeredTools).filter(([,f])=>f.enabled).map(([f,v])=>{let h={name:f,title:v.title,description:v.description,inputSchema:v.inputSchema?b0(v.inputSchema,{strictUnions:!0}):m5,annotations:v.annotations};if(v.outputSchema)h.outputSchema=b0(v.outputSchema,{strictUnions:!0});return h})})),this.server.setRequestHandler(P0,async(f,v)=>{let h=this._registeredTools[f.params.name];if(!h)throw new Dv(qv.InvalidParams,`Tool ${f.params.name} not found`);if(!h.enabled)throw new Dv(qv.InvalidParams,`Tool ${f.params.name} disabled`);let J;if(h.inputSchema){let Q=await h.inputSchema.safeParseAsync(f.params.arguments);if(!Q.success)throw new Dv(qv.InvalidParams,`Invalid arguments for tool ${f.params.name}: ${Q.error.message}`);let W=Q.data,X=h.callback;try{J=await Promise.resolve(X(W,v))}catch(Y){J={content:[{type:"text",text:Y instanceof Error?Y.message:String(Y)}],isError:!0}}}else{let Q=h.callback;try{J=await Promise.resolve(Q(v))}catch(W){J={content:[{type:"text",text:W instanceof Error?W.message:String(W)}],isError:!0}}}if(h.outputSchema&&!J.isError){if(!J.structuredContent)throw new Dv(qv.InvalidParams,`Tool ${f.params.name} has an output schema but no structured content was provided`);let Q=await h.outputSchema.safeParseAsync(J.structuredContent);if(!Q.success)throw new Dv(qv.InvalidParams,`Invalid structured content for tool ${f.params.name}: ${Q.error.message}`)}return J}),this._toolHandlersInitialized=!0}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(X0.shape.method.value),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(X0,async(f)=>{switch(f.params.ref.type){case"ref/prompt":return this.handlePromptCompletion(f,f.params.ref);case"ref/resource":return this.handleResourceCompletion(f,f.params.ref);default:throw new Dv(qv.InvalidParams,`Invalid completion reference: ${f.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion(f,v){let h=this._registeredPrompts[v.name];if(!h)throw new Dv(qv.InvalidParams,`Prompt ${v.name} not found`);if(!h.enabled)throw new Dv(qv.InvalidParams,`Prompt ${v.name} disabled`);if(!h.argsSchema)return R0;let J=h.argsSchema.shape[f.params.argument.name];if(!(J instanceof l1))return R0;let W=await J._def.complete(f.params.argument.value,f.params.context);return DJ(W)}async handleResourceCompletion(f,v){let h=Object.values(this._registeredResourceTemplates).find((W)=>W.resourceTemplate.uriTemplate.toString()===v.uri);if(!h){if(this._registeredResources[v.uri])return R0;throw new Dv(qv.InvalidParams,`Resource template ${f.params.ref.uri} not found`)}let J=h.resourceTemplate.completeCallback(f.params.argument.name);if(!J)return R0;let Q=await J(f.params.argument.value,f.params.context);return DJ(Q)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(v0.shape.method.value),this.server.assertCanSetRequestHandler(f0.shape.method.value),this.server.assertCanSetRequestHandler(Q0.shape.method.value),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(v0,async(f,v)=>{let h=Object.entries(this._registeredResources).filter(([Q,W])=>W.enabled).map(([Q,W])=>({uri:Q,name:W.name,...W.metadata})),J=[];for(let Q of Object.values(this._registeredResourceTemplates)){if(!Q.resourceTemplate.listCallback)continue;let W=await Q.resourceTemplate.listCallback(v);for(let X of W.resources)J.push({...Q.metadata,...X})}return{resources:[...h,...J]}}),this.server.setRequestHandler(f0,async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([v,h])=>({name:v,uriTemplate:h.resourceTemplate.uriTemplate.toString(),...h.metadata}))}}),this.server.setRequestHandler(Q0,async(f,v)=>{let h=new URL(f.params.uri),J=this._registeredResources[h.toString()];if(J){if(!J.enabled)throw new Dv(qv.InvalidParams,`Resource ${h} disabled`);return J.readCallback(h,v)}for(let Q of Object.values(this._registeredResourceTemplates)){let W=Q.resourceTemplate.uriTemplate.match(h.toString());if(W)return Q.readCallback(h,W,v)}throw new Dv(qv.InvalidParams,`Resource ${h} not found`)}),this.setCompletionRequestHandler(),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(h0.shape.method.value),this.server.assertCanSetRequestHandler(J0.shape.method.value),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(h0,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,f])=>f.enabled).map(([f,v])=>{return{name:f,title:v.title,description:v.description,arguments:v.argsSchema?c5(v.argsSchema):void 0}})})),this.server.setRequestHandler(J0,async(f,v)=>{let h=this._registeredPrompts[f.params.name];if(!h)throw new Dv(qv.InvalidParams,`Prompt ${f.params.name} not found`);if(!h.enabled)throw new Dv(qv.InvalidParams,`Prompt ${f.params.name} disabled`);if(h.argsSchema){let J=await h.argsSchema.safeParseAsync(f.params.arguments);if(!J.success)throw new Dv(qv.InvalidParams,`Invalid arguments for prompt ${f.params.name}: ${J.error.message}`);let Q=J.data,W=h.callback;return await Promise.resolve(W(Q,v))}else{let J=h.callback;return await Promise.resolve(J(v))}}),this.setCompletionRequestHandler(),this._promptHandlersInitialized=!0}resource(f,v,...h){let J;if(typeof h[0]==="object")J=h.shift();let Q=h[0];if(typeof v==="string"){if(this._registeredResources[v])throw new Error(`Resource ${v} is already registered`);let W=this._createRegisteredResource(f,void 0,v,J,Q);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),W}else{if(this._registeredResourceTemplates[f])throw new Error(`Resource template ${f} is already registered`);let W=this._createRegisteredResourceTemplate(f,void 0,v,J,Q);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),W}}registerResource(f,v,h,J){if(typeof v==="string"){if(this._registeredResources[v])throw new Error(`Resource ${v} is already registered`);let Q=this._createRegisteredResource(f,h.title,v,h,J);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),Q}else{if(this._registeredResourceTemplates[f])throw new Error(`Resource template ${f} is already registered`);let Q=this._createRegisteredResourceTemplate(f,h.title,v,h,J);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),Q}}_createRegisteredResource(f,v,h,J,Q){let W={name:f,title:v,metadata:J,readCallback:Q,enabled:!0,disable:()=>W.update({enabled:!1}),enable:()=>W.update({enabled:!0}),remove:()=>W.update({uri:null}),update:(X)=>{if(typeof X.uri!=="undefined"&&X.uri!==h){if(delete this._registeredResources[h],X.uri)this._registeredResources[X.uri]=W}if(typeof X.name!=="undefined")W.name=X.name;if(typeof X.title!=="undefined")W.title=X.title;if(typeof X.metadata!=="undefined")W.metadata=X.metadata;if(typeof X.callback!=="undefined")W.readCallback=X.callback;if(typeof X.enabled!=="undefined")W.enabled=X.enabled;this.sendResourceListChanged()}};return this._registeredResources[h]=W,W}_createRegisteredResourceTemplate(f,v,h,J,Q){let W={resourceTemplate:h,title:v,metadata:J,readCallback:Q,enabled:!0,disable:()=>W.update({enabled:!1}),enable:()=>W.update({enabled:!0}),remove:()=>W.update({name:null}),update:(X)=>{if(typeof X.name!=="undefined"&&X.name!==f){if(delete this._registeredResourceTemplates[f],X.name)this._registeredResourceTemplates[X.name]=W}if(typeof X.title!=="undefined")W.title=X.title;if(typeof X.template!=="undefined")W.resourceTemplate=X.template;if(typeof X.metadata!=="undefined")W.metadata=X.metadata;if(typeof X.callback!=="undefined")W.readCallback=X.callback;if(typeof X.enabled!=="undefined")W.enabled=X.enabled;this.sendResourceListChanged()}};return this._registeredResourceTemplates[f]=W,W}_createRegisteredPrompt(f,v,h,J,Q){let W={title:v,description:h,argsSchema:J===void 0?void 0:P.object(J),callback:Q,enabled:!0,disable:()=>W.update({enabled:!1}),enable:()=>W.update({enabled:!0}),remove:()=>W.update({name:null}),update:(X)=>{if(typeof X.name!=="undefined"&&X.name!==f){if(delete this._registeredPrompts[f],X.name)this._registeredPrompts[X.name]=W}if(typeof X.title!=="undefined")W.title=X.title;if(typeof X.description!=="undefined")W.description=X.description;if(typeof X.argsSchema!=="undefined")W.argsSchema=P.object(X.argsSchema);if(typeof X.callback!=="undefined")W.callback=X.callback;if(typeof X.enabled!=="undefined")W.enabled=X.enabled;this.sendPromptListChanged()}};return this._registeredPrompts[f]=W,W}_createRegisteredTool(f,v,h,J,Q,W,X){let Y={title:v,description:h,inputSchema:J===void 0?void 0:P.object(J),outputSchema:Q===void 0?void 0:P.object(Q),annotations:W,callback:X,enabled:!0,disable:()=>Y.update({enabled:!1}),enable:()=>Y.update({enabled:!0}),remove:()=>Y.update({name:null}),update:(B)=>{if(typeof B.name!=="undefined"&&B.name!==f){if(delete this._registeredTools[f],B.name)this._registeredTools[B.name]=Y}if(typeof B.title!=="undefined")Y.title=B.title;if(typeof B.description!=="undefined")Y.description=B.description;if(typeof B.paramsSchema!=="undefined")Y.inputSchema=P.object(B.paramsSchema);if(typeof B.callback!=="undefined")Y.callback=B.callback;if(typeof B.annotations!=="undefined")Y.annotations=B.annotations;if(typeof B.enabled!=="undefined")Y.enabled=B.enabled;this.sendToolListChanged()}};return this._registeredTools[f]=Y,this.setToolRequestHandlers(),this.sendToolListChanged(),Y}tool(f,...v){if(this._registeredTools[f])throw new Error(`Tool ${f} is already registered`);let h,J,Q,W;if(typeof v[0]==="string")h=v.shift();if(v.length>1){let Y=v[0];if(qJ(Y)){if(J=v.shift(),v.length>1&&typeof v[0]==="object"&&v[0]!==null&&!qJ(v[0]))W=v.shift()}else if(typeof Y==="object"&&Y!==null)W=v.shift()}let X=v[0];return this._createRegisteredTool(f,void 0,h,J,Q,W,X)}registerTool(f,v,h){if(this._registeredTools[f])throw new Error(`Tool ${f} is already registered`);let{title:J,description:Q,inputSchema:W,outputSchema:X,annotations:Y}=v;return this._createRegisteredTool(f,J,Q,W,X,Y,h)}prompt(f,...v){if(this._registeredPrompts[f])throw new Error(`Prompt ${f} is already registered`);let h;if(typeof v[0]==="string")h=v.shift();let J;if(v.length>1)J=v.shift();let Q=v[0],W=this._createRegisteredPrompt(f,void 0,h,J,Q);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),W}registerPrompt(f,v,h){if(this._registeredPrompts[f])throw new Error(`Prompt ${f} is already registered`);let{title:J,description:Q,argsSchema:W}=v,X=this._createRegisteredPrompt(f,J,Q,W,h);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),X}isConnected(){return this.server.transport!==void 0}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}}var m5={type:"object",properties:{}};function qJ(f){if(typeof f!=="object"||f===null)return!1;return Object.keys(f).length===0||Object.values(f).some(a5)}function a5(f){return f!==null&&typeof f==="object"&&"parse"in f&&typeof f.parse==="function"&&"safeParse"in f&&typeof f.safeParse==="function"}function c5(f){return Object.entries(f.shape).map(([v,h])=>({name:v,description:h.description,required:!h.isOptional()}))}function DJ(f){return{completion:{values:f.slice(0,100),total:f.length,hasMore:f.length>100}}}var R0={completion:{values:[],hasMore:!1}};function HJ(f,v){let h=process.argv,J=`--${f}=`;for(let Q of h)if(Q.startsWith(J))return Q.substring(J.length);return v}rf();var n5=sv("FigmaConfig",1),lQ=HJ("figma-api-key")||process.env.FIGMA_API_KEY||process.env.personalToken||"",$J="F2C MCP",jJ=process.env.FIGMA_VERSION||"0.0.1";n5.debug("DEFAULT_PERSONAL_TOKEN",lQ);av();var VJ=require("node:crypto");rf();var Ev=sv("ptdTool"),Iv=null,k1=0,LJ=10,i5=1000,l0=null,d5=process.argv.slice(2),MJ=d5.find((f)=>f.startsWith("--server=")),_0=MJ?MJ.split("=")[1]:"localhost",EJ=_0==="localhost"?`ws://${_0}`:`wss://${_0}`,jf=new Map;function kQ(f=3055){if(Iv&&Iv.readyState===WebSocket.OPEN){Ev.info("Already connected to Figma");return}let v=_0==="localhost"?`${EJ}:${f}`:EJ;Ev.info(`Connecting to Figma socket server at ${v}...`),Iv=new WebSocket(v),Ev.info("Connecting",Iv.readyState,WebSocket.OPEN),Iv.onopen=()=>{Ev.info("Successfully connected to Figma socket server"),l0=null,k1=0},Iv.onmessage=(h)=>{try{let J=JSON.parse(h.data);if(Ev.log("onmessage"+JSON.stringify(J)),J.type==="ping"){Iv?.send(JSON.stringify({type:"pong"}));return}let Q=J.message;if(Q.id&&jf.has(Q.id)&&Q.result){let W=jf.get(Q.id);if(clearTimeout(W.timeout),Q.error)Ev.error(`Error from Figma: ${Q.error}`),W.reject(new Error(Q.error));else if(Q.result)W.resolve(Q.result);jf.delete(Q.id)}else Ev.info(`Received broadcast message: ${JSON.stringify(Q)}`)}catch(J){Ev.error(`Error parsing message: ${J instanceof Error?J.message:String(J)}`)}},Iv.onerror=(h)=>{Ev.error(`Socket error: ${h instanceof Error?h.message:String(h)}`,h)},Iv.onclose=(h)=>{Ev.info(`Disconnected from Figma socket server, Code: ${h.code}, Reason: ${h.reason}`),Iv=null;for(let[J,Q]of jf.entries())clearTimeout(Q.timeout),Q.reject(new Error("Connection closed")),jf.delete(J);if(k1<LJ){let J=i5*2**k1;Ev.info(`Attempting to reconnect in ${J/1000} seconds... (Attempt ${k1+1}/${LJ})`),setTimeout(()=>kQ(f),J),k1++}else Ev.error("Max reconnection attempts reached. Will not try again.")}}async function FJ(){try{console.log("FigmaMCP server starting...");let f=process.env.PORT?Number.parseInt(process.env.PORT,10):3055;kQ(f)}catch(f){Ev.warn(`Could not connect to Figma initially: ${f instanceof Error?f.message:String(f)}`),Ev.warn("Will try to connect when the first command is sent")}Ev.info("FigmaMCP server running on stdio")}async function NJ(f){if(!Iv||Iv.readyState!==WebSocket.OPEN)throw new Error("Not connected to Figma");try{await s("join",{channel:f}),l0=f,Ev.info(`Joined channel: ${f}`)}catch(v){throw Ev.error(`Failed to join channel: ${v instanceof Error?v.message:String(v)}`),v}}function s(f,v={},h=30000){return Ev.info("sendCommandToFigmaReq",f,v),new Promise((J,Q)=>{if(!Iv||Iv.readyState!==WebSocket.OPEN){kQ(),Q(new Error("Not connected to Figma. Attempting to connect..."));return}if(f!=="join"&&!l0){Q(new Error("Must join a channel before sending commands"));return}let X=VJ.randomUUID(),Y={id:X,type:f==="join"?"join":"message",...f==="join"?{channel:v.channel}:{channel:l0},message:{id:X,command:f,params:{...v,commandId:X}}};Ev.info(`Sending command to Figma: ${JSON.stringify(Y)}`);let B=setTimeout(()=>{if(jf.has(X)){let{reject:q,...D}=jf.get(X);Ev.error(`Request to Figma timed out after ${h/1000} seconds. Request details: ${JSON.stringify(D)}`),jf.delete(X),Q(new Error("Request to Figma timed out"))}},h);jf.set(X,{resolve:J,reject:Q,timeout:B,lastActivity:Date.now()}),Ev.info(`Request details: ${JSON.stringify(Y)}`),Iv.send(JSON.stringify(Y))})}rf();var gQ=x1(require("fs")),g1=x1(require("path"));rf();var yQ=sv("filterComponent");function t5(f){return f.meta.component_sets.map((v)=>({key:v.key,name:v.name,description:v.description}))}function s5(f){let v={};return f.forEach((h)=>{let J="其他组件";if(h.name.includes("导航")||h.name.includes("步骤")||h.name.includes("Menu"))J="导航组件";else if(h.name.includes("反馈")||h.name.includes("缺省")||h.name.includes("Result"))J="反馈组件";else if(h.name.includes("Table")||h.name.includes("表格"))J="数据展示";else if(h.name.includes("Input")||h.name.includes("Tag")||h.name.includes("Select"))J="数据录入";else if(h.name.includes("Button")||h.name.includes("按钮"))J="通用组件";else if(h.name.includes("时间")||h.name.includes("Timeline")||h.name.includes("Badge")||h.name.includes("Watermark"))J="数据展示";if(!v[J])v[J]=[];v[J].push(h)}),Object.entries(v).map(([h,J])=>({name:h,components:J.sort((Q,W)=>Q.name.localeCompare(W.name))})).sort((h,J)=>h.name.localeCompare(J.name))}function o5(f){let v=s5(f),h=`---
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
`,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
`,h+=`|类别|组件数量|组件列表|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
`,h+=`## 目录
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
`})}),h}async function e5(f,v){if(!f||typeof f!=="string")throw new Error("内容不能为空且必须是字符串类型");if(!v||typeof v!=="string")throw new Error("文件路径不能为空且必须是字符串类型");let h;if(g1.default.isAbsolute(v))h=v;else{let Q=process.cwd();h=g1.default.resolve(Q,v)}let J=g1.default.normalize(h);if(J.includes(".."))throw new Error("文件路径不安全,包含相对路径");try{let Q=g1.default.dirname(J);await gQ.default.promises.mkdir(Q,{recursive:!0}),await gQ.default.promises.writeFile(J,f,"utf8"),yQ.log(`Markdown文件已保存到: ${J}`)}catch(Q){let W=`保存文件失败 [${J}]: ${Q instanceof Error?Q.message:String(Q)}`;throw yQ.error(W),new Error(W)}}function UJ(f,v="./components.md"){try{let h=t5(f),J=o5(h);e5(J,v),yQ.log(`成功处理 ${h.length} 个组件`)}catch(h){throw console.error("处理组件数据时出错:",h),h}}var vX=sv("ptdTool"),fX=(f)=>{f.tool("get_file_components_set_or_component","Retrieve the list of published component sets or components in the file library. If a file link is provided, extract the filekey to obtain the component set list. If a component key is provided, obtain individual component information",{fileKey:P.string().describe("The Figma file identifier found in the file URL"),componentKey:P.string().describe("The Figma component identifier found in the component URL")},async({fileKey:v,componentKey:h})=>{try{let J=lQ;if(vX.log("token",J),!J)return{content:[{type:"text",text:JSON.stringify({success:!1,error:"Personal token not found. Please provide personalToken parameter or set FIGMA_API_KEY environment variable."})}]};if(v){let Q=await fetch(`https://api.figma.com/v1/files/${v}/component_sets`,{headers:{"X-Figma-Token":J}});if(!Q.ok){let Y=await Q.text();return{content:[{type:"text",text:JSON.stringify({success:!1,error:`API request failed: ${Q.status} ${Q.statusText}`,details:Y})}]}}let W=await Q.json(),X=Date.now();if(W.meta.component_sets){let Y=`./generated-ui/components_${X}.md`;UJ(W,Y)}return{content:[{type:"text",text:JSON.stringify({success:!0,fileKey:v,randomId:X})}]}}else if(h){let Q=await fetch(`https://api.figma.com/v1/components/${h}`,{headers:{"X-Figma-Token":J}});if(!Q.ok){let X=await Q.text();return{content:[{type:"text",text:JSON.stringify({success:!1,error:`API request failed: ${Q.status} ${Q.statusText}`,details:X})}]}}let W=await Q.json();return{content:[{type:"text",text:JSON.stringify({success:!0,componentKey:h,component:W})}]}}return{content:[{type:"text",text:JSON.stringify({success:!1,error:"Error getting file components: please provide fileKey or componentKey"})}]}}catch(J){return{content:[{type:"text",text:JSON.stringify({success:!1,error:`Error getting file components: ${J instanceof Error?J.message:String(J)}`})}]}}}),f.tool("get_component","Get detailed information about a specific component by its key",{componentKey:P.string().describe("The unique key identifier of the component"),personalToken:P.string().optional().describe("Optional personal token, will use environment token if not provided")},async({componentKey:v,personalToken:h})=>{try{let J=h;if(!J){if(J=process.env.personalToken,!J)return{content:[{type:"text",text:JSON.stringify({success:!1,error:"Personal token not found. Please provide personalToken parameter or set FIGMA_API_KEY environment variable."})}]}}let Q=await fetch(`https://api.figma.com/v1/components/${v}`,{headers:{"X-Figma-Token":J}});if(!Q.ok){let X=await Q.text();return{content:[{type:"text",text:JSON.stringify({success:!1,error:`API request failed: ${Q.status} ${Q.statusText}`,details:X})}]}}let W=await Q.json();return{content:[{type:"text",text:JSON.stringify({success:!0,componentKey:v,component:W})}]}}catch(J){return{content:[{type:"text",text:JSON.stringify({success:!1,error:`Error getting component: ${J instanceof Error?J.message:String(J)}`})}]}}}),f.tool("get_instance_overrides","Get all override properties from a selected component instance. These overrides can be applied to other instances, which will swap them to match the source component.",{nodeId:P.string().optional().describe("Optional ID of the component instance to get overrides from. If not provided, currently selected instance will be used.")},async({nodeId:v})=>{try{let J=await s("get_instance_overrides",{instanceNodeId:v||null});return{content:[{type:"text",text:J.success?`Successfully got instance overrides: ${J.message}`:`Failed to get instance overrides: ${J.message}`}]}}catch(h){return{content:[{type:"text",text:`Error copying instance overrides: ${h instanceof Error?h.message:String(h)}`}]}}})},zJ=fX;rf();av();av();var QX=(f)=>{f.tool("join_channel","Join a specific channel to communicate with Figma",{channel:P.string().describe("The name of the channel to join").default("")},async({channel:v})=>{try{if(!v)return{content:[{type:"text",text:"Please provide a channel name to join:"}],followUp:{tool:"join_channel",description:"Join the specified channel"}};return await NJ(v),{content:[{type:"text",text:`Successfully joined channel: ${v}`}]}}catch(h){return{content:[{type:"text",text:`Error joining channel: ${h instanceof Error?h.message:String(h)}`}]}}})},AJ=QX;av();var hX=(f)=>{f.tool("create_rectangle","Create a new rectangle in Figma",{x:P.number().describe("X position"),y:P.number().describe("Y position"),width:P.number().describe("Width of the rectangle"),height:P.number().describe("Height of the rectangle"),name:P.string().optional().describe("Optional name for the rectangle"),parentId:P.string().optional().describe("Optional parent node ID to append the rectangle to")},async({x:v,y:h,width:J,height:Q,name:W,parentId:X})=>{try{let Y=await s("create_rectangle",{x:v,y:h,width:J,height:Q,name:W||"Rectangle",parentId:X});return{content:[{type:"text",text:`Created rectangle "${JSON.stringify(Y)}"`}]}}catch(Y){return{content:[{type:"text",text:`Error creating rectangle: ${Y instanceof Error?Y.message:String(Y)}`}]}}}),f.tool("create_frame","Create a new frame in Figma",{x:P.number().describe("X position"),y:P.number().describe("Y position"),width:P.number().describe("Width of the frame"),height:P.number().describe("Height of the frame"),name:P.string().optional().describe("Optional name for the frame"),parentId:P.string().optional().describe("Optional parent node ID to append the frame to"),fillColor:P.object({r:P.number().min(0).max(1).describe("Red component (0-1)"),g:P.number().min(0).max(1).describe("Green component (0-1)"),b:P.number().min(0).max(1).describe("Blue component (0-1)"),a:P.number().min(0).max(1).optional().describe("Alpha component (0-1)")}).optional().describe("Fill color in RGBA format"),strokeColor:P.object({r:P.number().min(0).max(1).describe("Red component (0-1)"),g:P.number().min(0).max(1).describe("Green component (0-1)"),b:P.number().min(0).max(1).describe("Blue component (0-1)"),a:P.number().min(0).max(1).optional().describe("Alpha component (0-1)")}).optional().describe("Stroke color in RGBA format"),strokeWeight:P.number().positive().optional().describe("Stroke weight"),layoutMode:P.enum(["NONE","HORIZONTAL","VERTICAL"]).optional().describe("Auto-layout mode for the frame"),layoutWrap:P.enum(["NO_WRAP","WRAP"]).optional().describe("Whether the auto-layout frame wraps its children"),paddingTop:P.number().optional().describe("Top padding for auto-layout frame"),paddingRight:P.number().optional().describe("Right padding for auto-layout frame"),paddingBottom:P.number().optional().describe("Bottom padding for auto-layout frame"),paddingLeft:P.number().optional().describe("Left padding for auto-layout frame"),primaryAxisAlignItems:P.enum(["MIN","MAX","CENTER","SPACE_BETWEEN"]).optional().describe("Primary axis alignment for auto-layout frame. Note: When set to SPACE_BETWEEN, itemSpacing will be ignored as children will be evenly spaced."),counterAxisAlignItems:P.enum(["MIN","MAX","CENTER","BASELINE"]).optional().describe("Counter axis alignment for auto-layout frame"),layoutSizingHorizontal:P.enum(["FIXED","HUG","FILL"]).optional().describe("Horizontal sizing mode for auto-layout frame"),layoutSizingVertical:P.enum(["FIXED","HUG","FILL"]).optional().describe("Vertical sizing mode for auto-layout frame"),itemSpacing:P.number().optional().describe("Distance between children in auto-layout frame. Note: This value will be ignored if primaryAxisAlignItems is set to SPACE_BETWEEN.")},async({x:v,y:h,width:J,height:Q,name:W,parentId:X,fillColor:Y,strokeColor:B,strokeWeight:q,layoutMode:D,layoutWrap:j,paddingTop:L,paddingRight:G,paddingBottom:O,paddingLeft:M,primaryAxisAlignItems:K,counterAxisAlignItems:F,layoutSizingHorizontal:S,layoutSizingVertical:N,itemSpacing:A})=>{try{let k=await s("create_frame",{x:v,y:h,width:J,height:Q,name:W||"Frame",parentId:X,fillColor:Y||{r:1,g:1,b:1,a:1},strokeColor:B,strokeWeight:q,layoutMode:D,layoutWrap:j,paddingTop:L,paddingRight:G,paddingBottom:O,paddingLeft:M,primaryAxisAlignItems:K,counterAxisAlignItems:F,layoutSizingHorizontal:S,layoutSizingVertical:N,itemSpacing:A});return{content:[{type:"text",text:`Created frame "${k.name}" with ID: ${k.id}. Use the ID as the parentId to appendChild inside this frame.`}]}}catch(b){return{content:[{type:"text",text:`Error creating frame: ${b instanceof Error?b.message:String(b)}`}]}}}),f.tool("create_text","Create a new text element in Figma",{x:P.number().describe("X position"),y:P.number().describe("Y position"),text:P.string().describe("Text content"),fontSize:P.number().optional().describe("Font size (default: 14)"),fontWeight:P.number().optional().describe("Font weight (e.g., 400 for Regular, 700 for Bold)"),fontColor:P.object({r:P.number().min(0).max(1).describe("Red component (0-1)"),g:P.number().min(0).max(1).describe("Green component (0-1)"),b:P.number().min(0).max(1).describe("Blue component (0-1)"),a:P.number().min(0).max(1).optional().describe("Alpha component (0-1)")}).optional().describe("Font color in RGBA format"),name:P.string().optional().describe("Semantic layer name for the text node"),parentId:P.string().optional().describe("Optional parent node ID to append the text to")},async({x:v,y:h,text:J,fontSize:Q,fontWeight:W,fontColor:X,name:Y,parentId:B})=>{try{let D=await s("create_text",{x:v,y:h,text:J,fontSize:Q||14,fontWeight:W||400,fontColor:X||{r:0,g:0,b:0,a:1},name:Y||"Text",parentId:B});return{content:[{type:"text",text:`Created text "${D.name}" with ID: ${D.id}`}]}}catch(q){return{content:[{type:"text",text:`Error creating text: ${q instanceof Error?q.message:String(q)}`}]}}}),f.tool("set_fill_color","Set the fill color of a node in Figma can be TextNode or FrameNode",{nodeId:P.string().describe("The ID of the node to modify"),r:P.number().min(0).max(1).describe("Red component (0-1)"),g:P.number().min(0).max(1).describe("Green component (0-1)"),b:P.number().min(0).max(1).describe("Blue component (0-1)"),a:P.number().min(0).max(1).optional().describe("Alpha component (0-1)")},async({nodeId:v,r:h,g:J,b:Q,a:W})=>{try{return{content:[{type:"text",text:`Set fill color of node "${(await s("set_fill_color",{nodeId:v,color:{r:h,g:J,b:Q,a:W||1}})).name}" to RGBA(${h}, ${J}, ${Q}, ${W||1})`}]}}catch(X){return{content:[{type:"text",text:`Error setting fill color: ${X instanceof Error?X.message:String(X)}`}]}}}),f.tool("set_stroke_color","Set the stroke color of a node in Figma",{nodeId:P.string().describe("The ID of the node to modify"),r:P.number().min(0).max(1).describe("Red component (0-1)"),g:P.number().min(0).max(1).describe("Green component (0-1)"),b:P.number().min(0).max(1).describe("Blue component (0-1)"),a:P.number().min(0).max(1).optional().describe("Alpha component (0-1)"),weight:P.number().positive().optional().describe("Stroke weight")},async({nodeId:v,r:h,g:J,b:Q,a:W,weight:X})=>{try{return{content:[{type:"text",text:`Set stroke color of node "${(await s("set_stroke_color",{nodeId:v,color:{r:h,g:J,b:Q,a:W||1},weight:X||1})).name}" to RGBA(${h}, ${J}, ${Q}, ${W||1}) with weight ${X||1}`}]}}catch(Y){return{content:[{type:"text",text:`Error setting stroke color: ${Y instanceof Error?Y.message:String(Y)}`}]}}}),f.tool("set_text_content","Set the text content of an existing text node in Figma",{nodeId:P.string().describe("The ID of the text node to modify"),text:P.string().describe("New text content")},async({nodeId:v,text:h})=>{try{return{content:[{type:"text",text:`Updated text content of node "${(await s("set_text_content",{nodeId:v,text:h})).name}" to "${h}"`}]}}catch(J){return{content:[{type:"text",text:`Error setting text content: ${J instanceof Error?J.message:String(J)}`}]}}}),f.tool("set_multiple_annotations","Set multiple annotations parallelly in a node",{nodeId:P.string().describe("The ID of the node containing the elements to annotate"),annotations:P.array(P.object({nodeId:P.string().describe("The ID of the node to annotate"),labelMarkdown:P.string().describe("The annotation text in markdown format"),categoryId:P.string().optional().describe("The ID of the annotation category"),annotationId:P.string().optional().describe("The ID of the annotation to update (if updating existing annotation)"),properties:P.array(P.object({type:P.string()})).optional().describe("Additional properties for the annotation")})).describe("Array of annotations to apply")},async({nodeId:v,annotations:h},J)=>{try{if(!h||h.length===0)return{content:[{type:"text",text:"No annotations provided"}]};let Q={type:"text",text:`Starting annotation process for ${h.length} nodes. This will be processed in batches of 5...`},W=0,X=h.length,B=await s("set_multiple_annotations",{nodeId:v,annotations:h}),q=B.annotationsApplied&&B.annotationsApplied>0,D=`
|
|
49
|
-
Annotation process completed:
|
|
50
|
-
- ${B.annotationsApplied||0} of ${X} successfully applied
|
|
51
|
-
- ${B.annotationsFailed||0} failed
|
|
52
|
-
- Processed in ${B.completedInChunks||1} batches
|
|
53
|
-
`,L=(B.results||[]).filter((O)=>!O.success),G="";if(L.length>0)G=`
|
|
54
|
-
|
|
55
|
-
Nodes that failed:
|
|
56
|
-
${L.map((O)=>`- ${O.nodeId}: ${O.error||"Unknown error"}`).join(`
|
|
57
|
-
`)}`;return{content:[Q,{type:"text",text:D+G}]}}catch(Q){return{content:[{type:"text",text:`Error setting multiple annotations: ${Q instanceof Error?Q.message:String(Q)}`}]}}}),f.tool("create_component_instance","Create an instance of a component in Figma",{componentKey:P.string().describe("Key of the component to instantiate"),x:P.number().describe("X position"),y:P.number().describe("Y position")},async({componentKey:v,x:h,y:J})=>{try{let W=await s("create_component_instance",{componentKey:v,x:h,y:J});return{content:[{type:"text",text:JSON.stringify(W)}]}}catch(Q){return{content:[{type:"text",text:`Error creating component instance: ${Q instanceof Error?Q.message:String(Q)}`}]}}}),f.tool("set_instance_overrides","Apply previously copied overrides to selected component instances. Target instances will be swapped to the source component and all copied override properties will be applied.",{sourceInstanceId:P.string().describe("ID of the source component instance"),targetNodeIds:P.array(P.string()).describe("Array of target instance IDs. Currently selected instances will be used.")},async({sourceInstanceId:v,targetNodeIds:h})=>{try{let Q=await s("set_instance_overrides",{sourceInstanceId:v,targetNodeIds:h||[]});if(Q.success){let W=Q.results?.filter((X)=>X.success).length||0;return{content:[{type:"text",text:`Successfully applied ${Q.totalCount||0} overrides to ${W} instances.`}]}}else return{content:[{type:"text",text:`Failed to set instance overrides: ${Q.message}`}]}}catch(J){return{content:[{type:"text",text:`Error setting instance overrides: ${J instanceof Error?J.message:String(J)}`}]}}}),f.tool("set_corner_radius","Set the corner radius of a node in Figma",{nodeId:P.string().describe("The ID of the node to modify"),radius:P.number().min(0).describe("Corner radius value"),corners:P.array(P.boolean()).length(4).optional().describe("Optional array of 4 booleans to specify which corners to round [topLeft, topRight, bottomRight, bottomLeft]")},async({nodeId:v,radius:h,corners:J})=>{try{return{content:[{type:"text",text:`Set corner radius of node "${(await s("set_corner_radius",{nodeId:v,radius:h,corners:J||[!0,!0,!0,!0]})).name}" to ${h}px`}]}}catch(Q){return{content:[{type:"text",text:`Error setting corner radius: ${Q instanceof Error?Q.message:String(Q)}`}]}}}),f.tool("set_multiple_text_contents","Set multiple text contents parallelly in a node",{nodeId:P.string().describe("The ID of the node containing the text nodes to replace"),text:P.array(P.object({nodeId:P.string().describe("The ID of the text node"),text:P.string().describe("The replacement text")})).describe("Array of text node IDs and their replacement texts")},async({nodeId:v,text:h},J)=>{try{if(!h||h.length===0)return{content:[{type:"text",text:"No text provided"}]};let Q={type:"text",text:`Starting text replacement for ${h.length} nodes. This will be processed in batches of 5...`},W=0,X=h.length,B=await s("set_multiple_text_contents",{nodeId:v,text:h}),q=B.replacementsApplied&&B.replacementsApplied>0,D=`
|
|
58
|
-
Text replacement completed:
|
|
59
|
-
- ${B.replacementsApplied||0} of ${X} successfully updated
|
|
60
|
-
- ${B.replacementsFailed||0} failed
|
|
61
|
-
- Processed in ${B.completedInChunks||1} batches
|
|
62
|
-
`,L=(B.results||[]).filter((O)=>!O.success),G="";if(L.length>0)G=`
|
|
63
|
-
|
|
64
|
-
Nodes that failed:
|
|
65
|
-
${L.map((O)=>`- ${O.nodeId}: ${O.error||"Unknown error"}`).join(`
|
|
66
|
-
`)}`;return{content:[Q,{type:"text",text:D+G}]}}catch(Q){return{content:[{type:"text",text:`Error setting multiple text contents: ${Q instanceof Error?Q.message:String(Q)}`}]}}}),f.tool("set_layout_mode","Set the layout mode and wrap behavior of a frame in Figma",{nodeId:P.string().describe("The ID of the frame to modify"),layoutMode:P.enum(["NONE","HORIZONTAL","VERTICAL"]).describe("Layout mode for the frame"),layoutWrap:P.enum(["NO_WRAP","WRAP"]).optional().describe("Whether the auto-layout frame wraps its children")},async({nodeId:v,layoutMode:h,layoutWrap:J})=>{try{return{content:[{type:"text",text:`Set layout mode of frame "${(await s("set_layout_mode",{nodeId:v,layoutMode:h,layoutWrap:J||"NO_WRAP"})).name}" to ${h}${J?` with ${J}`:""}`}]}}catch(Q){return{content:[{type:"text",text:`Error setting layout mode: ${Q instanceof Error?Q.message:String(Q)}`}]}}}),f.tool("set_annotation","Create or update an annotation",{nodeId:P.string().describe("The ID of the node to annotate"),annotationId:P.string().optional().describe("The ID of the annotation to update (if updating existing annotation)"),labelMarkdown:P.string().describe("The annotation text in markdown format"),categoryId:P.string().optional().describe("The ID of the annotation category"),properties:P.array(P.object({type:P.string()})).optional().describe("Additional properties for the annotation")},async({nodeId:v,annotationId:h,labelMarkdown:J,categoryId:Q,properties:W})=>{try{let X=await s("set_annotation",{nodeId:v,annotationId:h,labelMarkdown:J,categoryId:Q,properties:W});return{content:[{type:"text",text:JSON.stringify(X)}]}}catch(X){return{content:[{type:"text",text:`Error setting annotation: ${X instanceof Error?X.message:String(X)}`}]}}}),f.tool("set_padding","Set padding values for an auto-layout frame in Figma",{nodeId:P.string().describe("The ID of the frame to modify"),paddingTop:P.number().optional().describe("Top padding value"),paddingRight:P.number().optional().describe("Right padding value"),paddingBottom:P.number().optional().describe("Bottom padding value"),paddingLeft:P.number().optional().describe("Left padding value")},async({nodeId:v,paddingTop:h,paddingRight:J,paddingBottom:Q,paddingLeft:W})=>{try{let Y=await s("set_padding",{nodeId:v,paddingTop:h,paddingRight:J,paddingBottom:Q,paddingLeft:W}),B=[];if(h!==void 0)B.push(`top: ${h}`);if(J!==void 0)B.push(`right: ${J}`);if(Q!==void 0)B.push(`bottom: ${Q}`);if(W!==void 0)B.push(`left: ${W}`);return{content:[{type:"text",text:`Set ${B.length>0?`padding (${B.join(", ")})`:"padding"} for frame "${Y.name}"`}]}}catch(X){return{content:[{type:"text",text:`Error setting padding: ${X instanceof Error?X.message:String(X)}`}]}}}),f.tool("set_axis_align","Set primary and counter axis alignment for an auto-layout frame in Figma",{nodeId:P.string().describe("The ID of the frame to modify"),primaryAxisAlignItems:P.enum(["MIN","MAX","CENTER","SPACE_BETWEEN"]).optional().describe("Primary axis alignment (MIN/MAX = left/right in horizontal, top/bottom in vertical). Note: When set to SPACE_BETWEEN, itemSpacing will be ignored as children will be evenly spaced."),counterAxisAlignItems:P.enum(["MIN","MAX","CENTER","BASELINE"]).optional().describe("Counter axis alignment (MIN/MAX = top/bottom in horizontal, left/right in vertical)")},async({nodeId:v,primaryAxisAlignItems:h,counterAxisAlignItems:J})=>{try{let W=await s("set_axis_align",{nodeId:v,primaryAxisAlignItems:h,counterAxisAlignItems:J}),X=[];if(h!==void 0)X.push(`primary: ${h}`);if(J!==void 0)X.push(`counter: ${J}`);return{content:[{type:"text",text:`Set ${X.length>0?`axis alignment (${X.join(", ")})`:"axis alignment"} for frame "${W.name}"`}]}}catch(Q){return{content:[{type:"text",text:`Error setting axis alignment: ${Q instanceof Error?Q.message:String(Q)}`}]}}}),f.tool("set_layout_sizing","Set horizontal and vertical sizing modes for an auto-layout frame in Figma",{nodeId:P.string().describe("The ID of the frame to modify"),layoutSizingHorizontal:P.enum(["FIXED","HUG","FILL"]).optional().describe("Horizontal sizing mode (HUG for frames/text only, FILL for auto-layout children only)"),layoutSizingVertical:P.enum(["FIXED","HUG","FILL"]).optional().describe("Vertical sizing mode (HUG for frames/text only, FILL for auto-layout children only)")},async({nodeId:v,layoutSizingHorizontal:h,layoutSizingVertical:J})=>{try{let W=await s("set_layout_sizing",{nodeId:v,layoutSizingHorizontal:h,layoutSizingVertical:J}),X=[];if(h!==void 0)X.push(`horizontal: ${h}`);if(J!==void 0)X.push(`vertical: ${J}`);return{content:[{type:"text",text:`Set ${X.length>0?`layout sizing (${X.join(", ")})`:"layout sizing"} for frame "${W.name}"`}]}}catch(Q){return{content:[{type:"text",text:`Error setting layout sizing: ${Q instanceof Error?Q.message:String(Q)}`}]}}}),f.tool("set_item_spacing","Set distance between children in an auto-layout frame",{nodeId:P.string().describe("The ID of the frame to modify"),itemSpacing:P.number().describe("Distance between children. Note: This value will be ignored if primaryAxisAlignItems is set to SPACE_BETWEEN.")},async({nodeId:v,itemSpacing:h})=>{try{let Q=await s("set_item_spacing",{nodeId:v,itemSpacing:h});return{content:[{type:"text",text:`Set item spacing to ${h} for frame "${Q.name}"`}]}}catch(J){return{content:[{type:"text",text:`Error setting item spacing: ${J instanceof Error?J.message:String(J)}`}]}}})},SJ=hX;av();var JX=(f)=>{f.tool("get_document_info","Get detailed information about the current Figma document",{},async()=>{try{let v=await s("get_document_info");return{content:[{type:"text",text:JSON.stringify(v)}]}}catch(v){return{content:[{type:"text",text:`Error getting document info: ${v instanceof Error?v.message:String(v)}`}]}}}),f.tool("get_selection","Get information about the current selection in Figma",{},async()=>{try{let v=await s("get_selection");return{content:[{type:"text",text:JSON.stringify(v)}]}}catch(v){return{content:[{type:"text",text:`Error getting selection: ${v instanceof Error?v.message:String(v)}`}]}}}),f.tool("get_node_info","Get detailed information about a specific node in Figma",{nodeId:P.string().describe("The ID of the node to get information about")},async({nodeId:v})=>{try{let h=await s("get_node_info",{nodeId:v});return{content:[{type:"text",text:JSON.stringify(filterFigmaNode(h))}]}}catch(h){return{content:[{type:"text",text:`Error getting node info: ${h instanceof Error?h.message:String(h)}`}]}}}),f.tool("get_nodes_info","Get detailed information about multiple nodes in Figma",{nodeIds:P.array(P.string()).describe("Array of node IDs to get information about")},async({nodeIds:v})=>{try{let h=await Promise.all(v.map(async(J)=>{let Q=await s("get_node_info",{nodeId:J});return{nodeId:J,info:Q}}));return{content:[{type:"text",text:JSON.stringify(h.map((J)=>filterFigmaNode(J.info)))}]}}catch(h){return{content:[{type:"text",text:`Error getting nodes info: ${h instanceof Error?h.message:String(h)}`}]}}})},bJ=JX;var WX=(f)=>{f.prompt("swap_overrides_instances","Guide to swap instance overrides between instances",(v)=>{return{messages:[{role:"assistant",content:{type:"text",text:`# Swap Component Instance and Override Strategy
|
|
67
|
-
|
|
68
|
-
## Overview
|
|
69
|
-
This strategy enables transferring content and property overrides from a source instance to one or more target instances in Figma, maintaining design consistency while reducing manual work.
|
|
70
|
-
|
|
71
|
-
## Step-by-Step Process
|
|
72
|
-
|
|
73
|
-
### 1. Selection Analysis
|
|
74
|
-
- Use \`get_selection()\` to identify the parent component or selected instances
|
|
75
|
-
- For parent components, scan for instances with \`scan_nodes_by_types({ nodeId: "parent-id", types: ["INSTANCE"] })\`
|
|
76
|
-
- Identify custom slots by name patterns (e.g. "Custom Slot*" or "Instance Slot") or by examining text content
|
|
77
|
-
- Determine which is the source instance (with content to copy) and which are targets (where to apply content)
|
|
78
|
-
|
|
79
|
-
### 2. Extract Source Overrides
|
|
80
|
-
- Use \`get_instance_overrides()\` to extract customizations from the source instance
|
|
81
|
-
- This captures text content, property values, and style overrides
|
|
82
|
-
- Command syntax: \`get_instance_overrides({ nodeId: "source-instance-id" })\`
|
|
83
|
-
- Look for successful response like "Got component information from [instance name]"
|
|
84
|
-
|
|
85
|
-
### 3. Apply Overrides to Targets
|
|
86
|
-
- Apply captured overrides using \`set_instance_overrides()\`
|
|
87
|
-
- Command syntax:
|
|
88
|
-
\`\`\`
|
|
89
|
-
set_instance_overrides({
|
|
90
|
-
sourceInstanceId: "source-instance-id",
|
|
91
|
-
targetNodeIds: ["target-id-1", "target-id-2", ...]
|
|
92
|
-
})
|
|
93
|
-
\`\`\`
|
|
94
|
-
|
|
95
|
-
### 4. Verification
|
|
96
|
-
- Verify results with \`get_node_info()\` or \`read_my_design()\`
|
|
97
|
-
- Confirm text content and style overrides have transferred successfully
|
|
98
|
-
|
|
99
|
-
## Key Tips
|
|
100
|
-
- Always join the appropriate channel first with \`join_channel()\`
|
|
101
|
-
- When working with multiple targets, check the full selection with \`get_selection()\`
|
|
102
|
-
- Preserve component relationships by using instance overrides rather than direct text manipulation`}}],description:"Strategy for transferring overrides between component instances in Figma"}}),f.prompt("text_replacement_strategy","Systematic approach for replacing text in Figma designs",(v)=>{return{messages:[{role:"assistant",content:{type:"text",text:`# Intelligent Text Replacement Strategy
|
|
103
|
-
|
|
104
|
-
## 1. Analyze Design & Identify Structure
|
|
105
|
-
- Scan text nodes to understand the overall structure of the design
|
|
106
|
-
- Use AI pattern recognition to identify logical groupings:
|
|
107
|
-
* Tables (rows, columns, headers, cells)
|
|
108
|
-
* Lists (items, headers, nested lists)
|
|
109
|
-
* Card groups (similar cards with recurring text fields)
|
|
110
|
-
* Forms (labels, input fields, validation text)
|
|
111
|
-
* Navigation (menu items, breadcrumbs)
|
|
112
|
-
\`\`\`
|
|
113
|
-
scan_text_nodes(nodeId: "node-id")
|
|
114
|
-
get_node_info(nodeId: "node-id") // optional
|
|
115
|
-
\`\`\`
|
|
116
|
-
|
|
117
|
-
## 2. Strategic Chunking for Complex Designs
|
|
118
|
-
- Divide replacement tasks into logical content chunks based on design structure
|
|
119
|
-
- Use one of these chunking strategies that best fits the design:
|
|
120
|
-
* **Structural Chunking**: Table rows/columns, list sections, card groups
|
|
121
|
-
* **Spatial Chunking**: Top-to-bottom, left-to-right in screen areas
|
|
122
|
-
* **Semantic Chunking**: Content related to the same topic or functionality
|
|
123
|
-
* **Component-Based Chunking**: Process similar component instances together
|
|
124
|
-
|
|
125
|
-
## 3. Progressive Replacement with Verification
|
|
126
|
-
- Create a safe copy of the node for text replacement
|
|
127
|
-
- Replace text chunk by chunk with continuous progress updates
|
|
128
|
-
- After each chunk is processed:
|
|
129
|
-
* Export that section as a small, manageable image
|
|
130
|
-
* Verify text fits properly and maintain design integrity
|
|
131
|
-
* Fix issues before proceeding to the next chunk
|
|
132
|
-
|
|
133
|
-
\`\`\`
|
|
134
|
-
// Clone the node to create a safe copy
|
|
135
|
-
clone_node(nodeId: "selected-node-id", x: [new-x], y: [new-y])
|
|
136
|
-
|
|
137
|
-
// Replace text chunk by chunk
|
|
138
|
-
set_multiple_text_contents(
|
|
139
|
-
nodeId: "parent-node-id",
|
|
140
|
-
text: [
|
|
141
|
-
{ nodeId: "node-id-1", text: "New text 1" },
|
|
142
|
-
// More nodes in this chunk...
|
|
143
|
-
]
|
|
144
|
-
)
|
|
145
|
-
|
|
146
|
-
// Verify chunk with small, targeted image exports
|
|
147
|
-
export_node_as_image(nodeId: "chunk-node-id", format: "PNG", scale: 0.5)
|
|
148
|
-
\`\`\`
|
|
149
|
-
|
|
150
|
-
## 4. Intelligent Handling for Table Data
|
|
151
|
-
- For tabular content:
|
|
152
|
-
* Process one row or column at a time
|
|
153
|
-
* Maintain alignment and spacing between cells
|
|
154
|
-
* Consider conditional formatting based on cell content
|
|
155
|
-
* Preserve header/data relationships
|
|
156
|
-
|
|
157
|
-
## 5. Smart Text Adaptation
|
|
158
|
-
- Adaptively handle text based on container constraints:
|
|
159
|
-
* Auto-detect space constraints and adjust text length
|
|
160
|
-
* Apply line breaks at appropriate linguistic points
|
|
161
|
-
* Maintain text hierarchy and emphasis
|
|
162
|
-
* Consider font scaling for critical content that must fit
|
|
163
|
-
|
|
164
|
-
## 6. Progressive Feedback Loop
|
|
165
|
-
- Establish a continuous feedback loop during replacement:
|
|
166
|
-
* Real-time progress updates (0-100%)
|
|
167
|
-
* Small image exports after each chunk for verification
|
|
168
|
-
* Issues identified early and resolved incrementally
|
|
169
|
-
* Quick adjustments applied to subsequent chunks
|
|
170
|
-
|
|
171
|
-
## 7. Final Verification & Context-Aware QA
|
|
172
|
-
- After all chunks are processed:
|
|
173
|
-
* Export the entire design at reduced scale for final verification
|
|
174
|
-
* Check for cross-chunk consistency issues
|
|
175
|
-
* Verify proper text flow between different sections
|
|
176
|
-
* Ensure design harmony across the full composition
|
|
177
|
-
|
|
178
|
-
## 8. Chunk-Specific Export Scale Guidelines
|
|
179
|
-
- Scale exports appropriately based on chunk size:
|
|
180
|
-
* Small chunks (1-5 elements): scale 1.0
|
|
181
|
-
* Medium chunks (6-20 elements): scale 0.7
|
|
182
|
-
* Large chunks (21-50 elements): scale 0.5
|
|
183
|
-
* Very large chunks (50+ elements): scale 0.3
|
|
184
|
-
* Full design verification: scale 0.2
|
|
185
|
-
|
|
186
|
-
## Sample Chunking Strategy for Common Design Types
|
|
187
|
-
|
|
188
|
-
### Tables
|
|
189
|
-
- Process by logical rows (5-10 rows per chunk)
|
|
190
|
-
- Alternative: Process by column for columnar analysis
|
|
191
|
-
- Tip: Always include header row in first chunk for reference
|
|
192
|
-
|
|
193
|
-
### Card Lists
|
|
194
|
-
- Group 3-5 similar cards per chunk
|
|
195
|
-
- Process entire cards to maintain internal consistency
|
|
196
|
-
- Verify text-to-image ratio within cards after each chunk
|
|
197
|
-
|
|
198
|
-
### Forms
|
|
199
|
-
- Group related fields (e.g., "Personal Information", "Payment Details")
|
|
200
|
-
- Process labels and input fields together
|
|
201
|
-
- Ensure validation messages and hints are updated with their fields
|
|
202
|
-
|
|
203
|
-
### Navigation & Menus
|
|
204
|
-
- Process hierarchical levels together (main menu, submenu)
|
|
205
|
-
- Respect information architecture relationships
|
|
206
|
-
- Verify menu fit and alignment after replacement
|
|
207
|
-
|
|
208
|
-
## Best Practices
|
|
209
|
-
- **Preserve Design Intent**: Always prioritize design integrity
|
|
210
|
-
- **Structural Consistency**: Maintain alignment, spacing, and hierarchy
|
|
211
|
-
- **Visual Feedback**: Verify each chunk visually before proceeding
|
|
212
|
-
- **Incremental Improvement**: Learn from each chunk to improve subsequent ones
|
|
213
|
-
- **Balance Automation & Control**: Let AI handle repetitive replacements but maintain oversight
|
|
214
|
-
- **Respect Content Relationships**: Keep related content consistent across chunks
|
|
215
|
-
|
|
216
|
-
Remember that text is never just text—it's a core design element that must work harmoniously with the overall composition. This chunk-based strategy allows you to methodically transform text while maintaining design integrity.`}}],description:"Systematic approach for replacing text in Figma designs"}}),f.prompt("annotation_conversion_strategy","Strategy for converting manual annotations to Figma's native annotations",(v)=>{return{messages:[{role:"assistant",content:{type:"text",text:`# Automatic Annotation Conversion
|
|
217
|
-
|
|
218
|
-
## Process Overview
|
|
219
|
-
|
|
220
|
-
The process of converting manual annotations (numbered/alphabetical indicators with connected descriptions) to Figma's native annotations:
|
|
221
|
-
|
|
222
|
-
1. Get selected frame/component information
|
|
223
|
-
2. Scan and collect all annotation text nodes
|
|
224
|
-
3. Scan target UI elements (components, instances, frames)
|
|
225
|
-
4. Match annotations to appropriate UI elements
|
|
226
|
-
5. Apply native Figma annotations
|
|
227
|
-
|
|
228
|
-
## Step 1: Get Selection and Initial Setup
|
|
229
|
-
|
|
230
|
-
First, get the selected frame or component that contains annotations:
|
|
231
|
-
|
|
232
|
-
\`\`\`typescript
|
|
233
|
-
// Get the selected frame/component
|
|
234
|
-
const selection = await get_selection();
|
|
235
|
-
const selectedNodeId = selection[0].id
|
|
236
|
-
|
|
237
|
-
// Get available annotation categories for later use
|
|
238
|
-
const annotationData = await get_annotations({
|
|
239
|
-
nodeId: selectedNodeId,
|
|
240
|
-
includeCategories: true
|
|
241
|
-
});
|
|
242
|
-
const categories = annotationData.categories;
|
|
243
|
-
\`\`\`
|
|
244
|
-
|
|
245
|
-
## Step 2: Scan Annotation Text Nodes
|
|
246
|
-
|
|
247
|
-
Scan all text nodes to identify annotations and their descriptions:
|
|
248
|
-
|
|
249
|
-
\`\`\`typescript
|
|
250
|
-
// Get all text nodes in the selection
|
|
251
|
-
const textNodes = await scan_text_nodes({
|
|
252
|
-
nodeId: selectedNodeId
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
// Filter and group annotation markers and descriptions
|
|
256
|
-
|
|
257
|
-
// Markers typically have these characteristics:
|
|
258
|
-
// - Short text content (usually single digit/letter)
|
|
259
|
-
// - Specific font styles (often bold)
|
|
260
|
-
// - Located in a container with "Marker" or "Dot" in the name
|
|
261
|
-
// - Have a clear naming pattern (e.g., "1", "2", "3" or "A", "B", "C")
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
// Identify description nodes
|
|
265
|
-
// Usually longer text nodes near markers or with matching numbers in path
|
|
266
|
-
|
|
267
|
-
\`\`\`
|
|
268
|
-
|
|
269
|
-
## Step 3: Scan Target UI Elements
|
|
270
|
-
|
|
271
|
-
Get all potential target elements that annotations might refer to:
|
|
272
|
-
|
|
273
|
-
\`\`\`typescript
|
|
274
|
-
// Scan for all UI elements that could be annotation targets
|
|
275
|
-
const targetNodes = await scan_nodes_by_types({
|
|
276
|
-
nodeId: selectedNodeId,
|
|
277
|
-
types: [
|
|
278
|
-
"COMPONENT",
|
|
279
|
-
"INSTANCE",
|
|
280
|
-
"FRAME"
|
|
281
|
-
]
|
|
282
|
-
});
|
|
283
|
-
\`\`\`
|
|
284
|
-
|
|
285
|
-
## Step 4: Match Annotations to Targets
|
|
286
|
-
|
|
287
|
-
Match each annotation to its target UI element using these strategies in order of priority:
|
|
288
|
-
|
|
289
|
-
1. **Path-Based Matching**:
|
|
290
|
-
- Look at the marker's parent container name in the Figma layer hierarchy
|
|
291
|
-
- Remove any "Marker:" or "Annotation:" prefixes from the parent name
|
|
292
|
-
- Find UI elements that share the same parent name or have it in their path
|
|
293
|
-
- This works well when markers are grouped with their target elements
|
|
294
|
-
|
|
295
|
-
2. **Name-Based Matching**:
|
|
296
|
-
- Extract key terms from the annotation description
|
|
297
|
-
- Look for UI elements whose names contain these key terms
|
|
298
|
-
- Consider both exact matches and semantic similarities
|
|
299
|
-
- Particularly effective for form fields, buttons, and labeled components
|
|
300
|
-
|
|
301
|
-
3. **Proximity-Based Matching** (fallback):
|
|
302
|
-
- Calculate the center point of the marker
|
|
303
|
-
- Find the closest UI element by measuring distances to element centers
|
|
304
|
-
- Consider the marker's position relative to nearby elements
|
|
305
|
-
- Use this method when other matching strategies fail
|
|
306
|
-
|
|
307
|
-
Additional Matching Considerations:
|
|
308
|
-
- Give higher priority to matches found through path-based matching
|
|
309
|
-
- Consider the type of UI element when evaluating matches
|
|
310
|
-
- Take into account the annotation's context and content
|
|
311
|
-
- Use a combination of strategies for more accurate matching
|
|
312
|
-
|
|
313
|
-
## Step 5: Apply Native Annotations
|
|
314
|
-
|
|
315
|
-
Convert matched annotations to Figma's native annotations using batch processing:
|
|
316
|
-
|
|
317
|
-
\`\`\`typescript
|
|
318
|
-
// Prepare annotations array for batch processing
|
|
319
|
-
const annotationsToApply = Object.values(annotations).map(({ marker, description }) => {
|
|
320
|
-
// Find target using multiple strategies
|
|
321
|
-
const target =
|
|
322
|
-
findTargetByPath(marker, targetNodes) ||
|
|
323
|
-
findTargetByName(description, targetNodes) ||
|
|
324
|
-
findTargetByProximity(marker, targetNodes);
|
|
325
|
-
|
|
326
|
-
if (target) {
|
|
327
|
-
// Determine appropriate category based on content
|
|
328
|
-
const category = determineCategory(description.characters, categories);
|
|
329
|
-
|
|
330
|
-
// Determine appropriate additional annotationProperty based on content
|
|
331
|
-
const annotationProperty = determineProperties(description.characters, target.type);
|
|
332
|
-
|
|
333
|
-
return {
|
|
334
|
-
nodeId: target.id,
|
|
335
|
-
labelMarkdown: description.characters,
|
|
336
|
-
categoryId: category.id,
|
|
337
|
-
properties: annotationProperty
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
return null;
|
|
341
|
-
}).filter(Boolean); // Remove null entries
|
|
342
|
-
|
|
343
|
-
// Apply annotations in batches using set_multiple_annotations
|
|
344
|
-
if (annotationsToApply.length > 0) {
|
|
345
|
-
await set_multiple_annotations({
|
|
346
|
-
nodeId: selectedNodeId,
|
|
347
|
-
annotations: annotationsToApply
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
|
-
\`\`\`
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
This strategy focuses on practical implementation based on real-world usage patterns, emphasizing the importance of handling various UI elements as annotation targets, not just text nodes.`}}],description:"Strategy for converting manual annotations to Figma's native annotations"}}),f.prompt("design_strategy","Best practices for working with Figma designs",(v)=>{return{messages:[{role:"assistant",content:{type:"text",text:`When working with Figma designs, follow these best practices:
|
|
354
|
-
|
|
355
|
-
1. Start with Document Structure:
|
|
356
|
-
- First use get_document_info() to understand the current document
|
|
357
|
-
- Plan your layout hierarchy before creating elements
|
|
358
|
-
- Create a main container frame for each screen/section
|
|
359
|
-
- If a component library has already been provided, please prioritize creating elements using component instances
|
|
360
|
-
2. Naming Conventions:
|
|
361
|
-
- Use descriptive, semantic names for all elements
|
|
362
|
-
- Follow a consistent naming pattern (e.g., "Login Screen", "Logo Container", "Email Input")
|
|
363
|
-
- Group related elements with meaningful names
|
|
364
|
-
|
|
365
|
-
3. Layout Hierarchy:
|
|
366
|
-
- Create parent frames first, then add child elements
|
|
367
|
-
- For forms/login screens:
|
|
368
|
-
* Start with the main screen container frame
|
|
369
|
-
* Create a logo container at the top
|
|
370
|
-
* Group input fields in their own containers
|
|
371
|
-
* Place action buttons (login, submit) after inputs
|
|
372
|
-
* Add secondary elements (forgot password, signup links) last
|
|
373
|
-
|
|
374
|
-
4. Input Fields Structure:
|
|
375
|
-
- Create a container frame for each input field
|
|
376
|
-
- Include a label text above or inside the input
|
|
377
|
-
- Group related inputs (e.g., username/password) together
|
|
378
|
-
|
|
379
|
-
5. Element Creation:
|
|
380
|
-
- Use create_frame() for containers and input fields
|
|
381
|
-
- Use create_text() for labels, buttons text, and links
|
|
382
|
-
- Set appropriate colors and styles:
|
|
383
|
-
* Use fillColor for backgrounds
|
|
384
|
-
* Use strokeColor for borders
|
|
385
|
-
* Set proper fontWeight for different text elements
|
|
386
|
-
|
|
387
|
-
6. Mofifying existing elements:
|
|
388
|
-
- use set_text_content() to modify text content.
|
|
389
|
-
|
|
390
|
-
7. Visual Hierarchy:
|
|
391
|
-
- Position elements in logical reading order (top to bottom)
|
|
392
|
-
- Maintain consistent spacing between elements
|
|
393
|
-
- Use appropriate font sizes for different text types:
|
|
394
|
-
* Larger for headings/welcome text
|
|
395
|
-
* Medium for input labels
|
|
396
|
-
* Standard for button text
|
|
397
|
-
* Smaller for helper text/links
|
|
398
|
-
|
|
399
|
-
8. Best Practices:
|
|
400
|
-
- Verify each creation with get_node_info()
|
|
401
|
-
- Use parentId to maintain proper hierarchy
|
|
402
|
-
- Group related elements together in frames
|
|
403
|
-
- Keep consistent spacing and alignment
|
|
404
|
-
|
|
405
|
-
Example Login Screen Structure:
|
|
406
|
-
- Login Screen (main frame)
|
|
407
|
-
- Logo Container (frame)
|
|
408
|
-
- Logo (image/text)
|
|
409
|
-
- Welcome Text (text)
|
|
410
|
-
- Input Container (frame)
|
|
411
|
-
- Email Input (frame)
|
|
412
|
-
- Email Label (text)
|
|
413
|
-
- Email Field (frame)
|
|
414
|
-
- Password Input (frame)
|
|
415
|
-
- Password Label (text)
|
|
416
|
-
- Password Field (frame)
|
|
417
|
-
- Login Button (frame)
|
|
418
|
-
- Button Text (text)
|
|
419
|
-
- Helper Links (frame)
|
|
420
|
-
- Forgot Password (text)
|
|
421
|
-
- Don't have account (text)`}}],description:"Best practices for working with Figma designs"}}),f.prompt("read_design_strategy","Best practices for reading Figma designs",(v)=>{return{messages:[{role:"assistant",content:{type:"text",text:`When reading Figma designs, follow these best practices:
|
|
422
|
-
|
|
423
|
-
1. Start with selection:
|
|
424
|
-
- First use read_my_design() to understand the current selection
|
|
425
|
-
- If no selection ask user to select single or multiple nodes
|
|
426
|
-
`}}],description:"Best practices for reading Figma designs"}}),f.prompt("best_design_principle","Figma Design Best Practices",()=>{return{messages:[{role:"assistant",content:{type:"text",text:`
|
|
427
|
-
# 资深 Figma UX/UI 设计专家
|
|
428
|
-
|
|
429
|
-
你将担任资深UX/UI设计专家,在以用户为中心的设计、交互原型和设计系统方面拥有10+年经验,尤其精通Figma。你擅长运用最新方法创建直观、可访问、高转化率的数字界面。
|
|
430
|
-
|
|
431
|
-
核心任务:针对我的设计需求,提供专业、可落地的解决方案,始终优先考虑用户价值、业务目标、可访问性(WCAG 2.1+)和 Figma 高效实现。
|
|
432
|
-
|
|
433
|
-
响应流程 (请严格遵循):
|
|
434
|
-
|
|
435
|
-
1. \uD83D\uDD0D 需求解析与组件扫描
|
|
436
|
-
* 拆解需求:清晰阐述核心设计目标、用户场景和关键任务
|
|
437
|
-
* 组件库分析(当提供时):
|
|
438
|
-
- 扫描组件库文档,识别所有潜在适用组件
|
|
439
|
-
- 提取最匹配组件的key列表
|
|
440
|
-
- 标注组件匹配度(完全匹配/需修改/部分适用)
|
|
441
|
-
* 约束识别:明确技术限制和可访问性要求
|
|
442
|
-
|
|
443
|
-
2. \uD83E\uDDE9 设计策略与组件匹配
|
|
444
|
-
* 原则映射:列出3-5个核心UX/UI设计原则
|
|
445
|
-
* 组件化策略(当提供组件库时):
|
|
446
|
-
- 基于提取的key列表,详细说明每个组件的应用场景
|
|
447
|
-
- 说明组件选择理由及适配方案
|
|
448
|
-
- 当无完全匹配组件时,建议最小修改方案
|
|
449
|
-
* 独立设计策略(无组件库时):
|
|
450
|
-
- 推荐最佳交互模式
|
|
451
|
-
- 创建新组件的合理性和方案
|
|
452
|
-
|
|
453
|
-
3. ⚙️ 解决方案设计
|
|
454
|
-
* 核心方案描述:
|
|
455
|
-
- 当有组件库:基于选定组件的整体架构
|
|
456
|
-
- 当无组件库:完整设计方案描述
|
|
457
|
-
* Figma 实现要点:
|
|
458
|
-
* 组件应用(当有组件库):
|
|
459
|
-
- 指定使用的组件key及变体配置
|
|
460
|
-
- 组件组合的布局逻辑
|
|
461
|
-
* 原型交互:关键交互流程说明
|
|
462
|
-
* 设计系统集成:组件修改/扩展方案
|
|
463
|
-
|
|
464
|
-
4. \uD83D\uDE80 结论与优化
|
|
465
|
-
* 方案精要:总结核心优势
|
|
466
|
-
* 组件应用清单(当有组件库):表格形式列出所有使用组件的key
|
|
467
|
-
* 测试建议:组件级或整体可用性测试方案
|
|
468
|
-
* 迭代方向:现有组件优化或新组件创建建议
|
|
469
|
-
|
|
470
|
-
响应格式 (必须严格遵守):
|
|
471
|
-
\uD83D\uDCCB 需求摘要
|
|
472
|
-
* [1-2句话概括核心需求]
|
|
473
|
-
|
|
474
|
-
\uD83D\uDD0D 需求解析与组件扫描
|
|
475
|
-
* [需求拆解 + 组件扫描结果(含key列表)]
|
|
476
|
-
|
|
477
|
-
\uD83E\uDDE9 设计策略与组件匹配
|
|
478
|
-
* [设计原则 + 详细组件匹配方案]
|
|
479
|
-
|
|
480
|
-
⚙️ 解决方案设计
|
|
481
|
-
* [基于组件/独立的设计方案描述]
|
|
482
|
-
* [关键实现要点]
|
|
483
|
-
|
|
484
|
-
\uD83D\uDE80 结论与优化
|
|
485
|
-
* [总结 + 组件清单表格(如适用)]
|
|
486
|
-
|
|
487
|
-
❓ 澄清问题 (可选)
|
|
488
|
-
* [仅当组件信息不足时提问]
|
|
489
|
-
|
|
490
|
-
专业知识深度要求 (必须精通):
|
|
491
|
-
- 设计系统组件库分析与应用
|
|
492
|
-
- 组件复用策略与变体配置
|
|
493
|
-
- Figma组件开发与维护
|
|
494
|
-
- 设计思维与UCD方法论
|
|
495
|
-
- 响应式/移动优先设计
|
|
496
|
-
- WCAG 2.1/2.2可访问性标准
|
|
497
|
-
|
|
498
|
-
行为准则:
|
|
499
|
-
1. 组件优先原则:当提供组件库时,必须优先使用现有组件
|
|
500
|
-
2. 精确引用:通过key标识明确指定组件
|
|
501
|
-
3. 最小修改:无匹配组件时才建议创建新组件
|
|
502
|
-
4. 组件清单:在结论部分表格化列出所有使用组件的key
|
|
503
|
-
5. 双模式设计:明确区分组件库/独立设计流程
|
|
504
|
-
6. 用户价值优先
|
|
505
|
-
7. 强制可访问性整合
|
|
506
|
-
`}}],description:"Best practices for reading Figma designs"}})},RJ=WX;var PX=sv("ptdTool");function _J(f){AJ(f),SJ(f),bJ(f),zJ(f),RJ(f),f.tool("move_node","Move a node to a new position in Figma",{nodeId:P.string().describe("The ID of the node to move"),x:P.number().describe("New X position"),y:P.number().describe("New Y position")},async({nodeId:v,x:h,y:J})=>{try{return{content:[{type:"text",text:`Moved node "${(await s("move_node",{nodeId:v,x:h,y:J})).name}" to position (${h}, ${J})`}]}}catch(Q){return{content:[{type:"text",text:`Error moving node: ${Q instanceof Error?Q.message:String(Q)}`}]}}}),f.tool("clone_node","Clone an existing node in Figma",{nodeId:P.string().describe("The ID of the node to clone"),x:P.number().optional().describe("New X position for the clone"),y:P.number().optional().describe("New Y position for the clone")},async({nodeId:v,x:h,y:J})=>{try{let W=await s("clone_node",{nodeId:v,x:h,y:J});return{content:[{type:"text",text:`Cloned node "${W.name}" with new ID: ${W.id}${h!==void 0&&J!==void 0?` at position (${h}, ${J})`:""}`}]}}catch(Q){return{content:[{type:"text",text:`Error cloning node: ${Q instanceof Error?Q.message:String(Q)}`}]}}}),f.tool("resize_node","Resize a node in Figma",{nodeId:P.string().describe("The ID of the node to resize"),width:P.number().positive().describe("New width"),height:P.number().positive().describe("New height")},async({nodeId:v,width:h,height:J})=>{try{return{content:[{type:"text",text:`Resized node "${(await s("resize_node",{nodeId:v,width:h,height:J})).name}" to width ${h} and height ${J}`}]}}catch(Q){return{content:[{type:"text",text:`Error resizing node: ${Q instanceof Error?Q.message:String(Q)}`}]}}}),f.tool("delete_multiple_nodes","Delete multiple nodes from Figma at once",{nodeIds:P.array(P.string()).describe("Array of node IDs to delete")},async({nodeIds:v})=>{try{let h=await s("delete_multiple_nodes",{nodeIds:v});return{content:[{type:"text",text:JSON.stringify(h)}]}}catch(h){return{content:[{type:"text",text:`Error deleting multiple nodes: ${h instanceof Error?h.message:String(h)}`}]}}}),f.tool("export_node_as_image","Export a node as an image from Figma",{nodeId:P.string().describe("The ID of the node to export"),format:P.enum(["PNG","JPG","SVG","PDF"]).optional().describe("Export format"),scale:P.number().positive().optional().describe("Export scale")},async({nodeId:v,format:h,scale:J})=>{try{let W=await s("export_node_as_image",{nodeId:v,format:h||"PNG",scale:J||1});return{content:[{type:"image",data:W.imageData,mimeType:W.mimeType||"image/png"}]}}catch(Q){return{content:[{type:"text",text:`Error exporting node as image: ${Q instanceof Error?Q.message:String(Q)}`}]}}}),f.tool("get_annotations","Get all annotations in the current document or specific node",{nodeId:P.string().optional().describe("Optional node ID to get annotations for specific node"),includeCategories:P.boolean().optional().default(!0).describe("Whether to include category information")},async({nodeId:v,includeCategories:h})=>{try{let J=await s("get_annotations",{nodeId:v,includeCategories:h});return{content:[{type:"text",text:JSON.stringify(J)}]}}catch(J){return{content:[{type:"text",text:`Error getting annotations: ${J instanceof Error?J.message:String(J)}`}]}}}),f.tool("scan_text_nodes","Scan all text nodes in the selected Figma node",{nodeId:P.string().describe("ID of the node to scan")},async({nodeId:v})=>{try{let h={type:"text",text:"Starting text node scanning. This may take a moment for large designs..."},J=await s("scan_text_nodes",{nodeId:v,useChunking:!0,chunkSize:10});if(J&&typeof J==="object"&&"chunks"in J){let Q=J,W=`
|
|
507
|
-
Scan completed:
|
|
508
|
-
- Found ${Q.totalNodes} text nodes
|
|
509
|
-
- Processed in ${Q.chunks} chunks
|
|
510
|
-
`;return{content:[h,{type:"text",text:W},{type:"text",text:JSON.stringify(Q.textNodes,null,2)}]}}return{content:[h,{type:"text",text:JSON.stringify(J,null,2)}]}}catch(h){return{content:[{type:"text",text:`Error scanning text nodes: ${h instanceof Error?h.message:String(h)}`}]}}}),f.tool("scan_nodes_by_types","Scan for child nodes with specific types in the selected Figma node",{nodeId:P.string().describe("ID of the node to scan"),types:P.array(P.string()).describe("Array of node types to find in the child nodes (e.g. ['COMPONENT', 'FRAME'])")},async({nodeId:v,types:h})=>{try{let J={type:"text",text:`Starting node type scanning for types: ${h.join(", ")}...`},Q=await s("scan_nodes_by_types",{nodeId:v,types:h});if(Q&&typeof Q==="object"&&"matchingNodes"in Q){let W=Q,X=`Scan completed: Found ${W.count} nodes matching types: ${W.searchedTypes.join(", ")}`;return{content:[J,{type:"text",text:X},{type:"text",text:JSON.stringify(W.matchingNodes,null,2)}]}}return{content:[J,{type:"text",text:JSON.stringify(Q,null,2)}]}}catch(J){return{content:[{type:"text",text:`Error scanning nodes by types: ${J instanceof Error?J.message:String(J)}`}]}}}),f.tool("read_my_design","Get detailed information about the current selection in Figma, including all node details",{},async()=>{try{let v=await s("read_my_design",{});return{content:[{type:"text",text:JSON.stringify(v)}]}}catch(v){return{content:[{type:"text",text:`Error getting node info: ${v instanceof Error?v.message:String(v)}`}]}}}),f.tool("get_reactions","Get Figma Prototyping Reactions from multiple nodes. CRITICAL: The output MUST be processed using the 'reaction_to_connector_strategy' prompt IMMEDIATELY to generate parameters for connector lines via the 'create_connections' tool.",{nodeIds:P.array(P.string()).describe("Array of node IDs to get reactions from")},async({nodeIds:v})=>{try{let h=await s("get_reactions",{nodeIds:v});return{content:[{type:"text",text:JSON.stringify(h)},{type:"text",text:"IMPORTANT: You MUST now use the reaction data above and follow the `reaction_to_connector_strategy` prompt to prepare the parameters for the `create_connections` tool call. This is a required next step."}],followUp:{type:"prompt",prompt:"reaction_to_connector_strategy"}}}catch(h){return{content:[{type:"text",text:`Error getting reactions: ${h instanceof Error?h.message:String(h)}`}]}}}),f.tool("set_default_connector","Set a copied connector node as the default connector",{connectorId:P.string().optional().describe("The ID of the connector node to set as default")},async({connectorId:v})=>{try{let h=await s("set_default_connector",{connectorId:v});return{content:[{type:"text",text:`Default connector set: ${JSON.stringify(h)}`}]}}catch(h){return{content:[{type:"text",text:`Error setting default connector: ${h instanceof Error?h.message:String(h)}`}]}}}),f.tool("delete_node","Delete a node from Figma",{nodeId:P.string().describe("The ID of the node to delete")},async({nodeId:v})=>{try{return await s("delete_node",{nodeId:v}),{content:[{type:"text",text:`Deleted node with ID: ${v}`}]}}catch(h){return{content:[{type:"text",text:`Error deleting node: ${h instanceof Error?h.message:String(h)}`}]}}}),f.tool("create_connections","Create connections between nodes using the default connector style",{connections:P.array(P.object({startNodeId:P.string().describe("ID of the starting node"),endNodeId:P.string().describe("ID of the ending node"),text:P.string().optional().describe("Optional text to display on the connector")})).describe("Array of node connections to create")},async({connections:v})=>{try{if(!v||v.length===0)return{content:[{type:"text",text:"No connections provided"}]};let h=await s("create_connections",{connections:v});return{content:[{type:"text",text:`Created ${v.length} connections: ${JSON.stringify(h)}`}]}}catch(h){return{content:[{type:"text",text:`Error creating connections: ${h instanceof Error?h.message:String(h)}`}]}}})}FJ().catch((f)=>{PX.error(`Error starting FigmaMCP server: ${f instanceof Error?f.message:String(f)}`),process.exit(1)});var IQ=new _Q({name:$J,version:jJ},{capabilities:{logging:{}}});_J(IQ);var TQ=x1(require("node:process"));b1();class CQ{append(f){this._buffer=this._buffer?Buffer.concat([this._buffer,f]):f}readMessage(){if(!this._buffer)return null;let f=this._buffer.indexOf(`
|
|
511
|
-
`);if(f===-1)return null;let v=this._buffer.toString("utf8",0,f).replace(/\r$/,"");return this._buffer=this._buffer.subarray(f+1),XX(v)}clear(){this._buffer=void 0}}function XX(f){return Eh.parse(JSON.parse(f))}function lJ(f){return JSON.stringify(f)+`
|
|
512
|
-
`}class xQ{constructor(f=TQ.default.stdin,v=TQ.default.stdout){this._stdin=f,this._stdout=v,this._readBuffer=new CQ,this._started=!1,this._ondata=(h)=>{this._readBuffer.append(h),this.processReadBuffer()},this._onerror=(h)=>{var J;(J=this.onerror)===null||J===void 0||J.call(this,h)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){var f,v;while(!0)try{let h=this._readBuffer.readMessage();if(h===null)break;(f=this.onmessage)===null||f===void 0||f.call(this,h)}catch(h){(v=this.onerror)===null||v===void 0||v.call(this,h)}}async close(){var f;if(this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),(f=this.onclose)===null||f===void 0||f.call(this)}send(f){return new Promise((v)=>{let h=lJ(f);if(this._stdout.write(h))v();else this._stdout.once("drain",v)})}}rf();var YX=sv("StdioTransport");async function kJ(f){try{let v=new xQ;await f.connect(v)}catch(v){YX.info(JSON.stringify({jsonrpc:"2.0",id:null,error:{code:-32000,message:`Server startup failed: ${v.message}`}})),process.exit(1)}}kJ(IQ);
|
|
513
|
-
|
|
514
|
-
//# debugId=9BDEA48D3EE6D82264756E2164756E21
|
|
2
|
+
var y5=Object.create;var{getPrototypeOf:T5,defineProperty:EQ,getOwnPropertyNames:e9,getOwnPropertyDescriptor:x5}=Object,v6=Object.prototype.hasOwnProperty;var Hf=(f,v,W)=>{W=f!=null?y5(T5(f)):{};let X=v||!f||!f.__esModule?EQ(W,"default",{value:f,enumerable:!0}):W;for(let Q of e9(f))if(!v6.call(X,Q))EQ(X,Q,{get:()=>f[Q],enumerable:!0});return X},t9=new WeakMap,l5=(f)=>{var v=t9.get(f),W;if(v)return v;if(v=EQ({},"__esModule",{value:!0}),f&&typeof f==="object"||typeof f==="function")e9(f).map((X)=>!v6.call(v,X)&&EQ(v,X,{get:()=>f[X],enumerable:!(W=x5(f,X))||W.enumerable}));return t9.set(f,v),v},Qv=(f,v)=>()=>(v||f((v={exports:{}}).exports,v),v.exports);var pW=(f,v)=>{for(var W in v)EQ(f,W,{get:v[W],enumerable:!0,configurable:!0,set:(X)=>v[W]=()=>X})};var jv=(f,v)=>()=>(f&&(v=f(f=0)),v);var Ov,iW,r,B1=(f)=>{switch(typeof f){case"undefined":return r.undefined;case"string":return r.string;case"number":return Number.isNaN(f)?r.nan:r.number;case"boolean":return r.boolean;case"function":return r.function;case"bigint":return r.bigint;case"symbol":return r.symbol;case"object":if(Array.isArray(f))return r.array;if(f===null)return r.null;if(f.then&&typeof f.then==="function"&&f.catch&&typeof f.catch==="function")return r.promise;if(typeof Map!=="undefined"&&f instanceof Map)return r.map;if(typeof Set!=="undefined"&&f instanceof Set)return r.set;if(typeof Date!=="undefined"&&f instanceof Date)return r.date;return r.object;default:return r.unknown}};var AQ=jv(()=>{(function(f){f.assertEqual=(Q)=>{};function v(Q){}f.assertIs=v;function W(Q){throw new Error}f.assertNever=W,f.arrayToEnum=(Q)=>{let P={};for(let w of Q)P[w]=w;return P},f.getValidEnumValues=(Q)=>{let P=f.objectKeys(Q).filter((G)=>typeof Q[Q[G]]!=="number"),w={};for(let G of P)w[G]=Q[G];return f.objectValues(w)},f.objectValues=(Q)=>{return f.objectKeys(Q).map(function(P){return Q[P]})},f.objectKeys=typeof Object.keys==="function"?(Q)=>Object.keys(Q):(Q)=>{let P=[];for(let w in Q)if(Object.prototype.hasOwnProperty.call(Q,w))P.push(w);return P},f.find=(Q,P)=>{for(let w of Q)if(P(w))return w;return},f.isInteger=typeof Number.isInteger==="function"?(Q)=>Number.isInteger(Q):(Q)=>typeof Q==="number"&&Number.isFinite(Q)&&Math.floor(Q)===Q;function X(Q,P=" | "){return Q.map((w)=>typeof w==="string"?`'${w}'`:w).join(P)}f.joinValues=X,f.jsonStringifyReplacer=(Q,P)=>{if(typeof P==="bigint")return P.toString();return P}})(Ov||(Ov={}));(function(f){f.mergeShapes=(v,W)=>{return{...v,...W}}})(iW||(iW={}));r=Ov.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var l,b5=(f)=>{return JSON.stringify(f,null,2).replace(/"([^"]+)":/g,"$1:")},Vf;var V8=jv(()=>{AQ();l=Ov.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);Vf=class Vf extends Error{get errors(){return this.issues}constructor(f){super();this.issues=[],this.addIssue=(W)=>{this.issues=[...this.issues,W]},this.addIssues=(W=[])=>{this.issues=[...this.issues,...W]};let v=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,v);else this.__proto__=v;this.name="ZodError",this.issues=f}format(f){let v=f||function(Q){return Q.message},W={_errors:[]},X=(Q)=>{for(let P of Q.issues)if(P.code==="invalid_union")P.unionErrors.map(X);else if(P.code==="invalid_return_type")X(P.returnTypeError);else if(P.code==="invalid_arguments")X(P.argumentsError);else if(P.path.length===0)W._errors.push(v(P));else{let w=W,G=0;while(G<P.path.length){let B=P.path[G];if(G!==P.path.length-1)w[B]=w[B]||{_errors:[]};else w[B]=w[B]||{_errors:[]},w[B]._errors.push(v(P));w=w[B],G++}}};return X(this),W}static assert(f){if(!(f instanceof Vf))throw new Error(`Not a ZodError: ${f}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ov.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(f=(v)=>v.message){let v={},W=[];for(let X of this.issues)if(X.path.length>0){let Q=X.path[0];v[Q]=v[Q]||[],v[Q].push(f(X))}else W.push(f(X));return{formErrors:W,fieldErrors:v}}get formErrors(){return this.flatten()}};Vf.create=(f)=>{return new Vf(f)}});var u5=(f,v)=>{let W;switch(f.code){case l.invalid_type:if(f.received===r.undefined)W="Required";else W=`Expected ${f.expected}, received ${f.received}`;break;case l.invalid_literal:W=`Invalid literal value, expected ${JSON.stringify(f.expected,Ov.jsonStringifyReplacer)}`;break;case l.unrecognized_keys:W=`Unrecognized key(s) in object: ${Ov.joinValues(f.keys,", ")}`;break;case l.invalid_union:W="Invalid input";break;case l.invalid_union_discriminator:W=`Invalid discriminator value. Expected ${Ov.joinValues(f.options)}`;break;case l.invalid_enum_value:W=`Invalid enum value. Expected ${Ov.joinValues(f.options)}, received '${f.received}'`;break;case l.invalid_arguments:W="Invalid function arguments";break;case l.invalid_return_type:W="Invalid function return type";break;case l.invalid_date:W="Invalid date";break;case l.invalid_string:if(typeof f.validation==="object")if("includes"in f.validation){if(W=`Invalid input: must include "${f.validation.includes}"`,typeof f.validation.position==="number")W=`${W} at one or more positions greater than or equal to ${f.validation.position}`}else if("startsWith"in f.validation)W=`Invalid input: must start with "${f.validation.startsWith}"`;else if("endsWith"in f.validation)W=`Invalid input: must end with "${f.validation.endsWith}"`;else Ov.assertNever(f.validation);else if(f.validation!=="regex")W=`Invalid ${f.validation}`;else W="Invalid";break;case l.too_small:if(f.type==="array")W=`Array must contain ${f.exact?"exactly":f.inclusive?"at least":"more than"} ${f.minimum} element(s)`;else if(f.type==="string")W=`String must contain ${f.exact?"exactly":f.inclusive?"at least":"over"} ${f.minimum} character(s)`;else if(f.type==="number")W=`Number must be ${f.exact?"exactly equal to ":f.inclusive?"greater than or equal to ":"greater than "}${f.minimum}`;else if(f.type==="bigint")W=`Number must be ${f.exact?"exactly equal to ":f.inclusive?"greater than or equal to ":"greater than "}${f.minimum}`;else if(f.type==="date")W=`Date must be ${f.exact?"exactly equal to ":f.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(f.minimum))}`;else W="Invalid input";break;case l.too_big:if(f.type==="array")W=`Array must contain ${f.exact?"exactly":f.inclusive?"at most":"less than"} ${f.maximum} element(s)`;else if(f.type==="string")W=`String must contain ${f.exact?"exactly":f.inclusive?"at most":"under"} ${f.maximum} character(s)`;else if(f.type==="number")W=`Number must be ${f.exact?"exactly":f.inclusive?"less than or equal to":"less than"} ${f.maximum}`;else if(f.type==="bigint")W=`BigInt must be ${f.exact?"exactly":f.inclusive?"less than or equal to":"less than"} ${f.maximum}`;else if(f.type==="date")W=`Date must be ${f.exact?"exactly":f.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(f.maximum))}`;else W="Invalid input";break;case l.custom:W="Invalid input";break;case l.invalid_intersection_types:W="Intersection results could not be merged";break;case l.not_multiple_of:W=`Number must be a multiple of ${f.multipleOf}`;break;case l.not_finite:W="Number must be finite";break;default:W=v.defaultError,Ov.assertNever(f)}return{message:W}},F1;var dW=jv(()=>{V8();AQ();F1=u5});function m5(f){f6=f}function u0(){return f6}var f6;var q8=jv(()=>{dW();f6=F1});function n(f,v){let W=u0(),X=UQ({issueData:v,data:f.data,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,W,W===F1?void 0:F1].filter((Q)=>!!Q)});f.common.issues.push(X)}class Wf{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(f,v){let W=[];for(let X of v){if(X.status==="aborted")return fv;if(X.status==="dirty")f.dirty();W.push(X.value)}return{status:f.value,value:W}}static async mergeObjectAsync(f,v){let W=[];for(let X of v){let Q=await X.key,P=await X.value;W.push({key:Q,value:P})}return Wf.mergeObjectSync(f,W)}static mergeObjectSync(f,v){let W={};for(let X of v){let{key:Q,value:P}=X;if(Q.status==="aborted")return fv;if(P.status==="aborted")return fv;if(Q.status==="dirty")f.dirty();if(P.status==="dirty")f.dirty();if(Q.value!=="__proto__"&&(typeof P.value!=="undefined"||X.alwaysSet))W[Q.value]=P.value}return{status:f.value,value:W}}}var UQ=(f)=>{let{data:v,path:W,errorMaps:X,issueData:Q}=f,P=[...W,...Q.path||[]],w={...Q,path:P};if(Q.message!==void 0)return{...Q,path:P,message:Q.message};let G="",B=X.filter((D)=>!!D).slice().reverse();for(let D of B)G=D(w,{data:v,defaultError:G}).message;return{...Q,path:P,message:G}},r5,fv,K0=(f)=>({status:"dirty",value:f}),Gf=(f)=>({status:"valid",value:f}),N8=(f)=>f.status==="aborted",E8=(f)=>f.status==="dirty",u1=(f)=>f.status==="valid",m0=(f)=>typeof Promise!=="undefined"&&f instanceof Promise;var sW=jv(()=>{q8();dW();r5=[];fv=Object.freeze({status:"aborted"})});var Q6=()=>{};var o;var W6=jv(()=>{(function(f){f.errToObj=(v)=>typeof v==="string"?{message:v}:v||{},f.toString=(v)=>typeof v==="string"?v:v?.message})(o||(o={}))});class df{constructor(f,v,W,X){this._cachedPath=[],this.parent=f,this.data=v,this._path=W,this._key=X}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function wv(f){if(!f)return{};let{errorMap:v,invalid_type_error:W,required_error:X,description:Q}=f;if(v&&(W||X))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(v)return{errorMap:v,description:Q};return{errorMap:(w,G)=>{let{message:B}=f;if(w.code==="invalid_enum_value")return{message:B??G.defaultError};if(typeof G.data==="undefined")return{message:B??X??G.defaultError};if(w.code!=="invalid_type")return{message:G.defaultError};return{message:B??W??G.defaultError}},description:Q}}class zv{get description(){return this._def.description}_getType(f){return B1(f.data)}_getOrReturnCtx(f,v){return v||{common:f.parent.common,data:f.data,parsedType:B1(f.data),schemaErrorMap:this._def.errorMap,path:f.path,parent:f.parent}}_processInputParams(f){return{status:new Wf,ctx:{common:f.parent.common,data:f.data,parsedType:B1(f.data),schemaErrorMap:this._def.errorMap,path:f.path,parent:f.parent}}}_parseSync(f){let v=this._parse(f);if(m0(v))throw new Error("Synchronous parse encountered promise.");return v}_parseAsync(f){let v=this._parse(f);return Promise.resolve(v)}parse(f,v){let W=this.safeParse(f,v);if(W.success)return W.data;throw W.error}safeParse(f,v){let W={common:{issues:[],async:v?.async??!1,contextualErrorMap:v?.errorMap},path:v?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:f,parsedType:B1(f)},X=this._parseSync({data:f,path:W.path,parent:W});return J6(W,X)}"~validate"(f){let v={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:f,parsedType:B1(f)};if(!this["~standard"].async)try{let W=this._parseSync({data:f,path:[],parent:v});return u1(W)?{value:W.value}:{issues:v.common.issues}}catch(W){if(W?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;v.common={issues:[],async:!0}}return this._parseAsync({data:f,path:[],parent:v}).then((W)=>u1(W)?{value:W.value}:{issues:v.common.issues})}async parseAsync(f,v){let W=await this.safeParseAsync(f,v);if(W.success)return W.data;throw W.error}async safeParseAsync(f,v){let W={common:{issues:[],contextualErrorMap:v?.errorMap,async:!0},path:v?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:f,parsedType:B1(f)},X=this._parse({data:f,path:W.path,parent:W}),Q=await(m0(X)?X:Promise.resolve(X));return J6(W,Q)}refine(f,v){let W=(X)=>{if(typeof v==="string"||typeof v==="undefined")return{message:v};else if(typeof v==="function")return v(X);else return v};return this._refinement((X,Q)=>{let P=f(X),w=()=>Q.addIssue({code:l.custom,...W(X)});if(typeof Promise!=="undefined"&&P instanceof Promise)return P.then((G)=>{if(!G)return w(),!1;else return!0});if(!P)return w(),!1;else return!0})}refinement(f,v){return this._refinement((W,X)=>{if(!f(W))return X.addIssue(typeof v==="function"?v(W,X):v),!1;else return!0})}_refinement(f){return new sf({schema:this,typeName:u.ZodEffects,effect:{type:"refinement",refinement:f}})}superRefine(f){return this._refinement(f)}constructor(f){this.spa=this.safeParseAsync,this._def=f,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(v)=>this["~validate"](v)}}optional(){return pf.create(this,this._def)}nullable(){return S1.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return nf.create(this)}promise(){return M0.create(this,this._def)}or(f){return i0.create([this,f],this._def)}and(f){return d0.create(this,f,this._def)}transform(f){return new sf({...wv(this._def),schema:this,typeName:u.ZodEffects,effect:{type:"transform",transform:f}})}default(f){let v=typeof f==="function"?f:()=>f;return new e0({...wv(this._def),innerType:this,defaultValue:v,typeName:u.ZodDefault})}brand(){return new U8({typeName:u.ZodBranded,type:this,...wv(this._def)})}catch(f){let v=typeof f==="function"?f:()=>f;return new vQ({...wv(this._def),innerType:this,catchValue:v,typeName:u.ZodCatch})}describe(f){return new this.constructor({...this._def,description:f})}pipe(f){return RQ.create(this,f)}readonly(){return fQ.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function Y6(f){let v="[0-5]\\d";if(f.precision)v=`${v}\\.\\d{${f.precision}}`;else if(f.precision==null)v=`${v}(\\.\\d+)?`;let W=f.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${v})${W}`}function P7(f){return new RegExp(`^${Y6(f)}$`)}function w6(f){let v=`${P6}T${Y6(f)}`,W=[];if(W.push(f.local?"Z?":"Z"),f.offset)W.push("([+-]\\d{2}:?\\d{2})");return v=`${v}(${W.join("|")})`,new RegExp(`^${v}$`)}function Y7(f,v){if((v==="v4"||!v)&&e5.test(f))return!0;if((v==="v6"||!v)&&f7.test(f))return!0;return!1}function w7(f,v){if(!d5.test(f))return!1;try{let[W]=f.split(".");if(!W)return!1;let X=W.replace(/-/g,"+").replace(/_/g,"/").padEnd(W.length+(4-W.length%4)%4,"="),Q=JSON.parse(atob(X));if(typeof Q!=="object"||Q===null)return!1;if("typ"in Q&&Q?.typ!=="JWT")return!1;if(!Q.alg)return!1;if(v&&Q.alg!==v)return!1;return!0}catch{return!1}}function G7(f,v){if((v==="v4"||!v)&&v7.test(f))return!0;if((v==="v6"||!v)&&Q7.test(f))return!0;return!1}function z7(f,v){let W=(f.toString().split(".")[1]||"").length,X=(v.toString().split(".")[1]||"").length,Q=W>X?W:X,P=Number.parseInt(f.toFixed(Q).replace(".","")),w=Number.parseInt(v.toFixed(Q).replace(".",""));return P%w/10**Q}function r0(f){if(f instanceof mv){let v={};for(let W in f.shape){let X=f.shape[W];v[W]=pf.create(r0(X))}return new mv({...f._def,shape:()=>v})}else if(f instanceof nf)return new nf({...f._def,type:r0(f.element)});else if(f instanceof pf)return pf.create(r0(f.unwrap()));else if(f instanceof S1)return S1.create(r0(f.unwrap()));else if(f instanceof h1)return h1.create(f.items.map((v)=>r0(v)));else return f}function tW(f,v){let W=B1(f),X=B1(v);if(f===v)return{valid:!0,data:f};else if(W===r.object&&X===r.object){let Q=Ov.objectKeys(v),P=Ov.objectKeys(f).filter((G)=>Q.indexOf(G)!==-1),w={...f,...v};for(let G of P){let B=tW(f[G],v[G]);if(!B.valid)return{valid:!1};w[G]=B.data}return{valid:!0,data:w}}else if(W===r.array&&X===r.array){if(f.length!==v.length)return{valid:!1};let Q=[];for(let P=0;P<f.length;P++){let w=f[P],G=v[P],B=tW(w,G);if(!B.valid)return{valid:!1};Q.push(B.data)}return{valid:!0,data:Q}}else if(W===r.date&&X===r.date&&+f===+v)return{valid:!0,data:f};else return{valid:!1}}function G6(f,v){return new c1({values:f,typeName:u.ZodEnum,...wv(v)})}function X6(f,v){let W=typeof f==="function"?f(v):typeof f==="string"?{message:f}:f;return typeof W==="string"?{message:W}:W}function z6(f,v={},W){if(f)return $0.create().superRefine((X,Q)=>{let P=f(X);if(P instanceof Promise)return P.then((w)=>{if(!w){let G=X6(v,X),B=G.fatal??W??!0;Q.addIssue({code:"custom",...G,fatal:B})}});if(!P){let w=X6(v,X),G=w.fatal??W??!0;Q.addIssue({code:"custom",...w,fatal:G})}return});return $0.create()}var J6=(f,v)=>{if(u1(v))return{success:!0,data:v.value};else{if(!f.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let W=new Vf(f.common.issues);return this._error=W,this._error}}}},a5,c5,n5,p5,i5,d5,s5,o5,t5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",oW,e5,v7,f7,Q7,W7,J7,P6="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",X7,cf,r1,a1,c0,h0,jQ,n0,p0,$0,m1,K1,FQ,nf,mv,i0,L1=(f)=>{if(f instanceof s0)return L1(f.schema);else if(f instanceof sf)return L1(f.innerType());else if(f instanceof o0)return[f.value];else if(f instanceof c1)return f.options;else if(f instanceof t0)return Ov.objectValues(f.enum);else if(f instanceof e0)return L1(f._def.innerType);else if(f instanceof n0)return[void 0];else if(f instanceof p0)return[null];else if(f instanceof pf)return[void 0,...L1(f.unwrap())];else if(f instanceof S1)return[null,...L1(f.unwrap())];else if(f instanceof U8)return L1(f.unwrap());else if(f instanceof fQ)return L1(f.unwrap());else if(f instanceof vQ)return L1(f._def.innerType);else return[]},A8,d0,h1,LQ,SQ,D0,a0,s0,o0,c1,t0,M0,sf,pf,S1,e0,vQ,gQ,B7,U8,RQ,fQ,K7,u,h7=(f,v={message:`Input not instance of ${f.name}`})=>z6((W)=>W instanceof f,v),B6,K6,$7,D7,h6,M7,O7,H7,V7,q7,N7,E7,A7,U7,j7,F7,L7,S7,g7,R7,_7,k7,I7,Z7,C7,y7,T7,x7,l7,b7,u7,m7,r7,a7,c7=()=>B6().optional(),n7=()=>K6().optional(),p7=()=>h6().optional(),i7,d7;var $6=jv(()=>{V8();q8();W6();sW();AQ();a5=/^c[^\s-]{8,}$/i,c5=/^[0-9a-z]+$/,n5=/^[0-9A-HJKMNP-TV-Z]{26}$/i,p5=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,i5=/^[a-z0-9_-]{21}$/i,d5=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,s5=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,o5=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,e5=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,v7=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,f7=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Q7=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,W7=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,J7=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,X7=new RegExp(`^${P6}$`);cf=class cf extends zv{_parse(f){if(this._def.coerce)f.data=String(f.data);if(this._getType(f)!==r.string){let Q=this._getOrReturnCtx(f);return n(Q,{code:l.invalid_type,expected:r.string,received:Q.parsedType}),fv}let W=new Wf,X=void 0;for(let Q of this._def.checks)if(Q.kind==="min"){if(f.data.length<Q.value)X=this._getOrReturnCtx(f,X),n(X,{code:l.too_small,minimum:Q.value,type:"string",inclusive:!0,exact:!1,message:Q.message}),W.dirty()}else if(Q.kind==="max"){if(f.data.length>Q.value)X=this._getOrReturnCtx(f,X),n(X,{code:l.too_big,maximum:Q.value,type:"string",inclusive:!0,exact:!1,message:Q.message}),W.dirty()}else if(Q.kind==="length"){let P=f.data.length>Q.value,w=f.data.length<Q.value;if(P||w){if(X=this._getOrReturnCtx(f,X),P)n(X,{code:l.too_big,maximum:Q.value,type:"string",inclusive:!0,exact:!0,message:Q.message});else if(w)n(X,{code:l.too_small,minimum:Q.value,type:"string",inclusive:!0,exact:!0,message:Q.message});W.dirty()}}else if(Q.kind==="email"){if(!o5.test(f.data))X=this._getOrReturnCtx(f,X),n(X,{validation:"email",code:l.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="emoji"){if(!oW)oW=new RegExp(t5,"u");if(!oW.test(f.data))X=this._getOrReturnCtx(f,X),n(X,{validation:"emoji",code:l.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="uuid"){if(!p5.test(f.data))X=this._getOrReturnCtx(f,X),n(X,{validation:"uuid",code:l.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="nanoid"){if(!i5.test(f.data))X=this._getOrReturnCtx(f,X),n(X,{validation:"nanoid",code:l.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="cuid"){if(!a5.test(f.data))X=this._getOrReturnCtx(f,X),n(X,{validation:"cuid",code:l.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="cuid2"){if(!c5.test(f.data))X=this._getOrReturnCtx(f,X),n(X,{validation:"cuid2",code:l.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="ulid"){if(!n5.test(f.data))X=this._getOrReturnCtx(f,X),n(X,{validation:"ulid",code:l.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="url")try{new URL(f.data)}catch{X=this._getOrReturnCtx(f,X),n(X,{validation:"url",code:l.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="regex"){if(Q.regex.lastIndex=0,!Q.regex.test(f.data))X=this._getOrReturnCtx(f,X),n(X,{validation:"regex",code:l.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="trim")f.data=f.data.trim();else if(Q.kind==="includes"){if(!f.data.includes(Q.value,Q.position))X=this._getOrReturnCtx(f,X),n(X,{code:l.invalid_string,validation:{includes:Q.value,position:Q.position},message:Q.message}),W.dirty()}else if(Q.kind==="toLowerCase")f.data=f.data.toLowerCase();else if(Q.kind==="toUpperCase")f.data=f.data.toUpperCase();else if(Q.kind==="startsWith"){if(!f.data.startsWith(Q.value))X=this._getOrReturnCtx(f,X),n(X,{code:l.invalid_string,validation:{startsWith:Q.value},message:Q.message}),W.dirty()}else if(Q.kind==="endsWith"){if(!f.data.endsWith(Q.value))X=this._getOrReturnCtx(f,X),n(X,{code:l.invalid_string,validation:{endsWith:Q.value},message:Q.message}),W.dirty()}else if(Q.kind==="datetime"){if(!w6(Q).test(f.data))X=this._getOrReturnCtx(f,X),n(X,{code:l.invalid_string,validation:"datetime",message:Q.message}),W.dirty()}else if(Q.kind==="date"){if(!X7.test(f.data))X=this._getOrReturnCtx(f,X),n(X,{code:l.invalid_string,validation:"date",message:Q.message}),W.dirty()}else if(Q.kind==="time"){if(!P7(Q).test(f.data))X=this._getOrReturnCtx(f,X),n(X,{code:l.invalid_string,validation:"time",message:Q.message}),W.dirty()}else if(Q.kind==="duration"){if(!s5.test(f.data))X=this._getOrReturnCtx(f,X),n(X,{validation:"duration",code:l.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="ip"){if(!Y7(f.data,Q.version))X=this._getOrReturnCtx(f,X),n(X,{validation:"ip",code:l.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="jwt"){if(!w7(f.data,Q.alg))X=this._getOrReturnCtx(f,X),n(X,{validation:"jwt",code:l.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="cidr"){if(!G7(f.data,Q.version))X=this._getOrReturnCtx(f,X),n(X,{validation:"cidr",code:l.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="base64"){if(!W7.test(f.data))X=this._getOrReturnCtx(f,X),n(X,{validation:"base64",code:l.invalid_string,message:Q.message}),W.dirty()}else if(Q.kind==="base64url"){if(!J7.test(f.data))X=this._getOrReturnCtx(f,X),n(X,{validation:"base64url",code:l.invalid_string,message:Q.message}),W.dirty()}else Ov.assertNever(Q);return{status:W.value,value:f.data}}_regex(f,v,W){return this.refinement((X)=>f.test(X),{validation:v,code:l.invalid_string,...o.errToObj(W)})}_addCheck(f){return new cf({...this._def,checks:[...this._def.checks,f]})}email(f){return this._addCheck({kind:"email",...o.errToObj(f)})}url(f){return this._addCheck({kind:"url",...o.errToObj(f)})}emoji(f){return this._addCheck({kind:"emoji",...o.errToObj(f)})}uuid(f){return this._addCheck({kind:"uuid",...o.errToObj(f)})}nanoid(f){return this._addCheck({kind:"nanoid",...o.errToObj(f)})}cuid(f){return this._addCheck({kind:"cuid",...o.errToObj(f)})}cuid2(f){return this._addCheck({kind:"cuid2",...o.errToObj(f)})}ulid(f){return this._addCheck({kind:"ulid",...o.errToObj(f)})}base64(f){return this._addCheck({kind:"base64",...o.errToObj(f)})}base64url(f){return this._addCheck({kind:"base64url",...o.errToObj(f)})}jwt(f){return this._addCheck({kind:"jwt",...o.errToObj(f)})}ip(f){return this._addCheck({kind:"ip",...o.errToObj(f)})}cidr(f){return this._addCheck({kind:"cidr",...o.errToObj(f)})}datetime(f){if(typeof f==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:f});return this._addCheck({kind:"datetime",precision:typeof f?.precision==="undefined"?null:f?.precision,offset:f?.offset??!1,local:f?.local??!1,...o.errToObj(f?.message)})}date(f){return this._addCheck({kind:"date",message:f})}time(f){if(typeof f==="string")return this._addCheck({kind:"time",precision:null,message:f});return this._addCheck({kind:"time",precision:typeof f?.precision==="undefined"?null:f?.precision,...o.errToObj(f?.message)})}duration(f){return this._addCheck({kind:"duration",...o.errToObj(f)})}regex(f,v){return this._addCheck({kind:"regex",regex:f,...o.errToObj(v)})}includes(f,v){return this._addCheck({kind:"includes",value:f,position:v?.position,...o.errToObj(v?.message)})}startsWith(f,v){return this._addCheck({kind:"startsWith",value:f,...o.errToObj(v)})}endsWith(f,v){return this._addCheck({kind:"endsWith",value:f,...o.errToObj(v)})}min(f,v){return this._addCheck({kind:"min",value:f,...o.errToObj(v)})}max(f,v){return this._addCheck({kind:"max",value:f,...o.errToObj(v)})}length(f,v){return this._addCheck({kind:"length",value:f,...o.errToObj(v)})}nonempty(f){return this.min(1,o.errToObj(f))}trim(){return new cf({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new cf({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new cf({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((f)=>f.kind==="datetime")}get isDate(){return!!this._def.checks.find((f)=>f.kind==="date")}get isTime(){return!!this._def.checks.find((f)=>f.kind==="time")}get isDuration(){return!!this._def.checks.find((f)=>f.kind==="duration")}get isEmail(){return!!this._def.checks.find((f)=>f.kind==="email")}get isURL(){return!!this._def.checks.find((f)=>f.kind==="url")}get isEmoji(){return!!this._def.checks.find((f)=>f.kind==="emoji")}get isUUID(){return!!this._def.checks.find((f)=>f.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((f)=>f.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((f)=>f.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((f)=>f.kind==="cuid2")}get isULID(){return!!this._def.checks.find((f)=>f.kind==="ulid")}get isIP(){return!!this._def.checks.find((f)=>f.kind==="ip")}get isCIDR(){return!!this._def.checks.find((f)=>f.kind==="cidr")}get isBase64(){return!!this._def.checks.find((f)=>f.kind==="base64")}get isBase64url(){return!!this._def.checks.find((f)=>f.kind==="base64url")}get minLength(){let f=null;for(let v of this._def.checks)if(v.kind==="min"){if(f===null||v.value>f)f=v.value}return f}get maxLength(){let f=null;for(let v of this._def.checks)if(v.kind==="max"){if(f===null||v.value<f)f=v.value}return f}};cf.create=(f)=>{return new cf({checks:[],typeName:u.ZodString,coerce:f?.coerce??!1,...wv(f)})};r1=class r1 extends zv{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(f){if(this._def.coerce)f.data=Number(f.data);if(this._getType(f)!==r.number){let Q=this._getOrReturnCtx(f);return n(Q,{code:l.invalid_type,expected:r.number,received:Q.parsedType}),fv}let W=void 0,X=new Wf;for(let Q of this._def.checks)if(Q.kind==="int"){if(!Ov.isInteger(f.data))W=this._getOrReturnCtx(f,W),n(W,{code:l.invalid_type,expected:"integer",received:"float",message:Q.message}),X.dirty()}else if(Q.kind==="min"){if(Q.inclusive?f.data<Q.value:f.data<=Q.value)W=this._getOrReturnCtx(f,W),n(W,{code:l.too_small,minimum:Q.value,type:"number",inclusive:Q.inclusive,exact:!1,message:Q.message}),X.dirty()}else if(Q.kind==="max"){if(Q.inclusive?f.data>Q.value:f.data>=Q.value)W=this._getOrReturnCtx(f,W),n(W,{code:l.too_big,maximum:Q.value,type:"number",inclusive:Q.inclusive,exact:!1,message:Q.message}),X.dirty()}else if(Q.kind==="multipleOf"){if(z7(f.data,Q.value)!==0)W=this._getOrReturnCtx(f,W),n(W,{code:l.not_multiple_of,multipleOf:Q.value,message:Q.message}),X.dirty()}else if(Q.kind==="finite"){if(!Number.isFinite(f.data))W=this._getOrReturnCtx(f,W),n(W,{code:l.not_finite,message:Q.message}),X.dirty()}else Ov.assertNever(Q);return{status:X.value,value:f.data}}gte(f,v){return this.setLimit("min",f,!0,o.toString(v))}gt(f,v){return this.setLimit("min",f,!1,o.toString(v))}lte(f,v){return this.setLimit("max",f,!0,o.toString(v))}lt(f,v){return this.setLimit("max",f,!1,o.toString(v))}setLimit(f,v,W,X){return new r1({...this._def,checks:[...this._def.checks,{kind:f,value:v,inclusive:W,message:o.toString(X)}]})}_addCheck(f){return new r1({...this._def,checks:[...this._def.checks,f]})}int(f){return this._addCheck({kind:"int",message:o.toString(f)})}positive(f){return this._addCheck({kind:"min",value:0,inclusive:!1,message:o.toString(f)})}negative(f){return this._addCheck({kind:"max",value:0,inclusive:!1,message:o.toString(f)})}nonpositive(f){return this._addCheck({kind:"max",value:0,inclusive:!0,message:o.toString(f)})}nonnegative(f){return this._addCheck({kind:"min",value:0,inclusive:!0,message:o.toString(f)})}multipleOf(f,v){return this._addCheck({kind:"multipleOf",value:f,message:o.toString(v)})}finite(f){return this._addCheck({kind:"finite",message:o.toString(f)})}safe(f){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:o.toString(f)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:o.toString(f)})}get minValue(){let f=null;for(let v of this._def.checks)if(v.kind==="min"){if(f===null||v.value>f)f=v.value}return f}get maxValue(){let f=null;for(let v of this._def.checks)if(v.kind==="max"){if(f===null||v.value<f)f=v.value}return f}get isInt(){return!!this._def.checks.find((f)=>f.kind==="int"||f.kind==="multipleOf"&&Ov.isInteger(f.value))}get isFinite(){let f=null,v=null;for(let W of this._def.checks)if(W.kind==="finite"||W.kind==="int"||W.kind==="multipleOf")return!0;else if(W.kind==="min"){if(v===null||W.value>v)v=W.value}else if(W.kind==="max"){if(f===null||W.value<f)f=W.value}return Number.isFinite(v)&&Number.isFinite(f)}};r1.create=(f)=>{return new r1({checks:[],typeName:u.ZodNumber,coerce:f?.coerce||!1,...wv(f)})};a1=class a1 extends zv{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(f){if(this._def.coerce)try{f.data=BigInt(f.data)}catch{return this._getInvalidInput(f)}if(this._getType(f)!==r.bigint)return this._getInvalidInput(f);let W=void 0,X=new Wf;for(let Q of this._def.checks)if(Q.kind==="min"){if(Q.inclusive?f.data<Q.value:f.data<=Q.value)W=this._getOrReturnCtx(f,W),n(W,{code:l.too_small,type:"bigint",minimum:Q.value,inclusive:Q.inclusive,message:Q.message}),X.dirty()}else if(Q.kind==="max"){if(Q.inclusive?f.data>Q.value:f.data>=Q.value)W=this._getOrReturnCtx(f,W),n(W,{code:l.too_big,type:"bigint",maximum:Q.value,inclusive:Q.inclusive,message:Q.message}),X.dirty()}else if(Q.kind==="multipleOf"){if(f.data%Q.value!==BigInt(0))W=this._getOrReturnCtx(f,W),n(W,{code:l.not_multiple_of,multipleOf:Q.value,message:Q.message}),X.dirty()}else Ov.assertNever(Q);return{status:X.value,value:f.data}}_getInvalidInput(f){let v=this._getOrReturnCtx(f);return n(v,{code:l.invalid_type,expected:r.bigint,received:v.parsedType}),fv}gte(f,v){return this.setLimit("min",f,!0,o.toString(v))}gt(f,v){return this.setLimit("min",f,!1,o.toString(v))}lte(f,v){return this.setLimit("max",f,!0,o.toString(v))}lt(f,v){return this.setLimit("max",f,!1,o.toString(v))}setLimit(f,v,W,X){return new a1({...this._def,checks:[...this._def.checks,{kind:f,value:v,inclusive:W,message:o.toString(X)}]})}_addCheck(f){return new a1({...this._def,checks:[...this._def.checks,f]})}positive(f){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:o.toString(f)})}negative(f){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:o.toString(f)})}nonpositive(f){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:o.toString(f)})}nonnegative(f){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:o.toString(f)})}multipleOf(f,v){return this._addCheck({kind:"multipleOf",value:f,message:o.toString(v)})}get minValue(){let f=null;for(let v of this._def.checks)if(v.kind==="min"){if(f===null||v.value>f)f=v.value}return f}get maxValue(){let f=null;for(let v of this._def.checks)if(v.kind==="max"){if(f===null||v.value<f)f=v.value}return f}};a1.create=(f)=>{return new a1({checks:[],typeName:u.ZodBigInt,coerce:f?.coerce??!1,...wv(f)})};c0=class c0 extends zv{_parse(f){if(this._def.coerce)f.data=Boolean(f.data);if(this._getType(f)!==r.boolean){let W=this._getOrReturnCtx(f);return n(W,{code:l.invalid_type,expected:r.boolean,received:W.parsedType}),fv}return Gf(f.data)}};c0.create=(f)=>{return new c0({typeName:u.ZodBoolean,coerce:f?.coerce||!1,...wv(f)})};h0=class h0 extends zv{_parse(f){if(this._def.coerce)f.data=new Date(f.data);if(this._getType(f)!==r.date){let Q=this._getOrReturnCtx(f);return n(Q,{code:l.invalid_type,expected:r.date,received:Q.parsedType}),fv}if(Number.isNaN(f.data.getTime())){let Q=this._getOrReturnCtx(f);return n(Q,{code:l.invalid_date}),fv}let W=new Wf,X=void 0;for(let Q of this._def.checks)if(Q.kind==="min"){if(f.data.getTime()<Q.value)X=this._getOrReturnCtx(f,X),n(X,{code:l.too_small,message:Q.message,inclusive:!0,exact:!1,minimum:Q.value,type:"date"}),W.dirty()}else if(Q.kind==="max"){if(f.data.getTime()>Q.value)X=this._getOrReturnCtx(f,X),n(X,{code:l.too_big,message:Q.message,inclusive:!0,exact:!1,maximum:Q.value,type:"date"}),W.dirty()}else Ov.assertNever(Q);return{status:W.value,value:new Date(f.data.getTime())}}_addCheck(f){return new h0({...this._def,checks:[...this._def.checks,f]})}min(f,v){return this._addCheck({kind:"min",value:f.getTime(),message:o.toString(v)})}max(f,v){return this._addCheck({kind:"max",value:f.getTime(),message:o.toString(v)})}get minDate(){let f=null;for(let v of this._def.checks)if(v.kind==="min"){if(f===null||v.value>f)f=v.value}return f!=null?new Date(f):null}get maxDate(){let f=null;for(let v of this._def.checks)if(v.kind==="max"){if(f===null||v.value<f)f=v.value}return f!=null?new Date(f):null}};h0.create=(f)=>{return new h0({checks:[],coerce:f?.coerce||!1,typeName:u.ZodDate,...wv(f)})};jQ=class jQ extends zv{_parse(f){if(this._getType(f)!==r.symbol){let W=this._getOrReturnCtx(f);return n(W,{code:l.invalid_type,expected:r.symbol,received:W.parsedType}),fv}return Gf(f.data)}};jQ.create=(f)=>{return new jQ({typeName:u.ZodSymbol,...wv(f)})};n0=class n0 extends zv{_parse(f){if(this._getType(f)!==r.undefined){let W=this._getOrReturnCtx(f);return n(W,{code:l.invalid_type,expected:r.undefined,received:W.parsedType}),fv}return Gf(f.data)}};n0.create=(f)=>{return new n0({typeName:u.ZodUndefined,...wv(f)})};p0=class p0 extends zv{_parse(f){if(this._getType(f)!==r.null){let W=this._getOrReturnCtx(f);return n(W,{code:l.invalid_type,expected:r.null,received:W.parsedType}),fv}return Gf(f.data)}};p0.create=(f)=>{return new p0({typeName:u.ZodNull,...wv(f)})};$0=class $0 extends zv{constructor(){super(...arguments);this._any=!0}_parse(f){return Gf(f.data)}};$0.create=(f)=>{return new $0({typeName:u.ZodAny,...wv(f)})};m1=class m1 extends zv{constructor(){super(...arguments);this._unknown=!0}_parse(f){return Gf(f.data)}};m1.create=(f)=>{return new m1({typeName:u.ZodUnknown,...wv(f)})};K1=class K1 extends zv{_parse(f){let v=this._getOrReturnCtx(f);return n(v,{code:l.invalid_type,expected:r.never,received:v.parsedType}),fv}};K1.create=(f)=>{return new K1({typeName:u.ZodNever,...wv(f)})};FQ=class FQ extends zv{_parse(f){if(this._getType(f)!==r.undefined){let W=this._getOrReturnCtx(f);return n(W,{code:l.invalid_type,expected:r.void,received:W.parsedType}),fv}return Gf(f.data)}};FQ.create=(f)=>{return new FQ({typeName:u.ZodVoid,...wv(f)})};nf=class nf extends zv{_parse(f){let{ctx:v,status:W}=this._processInputParams(f),X=this._def;if(v.parsedType!==r.array)return n(v,{code:l.invalid_type,expected:r.array,received:v.parsedType}),fv;if(X.exactLength!==null){let P=v.data.length>X.exactLength.value,w=v.data.length<X.exactLength.value;if(P||w)n(v,{code:P?l.too_big:l.too_small,minimum:w?X.exactLength.value:void 0,maximum:P?X.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:X.exactLength.message}),W.dirty()}if(X.minLength!==null){if(v.data.length<X.minLength.value)n(v,{code:l.too_small,minimum:X.minLength.value,type:"array",inclusive:!0,exact:!1,message:X.minLength.message}),W.dirty()}if(X.maxLength!==null){if(v.data.length>X.maxLength.value)n(v,{code:l.too_big,maximum:X.maxLength.value,type:"array",inclusive:!0,exact:!1,message:X.maxLength.message}),W.dirty()}if(v.common.async)return Promise.all([...v.data].map((P,w)=>{return X.type._parseAsync(new df(v,P,v.path,w))})).then((P)=>{return Wf.mergeArray(W,P)});let Q=[...v.data].map((P,w)=>{return X.type._parseSync(new df(v,P,v.path,w))});return Wf.mergeArray(W,Q)}get element(){return this._def.type}min(f,v){return new nf({...this._def,minLength:{value:f,message:o.toString(v)}})}max(f,v){return new nf({...this._def,maxLength:{value:f,message:o.toString(v)}})}length(f,v){return new nf({...this._def,exactLength:{value:f,message:o.toString(v)}})}nonempty(f){return this.min(1,f)}};nf.create=(f,v)=>{return new nf({type:f,minLength:null,maxLength:null,exactLength:null,typeName:u.ZodArray,...wv(v)})};mv=class mv extends zv{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let f=this._def.shape(),v=Ov.objectKeys(f);return this._cached={shape:f,keys:v},this._cached}_parse(f){if(this._getType(f)!==r.object){let B=this._getOrReturnCtx(f);return n(B,{code:l.invalid_type,expected:r.object,received:B.parsedType}),fv}let{status:W,ctx:X}=this._processInputParams(f),{shape:Q,keys:P}=this._getCached(),w=[];if(!(this._def.catchall instanceof K1&&this._def.unknownKeys==="strip")){for(let B in X.data)if(!P.includes(B))w.push(B)}let G=[];for(let B of P){let D=Q[B],M=X.data[B];G.push({key:{status:"valid",value:B},value:D._parse(new df(X,M,X.path,B)),alwaysSet:B in X.data})}if(this._def.catchall instanceof K1){let B=this._def.unknownKeys;if(B==="passthrough")for(let D of w)G.push({key:{status:"valid",value:D},value:{status:"valid",value:X.data[D]}});else if(B==="strict"){if(w.length>0)n(X,{code:l.unrecognized_keys,keys:w}),W.dirty()}else if(B==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let B=this._def.catchall;for(let D of w){let M=X.data[D];G.push({key:{status:"valid",value:D},value:B._parse(new df(X,M,X.path,D)),alwaysSet:D in X.data})}}if(X.common.async)return Promise.resolve().then(async()=>{let B=[];for(let D of G){let M=await D.key,A=await D.value;B.push({key:M,value:A,alwaysSet:D.alwaysSet})}return B}).then((B)=>{return Wf.mergeObjectSync(W,B)});else return Wf.mergeObjectSync(W,G)}get shape(){return this._def.shape()}strict(f){return o.errToObj,new mv({...this._def,unknownKeys:"strict",...f!==void 0?{errorMap:(v,W)=>{let X=this._def.errorMap?.(v,W).message??W.defaultError;if(v.code==="unrecognized_keys")return{message:o.errToObj(f).message??X};return{message:X}}}:{}})}strip(){return new mv({...this._def,unknownKeys:"strip"})}passthrough(){return new mv({...this._def,unknownKeys:"passthrough"})}extend(f){return new mv({...this._def,shape:()=>({...this._def.shape(),...f})})}merge(f){return new mv({unknownKeys:f._def.unknownKeys,catchall:f._def.catchall,shape:()=>({...this._def.shape(),...f._def.shape()}),typeName:u.ZodObject})}setKey(f,v){return this.augment({[f]:v})}catchall(f){return new mv({...this._def,catchall:f})}pick(f){let v={};for(let W of Ov.objectKeys(f))if(f[W]&&this.shape[W])v[W]=this.shape[W];return new mv({...this._def,shape:()=>v})}omit(f){let v={};for(let W of Ov.objectKeys(this.shape))if(!f[W])v[W]=this.shape[W];return new mv({...this._def,shape:()=>v})}deepPartial(){return r0(this)}partial(f){let v={};for(let W of Ov.objectKeys(this.shape)){let X=this.shape[W];if(f&&!f[W])v[W]=X;else v[W]=X.optional()}return new mv({...this._def,shape:()=>v})}required(f){let v={};for(let W of Ov.objectKeys(this.shape))if(f&&!f[W])v[W]=this.shape[W];else{let Q=this.shape[W];while(Q instanceof pf)Q=Q._def.innerType;v[W]=Q}return new mv({...this._def,shape:()=>v})}keyof(){return G6(Ov.objectKeys(this.shape))}};mv.create=(f,v)=>{return new mv({shape:()=>f,unknownKeys:"strip",catchall:K1.create(),typeName:u.ZodObject,...wv(v)})};mv.strictCreate=(f,v)=>{return new mv({shape:()=>f,unknownKeys:"strict",catchall:K1.create(),typeName:u.ZodObject,...wv(v)})};mv.lazycreate=(f,v)=>{return new mv({shape:f,unknownKeys:"strip",catchall:K1.create(),typeName:u.ZodObject,...wv(v)})};i0=class i0 extends zv{_parse(f){let{ctx:v}=this._processInputParams(f),W=this._def.options;function X(Q){for(let w of Q)if(w.result.status==="valid")return w.result;for(let w of Q)if(w.result.status==="dirty")return v.common.issues.push(...w.ctx.common.issues),w.result;let P=Q.map((w)=>new Vf(w.ctx.common.issues));return n(v,{code:l.invalid_union,unionErrors:P}),fv}if(v.common.async)return Promise.all(W.map(async(Q)=>{let P={...v,common:{...v.common,issues:[]},parent:null};return{result:await Q._parseAsync({data:v.data,path:v.path,parent:P}),ctx:P}})).then(X);else{let Q=void 0,P=[];for(let G of W){let B={...v,common:{...v.common,issues:[]},parent:null},D=G._parseSync({data:v.data,path:v.path,parent:B});if(D.status==="valid")return D;else if(D.status==="dirty"&&!Q)Q={result:D,ctx:B};if(B.common.issues.length)P.push(B.common.issues)}if(Q)return v.common.issues.push(...Q.ctx.common.issues),Q.result;let w=P.map((G)=>new Vf(G));return n(v,{code:l.invalid_union,unionErrors:w}),fv}}get options(){return this._def.options}};i0.create=(f,v)=>{return new i0({options:f,typeName:u.ZodUnion,...wv(v)})};A8=class A8 extends zv{_parse(f){let{ctx:v}=this._processInputParams(f);if(v.parsedType!==r.object)return n(v,{code:l.invalid_type,expected:r.object,received:v.parsedType}),fv;let W=this.discriminator,X=v.data[W],Q=this.optionsMap.get(X);if(!Q)return n(v,{code:l.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[W]}),fv;if(v.common.async)return Q._parseAsync({data:v.data,path:v.path,parent:v});else return Q._parseSync({data:v.data,path:v.path,parent:v})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(f,v,W){let X=new Map;for(let Q of v){let P=L1(Q.shape[f]);if(!P.length)throw new Error(`A discriminator value for key \`${f}\` could not be extracted from all schema options`);for(let w of P){if(X.has(w))throw new Error(`Discriminator property ${String(f)} has duplicate value ${String(w)}`);X.set(w,Q)}}return new A8({typeName:u.ZodDiscriminatedUnion,discriminator:f,options:v,optionsMap:X,...wv(W)})}};d0=class d0 extends zv{_parse(f){let{status:v,ctx:W}=this._processInputParams(f),X=(Q,P)=>{if(N8(Q)||N8(P))return fv;let w=tW(Q.value,P.value);if(!w.valid)return n(W,{code:l.invalid_intersection_types}),fv;if(E8(Q)||E8(P))v.dirty();return{status:v.value,value:w.data}};if(W.common.async)return Promise.all([this._def.left._parseAsync({data:W.data,path:W.path,parent:W}),this._def.right._parseAsync({data:W.data,path:W.path,parent:W})]).then(([Q,P])=>X(Q,P));else return X(this._def.left._parseSync({data:W.data,path:W.path,parent:W}),this._def.right._parseSync({data:W.data,path:W.path,parent:W}))}};d0.create=(f,v,W)=>{return new d0({left:f,right:v,typeName:u.ZodIntersection,...wv(W)})};h1=class h1 extends zv{_parse(f){let{status:v,ctx:W}=this._processInputParams(f);if(W.parsedType!==r.array)return n(W,{code:l.invalid_type,expected:r.array,received:W.parsedType}),fv;if(W.data.length<this._def.items.length)return n(W,{code:l.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),fv;if(!this._def.rest&&W.data.length>this._def.items.length)n(W,{code:l.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),v.dirty();let Q=[...W.data].map((P,w)=>{let G=this._def.items[w]||this._def.rest;if(!G)return null;return G._parse(new df(W,P,W.path,w))}).filter((P)=>!!P);if(W.common.async)return Promise.all(Q).then((P)=>{return Wf.mergeArray(v,P)});else return Wf.mergeArray(v,Q)}get items(){return this._def.items}rest(f){return new h1({...this._def,rest:f})}};h1.create=(f,v)=>{if(!Array.isArray(f))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new h1({items:f,typeName:u.ZodTuple,rest:null,...wv(v)})};LQ=class LQ extends zv{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(f){let{status:v,ctx:W}=this._processInputParams(f);if(W.parsedType!==r.object)return n(W,{code:l.invalid_type,expected:r.object,received:W.parsedType}),fv;let X=[],Q=this._def.keyType,P=this._def.valueType;for(let w in W.data)X.push({key:Q._parse(new df(W,w,W.path,w)),value:P._parse(new df(W,W.data[w],W.path,w)),alwaysSet:w in W.data});if(W.common.async)return Wf.mergeObjectAsync(v,X);else return Wf.mergeObjectSync(v,X)}get element(){return this._def.valueType}static create(f,v,W){if(v instanceof zv)return new LQ({keyType:f,valueType:v,typeName:u.ZodRecord,...wv(W)});return new LQ({keyType:cf.create(),valueType:f,typeName:u.ZodRecord,...wv(v)})}};SQ=class SQ extends zv{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(f){let{status:v,ctx:W}=this._processInputParams(f);if(W.parsedType!==r.map)return n(W,{code:l.invalid_type,expected:r.map,received:W.parsedType}),fv;let X=this._def.keyType,Q=this._def.valueType,P=[...W.data.entries()].map(([w,G],B)=>{return{key:X._parse(new df(W,w,W.path,[B,"key"])),value:Q._parse(new df(W,G,W.path,[B,"value"]))}});if(W.common.async){let w=new Map;return Promise.resolve().then(async()=>{for(let G of P){let B=await G.key,D=await G.value;if(B.status==="aborted"||D.status==="aborted")return fv;if(B.status==="dirty"||D.status==="dirty")v.dirty();w.set(B.value,D.value)}return{status:v.value,value:w}})}else{let w=new Map;for(let G of P){let{key:B,value:D}=G;if(B.status==="aborted"||D.status==="aborted")return fv;if(B.status==="dirty"||D.status==="dirty")v.dirty();w.set(B.value,D.value)}return{status:v.value,value:w}}}};SQ.create=(f,v,W)=>{return new SQ({valueType:v,keyType:f,typeName:u.ZodMap,...wv(W)})};D0=class D0 extends zv{_parse(f){let{status:v,ctx:W}=this._processInputParams(f);if(W.parsedType!==r.set)return n(W,{code:l.invalid_type,expected:r.set,received:W.parsedType}),fv;let X=this._def;if(X.minSize!==null){if(W.data.size<X.minSize.value)n(W,{code:l.too_small,minimum:X.minSize.value,type:"set",inclusive:!0,exact:!1,message:X.minSize.message}),v.dirty()}if(X.maxSize!==null){if(W.data.size>X.maxSize.value)n(W,{code:l.too_big,maximum:X.maxSize.value,type:"set",inclusive:!0,exact:!1,message:X.maxSize.message}),v.dirty()}let Q=this._def.valueType;function P(G){let B=new Set;for(let D of G){if(D.status==="aborted")return fv;if(D.status==="dirty")v.dirty();B.add(D.value)}return{status:v.value,value:B}}let w=[...W.data.values()].map((G,B)=>Q._parse(new df(W,G,W.path,B)));if(W.common.async)return Promise.all(w).then((G)=>P(G));else return P(w)}min(f,v){return new D0({...this._def,minSize:{value:f,message:o.toString(v)}})}max(f,v){return new D0({...this._def,maxSize:{value:f,message:o.toString(v)}})}size(f,v){return this.min(f,v).max(f,v)}nonempty(f){return this.min(1,f)}};D0.create=(f,v)=>{return new D0({valueType:f,minSize:null,maxSize:null,typeName:u.ZodSet,...wv(v)})};a0=class a0 extends zv{constructor(){super(...arguments);this.validate=this.implement}_parse(f){let{ctx:v}=this._processInputParams(f);if(v.parsedType!==r.function)return n(v,{code:l.invalid_type,expected:r.function,received:v.parsedType}),fv;function W(w,G){return UQ({data:w,path:v.path,errorMaps:[v.common.contextualErrorMap,v.schemaErrorMap,u0(),F1].filter((B)=>!!B),issueData:{code:l.invalid_arguments,argumentsError:G}})}function X(w,G){return UQ({data:w,path:v.path,errorMaps:[v.common.contextualErrorMap,v.schemaErrorMap,u0(),F1].filter((B)=>!!B),issueData:{code:l.invalid_return_type,returnTypeError:G}})}let Q={errorMap:v.common.contextualErrorMap},P=v.data;if(this._def.returns instanceof M0){let w=this;return Gf(async function(...G){let B=new Vf([]),D=await w._def.args.parseAsync(G,Q).catch((N)=>{throw B.addIssue(W(G,N)),B}),M=await Reflect.apply(P,this,D);return await w._def.returns._def.type.parseAsync(M,Q).catch((N)=>{throw B.addIssue(X(M,N)),B})})}else{let w=this;return Gf(function(...G){let B=w._def.args.safeParse(G,Q);if(!B.success)throw new Vf([W(G,B.error)]);let D=Reflect.apply(P,this,B.data),M=w._def.returns.safeParse(D,Q);if(!M.success)throw new Vf([X(D,M.error)]);return M.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...f){return new a0({...this._def,args:h1.create(f).rest(m1.create())})}returns(f){return new a0({...this._def,returns:f})}implement(f){return this.parse(f)}strictImplement(f){return this.parse(f)}static create(f,v,W){return new a0({args:f?f:h1.create([]).rest(m1.create()),returns:v||m1.create(),typeName:u.ZodFunction,...wv(W)})}};s0=class s0 extends zv{get schema(){return this._def.getter()}_parse(f){let{ctx:v}=this._processInputParams(f);return this._def.getter()._parse({data:v.data,path:v.path,parent:v})}};s0.create=(f,v)=>{return new s0({getter:f,typeName:u.ZodLazy,...wv(v)})};o0=class o0 extends zv{_parse(f){if(f.data!==this._def.value){let v=this._getOrReturnCtx(f);return n(v,{received:v.data,code:l.invalid_literal,expected:this._def.value}),fv}return{status:"valid",value:f.data}}get value(){return this._def.value}};o0.create=(f,v)=>{return new o0({value:f,typeName:u.ZodLiteral,...wv(v)})};c1=class c1 extends zv{_parse(f){if(typeof f.data!=="string"){let v=this._getOrReturnCtx(f),W=this._def.values;return n(v,{expected:Ov.joinValues(W),received:v.parsedType,code:l.invalid_type}),fv}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(f.data)){let v=this._getOrReturnCtx(f),W=this._def.values;return n(v,{received:v.data,code:l.invalid_enum_value,options:W}),fv}return Gf(f.data)}get options(){return this._def.values}get enum(){let f={};for(let v of this._def.values)f[v]=v;return f}get Values(){let f={};for(let v of this._def.values)f[v]=v;return f}get Enum(){let f={};for(let v of this._def.values)f[v]=v;return f}extract(f,v=this._def){return c1.create(f,{...this._def,...v})}exclude(f,v=this._def){return c1.create(this.options.filter((W)=>!f.includes(W)),{...this._def,...v})}};c1.create=G6;t0=class t0 extends zv{_parse(f){let v=Ov.getValidEnumValues(this._def.values),W=this._getOrReturnCtx(f);if(W.parsedType!==r.string&&W.parsedType!==r.number){let X=Ov.objectValues(v);return n(W,{expected:Ov.joinValues(X),received:W.parsedType,code:l.invalid_type}),fv}if(!this._cache)this._cache=new Set(Ov.getValidEnumValues(this._def.values));if(!this._cache.has(f.data)){let X=Ov.objectValues(v);return n(W,{received:W.data,code:l.invalid_enum_value,options:X}),fv}return Gf(f.data)}get enum(){return this._def.values}};t0.create=(f,v)=>{return new t0({values:f,typeName:u.ZodNativeEnum,...wv(v)})};M0=class M0 extends zv{unwrap(){return this._def.type}_parse(f){let{ctx:v}=this._processInputParams(f);if(v.parsedType!==r.promise&&v.common.async===!1)return n(v,{code:l.invalid_type,expected:r.promise,received:v.parsedType}),fv;let W=v.parsedType===r.promise?v.data:Promise.resolve(v.data);return Gf(W.then((X)=>{return this._def.type.parseAsync(X,{path:v.path,errorMap:v.common.contextualErrorMap})}))}};M0.create=(f,v)=>{return new M0({type:f,typeName:u.ZodPromise,...wv(v)})};sf=class sf extends zv{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===u.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(f){let{status:v,ctx:W}=this._processInputParams(f),X=this._def.effect||null,Q={addIssue:(P)=>{if(n(W,P),P.fatal)v.abort();else v.dirty()},get path(){return W.path}};if(Q.addIssue=Q.addIssue.bind(Q),X.type==="preprocess"){let P=X.transform(W.data,Q);if(W.common.async)return Promise.resolve(P).then(async(w)=>{if(v.value==="aborted")return fv;let G=await this._def.schema._parseAsync({data:w,path:W.path,parent:W});if(G.status==="aborted")return fv;if(G.status==="dirty")return K0(G.value);if(v.value==="dirty")return K0(G.value);return G});else{if(v.value==="aborted")return fv;let w=this._def.schema._parseSync({data:P,path:W.path,parent:W});if(w.status==="aborted")return fv;if(w.status==="dirty")return K0(w.value);if(v.value==="dirty")return K0(w.value);return w}}if(X.type==="refinement"){let P=(w)=>{let G=X.refinement(w,Q);if(W.common.async)return Promise.resolve(G);if(G instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return w};if(W.common.async===!1){let w=this._def.schema._parseSync({data:W.data,path:W.path,parent:W});if(w.status==="aborted")return fv;if(w.status==="dirty")v.dirty();return P(w.value),{status:v.value,value:w.value}}else return this._def.schema._parseAsync({data:W.data,path:W.path,parent:W}).then((w)=>{if(w.status==="aborted")return fv;if(w.status==="dirty")v.dirty();return P(w.value).then(()=>{return{status:v.value,value:w.value}})})}if(X.type==="transform")if(W.common.async===!1){let P=this._def.schema._parseSync({data:W.data,path:W.path,parent:W});if(!u1(P))return fv;let w=X.transform(P.value,Q);if(w instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:v.value,value:w}}else return this._def.schema._parseAsync({data:W.data,path:W.path,parent:W}).then((P)=>{if(!u1(P))return fv;return Promise.resolve(X.transform(P.value,Q)).then((w)=>({status:v.value,value:w}))});Ov.assertNever(X)}};sf.create=(f,v,W)=>{return new sf({schema:f,typeName:u.ZodEffects,effect:v,...wv(W)})};sf.createWithPreprocess=(f,v,W)=>{return new sf({schema:v,effect:{type:"preprocess",transform:f},typeName:u.ZodEffects,...wv(W)})};pf=class pf extends zv{_parse(f){if(this._getType(f)===r.undefined)return Gf(void 0);return this._def.innerType._parse(f)}unwrap(){return this._def.innerType}};pf.create=(f,v)=>{return new pf({innerType:f,typeName:u.ZodOptional,...wv(v)})};S1=class S1 extends zv{_parse(f){if(this._getType(f)===r.null)return Gf(null);return this._def.innerType._parse(f)}unwrap(){return this._def.innerType}};S1.create=(f,v)=>{return new S1({innerType:f,typeName:u.ZodNullable,...wv(v)})};e0=class e0 extends zv{_parse(f){let{ctx:v}=this._processInputParams(f),W=v.data;if(v.parsedType===r.undefined)W=this._def.defaultValue();return this._def.innerType._parse({data:W,path:v.path,parent:v})}removeDefault(){return this._def.innerType}};e0.create=(f,v)=>{return new e0({innerType:f,typeName:u.ZodDefault,defaultValue:typeof v.default==="function"?v.default:()=>v.default,...wv(v)})};vQ=class vQ extends zv{_parse(f){let{ctx:v}=this._processInputParams(f),W={...v,common:{...v.common,issues:[]}},X=this._def.innerType._parse({data:W.data,path:W.path,parent:{...W}});if(m0(X))return X.then((Q)=>{return{status:"valid",value:Q.status==="valid"?Q.value:this._def.catchValue({get error(){return new Vf(W.common.issues)},input:W.data})}});else return{status:"valid",value:X.status==="valid"?X.value:this._def.catchValue({get error(){return new Vf(W.common.issues)},input:W.data})}}removeCatch(){return this._def.innerType}};vQ.create=(f,v)=>{return new vQ({innerType:f,typeName:u.ZodCatch,catchValue:typeof v.catch==="function"?v.catch:()=>v.catch,...wv(v)})};gQ=class gQ extends zv{_parse(f){if(this._getType(f)!==r.nan){let W=this._getOrReturnCtx(f);return n(W,{code:l.invalid_type,expected:r.nan,received:W.parsedType}),fv}return{status:"valid",value:f.data}}};gQ.create=(f)=>{return new gQ({typeName:u.ZodNaN,...wv(f)})};B7=Symbol("zod_brand");U8=class U8 extends zv{_parse(f){let{ctx:v}=this._processInputParams(f),W=v.data;return this._def.type._parse({data:W,path:v.path,parent:v})}unwrap(){return this._def.type}};RQ=class RQ extends zv{_parse(f){let{status:v,ctx:W}=this._processInputParams(f);if(W.common.async)return(async()=>{let Q=await this._def.in._parseAsync({data:W.data,path:W.path,parent:W});if(Q.status==="aborted")return fv;if(Q.status==="dirty")return v.dirty(),K0(Q.value);else return this._def.out._parseAsync({data:Q.value,path:W.path,parent:W})})();else{let X=this._def.in._parseSync({data:W.data,path:W.path,parent:W});if(X.status==="aborted")return fv;if(X.status==="dirty")return v.dirty(),{status:"dirty",value:X.value};else return this._def.out._parseSync({data:X.value,path:W.path,parent:W})}}static create(f,v){return new RQ({in:f,out:v,typeName:u.ZodPipeline})}};fQ=class fQ extends zv{_parse(f){let v=this._def.innerType._parse(f),W=(X)=>{if(u1(X))X.value=Object.freeze(X.value);return X};return m0(v)?v.then((X)=>W(X)):W(v)}unwrap(){return this._def.innerType}};fQ.create=(f,v)=>{return new fQ({innerType:f,typeName:u.ZodReadonly,...wv(v)})};K7={object:mv.lazycreate};(function(f){f.ZodString="ZodString",f.ZodNumber="ZodNumber",f.ZodNaN="ZodNaN",f.ZodBigInt="ZodBigInt",f.ZodBoolean="ZodBoolean",f.ZodDate="ZodDate",f.ZodSymbol="ZodSymbol",f.ZodUndefined="ZodUndefined",f.ZodNull="ZodNull",f.ZodAny="ZodAny",f.ZodUnknown="ZodUnknown",f.ZodNever="ZodNever",f.ZodVoid="ZodVoid",f.ZodArray="ZodArray",f.ZodObject="ZodObject",f.ZodUnion="ZodUnion",f.ZodDiscriminatedUnion="ZodDiscriminatedUnion",f.ZodIntersection="ZodIntersection",f.ZodTuple="ZodTuple",f.ZodRecord="ZodRecord",f.ZodMap="ZodMap",f.ZodSet="ZodSet",f.ZodFunction="ZodFunction",f.ZodLazy="ZodLazy",f.ZodLiteral="ZodLiteral",f.ZodEnum="ZodEnum",f.ZodEffects="ZodEffects",f.ZodNativeEnum="ZodNativeEnum",f.ZodOptional="ZodOptional",f.ZodNullable="ZodNullable",f.ZodDefault="ZodDefault",f.ZodCatch="ZodCatch",f.ZodPromise="ZodPromise",f.ZodBranded="ZodBranded",f.ZodPipeline="ZodPipeline",f.ZodReadonly="ZodReadonly"})(u||(u={}));B6=cf.create,K6=r1.create,$7=gQ.create,D7=a1.create,h6=c0.create,M7=h0.create,O7=jQ.create,H7=n0.create,V7=p0.create,q7=$0.create,N7=m1.create,E7=K1.create,A7=FQ.create,U7=nf.create,j7=mv.create,F7=mv.strictCreate,L7=i0.create,S7=A8.create,g7=d0.create,R7=h1.create,_7=LQ.create,k7=SQ.create,I7=D0.create,Z7=a0.create,C7=s0.create,y7=o0.create,T7=c1.create,x7=t0.create,l7=M0.create,b7=sf.create,u7=pf.create,m7=S1.create,r7=sf.createWithPreprocess,a7=RQ.create,i7={string:(f)=>cf.create({...f,coerce:!0}),number:(f)=>r1.create({...f,coerce:!0}),boolean:(f)=>c0.create({...f,coerce:!0}),bigint:(f)=>a1.create({...f,coerce:!0}),date:(f)=>h0.create({...f,coerce:!0})},d7=fv});var K={};pW(K,{void:()=>A7,util:()=>Ov,unknown:()=>N7,union:()=>L7,undefined:()=>H7,tuple:()=>R7,transformer:()=>b7,symbol:()=>O7,string:()=>B6,strictObject:()=>F7,setErrorMap:()=>m5,set:()=>I7,record:()=>_7,quotelessJson:()=>b5,promise:()=>l7,preprocess:()=>r7,pipeline:()=>a7,ostring:()=>c7,optional:()=>u7,onumber:()=>n7,oboolean:()=>p7,objectUtil:()=>iW,object:()=>j7,number:()=>K6,nullable:()=>m7,null:()=>V7,never:()=>E7,nativeEnum:()=>x7,nan:()=>$7,map:()=>k7,makeIssue:()=>UQ,literal:()=>y7,lazy:()=>C7,late:()=>K7,isValid:()=>u1,isDirty:()=>E8,isAsync:()=>m0,isAborted:()=>N8,intersection:()=>g7,instanceof:()=>h7,getParsedType:()=>B1,getErrorMap:()=>u0,function:()=>Z7,enum:()=>T7,effect:()=>b7,discriminatedUnion:()=>S7,defaultErrorMap:()=>F1,datetimeRegex:()=>w6,date:()=>M7,custom:()=>z6,coerce:()=>i7,boolean:()=>h6,bigint:()=>D7,array:()=>U7,any:()=>q7,addIssueToContext:()=>n,ZodVoid:()=>FQ,ZodUnknown:()=>m1,ZodUnion:()=>i0,ZodUndefined:()=>n0,ZodType:()=>zv,ZodTuple:()=>h1,ZodTransformer:()=>sf,ZodSymbol:()=>jQ,ZodString:()=>cf,ZodSet:()=>D0,ZodSchema:()=>zv,ZodRecord:()=>LQ,ZodReadonly:()=>fQ,ZodPromise:()=>M0,ZodPipeline:()=>RQ,ZodParsedType:()=>r,ZodOptional:()=>pf,ZodObject:()=>mv,ZodNumber:()=>r1,ZodNullable:()=>S1,ZodNull:()=>p0,ZodNever:()=>K1,ZodNativeEnum:()=>t0,ZodNaN:()=>gQ,ZodMap:()=>SQ,ZodLiteral:()=>o0,ZodLazy:()=>s0,ZodIssueCode:()=>l,ZodIntersection:()=>d0,ZodFunction:()=>a0,ZodFirstPartyTypeKind:()=>u,ZodError:()=>Vf,ZodEnum:()=>c1,ZodEffects:()=>sf,ZodDiscriminatedUnion:()=>A8,ZodDefault:()=>e0,ZodDate:()=>h0,ZodCatch:()=>vQ,ZodBranded:()=>U8,ZodBoolean:()=>c0,ZodBigInt:()=>a1,ZodArray:()=>nf,ZodAny:()=>$0,Schema:()=>zv,ParseStatus:()=>Wf,OK:()=>Gf,NEVER:()=>d7,INVALID:()=>fv,EMPTY_PATH:()=>r5,DIRTY:()=>K0,BRAND:()=>B7});var eW=jv(()=>{q8();sW();Q6();AQ();$6();V8()});var n1=jv(()=>{eW();eW()});var vJ="2025-06-18",Z3="2025-03-26",D6,j8="2.0",M6,O6,s7,yf,qf,_Q,$1,Tf,F8,H6,V6=(f)=>H6.safeParse(f).success,q6,N6=(f)=>q6.safeParse(f).success,E6,fJ=(f)=>E6.safeParse(f).success,kv,A6,U6=(f)=>A6.safeParse(f).success,j6,L8,S8,kQ,F6,o7,g8,C3=(f)=>g8.safeParse(f).success,t7,e7,QJ,R8,v2,_8,k8,I8,L6,S6,WJ,g6,R6,f2,Z8,Q2,C8,W2,y8,J2,X2,P2,Y2,w2,G2,z2,T8,B2,x8,JJ,XJ,PJ,K2,h2,_6,$2,D2,M2,O2,H2,l8,V2,k6,y3,b8,q2,I6,N2,E2,A2,U2,j2,F2,YJ,L2,S2,g2,R2,_2,k2,wJ,I2,Z2,u8,C2,y2,T2,GJ,x2,T3,x3,l3,b3,u3,m3,Tv;var IQ=jv(()=>{n1();D6=[vJ,"2025-03-26","2024-11-05","2024-10-07"],M6=K.union([K.string(),K.number().int()]),O6=K.string(),s7=K.object({progressToken:K.optional(M6)}).passthrough(),yf=K.object({_meta:K.optional(s7)}).passthrough(),qf=K.object({method:K.string(),params:K.optional(yf)}),_Q=K.object({_meta:K.optional(K.object({}).passthrough())}).passthrough(),$1=K.object({method:K.string(),params:K.optional(_Q)}),Tf=K.object({_meta:K.optional(K.object({}).passthrough())}).passthrough(),F8=K.union([K.string(),K.number().int()]),H6=K.object({jsonrpc:K.literal(j8),id:F8}).merge(qf).strict(),q6=K.object({jsonrpc:K.literal(j8)}).merge($1).strict(),E6=K.object({jsonrpc:K.literal(j8),id:F8,result:Tf}).strict();(function(f){f[f.ConnectionClosed=-32000]="ConnectionClosed",f[f.RequestTimeout=-32001]="RequestTimeout",f[f.ParseError=-32700]="ParseError",f[f.InvalidRequest=-32600]="InvalidRequest",f[f.MethodNotFound=-32601]="MethodNotFound",f[f.InvalidParams=-32602]="InvalidParams",f[f.InternalError=-32603]="InternalError"})(kv||(kv={}));A6=K.object({jsonrpc:K.literal(j8),id:F8,error:K.object({code:K.number().int(),message:K.string(),data:K.optional(K.unknown())})}).strict(),j6=K.union([H6,q6,E6,A6]),L8=Tf.strict(),S8=$1.extend({method:K.literal("notifications/cancelled"),params:_Q.extend({requestId:F8,reason:K.string().optional()})}),kQ=K.object({name:K.string(),title:K.optional(K.string())}).passthrough(),F6=kQ.extend({version:K.string()}),o7=K.object({experimental:K.optional(K.object({}).passthrough()),sampling:K.optional(K.object({}).passthrough()),elicitation:K.optional(K.object({}).passthrough()),roots:K.optional(K.object({listChanged:K.optional(K.boolean())}).passthrough())}).passthrough(),g8=qf.extend({method:K.literal("initialize"),params:yf.extend({protocolVersion:K.string(),capabilities:o7,clientInfo:F6})}),t7=K.object({experimental:K.optional(K.object({}).passthrough()),logging:K.optional(K.object({}).passthrough()),completions:K.optional(K.object({}).passthrough()),prompts:K.optional(K.object({listChanged:K.optional(K.boolean())}).passthrough()),resources:K.optional(K.object({subscribe:K.optional(K.boolean()),listChanged:K.optional(K.boolean())}).passthrough()),tools:K.optional(K.object({listChanged:K.optional(K.boolean())}).passthrough())}).passthrough(),e7=Tf.extend({protocolVersion:K.string(),capabilities:t7,serverInfo:F6,instructions:K.optional(K.string())}),QJ=$1.extend({method:K.literal("notifications/initialized")}),R8=qf.extend({method:K.literal("ping")}),v2=K.object({progress:K.number(),total:K.optional(K.number()),message:K.optional(K.string())}).passthrough(),_8=$1.extend({method:K.literal("notifications/progress"),params:_Q.merge(v2).extend({progressToken:M6})}),k8=qf.extend({params:yf.extend({cursor:K.optional(O6)}).optional()}),I8=Tf.extend({nextCursor:K.optional(O6)}),L6=K.object({uri:K.string(),mimeType:K.optional(K.string()),_meta:K.optional(K.object({}).passthrough())}).passthrough(),S6=L6.extend({text:K.string()}),WJ=K.string().refine((f)=>{try{return atob(f),!0}catch(v){return!1}},{message:"Invalid Base64 string"}),g6=L6.extend({blob:WJ}),R6=kQ.extend({uri:K.string(),description:K.optional(K.string()),mimeType:K.optional(K.string()),_meta:K.optional(K.object({}).passthrough())}),f2=kQ.extend({uriTemplate:K.string(),description:K.optional(K.string()),mimeType:K.optional(K.string()),_meta:K.optional(K.object({}).passthrough())}),Z8=k8.extend({method:K.literal("resources/list")}),Q2=I8.extend({resources:K.array(R6)}),C8=k8.extend({method:K.literal("resources/templates/list")}),W2=I8.extend({resourceTemplates:K.array(f2)}),y8=qf.extend({method:K.literal("resources/read"),params:yf.extend({uri:K.string()})}),J2=Tf.extend({contents:K.array(K.union([S6,g6]))}),X2=$1.extend({method:K.literal("notifications/resources/list_changed")}),P2=qf.extend({method:K.literal("resources/subscribe"),params:yf.extend({uri:K.string()})}),Y2=qf.extend({method:K.literal("resources/unsubscribe"),params:yf.extend({uri:K.string()})}),w2=$1.extend({method:K.literal("notifications/resources/updated"),params:_Q.extend({uri:K.string()})}),G2=K.object({name:K.string(),description:K.optional(K.string()),required:K.optional(K.boolean())}).passthrough(),z2=kQ.extend({description:K.optional(K.string()),arguments:K.optional(K.array(G2)),_meta:K.optional(K.object({}).passthrough())}),T8=k8.extend({method:K.literal("prompts/list")}),B2=I8.extend({prompts:K.array(z2)}),x8=qf.extend({method:K.literal("prompts/get"),params:yf.extend({name:K.string(),arguments:K.optional(K.record(K.string()))})}),JJ=K.object({type:K.literal("text"),text:K.string(),_meta:K.optional(K.object({}).passthrough())}).passthrough(),XJ=K.object({type:K.literal("image"),data:WJ,mimeType:K.string(),_meta:K.optional(K.object({}).passthrough())}).passthrough(),PJ=K.object({type:K.literal("audio"),data:WJ,mimeType:K.string(),_meta:K.optional(K.object({}).passthrough())}).passthrough(),K2=K.object({type:K.literal("resource"),resource:K.union([S6,g6]),_meta:K.optional(K.object({}).passthrough())}).passthrough(),h2=R6.extend({type:K.literal("resource_link")}),_6=K.union([JJ,XJ,PJ,h2,K2]),$2=K.object({role:K.enum(["user","assistant"]),content:_6}).passthrough(),D2=Tf.extend({description:K.optional(K.string()),messages:K.array($2)}),M2=$1.extend({method:K.literal("notifications/prompts/list_changed")}),O2=K.object({title:K.optional(K.string()),readOnlyHint:K.optional(K.boolean()),destructiveHint:K.optional(K.boolean()),idempotentHint:K.optional(K.boolean()),openWorldHint:K.optional(K.boolean())}).passthrough(),H2=kQ.extend({description:K.optional(K.string()),inputSchema:K.object({type:K.literal("object"),properties:K.optional(K.object({}).passthrough()),required:K.optional(K.array(K.string()))}).passthrough(),outputSchema:K.optional(K.object({type:K.literal("object"),properties:K.optional(K.object({}).passthrough()),required:K.optional(K.array(K.string()))}).passthrough()),annotations:K.optional(O2),_meta:K.optional(K.object({}).passthrough())}),l8=k8.extend({method:K.literal("tools/list")}),V2=I8.extend({tools:K.array(H2)}),k6=Tf.extend({content:K.array(_6).default([]),structuredContent:K.object({}).passthrough().optional(),isError:K.optional(K.boolean())}),y3=k6.or(Tf.extend({toolResult:K.unknown()})),b8=qf.extend({method:K.literal("tools/call"),params:yf.extend({name:K.string(),arguments:K.optional(K.record(K.unknown()))})}),q2=$1.extend({method:K.literal("notifications/tools/list_changed")}),I6=K.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),N2=qf.extend({method:K.literal("logging/setLevel"),params:yf.extend({level:I6})}),E2=$1.extend({method:K.literal("notifications/message"),params:_Q.extend({level:I6,logger:K.optional(K.string()),data:K.unknown()})}),A2=K.object({name:K.string().optional()}).passthrough(),U2=K.object({hints:K.optional(K.array(A2)),costPriority:K.optional(K.number().min(0).max(1)),speedPriority:K.optional(K.number().min(0).max(1)),intelligencePriority:K.optional(K.number().min(0).max(1))}).passthrough(),j2=K.object({role:K.enum(["user","assistant"]),content:K.union([JJ,XJ,PJ])}).passthrough(),F2=qf.extend({method:K.literal("sampling/createMessage"),params:yf.extend({messages:K.array(j2),systemPrompt:K.optional(K.string()),includeContext:K.optional(K.enum(["none","thisServer","allServers"])),temperature:K.optional(K.number()),maxTokens:K.number().int(),stopSequences:K.optional(K.array(K.string())),metadata:K.optional(K.object({}).passthrough()),modelPreferences:K.optional(U2)})}),YJ=Tf.extend({model:K.string(),stopReason:K.optional(K.enum(["endTurn","stopSequence","maxTokens"]).or(K.string())),role:K.enum(["user","assistant"]),content:K.discriminatedUnion("type",[JJ,XJ,PJ])}),L2=K.object({type:K.literal("boolean"),title:K.optional(K.string()),description:K.optional(K.string()),default:K.optional(K.boolean())}).passthrough(),S2=K.object({type:K.literal("string"),title:K.optional(K.string()),description:K.optional(K.string()),minLength:K.optional(K.number()),maxLength:K.optional(K.number()),format:K.optional(K.enum(["email","uri","date","date-time"]))}).passthrough(),g2=K.object({type:K.enum(["number","integer"]),title:K.optional(K.string()),description:K.optional(K.string()),minimum:K.optional(K.number()),maximum:K.optional(K.number())}).passthrough(),R2=K.object({type:K.literal("string"),title:K.optional(K.string()),description:K.optional(K.string()),enum:K.array(K.string()),enumNames:K.optional(K.array(K.string()))}).passthrough(),_2=K.union([L2,S2,g2,R2]),k2=qf.extend({method:K.literal("elicitation/create"),params:yf.extend({message:K.string(),requestedSchema:K.object({type:K.literal("object"),properties:K.record(K.string(),_2),required:K.optional(K.array(K.string()))}).passthrough()})}),wJ=Tf.extend({action:K.enum(["accept","decline","cancel"]),content:K.optional(K.record(K.string(),K.unknown()))}),I2=K.object({type:K.literal("ref/resource"),uri:K.string()}).passthrough(),Z2=K.object({type:K.literal("ref/prompt"),name:K.string()}).passthrough(),u8=qf.extend({method:K.literal("completion/complete"),params:yf.extend({ref:K.union([Z2,I2]),argument:K.object({name:K.string(),value:K.string()}).passthrough(),context:K.optional(K.object({arguments:K.optional(K.record(K.string(),K.string()))}))})}),C2=Tf.extend({completion:K.object({values:K.array(K.string()).max(100),total:K.optional(K.number().int()),hasMore:K.optional(K.boolean())}).passthrough()}),y2=K.object({uri:K.string().startsWith("file://"),name:K.optional(K.string()),_meta:K.optional(K.object({}).passthrough())}).passthrough(),T2=qf.extend({method:K.literal("roots/list")}),GJ=Tf.extend({roots:K.array(y2)}),x2=$1.extend({method:K.literal("notifications/roots/list_changed")}),T3=K.union([R8,g8,u8,N2,x8,T8,Z8,C8,y8,P2,Y2,b8,l8]),x3=K.union([S8,_8,QJ,x2]),l3=K.union([L8,YJ,wJ,GJ]),b3=K.union([R8,F2,k2,T2]),u3=K.union([S8,_8,E2,w2,X2,q2,M2]),m3=K.union([L8,e7,C2,D2,B2,Q2,W2,J2,k6,V2]);Tv=class Tv extends Error{constructor(f,v,W){super(`MCP error ${f}: ${v}`);this.code=f,this.data=W,this.name="McpError"}}});var y6=Qv((m8,C6)=>{(function(f,v){typeof m8==="object"&&typeof C6!=="undefined"?v(m8):typeof define==="function"&&define.amd?define(["exports"],v):v(f.URI=f.URI||{})})(m8,function(f){function v(){for(var j=arguments.length,V=Array(j),S=0;S<j;S++)V[S]=arguments[S];if(V.length>1){V[0]=V[0].slice(0,-1);var I=V.length-1;for(var _=1;_<I;++_)V[_]=V[_].slice(1,-1);return V[I]=V[I].slice(1),V.join("")}else return V[0]}function W(j){return"(?:"+j+")"}function X(j){return j===void 0?"undefined":j===null?"null":Object.prototype.toString.call(j).split(" ").pop().split("]").shift().toLowerCase()}function Q(j){return j.toUpperCase()}function P(j){return j!==void 0&&j!==null?j instanceof Array?j:typeof j.length!=="number"||j.split||j.setInterval||j.call?[j]:Array.prototype.slice.call(j):[]}function w(j,V){var S=j;if(V)for(var I in V)S[I]=V[I];return S}function G(j){var V="[A-Za-z]",S="[\\x0D]",I="[0-9]",_="[\\x22]",c=v(I,"[A-Fa-f]"),Wv="[\\x0A]",Dv="[\\x20]",hv=W(W("%[EFef]"+c+"%"+c+c+"%"+c+c)+"|"+W("%[89A-Fa-f]"+c+"%"+c+c)+"|"+W("%"+c+c)),uv="[\\:\\/\\?\\#\\[\\]\\@]",$v="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",gv=v(uv,$v),yv=j?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",Lv=j?"[\\uE000-\\uF8FF]":"[]",qv=v(V,I,"[\\-\\.\\_\\~]",yv),Rv=W(V+v(V,I,"[\\+\\-\\.]")+"*"),Uv=W(W(hv+"|"+v(qv,$v,"[\\:]"))+"*"),J1=W(W("25[0-5]")+"|"+W("2[0-4]"+I)+"|"+W("1"+I+I)+"|"+W("[1-9]"+I)+"|"+I),ff=W(W("25[0-5]")+"|"+W("2[0-4]"+I)+"|"+W("1"+I+I)+"|"+W("0?[1-9]"+I)+"|0?0?"+I),Pf=W(ff+"\\."+ff+"\\."+ff+"\\."+ff),Fv=W(c+"{1,4}"),hf=W(W(Fv+"\\:"+Fv)+"|"+Pf),Mf=W(W(Fv+"\\:")+"{6}"+hf),_f=W("\\:\\:"+W(Fv+"\\:")+"{5}"+hf),X1=W(W(Fv)+"?\\:\\:"+W(Fv+"\\:")+"{4}"+hf),Yf=W(W(W(Fv+"\\:")+"{0,1}"+Fv)+"?\\:\\:"+W(Fv+"\\:")+"{3}"+hf),Q0=W(W(W(Fv+"\\:")+"{0,2}"+Fv)+"?\\:\\:"+W(Fv+"\\:")+"{2}"+hf),H1=W(W(W(Fv+"\\:")+"{0,3}"+Fv)+"?\\:\\:"+Fv+"\\:"+hf),P1=W(W(W(Fv+"\\:")+"{0,4}"+Fv)+"?\\:\\:"+hf),mf=W(W(W(Fv+"\\:")+"{0,5}"+Fv)+"?\\:\\:"+Fv),dv=W(W(W(Fv+"\\:")+"{0,6}"+Fv)+"?\\:\\:"),kf=W([Mf,_f,X1,Yf,Q0,H1,P1,mf,dv].join("|")),Y1=W(W(qv+"|"+hv)+"+"),L0=W(kf+"\\%25"+Y1),If=W(kf+W("\\%25|\\%(?!"+c+"{2})")+Y1),S0=W("[vV]"+c+"+\\."+v(qv,$v,"[\\:]")+"+"),v8=W("\\["+W(If+"|"+kf+"|"+S0)+"\\]"),f8=W(W(hv+"|"+v(qv,$v))+"*"),W0=W(v8+"|"+Pf+"(?!"+f8+")|"+f8),V1=W(I+"*"),Z1=W(W(Uv+"@")+"?"+W0+W("\\:"+V1)+"?"),J0=W(hv+"|"+v(qv,$v,"[\\:\\@]")),gW=W(J0+"*"),Q8=W(J0+"+"),W8=W(W(hv+"|"+v(qv,$v,"[\\@]"))+"+"),Zf=W(W("\\/"+gW)+"*"),C1=W("\\/"+W(Q8+Zf)+"?"),g0=W(W8+Zf),y1=W(Q8+Zf),wf="(?!"+J0+")",T1=W(Zf+"|"+C1+"|"+g0+"|"+y1+"|"+wf),q1=W(W(J0+"|"+v("[\\/\\?]",Lv))+"*"),X0=W(W(J0+"|[\\/\\?]")+"*"),KQ=W(W("\\/\\/"+Z1+Zf)+"|"+C1+"|"+y1+"|"+wf),R0=W(Rv+"\\:"+KQ+W("\\?"+q1)+"?"+W("\\#"+X0)+"?"),P0=W(W("\\/\\/"+Z1+Zf)+"|"+C1+"|"+g0+"|"+wf),_0=W(P0+W("\\?"+q1)+"?"+W("\\#"+X0)+"?"),hQ=W(R0+"|"+_0),B9=W(Rv+"\\:"+KQ+W("\\?"+q1)+"?"),K9="^("+Rv+")\\:"+W(W("\\/\\/("+W("("+Uv+")@")+"?("+W0+")"+W("\\:("+V1+")")+"?)")+"?("+Zf+"|"+C1+"|"+y1+"|"+wf+")")+W("\\?("+q1+")")+"?"+W("\\#("+X0+")")+"?$",h9="^(){0}"+W(W("\\/\\/("+W("("+Uv+")@")+"?("+W0+")"+W("\\:("+V1+")")+"?)")+"?("+Zf+"|"+C1+"|"+g0+"|"+wf+")")+W("\\?("+q1+")")+"?"+W("\\#("+X0+")")+"?$",$9="^("+Rv+")\\:"+W(W("\\/\\/("+W("("+Uv+")@")+"?("+W0+")"+W("\\:("+V1+")")+"?)")+"?("+Zf+"|"+C1+"|"+y1+"|"+wf+")")+W("\\?("+q1+")")+"?$",D9="^"+W("\\#("+X0+")")+"?$",M9="^"+W("("+Uv+")@")+"?("+W0+")"+W("\\:("+V1+")")+"?$";return{NOT_SCHEME:new RegExp(v("[^]",V,I,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(v("[^\\%\\:]",qv,$v),"g"),NOT_HOST:new RegExp(v("[^\\%\\[\\]\\:]",qv,$v),"g"),NOT_PATH:new RegExp(v("[^\\%\\/\\:\\@]",qv,$v),"g"),NOT_PATH_NOSCHEME:new RegExp(v("[^\\%\\/\\@]",qv,$v),"g"),NOT_QUERY:new RegExp(v("[^\\%]",qv,$v,"[\\:\\@\\/\\?]",Lv),"g"),NOT_FRAGMENT:new RegExp(v("[^\\%]",qv,$v,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(v("[^]",qv,$v),"g"),UNRESERVED:new RegExp(qv,"g"),OTHER_CHARS:new RegExp(v("[^\\%]",qv,gv),"g"),PCT_ENCODED:new RegExp(hv,"g"),IPV4ADDRESS:new RegExp("^("+Pf+")$"),IPV6ADDRESS:new RegExp("^\\[?("+kf+")"+W(W("\\%25|\\%(?!"+c+"{2})")+"("+Y1+")")+"?\\]?$")}}var B=G(!1),D=G(!0),M=function(){function j(V,S){var I=[],_=!0,c=!1,Wv=void 0;try{for(var Dv=V[Symbol.iterator](),hv;!(_=(hv=Dv.next()).done);_=!0)if(I.push(hv.value),S&&I.length===S)break}catch(uv){c=!0,Wv=uv}finally{try{if(!_&&Dv.return)Dv.return()}finally{if(c)throw Wv}}return I}return function(V,S){if(Array.isArray(V))return V;else if(Symbol.iterator in Object(V))return j(V,S);else throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),A=function(j){if(Array.isArray(j)){for(var V=0,S=Array(j.length);V<j.length;V++)S[V]=j[V];return S}else return Array.from(j)},N=2147483647,h=36,$=1,U=26,O=38,H=700,F=72,E=128,L="-",R=/^xn--/,Z=/[^\0-\x7E]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=h-$,a=Math.floor,p=String.fromCharCode;function i(j){throw new RangeError(x[j])}function T(j,V){var S=[],I=j.length;while(I--)S[I]=V(j[I]);return S}function b(j,V){var S=j.split("@"),I="";if(S.length>1)I=S[0]+"@",j=S[1];j=j.replace(m,".");var _=j.split("."),c=T(_,V).join(".");return I+c}function d(j){var V=[],S=0,I=j.length;while(S<I){var _=j.charCodeAt(S++);if(_>=55296&&_<=56319&&S<I){var c=j.charCodeAt(S++);if((c&64512)==56320)V.push(((_&1023)<<10)+(c&1023)+65536);else V.push(_),S--}else V.push(_)}return V}var Av=function j(V){return String.fromCodePoint.apply(String,A(V))},Bv=function j(V){if(V-48<10)return V-22;if(V-65<26)return V-65;if(V-97<26)return V-97;return h},Kv=function j(V,S){return V+22+75*(V<26)-((S!=0)<<5)},Gv=function j(V,S,I){var _=0;V=I?a(V/H):V>>1,V+=a(V/S);for(;V>y*U>>1;_+=h)V=a(V/y);return a(_+(y+1)*V/(V+O))},e=function j(V){var S=[],I=V.length,_=0,c=E,Wv=F,Dv=V.lastIndexOf(L);if(Dv<0)Dv=0;for(var hv=0;hv<Dv;++hv){if(V.charCodeAt(hv)>=128)i("not-basic");S.push(V.charCodeAt(hv))}for(var uv=Dv>0?Dv+1:0;uv<I;){var $v=_;for(var gv=1,yv=h;;yv+=h){if(uv>=I)i("invalid-input");var Lv=Bv(V.charCodeAt(uv++));if(Lv>=h||Lv>a((N-_)/gv))i("overflow");_+=Lv*gv;var qv=yv<=Wv?$:yv>=Wv+U?U:yv-Wv;if(Lv<qv)break;var Rv=h-qv;if(gv>a(N/Rv))i("overflow");gv*=Rv}var Uv=S.length+1;if(Wv=Gv(_-$v,Uv,$v==0),a(_/Uv)>N-c)i("overflow");c+=a(_/Uv),_%=Uv,S.splice(_++,0,c)}return String.fromCodePoint.apply(String,S)},Zv=function j(V){var S=[];V=d(V);var I=V.length,_=E,c=0,Wv=F,Dv=!0,hv=!1,uv=void 0;try{for(var $v=V[Symbol.iterator](),gv;!(Dv=(gv=$v.next()).done);Dv=!0){var yv=gv.value;if(yv<128)S.push(p(yv))}}catch(If){hv=!0,uv=If}finally{try{if(!Dv&&$v.return)$v.return()}finally{if(hv)throw uv}}var Lv=S.length,qv=Lv;if(Lv)S.push(L);while(qv<I){var Rv=N,Uv=!0,J1=!1,ff=void 0;try{for(var Pf=V[Symbol.iterator](),Fv;!(Uv=(Fv=Pf.next()).done);Uv=!0){var hf=Fv.value;if(hf>=_&&hf<Rv)Rv=hf}}catch(If){J1=!0,ff=If}finally{try{if(!Uv&&Pf.return)Pf.return()}finally{if(J1)throw ff}}var Mf=qv+1;if(Rv-_>a((N-c)/Mf))i("overflow");c+=(Rv-_)*Mf,_=Rv;var _f=!0,X1=!1,Yf=void 0;try{for(var Q0=V[Symbol.iterator](),H1;!(_f=(H1=Q0.next()).done);_f=!0){var P1=H1.value;if(P1<_&&++c>N)i("overflow");if(P1==_){var mf=c;for(var dv=h;;dv+=h){var kf=dv<=Wv?$:dv>=Wv+U?U:dv-Wv;if(mf<kf)break;var Y1=mf-kf,L0=h-kf;S.push(p(Kv(kf+Y1%L0,0))),mf=a(Y1/L0)}S.push(p(Kv(mf,0))),Wv=Gv(c,Mf,qv==Lv),c=0,++qv}}}catch(If){X1=!0,Yf=If}finally{try{if(!_f&&Q0.return)Q0.return()}finally{if(X1)throw Yf}}++c,++_}return S.join("")},sv=function j(V){return b(V,function(S){return R.test(S)?e(S.slice(4).toLowerCase()):S})},vf=function j(V){return b(V,function(S){return Z.test(S)?"xn--"+Zv(S):S})},Pv={version:"2.1.0",ucs2:{decode:d,encode:Av},decode:e,encode:Zv,toASCII:vf,toUnicode:sv},Ev={};function nv(j){var V=j.charCodeAt(0),S=void 0;if(V<16)S="%0"+V.toString(16).toUpperCase();else if(V<128)S="%"+V.toString(16).toUpperCase();else if(V<2048)S="%"+(V>>6|192).toString(16).toUpperCase()+"%"+(V&63|128).toString(16).toUpperCase();else S="%"+(V>>12|224).toString(16).toUpperCase()+"%"+(V>>6&63|128).toString(16).toUpperCase()+"%"+(V&63|128).toString(16).toUpperCase();return S}function ov(j){var V="",S=0,I=j.length;while(S<I){var _=parseInt(j.substr(S+1,2),16);if(_<128)V+=String.fromCharCode(_),S+=3;else if(_>=194&&_<224){if(I-S>=6){var c=parseInt(j.substr(S+4,2),16);V+=String.fromCharCode((_&31)<<6|c&63)}else V+=j.substr(S,6);S+=6}else if(_>=224){if(I-S>=9){var Wv=parseInt(j.substr(S+4,2),16),Dv=parseInt(j.substr(S+7,2),16);V+=String.fromCharCode((_&15)<<12|(Wv&63)<<6|Dv&63)}else V+=j.substr(S,9);S+=9}else V+=j.substr(S,3),S+=3}return V}function tv(j,V){function S(I){var _=ov(I);return!_.match(V.UNRESERVED)?I:_}if(j.scheme)j.scheme=String(j.scheme).replace(V.PCT_ENCODED,S).toLowerCase().replace(V.NOT_SCHEME,"");if(j.userinfo!==void 0)j.userinfo=String(j.userinfo).replace(V.PCT_ENCODED,S).replace(V.NOT_USERINFO,nv).replace(V.PCT_ENCODED,Q);if(j.host!==void 0)j.host=String(j.host).replace(V.PCT_ENCODED,S).toLowerCase().replace(V.NOT_HOST,nv).replace(V.PCT_ENCODED,Q);if(j.path!==void 0)j.path=String(j.path).replace(V.PCT_ENCODED,S).replace(j.scheme?V.NOT_PATH:V.NOT_PATH_NOSCHEME,nv).replace(V.PCT_ENCODED,Q);if(j.query!==void 0)j.query=String(j.query).replace(V.PCT_ENCODED,S).replace(V.NOT_QUERY,nv).replace(V.PCT_ENCODED,Q);if(j.fragment!==void 0)j.fragment=String(j.fragment).replace(V.PCT_ENCODED,S).replace(V.NOT_FRAGMENT,nv).replace(V.PCT_ENCODED,Q);return j}function Uf(j){return j.replace(/^0*(.*)/,"$1")||"0"}function xv(j,V){var S=j.match(V.IPV4ADDRESS)||[],I=M(S,2),_=I[1];if(_)return _.split(".").map(Uf).join(".");else return j}function Cv(j,V){var S=j.match(V.IPV6ADDRESS)||[],I=M(S,3),_=I[1],c=I[2];if(_){var Wv=_.toLowerCase().split("::").reverse(),Dv=M(Wv,2),hv=Dv[0],uv=Dv[1],$v=uv?uv.split(":").map(Uf):[],gv=hv.split(":").map(Uf),yv=V.IPV4ADDRESS.test(gv[gv.length-1]),Lv=yv?7:8,qv=gv.length-Lv,Rv=Array(Lv);for(var Uv=0;Uv<Lv;++Uv)Rv[Uv]=$v[Uv]||gv[qv+Uv]||"";if(yv)Rv[Lv-1]=xv(Rv[Lv-1],V);var J1=Rv.reduce(function(Mf,_f,X1){if(!_f||_f==="0"){var Yf=Mf[Mf.length-1];if(Yf&&Yf.index+Yf.length===X1)Yf.length++;else Mf.push({index:X1,length:1})}return Mf},[]),ff=J1.sort(function(Mf,_f){return _f.length-Mf.length})[0],Pf=void 0;if(ff&&ff.length>1){var Fv=Rv.slice(0,ff.index),hf=Rv.slice(ff.index+ff.length);Pf=Fv.join(":")+"::"+hf.join(":")}else Pf=Rv.join(":");if(c)Pf+="%"+c;return Pf}else return j}var M1=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,pv="".match(/(){0}/)[1]===void 0;function Vv(j){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S={},I=V.iri!==!1?D:B;if(V.reference==="suffix")j=(V.scheme?V.scheme+":":"")+"//"+j;var _=j.match(M1);if(_){if(pv){if(S.scheme=_[1],S.userinfo=_[3],S.host=_[4],S.port=parseInt(_[5],10),S.path=_[6]||"",S.query=_[7],S.fragment=_[8],isNaN(S.port))S.port=_[5]}else if(S.scheme=_[1]||void 0,S.userinfo=j.indexOf("@")!==-1?_[3]:void 0,S.host=j.indexOf("//")!==-1?_[4]:void 0,S.port=parseInt(_[5],10),S.path=_[6]||"",S.query=j.indexOf("?")!==-1?_[7]:void 0,S.fragment=j.indexOf("#")!==-1?_[8]:void 0,isNaN(S.port))S.port=j.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?_[4]:void 0;if(S.host)S.host=Cv(xv(S.host,I),I);if(S.scheme===void 0&&S.userinfo===void 0&&S.host===void 0&&S.port===void 0&&!S.path&&S.query===void 0)S.reference="same-document";else if(S.scheme===void 0)S.reference="relative";else if(S.fragment===void 0)S.reference="absolute";else S.reference="uri";if(V.reference&&V.reference!=="suffix"&&V.reference!==S.reference)S.error=S.error||"URI is not a "+V.reference+" reference.";var c=Ev[(V.scheme||S.scheme||"").toLowerCase()];if(!V.unicodeSupport&&(!c||!c.unicodeSupport)){if(S.host&&(V.domainHost||c&&c.domainHost))try{S.host=Pv.toASCII(S.host.replace(I.PCT_ENCODED,ov).toLowerCase())}catch(Wv){S.error=S.error||"Host's domain name can not be converted to ASCII via punycode: "+Wv}tv(S,B)}else tv(S,I);if(c&&c.parse)c.parse(S,V)}else S.error=S.error||"URI can not be parsed.";return S}function Bf(j,V){var S=V.iri!==!1?D:B,I=[];if(j.userinfo!==void 0)I.push(j.userinfo),I.push("@");if(j.host!==void 0)I.push(Cv(xv(String(j.host),S),S).replace(S.IPV6ADDRESS,function(_,c,Wv){return"["+c+(Wv?"%25"+Wv:"")+"]"}));if(typeof j.port==="number"||typeof j.port==="string")I.push(":"),I.push(String(j.port));return I.length?I.join(""):void 0}var Sf=/^\.\.?\//,bf=/^\/\.(\/|$)/,gf=/^\/\.\.(\/|$)/,iv=/^\/?(?:.|\n)*?(?=\/|$)/;function rv(j){var V=[];while(j.length)if(j.match(Sf))j=j.replace(Sf,"");else if(j.match(bf))j=j.replace(bf,"/");else if(j.match(gf))j=j.replace(gf,"/"),V.pop();else if(j==="."||j==="..")j="";else{var S=j.match(iv);if(S){var I=S[0];j=j.slice(I.length),V.push(I)}else throw new Error("Unexpected dot segment condition")}return V.join("")}function bv(j){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=V.iri?D:B,I=[],_=Ev[(V.scheme||j.scheme||"").toLowerCase()];if(_&&_.serialize)_.serialize(j,V);if(j.host){if(S.IPV6ADDRESS.test(j.host));else if(V.domainHost||_&&_.domainHost)try{j.host=!V.iri?Pv.toASCII(j.host.replace(S.PCT_ENCODED,ov).toLowerCase()):Pv.toUnicode(j.host)}catch(Dv){j.error=j.error||"Host's domain name can not be converted to "+(!V.iri?"ASCII":"Unicode")+" via punycode: "+Dv}}if(tv(j,S),V.reference!=="suffix"&&j.scheme)I.push(j.scheme),I.push(":");var c=Bf(j,V);if(c!==void 0){if(V.reference!=="suffix")I.push("//");if(I.push(c),j.path&&j.path.charAt(0)!=="/")I.push("/")}if(j.path!==void 0){var Wv=j.path;if(!V.absolutePath&&(!_||!_.absolutePath))Wv=rv(Wv);if(c===void 0)Wv=Wv.replace(/^\/\//,"/%2F");I.push(Wv)}if(j.query!==void 0)I.push("?"),I.push(j.query);if(j.fragment!==void 0)I.push("#"),I.push(j.fragment);return I.join("")}function cv(j,V){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},I=arguments[3],_={};if(!I)j=Vv(bv(j,S),S),V=Vv(bv(V,S),S);if(S=S||{},!S.tolerant&&V.scheme)_.scheme=V.scheme,_.userinfo=V.userinfo,_.host=V.host,_.port=V.port,_.path=rv(V.path||""),_.query=V.query;else{if(V.userinfo!==void 0||V.host!==void 0||V.port!==void 0)_.userinfo=V.userinfo,_.host=V.host,_.port=V.port,_.path=rv(V.path||""),_.query=V.query;else{if(!V.path)if(_.path=j.path,V.query!==void 0)_.query=V.query;else _.query=j.query;else{if(V.path.charAt(0)==="/")_.path=rv(V.path);else{if((j.userinfo!==void 0||j.host!==void 0||j.port!==void 0)&&!j.path)_.path="/"+V.path;else if(!j.path)_.path=V.path;else _.path=j.path.slice(0,j.path.lastIndexOf("/")+1)+V.path;_.path=rv(_.path)}_.query=V.query}_.userinfo=j.userinfo,_.host=j.host,_.port=j.port}_.scheme=j.scheme}return _.fragment=V.fragment,_}function Rf(j,V,S){var I=w({scheme:"null"},S);return bv(cv(Vv(j,I),Vv(V,I),I,!0),I)}function Jf(j,V){if(typeof j==="string")j=bv(Vv(j,V),V);else if(X(j)==="object")j=Vv(bv(j,V),V);return j}function O1(j,V,S){if(typeof j==="string")j=bv(Vv(j,S),S);else if(X(j)==="object")j=bv(j,S);if(typeof V==="string")V=bv(Vv(V,S),S);else if(X(V)==="object")V=bv(V,S);return j===V}function XQ(j,V){return j&&j.toString().replace(!V||!V.iri?B.ESCAPE:D.ESCAPE,nv)}function Kf(j,V){return j&&j.toString().replace(!V||!V.iri?B.PCT_ENCODED:D.PCT_ENCODED,ov)}var k1={scheme:"http",domainHost:!0,parse:function j(V,S){if(!V.host)V.error=V.error||"HTTP URIs must have a host.";return V},serialize:function j(V,S){var I=String(V.scheme).toLowerCase()==="https";if(V.port===(I?443:80)||V.port==="")V.port=void 0;if(!V.path)V.path="/";return V}},nQ={scheme:"https",domainHost:k1.domainHost,parse:k1.parse,serialize:k1.serialize};function PQ(j){return typeof j.secure==="boolean"?j.secure:String(j.scheme).toLowerCase()==="wss"}var I1={scheme:"ws",domainHost:!0,parse:function j(V,S){var I=V;return I.secure=PQ(I),I.resourceName=(I.path||"/")+(I.query?"?"+I.query:""),I.path=void 0,I.query=void 0,I},serialize:function j(V,S){if(V.port===(PQ(V)?443:80)||V.port==="")V.port=void 0;if(typeof V.secure==="boolean")V.scheme=V.secure?"wss":"ws",V.secure=void 0;if(V.resourceName){var I=V.resourceName.split("?"),_=M(I,2),c=_[0],Wv=_[1];V.path=c&&c!=="/"?c:void 0,V.query=Wv,V.resourceName=void 0}return V.fragment=void 0,V}},YQ={scheme:"wss",domainHost:I1.domainHost,parse:I1.parse,serialize:I1.serialize},wQ={},GQ=!0,U0="[A-Za-z0-9\\-\\.\\_\\~"+(GQ?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",Xf="[0-9A-Fa-f]",pQ=W(W("%[EFef]"+Xf+"%"+Xf+Xf+"%"+Xf+Xf)+"|"+W("%[89A-Fa-f]"+Xf+"%"+Xf+Xf)+"|"+W("%"+Xf+Xf)),uf="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Q1="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",iQ=v(Q1,"[\\\"\\\\]"),j0="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",LW=new RegExp(U0,"g"),W1=new RegExp(pQ,"g"),dQ=new RegExp(v("[^]",uf,"[\\.]","[\\\"]",iQ),"g"),sQ=new RegExp(v("[^]",U0,j0),"g"),SW=sQ;function zQ(j){var V=ov(j);return!V.match(LW)?j:V}var oQ={scheme:"mailto",parse:function j(V,S){var I=V,_=I.to=I.path?I.path.split(","):[];if(I.path=void 0,I.query){var c=!1,Wv={},Dv=I.query.split("&");for(var hv=0,uv=Dv.length;hv<uv;++hv){var $v=Dv[hv].split("=");switch($v[0]){case"to":var gv=$v[1].split(",");for(var yv=0,Lv=gv.length;yv<Lv;++yv)_.push(gv[yv]);break;case"subject":I.subject=Kf($v[1],S);break;case"body":I.body=Kf($v[1],S);break;default:c=!0,Wv[Kf($v[0],S)]=Kf($v[1],S);break}}if(c)I.headers=Wv}I.query=void 0;for(var qv=0,Rv=_.length;qv<Rv;++qv){var Uv=_[qv].split("@");if(Uv[0]=Kf(Uv[0]),!S.unicodeSupport)try{Uv[1]=Pv.toASCII(Kf(Uv[1],S).toLowerCase())}catch(J1){I.error=I.error||"Email address's domain name can not be converted to ASCII via punycode: "+J1}else Uv[1]=Kf(Uv[1],S).toLowerCase();_[qv]=Uv.join("@")}return I},serialize:function j(V,S){var I=V,_=P(V.to);if(_){for(var c=0,Wv=_.length;c<Wv;++c){var Dv=String(_[c]),hv=Dv.lastIndexOf("@"),uv=Dv.slice(0,hv).replace(W1,zQ).replace(W1,Q).replace(dQ,nv),$v=Dv.slice(hv+1);try{$v=!S.iri?Pv.toASCII(Kf($v,S).toLowerCase()):Pv.toUnicode($v)}catch(qv){I.error=I.error||"Email address's domain name can not be converted to "+(!S.iri?"ASCII":"Unicode")+" via punycode: "+qv}_[c]=uv+"@"+$v}I.path=_.join(",")}var gv=V.headers=V.headers||{};if(V.subject)gv.subject=V.subject;if(V.body)gv.body=V.body;var yv=[];for(var Lv in gv)if(gv[Lv]!==wQ[Lv])yv.push(Lv.replace(W1,zQ).replace(W1,Q).replace(sQ,nv)+"="+gv[Lv].replace(W1,zQ).replace(W1,Q).replace(SW,nv));if(yv.length)I.query=yv.join("&");return I}},tQ=/^([^\:]+)\:(.*)/,F0={scheme:"urn",parse:function j(V,S){var I=V.path&&V.path.match(tQ),_=V;if(I){var c=S.scheme||_.scheme||"urn",Wv=I[1].toLowerCase(),Dv=I[2],hv=c+":"+(S.nid||Wv),uv=Ev[hv];if(_.nid=Wv,_.nss=Dv,_.path=void 0,uv)_=uv.parse(_,S)}else _.error=_.error||"URN can not be parsed.";return _},serialize:function j(V,S){var I=S.scheme||V.scheme||"urn",_=V.nid,c=I+":"+(S.nid||_),Wv=Ev[c];if(Wv)V=Wv.serialize(V,S);var Dv=V,hv=V.nss;return Dv.path=(_||S.nid)+":"+hv,Dv}},BQ=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,eQ={scheme:"urn:uuid",parse:function j(V,S){var I=V;if(I.uuid=I.nss,I.nss=void 0,!S.tolerant&&(!I.uuid||!I.uuid.match(BQ)))I.error=I.error||"UUID is not valid.";return I},serialize:function j(V,S){var I=V;return I.nss=(V.uuid||"").toLowerCase(),I}};Ev[k1.scheme]=k1,Ev[nQ.scheme]=nQ,Ev[I1.scheme]=I1,Ev[YQ.scheme]=YQ,Ev[oQ.scheme]=oQ,Ev[F0.scheme]=F0,Ev[eQ.scheme]=eQ,f.SCHEMES=Ev,f.pctEncChar=nv,f.pctDecChars=ov,f.parse=Vv,f.removeDotSegments=rv,f.serialize=bv,f.resolveComponents=cv,f.resolve=Rf,f.normalize=Jf,f.equal=O1,f.escapeComponent=XQ,f.unescapeComponent=Kf,Object.defineProperty(f,"__esModule",{value:!0})})});var r8=Qv((n3,T6)=>{T6.exports=function f(v,W){if(v===W)return!0;if(v&&W&&typeof v=="object"&&typeof W=="object"){if(v.constructor!==W.constructor)return!1;var X,Q,P;if(Array.isArray(v)){if(X=v.length,X!=W.length)return!1;for(Q=X;Q--!==0;)if(!f(v[Q],W[Q]))return!1;return!0}if(v.constructor===RegExp)return v.source===W.source&&v.flags===W.flags;if(v.valueOf!==Object.prototype.valueOf)return v.valueOf()===W.valueOf();if(v.toString!==Object.prototype.toString)return v.toString()===W.toString();if(P=Object.keys(v),X=P.length,X!==Object.keys(W).length)return!1;for(Q=X;Q--!==0;)if(!Object.prototype.hasOwnProperty.call(W,P[Q]))return!1;for(Q=X;Q--!==0;){var w=P[Q];if(!f(v[w],W[w]))return!1}return!0}return v!==v&&W!==W}});var l6=Qv((p3,x6)=>{x6.exports=function f(v){var W=0,X=v.length,Q=0,P;while(Q<X)if(W++,P=v.charCodeAt(Q++),P>=55296&&P<=56319&&Q<X){if(P=v.charCodeAt(Q),(P&64512)==56320)Q++}return W}});var O0=Qv((i3,m6)=>{m6.exports={copy:b2,checkDataType:BJ,checkDataTypes:u2,coerceToTypes:m2,toHash:hJ,getProperty:$J,escapeQuotes:DJ,equal:r8(),ucs2length:l6(),varOccurences:c2,varReplace:n2,schemaHasRules:p2,schemaHasRulesExcept:i2,schemaUnknownRules:d2,toQuotedString:KJ,getPathExpr:s2,getPath:o2,getData:vw,unescapeFragment:fw,unescapeJsonPointer:OJ,escapeFragment:Qw,escapeJsonPointer:MJ};function b2(f,v){v=v||{};for(var W in f)v[W]=f[W];return v}function BJ(f,v,W,X){var Q=X?" !== ":" === ",P=X?" || ":" && ",w=X?"!":"",G=X?"":"!";switch(f){case"null":return v+Q+"null";case"array":return w+"Array.isArray("+v+")";case"object":return"("+w+v+P+"typeof "+v+Q+'"object"'+P+G+"Array.isArray("+v+"))";case"integer":return"(typeof "+v+Q+'"number"'+P+G+"("+v+" % 1)"+P+v+Q+v+(W?P+w+"isFinite("+v+")":"")+")";case"number":return"(typeof "+v+Q+'"'+f+'"'+(W?P+w+"isFinite("+v+")":"")+")";default:return"typeof "+v+Q+'"'+f+'"'}}function u2(f,v,W){switch(f.length){case 1:return BJ(f[0],v,W,!0);default:var X="",Q=hJ(f);if(Q.array&&Q.object)X=Q.null?"(":"(!"+v+" || ",X+="typeof "+v+' !== "object")',delete Q.null,delete Q.array,delete Q.object;if(Q.number)delete Q.integer;for(var P in Q)X+=(X?" && ":"")+BJ(P,v,W,!0);return X}}var b6=hJ(["string","number","integer","boolean","null"]);function m2(f,v){if(Array.isArray(v)){var W=[];for(var X=0;X<v.length;X++){var Q=v[X];if(b6[Q])W[W.length]=Q;else if(f==="array"&&Q==="array")W[W.length]=Q}if(W.length)return W}else if(b6[v])return[v];else if(f==="array"&&v==="array")return["array"]}function hJ(f){var v={};for(var W=0;W<f.length;W++)v[f[W]]=!0;return v}var r2=/^[a-z$_][a-z$_0-9]*$/i,a2=/'|\\/g;function $J(f){return typeof f=="number"?"["+f+"]":r2.test(f)?"."+f:"['"+DJ(f)+"']"}function DJ(f){return f.replace(a2,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function c2(f,v){v+="[^0-9]";var W=f.match(new RegExp(v,"g"));return W?W.length:0}function n2(f,v,W){return v+="([^0-9])",W=W.replace(/\$/g,"$$$$"),f.replace(new RegExp(v,"g"),W+"$1")}function p2(f,v){if(typeof f=="boolean")return!f;for(var W in f)if(v[W])return!0}function i2(f,v,W){if(typeof f=="boolean")return!f&&W!="not";for(var X in f)if(X!=W&&v[X])return!0}function d2(f,v){if(typeof f=="boolean")return;for(var W in f)if(!v[W])return W}function KJ(f){return"'"+DJ(f)+"'"}function s2(f,v,W,X){var Q=W?"'/' + "+v+(X?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):X?"'[' + "+v+" + ']'":"'[\\'' + "+v+" + '\\']'";return u6(f,Q)}function o2(f,v,W){var X=W?KJ("/"+MJ(v)):KJ($J(v));return u6(f,X)}var t2=/^\/(?:[^~]|~0|~1)*$/,e2=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function vw(f,v,W){var X,Q,P,w;if(f==="")return"rootData";if(f[0]=="/"){if(!t2.test(f))throw new Error("Invalid JSON-pointer: "+f);Q=f,P="rootData"}else{if(w=f.match(e2),!w)throw new Error("Invalid JSON-pointer: "+f);if(X=+w[1],Q=w[2],Q=="#"){if(X>=v)throw new Error("Cannot access property/index "+X+" levels up, current level is "+v);return W[v-X]}if(X>v)throw new Error("Cannot access data "+X+" levels up, current level is "+v);if(P="data"+(v-X||""),!Q)return P}var G=P,B=Q.split("/");for(var D=0;D<B.length;D++){var M=B[D];if(M)P+=$J(OJ(M)),G+=" && "+P}return G}function u6(f,v){if(f=='""')return v;return(f+" + "+v).replace(/([^\\])' \+ '/g,"$1")}function fw(f){return OJ(decodeURIComponent(f))}function Qw(f){return encodeURIComponent(MJ(f))}function MJ(f){return f.replace(/~/g,"~0").replace(/\//g,"~1")}function OJ(f){return f.replace(/~1/g,"/").replace(/~0/g,"~")}});var HJ=Qv((d3,r6)=>{var Ww=O0();r6.exports=Jw;function Jw(f){Ww.copy(f,this)}});var c6=Qv((s3,a6)=>{var p1=a6.exports=function(f,v,W){if(typeof v=="function")W=v,v={};W=v.cb||W;var X=typeof W=="function"?W:W.pre||function(){},Q=W.post||function(){};a8(v,X,Q,f,"",f)};p1.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0};p1.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};p1.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};p1.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 a8(f,v,W,X,Q,P,w,G,B,D){if(X&&typeof X=="object"&&!Array.isArray(X)){v(X,Q,P,w,G,B,D);for(var M in X){var A=X[M];if(Array.isArray(A)){if(M in p1.arrayKeywords)for(var N=0;N<A.length;N++)a8(f,v,W,A[N],Q+"/"+M+"/"+N,P,Q,M,X,N)}else if(M in p1.propsKeywords){if(A&&typeof A=="object")for(var h in A)a8(f,v,W,A[h],Q+"/"+M+"/"+Xw(h),P,Q,M,X,h)}else if(M in p1.keywords||f.allKeys&&!(M in p1.skipKeywords))a8(f,v,W,A,Q+"/"+M,P,Q,M,X)}W(X,Q,P,w,G,B,D)}}function Xw(f){return f.replace(/~/g,"~0").replace(/\//g,"~1")}});var s8=Qv((o3,d6)=>{var ZQ=y6(),n6=r8(),i8=O0(),c8=HJ(),Pw=c6();d6.exports=d1;d1.normalizeId=i1;d1.fullPath=n8;d1.url=p8;d1.ids=Bw;d1.inlineRef=VJ;d1.schema=d8;function d1(f,v,W){var X=this._refs[W];if(typeof X=="string")if(this._refs[X])X=this._refs[X];else return d1.call(this,f,v,X);if(X=X||this._schemas[W],X instanceof c8)return VJ(X.schema,this._opts.inlineRefs)?X.schema:X.validate||this._compile(X);var Q=d8.call(this,v,W),P,w,G;if(Q)P=Q.schema,v=Q.root,G=Q.baseId;if(P instanceof c8)w=P.validate||f.call(this,P.schema,v,void 0,G);else if(P!==void 0)w=VJ(P,this._opts.inlineRefs)?P:f.call(this,P,v,void 0,G);return w}function d8(f,v){var W=ZQ.parse(v),X=i6(W),Q=n8(this._getId(f.schema));if(Object.keys(f.schema).length===0||X!==Q){var P=i1(X),w=this._refs[P];if(typeof w=="string")return Yw.call(this,f,w,W);else if(w instanceof c8){if(!w.validate)this._compile(w);f=w}else if(w=this._schemas[P],w instanceof c8){if(!w.validate)this._compile(w);if(P==i1(v))return{schema:w,root:f,baseId:Q};f=w}else return;if(!f.schema)return;Q=n8(this._getId(f.schema))}return p6.call(this,W,Q,f.schema,f)}function Yw(f,v,W){var X=d8.call(this,f,v);if(X){var{schema:Q,baseId:P}=X;f=X.root;var w=this._getId(Q);if(w)P=p8(P,w);return p6.call(this,W,P,Q,f)}}var ww=i8.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function p6(f,v,W,X){if(f.fragment=f.fragment||"",f.fragment.slice(0,1)!="/")return;var Q=f.fragment.split("/");for(var P=1;P<Q.length;P++){var w=Q[P];if(w){if(w=i8.unescapeFragment(w),W=W[w],W===void 0)break;var G;if(!ww[w]){if(G=this._getId(W),G)v=p8(v,G);if(W.$ref){var B=p8(v,W.$ref),D=d8.call(this,X,B);if(D)W=D.schema,X=D.root,v=D.baseId}}}}if(W!==void 0&&W!==X.schema)return{schema:W,root:X,baseId:v}}var Gw=i8.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function VJ(f,v){if(v===!1)return!1;if(v===void 0||v===!0)return qJ(f);else if(v)return NJ(f)<=v}function qJ(f){var v;if(Array.isArray(f)){for(var W=0;W<f.length;W++)if(v=f[W],typeof v=="object"&&!qJ(v))return!1}else for(var X in f){if(X=="$ref")return!1;if(v=f[X],typeof v=="object"&&!qJ(v))return!1}return!0}function NJ(f){var v=0,W;if(Array.isArray(f))for(var X=0;X<f.length;X++){if(W=f[X],typeof W=="object")v+=NJ(W);if(v==1/0)return 1/0}else for(var Q in f){if(Q=="$ref")return 1/0;if(Gw[Q])v++;else{if(W=f[Q],typeof W=="object")v+=NJ(W)+1;if(v==1/0)return 1/0}}return v}function n8(f,v){if(v!==!1)f=i1(f);var W=ZQ.parse(f);return i6(W)}function i6(f){return ZQ.serialize(f).split("#")[0]+"#"}var zw=/#\/?$/;function i1(f){return f?f.replace(zw,""):""}function p8(f,v){return v=i1(v),ZQ.resolve(f,v)}function Bw(f){var v=i1(this._getId(f)),W={"":v},X={"":n8(v,!1)},Q={},P=this;return Pw(f,{allKeys:!0},function(w,G,B,D,M,A,N){if(G==="")return;var h=P._getId(w),$=W[D],U=X[D]+"/"+M;if(N!==void 0)U+="/"+(typeof N=="number"?N:i8.escapeFragment(N));if(typeof h=="string"){h=$=i1($?ZQ.resolve($,h):h);var O=P._refs[h];if(typeof O=="string")O=P._refs[O];if(O&&O.schema){if(!n6(w,O.schema))throw new Error('id "'+h+'" resolves to more than one schema')}else if(h!=i1(U))if(h[0]=="#"){if(Q[h]&&!n6(w,Q[h]))throw new Error('id "'+h+'" resolves to more than one schema');Q[h]=w}else P._refs[h]=U}W[G]=$,X[G]=U}),Q}});var o8=Qv((t3,o6)=>{var EJ=s8();o6.exports={Validation:s6(Kw),MissingRef:s6(AJ)};function Kw(f){this.message="validation failed",this.errors=f,this.ajv=this.validation=!0}AJ.message=function(f,v){return"can't resolve reference "+v+" from id "+f};function AJ(f,v,W){this.message=W||AJ.message(f,v),this.missingRef=EJ.url(f,v),this.missingSchema=EJ.normalizeId(EJ.fullPath(this.missingRef))}function s6(f){return f.prototype=Object.create(Error.prototype),f.prototype.constructor=f,f}});var UJ=Qv((e3,t6)=>{t6.exports=function(f,v){if(!v)v={};if(typeof v==="function")v={cmp:v};var W=typeof v.cycles==="boolean"?v.cycles:!1,X=v.cmp&&function(P){return function(w){return function(G,B){var D={key:G,value:w[G]},M={key:B,value:w[B]};return P(D,M)}}}(v.cmp),Q=[];return function P(w){if(w&&w.toJSON&&typeof w.toJSON==="function")w=w.toJSON();if(w===void 0)return;if(typeof w=="number")return isFinite(w)?""+w:"null";if(typeof w!=="object")return JSON.stringify(w);var G,B;if(Array.isArray(w)){B="[";for(G=0;G<w.length;G++){if(G)B+=",";B+=P(w[G])||"null"}return B+"]"}if(w===null)return"null";if(Q.indexOf(w)!==-1){if(W)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var D=Q.push(w)-1,M=Object.keys(w).sort(X&&X(w));B="";for(G=0;G<M.length;G++){var A=M[G],N=P(w[A]);if(!N)continue;if(B)B+=",";B+=JSON.stringify(A)+":"+N}return Q.splice(D,1),"{"+B+"}"}(f)}});var jJ=Qv((vz,e6)=>{e6.exports=function f(v,W,X){var Q="",P=v.schema.$async===!0,w=v.util.schemaHasRulesExcept(v.schema,v.RULES.all,"$ref"),G=v.self._getId(v.schema);if(v.opts.strictKeywords){var B=v.util.schemaUnknownRules(v.schema,v.RULES.keywords);if(B){var D="unknown keyword: "+B;if(v.opts.strictKeywords==="log")v.logger.warn(D);else throw new Error(D)}}if(v.isTop){if(Q+=" var validate = ",P)v.async=!0,Q+="async ";if(Q+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",G&&(v.opts.sourceCode||v.opts.processCode))Q+=" "+("/*# sourceURL="+G+" */")+" "}if(typeof v.schema=="boolean"||!(w||v.schema.$ref)){var W="false schema",M=v.level,A=v.dataLevel,N=v.schema[W],h=v.schemaPath+v.util.getProperty(W),$=v.errSchemaPath+"/"+W,R=!v.opts.allErrors,x,U="data"+(A||""),L="valid"+M;if(v.schema===!1){if(v.isTop)R=!0;else Q+=" var "+L+" = false; ";var O=O||[];if(O.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(x||"false schema")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString($)+" , params: {} ",v.opts.messages!==!1)Q+=" , message: 'boolean schema is false' ";if(v.opts.verbose)Q+=" , schema: false , parentSchema: validate.schema"+v.schemaPath+" , data: "+U+" ";Q+=" } "}else Q+=" {} ";var H=Q;if(Q=O.pop(),!v.compositeRule&&R)if(v.async)Q+=" throw new ValidationError(["+H+"]); ";else Q+=" validate.errors = ["+H+"]; return false; ";else Q+=" var err = "+H+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else if(v.isTop)if(P)Q+=" return data; ";else Q+=" validate.errors = null; return true; ";else Q+=" var "+L+" = true; ";if(v.isTop)Q+=" }; return validate; ";return Q}if(v.isTop){var F=v.isTop,M=v.level=0,A=v.dataLevel=0,U="data";if(v.rootId=v.resolve.fullPath(v.self._getId(v.root.schema)),v.baseId=v.baseId||v.rootId,delete v.isTop,v.dataPathArr=[""],v.schema.default!==void 0&&v.opts.useDefaults&&v.opts.strictDefaults){var E="default is ignored in the schema root";if(v.opts.strictDefaults==="log")v.logger.warn(E);else throw new Error(E)}Q+=" var vErrors = null; ",Q+=" var errors = 0; ",Q+=" if (rootData === undefined) rootData = data; "}else{var{level:M,dataLevel:A}=v,U="data"+(A||"");if(G)v.baseId=v.resolve.url(v.baseId,G);if(P&&!v.async)throw new Error("async schema in sync schema");Q+=" var errs_"+M+" = errors;"}var L="valid"+M,R=!v.opts.allErrors,Z="",m="",x,y=v.schema.type,a=Array.isArray(y);if(y&&v.opts.nullable&&v.schema.nullable===!0){if(a){if(y.indexOf("null")==-1)y=y.concat("null")}else if(y!="null")y=[y,"null"],a=!0}if(a&&y.length==1)y=y[0],a=!1;if(v.schema.$ref&&w){if(v.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+v.errSchemaPath+'" (see option extendRefs)');else if(v.opts.extendRefs!==!0)w=!1,v.logger.warn('$ref: keywords ignored in schema at path "'+v.errSchemaPath+'"')}if(v.schema.$comment&&v.opts.$comment)Q+=" "+v.RULES.all.$comment.code(v,"$comment");if(y){if(v.opts.coerceTypes)var p=v.util.coerceToTypes(v.opts.coerceTypes,y);var i=v.RULES.types[y];if(p||a||i===!0||i&&!iv(i)){var h=v.schemaPath+".type",$=v.errSchemaPath+"/type",h=v.schemaPath+".type",$=v.errSchemaPath+"/type",T=a?"checkDataTypes":"checkDataType";if(Q+=" if ("+v.util[T](y,U,v.opts.strictNumbers,!0)+") { ",p){var b="dataType"+M,d="coerced"+M;if(Q+=" var "+b+" = typeof "+U+"; var "+d+" = undefined; ",v.opts.coerceTypes=="array")Q+=" if ("+b+" == 'object' && Array.isArray("+U+") && "+U+".length == 1) { "+U+" = "+U+"[0]; "+b+" = typeof "+U+"; if ("+v.util.checkDataType(v.schema.type,U,v.opts.strictNumbers)+") "+d+" = "+U+"; } ";Q+=" if ("+d+" !== undefined) ; ";var Av=p;if(Av){var Bv,Kv=-1,Gv=Av.length-1;while(Kv<Gv)if(Bv=Av[Kv+=1],Bv=="string")Q+=" else if ("+b+" == 'number' || "+b+" == 'boolean') "+d+" = '' + "+U+"; else if ("+U+" === null) "+d+" = ''; ";else if(Bv=="number"||Bv=="integer"){if(Q+=" else if ("+b+" == 'boolean' || "+U+" === null || ("+b+" == 'string' && "+U+" && "+U+" == +"+U+" ",Bv=="integer")Q+=" && !("+U+" % 1)";Q+=")) "+d+" = +"+U+"; "}else if(Bv=="boolean")Q+=" else if ("+U+" === 'false' || "+U+" === 0 || "+U+" === null) "+d+" = false; else if ("+U+" === 'true' || "+U+" === 1) "+d+" = true; ";else if(Bv=="null")Q+=" else if ("+U+" === '' || "+U+" === 0 || "+U+" === false) "+d+" = null; ";else if(v.opts.coerceTypes=="array"&&Bv=="array")Q+=" else if ("+b+" == 'string' || "+b+" == 'number' || "+b+" == 'boolean' || "+U+" == null) "+d+" = ["+U+"]; "}Q+=" else { ";var O=O||[];if(O.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(x||"type")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString($)+" , params: { type: '",a)Q+=""+y.join(",");else Q+=""+y;if(Q+="' } ",v.opts.messages!==!1){if(Q+=" , message: 'should be ",a)Q+=""+y.join(",");else Q+=""+y;Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+U+" ";Q+=" } "}else Q+=" {} ";var H=Q;if(Q=O.pop(),!v.compositeRule&&R)if(v.async)Q+=" throw new ValidationError(["+H+"]); ";else Q+=" validate.errors = ["+H+"]; return false; ";else Q+=" var err = "+H+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";Q+=" } if ("+d+" !== undefined) { ";var e=A?"data"+(A-1||""):"parentData",Zv=A?v.dataPathArr[A]:"parentDataProperty";if(Q+=" "+U+" = "+d+"; ",!A)Q+="if ("+e+" !== undefined)";Q+=" "+e+"["+Zv+"] = "+d+"; } "}else{var O=O||[];if(O.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(x||"type")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString($)+" , params: { type: '",a)Q+=""+y.join(",");else Q+=""+y;if(Q+="' } ",v.opts.messages!==!1){if(Q+=" , message: 'should be ",a)Q+=""+y.join(",");else Q+=""+y;Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+U+" ";Q+=" } "}else Q+=" {} ";var H=Q;if(Q=O.pop(),!v.compositeRule&&R)if(v.async)Q+=" throw new ValidationError(["+H+"]); ";else Q+=" validate.errors = ["+H+"]; return false; ";else Q+=" var err = "+H+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}Q+=" } "}}if(v.schema.$ref&&!w){if(Q+=" "+v.RULES.all.$ref.code(v,"$ref")+" ",R){if(Q+=" } if (errors === ",F)Q+="0";else Q+="errs_"+M;Q+=") { ",m+="}"}}else{var sv=v.RULES;if(sv){var i,vf=-1,Pv=sv.length-1;while(vf<Pv)if(i=sv[vf+=1],iv(i)){if(i.type)Q+=" if ("+v.util.checkDataType(i.type,U,v.opts.strictNumbers)+") { ";if(v.opts.useDefaults){if(i.type=="object"&&v.schema.properties){var N=v.schema.properties,Ev=Object.keys(N),nv=Ev;if(nv){var ov,tv=-1,Uf=nv.length-1;while(tv<Uf){ov=nv[tv+=1];var xv=N[ov];if(xv.default!==void 0){var Cv=U+v.util.getProperty(ov);if(v.compositeRule){if(v.opts.strictDefaults){var E="default is ignored for: "+Cv;if(v.opts.strictDefaults==="log")v.logger.warn(E);else throw new Error(E)}}else{if(Q+=" if ("+Cv+" === undefined ",v.opts.useDefaults=="empty")Q+=" || "+Cv+" === null || "+Cv+" === '' ";if(Q+=" ) "+Cv+" = ",v.opts.useDefaults=="shared")Q+=" "+v.useDefault(xv.default)+" ";else Q+=" "+JSON.stringify(xv.default)+" ";Q+="; "}}}}}else if(i.type=="array"&&Array.isArray(v.schema.items)){var M1=v.schema.items;if(M1){var xv,Kv=-1,pv=M1.length-1;while(Kv<pv)if(xv=M1[Kv+=1],xv.default!==void 0){var Cv=U+"["+Kv+"]";if(v.compositeRule){if(v.opts.strictDefaults){var E="default is ignored for: "+Cv;if(v.opts.strictDefaults==="log")v.logger.warn(E);else throw new Error(E)}}else{if(Q+=" if ("+Cv+" === undefined ",v.opts.useDefaults=="empty")Q+=" || "+Cv+" === null || "+Cv+" === '' ";if(Q+=" ) "+Cv+" = ",v.opts.useDefaults=="shared")Q+=" "+v.useDefault(xv.default)+" ";else Q+=" "+JSON.stringify(xv.default)+" ";Q+="; "}}}}}var Vv=i.rules;if(Vv){var Bf,Sf=-1,bf=Vv.length-1;while(Sf<bf)if(Bf=Vv[Sf+=1],rv(Bf)){var gf=Bf.code(v,Bf.keyword,i.type);if(gf){if(Q+=" "+gf+" ",R)Z+="}"}}}if(R)Q+=" "+Z+" ",Z="";if(i.type){if(Q+=" } ",y&&y===i.type&&!p){Q+=" else { ";var h=v.schemaPath+".type",$=v.errSchemaPath+"/type",O=O||[];if(O.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(x||"type")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString($)+" , params: { type: '",a)Q+=""+y.join(",");else Q+=""+y;if(Q+="' } ",v.opts.messages!==!1){if(Q+=" , message: 'should be ",a)Q+=""+y.join(",");else Q+=""+y;Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+U+" ";Q+=" } "}else Q+=" {} ";var H=Q;if(Q=O.pop(),!v.compositeRule&&R)if(v.async)Q+=" throw new ValidationError(["+H+"]); ";else Q+=" validate.errors = ["+H+"]; return false; ";else Q+=" var err = "+H+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";Q+=" } "}}if(R){if(Q+=" if (errors === ",F)Q+="0";else Q+="errs_"+M;Q+=") { ",m+="}"}}}}if(R)Q+=" "+m+" ";if(F){if(P)Q+=" if (errors === 0) return data; ",Q+=" else throw new ValidationError(vErrors); ";else Q+=" validate.errors = vErrors; ",Q+=" return errors === 0; ";Q+=" }; return validate;"}else Q+=" var "+L+" = errors === errs_"+M+";";function iv(cv){var Rf=cv.rules;for(var Jf=0;Jf<Rf.length;Jf++)if(rv(Rf[Jf]))return!0}function rv(cv){return v.schema[cv.keyword]!==void 0||cv.implements&&bv(cv)}function bv(cv){var Rf=cv.implements;for(var Jf=0;Jf<Rf.length;Jf++)if(v.schema[Rf[Jf]]!==void 0)return!0}return Q}});var JX=Qv((fz,WX)=>{var t8=s8(),vW=O0(),fX=o8(),hw=UJ(),vX=jJ(),$w=vW.ucs2length,Dw=r8(),Mw=fX.Validation;WX.exports=FJ;function FJ(f,v,W,X){var Q=this,P=this._opts,w=[void 0],G={},B=[],D={},M=[],A={},N=[];v=v||{schema:f,refVal:w,refs:G};var h=Ow.call(this,f,v,X),$=this._compilations[h.index];if(h.compiling)return $.callValidate=E;var U=this._formats,O=this.RULES;try{var H=L(f,v,W,X);$.validate=H;var F=$.callValidate;if(F){if(F.schema=H.schema,F.errors=null,F.refs=H.refs,F.refVal=H.refVal,F.root=H.root,F.$async=H.$async,P.sourceCode)F.source=H.source}return H}finally{Hw.call(this,f,v,X)}function E(){var T=$.validate,b=T.apply(this,arguments);return E.errors=T.errors,b}function L(T,b,d,Av){var Bv=!b||b&&b.schema==T;if(b.schema!=v.schema)return FJ.call(Q,T,b,d,Av);var Kv=T.$async===!0,Gv=vX({isTop:!0,schema:T,isRoot:Bv,baseId:Av,root:b,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:fX.MissingRef,RULES:O,validate:vX,util:vW,resolve:t8,resolveRef:R,usePattern:a,useDefault:p,useCustomRule:i,opts:P,formats:U,logger:Q.logger,self:Q});if(Gv=e8(w,Nw)+e8(B,Vw)+e8(M,qw)+e8(N,Ew)+Gv,P.processCode)Gv=P.processCode(Gv,T);var e;try{var Zv=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",Gv);e=Zv(Q,O,U,v,w,M,N,Dw,$w,Mw),w[0]=e}catch(sv){throw Q.logger.error("Error compiling schema, function code:",Gv),sv}if(e.schema=T,e.errors=null,e.refs=G,e.refVal=w,e.root=Bv?e:b,Kv)e.$async=!0;if(P.sourceCode===!0)e.source={code:Gv,patterns:B,defaults:M};return e}function R(T,b,d){b=t8.url(T,b);var Av=G[b],Bv,Kv;if(Av!==void 0)return Bv=w[Av],Kv="refVal["+Av+"]",y(Bv,Kv);if(!d&&v.refs){var Gv=v.refs[b];if(Gv!==void 0)return Bv=v.refVal[Gv],Kv=Z(b,Bv),y(Bv,Kv)}Kv=Z(b);var e=t8.call(Q,L,v,b);if(e===void 0){var Zv=W&&W[b];if(Zv)e=t8.inlineRef(Zv,P.inlineRefs)?Zv:FJ.call(Q,Zv,v,W,T)}if(e===void 0)m(b);else return x(b,e),y(e,Kv)}function Z(T,b){var d=w.length;return w[d]=b,G[T]=d,"refVal"+d}function m(T){delete G[T]}function x(T,b){var d=G[T];w[d]=b}function y(T,b){return typeof T=="object"||typeof T=="boolean"?{code:b,schema:T,inline:!0}:{code:b,$async:T&&!!T.$async}}function a(T){var b=D[T];if(b===void 0)b=D[T]=B.length,B[b]=T;return"pattern"+b}function p(T){switch(typeof T){case"boolean":case"number":return""+T;case"string":return vW.toQuotedString(T);case"object":if(T===null)return"null";var b=hw(T),d=A[b];if(d===void 0)d=A[b]=M.length,M[d]=T;return"default"+d}}function i(T,b,d,Av){if(Q._opts.validateSchema!==!1){var Bv=T.definition.dependencies;if(Bv&&!Bv.every(function(nv){return Object.prototype.hasOwnProperty.call(d,nv)}))throw new Error("parent schema must have all required keywords: "+Bv.join(","));var Kv=T.definition.validateSchema;if(Kv){var Gv=Kv(b);if(!Gv){var e="keyword schema is invalid: "+Q.errorsText(Kv.errors);if(Q._opts.validateSchema=="log")Q.logger.error(e);else throw new Error(e)}}}var Zv=T.definition.compile,sv=T.definition.inline,vf=T.definition.macro,Pv;if(Zv)Pv=Zv.call(Q,b,d,Av);else if(vf){if(Pv=vf.call(Q,b,d,Av),P.validateSchema!==!1)Q.validateSchema(Pv,!0)}else if(sv)Pv=sv.call(Q,Av,T.keyword,b,d);else if(Pv=T.definition.validate,!Pv)return;if(Pv===void 0)throw new Error('custom keyword "'+T.keyword+'"failed to compile');var Ev=N.length;return N[Ev]=Pv,{code:"customRule"+Ev,validate:Pv}}}function Ow(f,v,W){var X=QX.call(this,f,v,W);if(X>=0)return{index:X,compiling:!0};return X=this._compilations.length,this._compilations[X]={schema:f,root:v,baseId:W},{index:X,compiling:!1}}function Hw(f,v,W){var X=QX.call(this,f,v,W);if(X>=0)this._compilations.splice(X,1)}function QX(f,v,W){for(var X=0;X<this._compilations.length;X++){var Q=this._compilations[X];if(Q.schema==f&&Q.root==v&&Q.baseId==W)return X}return-1}function Vw(f,v){return"var pattern"+f+" = new RegExp("+vW.toQuotedString(v[f])+");"}function qw(f){return"var default"+f+" = defaults["+f+"];"}function Nw(f,v){return v[f]===void 0?"":"var refVal"+f+" = refVal["+f+"];"}function Ew(f){return"var customRule"+f+" = customRules["+f+"];"}function e8(f,v){if(!f.length)return"";var W="";for(var X=0;X<f.length;X++)W+=v(X,f);return W}});var PX=Qv((Qz,XX)=>{var fW=XX.exports=function f(){this._cache={}};fW.prototype.put=function f(v,W){this._cache[v]=W};fW.prototype.get=function f(v){return this._cache[v]};fW.prototype.del=function f(v){delete this._cache[v]};fW.prototype.clear=function f(){this._cache={}}});var HX=Qv((Wz,OX)=>{var Aw=O0(),Uw=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,jw=[0,31,28,31,30,31,30,31,31,30,31,30,31],Fw=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,YX=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,Lw=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,Sw=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,wX=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,GX=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,zX=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,BX=/^(?:\/(?:[^~/]|~0|~1)*)*$/,KX=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,hX=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;OX.exports=QW;function QW(f){return f=f=="full"?"full":"fast",Aw.copy(QW[f])}QW.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":wX,url:GX,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:YX,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:MX,uuid:zX,"json-pointer":BX,"json-pointer-uri-fragment":KX,"relative-json-pointer":hX};QW.full={date:$X,time:DX,"date-time":_w,uri:Iw,"uri-reference":Sw,"uri-template":wX,url:GX,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:YX,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:MX,uuid:zX,"json-pointer":BX,"json-pointer-uri-fragment":KX,"relative-json-pointer":hX};function gw(f){return f%4===0&&(f%100!==0||f%400===0)}function $X(f){var v=f.match(Uw);if(!v)return!1;var W=+v[1],X=+v[2],Q=+v[3];return X>=1&&X<=12&&Q>=1&&Q<=(X==2&&gw(W)?29:jw[X])}function DX(f,v){var W=f.match(Fw);if(!W)return!1;var X=W[1],Q=W[2],P=W[3],w=W[5];return(X<=23&&Q<=59&&P<=59||X==23&&Q==59&&P==60)&&(!v||w)}var Rw=/t|\s/i;function _w(f){var v=f.split(Rw);return v.length==2&&$X(v[0])&&DX(v[1],!0)}var kw=/\/|:/;function Iw(f){return kw.test(f)&&Lw.test(f)}var Zw=/[^\\]\\Z/;function MX(f){if(Zw.test(f))return!1;try{return new RegExp(f),!0}catch(v){return!1}}});var qX=Qv((Jz,VX)=>{VX.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.errSchemaPath+"/"+W,D=!v.opts.allErrors,M="data"+(w||""),A="valid"+P,N,h;if(G=="#"||G=="#/")if(v.isRoot)N=v.async,h="validate";else N=v.root.schema.$async===!0,h="root.refVal[0]";else{var $=v.resolveRef(v.baseId,G,v.isRoot);if($===void 0){var U=v.MissingRefError.message(v.baseId,G);if(v.opts.missingRefs=="fail"){v.logger.error(U);var O=O||[];if(O.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(B)+" , params: { ref: '"+v.util.escapeQuotes(G)+"' } ",v.opts.messages!==!1)Q+=" , message: 'can\\'t resolve reference "+v.util.escapeQuotes(G)+"' ";if(v.opts.verbose)Q+=" , schema: "+v.util.toQuotedString(G)+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+M+" ";Q+=" } "}else Q+=" {} ";var H=Q;if(Q=O.pop(),!v.compositeRule&&D)if(v.async)Q+=" throw new ValidationError(["+H+"]); ";else Q+=" validate.errors = ["+H+"]; return false; ";else Q+=" var err = "+H+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(D)Q+=" if (false) { "}else if(v.opts.missingRefs=="ignore"){if(v.logger.warn(U),D)Q+=" if (true) { "}else throw new v.MissingRefError(v.baseId,G,U)}else if($.inline){var F=v.util.copy(v);F.level++;var E="valid"+F.level;F.schema=$.schema,F.schemaPath="",F.errSchemaPath=G;var L=v.validate(F).replace(/validate\.schema/g,$.code);if(Q+=" "+L+" ",D)Q+=" if ("+E+") { "}else N=$.$async===!0||v.async&&$.$async!==!1,h=$.code}if(h){var O=O||[];if(O.push(Q),Q="",v.opts.passContext)Q+=" "+h+".call(this, ";else Q+=" "+h+"( ";if(Q+=" "+M+", (dataPath || '')",v.errorPath!='""')Q+=" + "+v.errorPath;var R=w?"data"+(w-1||""):"parentData",Z=w?v.dataPathArr[w]:"parentDataProperty";Q+=" , "+R+" , "+Z+", rootData) ";var m=Q;if(Q=O.pop(),N){if(!v.async)throw new Error("async schema referenced by sync schema");if(D)Q+=" var "+A+"; ";if(Q+=" try { await "+m+"; ",D)Q+=" "+A+" = true; ";if(Q+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",D)Q+=" "+A+" = false; ";if(Q+=" } ",D)Q+=" if ("+A+") { "}else if(Q+=" if (!"+m+") { if (vErrors === null) vErrors = "+h+".errors; else vErrors = vErrors.concat("+h+".errors); errors = vErrors.length; } ",D)Q+=" else { "}return Q}});var EX=Qv((Xz,NX)=>{NX.exports=function f(v,W,X){var Q=" ",P=v.schema[W],w=v.schemaPath+v.util.getProperty(W),G=v.errSchemaPath+"/"+W,B=!v.opts.allErrors,D=v.util.copy(v),M="";D.level++;var A="valid"+D.level,N=D.baseId,h=!0,$=P;if($){var U,O=-1,H=$.length-1;while(O<H)if(U=$[O+=1],v.opts.strictKeywords?typeof U=="object"&&Object.keys(U).length>0||U===!1:v.util.schemaHasRules(U,v.RULES.all)){if(h=!1,D.schema=U,D.schemaPath=w+"["+O+"]",D.errSchemaPath=G+"/"+O,Q+=" "+v.validate(D)+" ",D.baseId=N,B)Q+=" if ("+A+") { ",M+="}"}}if(B)if(h)Q+=" if (true) { ";else Q+=" "+M.slice(0,-1)+" ";return Q}});var UX=Qv((Pz,AX)=>{AX.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.schemaPath+v.util.getProperty(W),D=v.errSchemaPath+"/"+W,M=!v.opts.allErrors,A="data"+(w||""),N="valid"+P,h="errs__"+P,$=v.util.copy(v),U="";$.level++;var O="valid"+$.level,H=G.every(function(x){return v.opts.strictKeywords?typeof x=="object"&&Object.keys(x).length>0||x===!1:v.util.schemaHasRules(x,v.RULES.all)});if(H){var F=$.baseId;Q+=" var "+h+" = errors; var "+N+" = false; ";var E=v.compositeRule;v.compositeRule=$.compositeRule=!0;var L=G;if(L){var R,Z=-1,m=L.length-1;while(Z<m)R=L[Z+=1],$.schema=R,$.schemaPath=B+"["+Z+"]",$.errSchemaPath=D+"/"+Z,Q+=" "+v.validate($)+" ",$.baseId=F,Q+=" "+N+" = "+N+" || "+O+"; if (!"+N+") { ",U+="}"}if(v.compositeRule=$.compositeRule=E,Q+=" "+U+" if (!"+N+") { var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: {} ",v.opts.messages!==!1)Q+=" , message: 'should match some schema in anyOf' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" ";Q+=" } "}else Q+=" {} ";if(Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(vErrors); ";else Q+=" validate.errors = vErrors; return false; ";if(Q+=" } else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",v.opts.allErrors)Q+=" } "}else if(M)Q+=" if (true) { ";return Q}});var FX=Qv((Yz,jX)=>{jX.exports=function f(v,W,X){var Q=" ",P=v.schema[W],w=v.errSchemaPath+"/"+W,G=!v.opts.allErrors,B=v.util.toQuotedString(P);if(v.opts.$comment===!0)Q+=" console.log("+B+");";else if(typeof v.opts.$comment=="function")Q+=" self._opts.$comment("+B+", "+v.util.toQuotedString(w)+", validate.root.schema);";return Q}});var SX=Qv((wz,LX)=>{LX.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.schemaPath+v.util.getProperty(W),D=v.errSchemaPath+"/"+W,M=!v.opts.allErrors,A="data"+(w||""),N="valid"+P,h=v.opts.$data&&G&&G.$data,$;if(h)Q+=" var schema"+P+" = "+v.util.getData(G.$data,w,v.dataPathArr)+"; ",$="schema"+P;else $=G;if(!h)Q+=" var schema"+P+" = validate.schema"+B+";";Q+="var "+N+" = equal("+A+", schema"+P+"); if (!"+N+") { ";var U=U||[];if(U.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'const' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { allowedValue: schema"+P+" } ",v.opts.messages!==!1)Q+=" , message: 'should be equal to constant' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" ";Q+=" } "}else Q+=" {} ";var O=Q;if(Q=U.pop(),!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(["+O+"]); ";else Q+=" validate.errors = ["+O+"]; return false; ";else Q+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" }",M)Q+=" else { ";return Q}});var RX=Qv((Gz,gX)=>{gX.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.schemaPath+v.util.getProperty(W),D=v.errSchemaPath+"/"+W,M=!v.opts.allErrors,A="data"+(w||""),N="valid"+P,h="errs__"+P,$=v.util.copy(v),U="";$.level++;var O="valid"+$.level,H="i"+P,F=$.dataLevel=v.dataLevel+1,E="data"+F,L=v.baseId,R=v.opts.strictKeywords?typeof G=="object"&&Object.keys(G).length>0||G===!1:v.util.schemaHasRules(G,v.RULES.all);if(Q+="var "+h+" = errors;var "+N+";",R){var Z=v.compositeRule;v.compositeRule=$.compositeRule=!0,$.schema=G,$.schemaPath=B,$.errSchemaPath=D,Q+=" var "+O+" = false; for (var "+H+" = 0; "+H+" < "+A+".length; "+H+"++) { ",$.errorPath=v.util.getPathExpr(v.errorPath,H,v.opts.jsonPointers,!0);var m=A+"["+H+"]";$.dataPathArr[F]=H;var x=v.validate($);if($.baseId=L,v.util.varOccurences(x,E)<2)Q+=" "+v.util.varReplace(x,E,m)+" ";else Q+=" var "+E+" = "+m+"; "+x+" ";Q+=" if ("+O+") break; } ",v.compositeRule=$.compositeRule=Z,Q+=" "+U+" if (!"+O+") {"}else Q+=" if ("+A+".length == 0) {";var y=y||[];if(y.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: {} ",v.opts.messages!==!1)Q+=" , message: 'should contain a valid item' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" ";Q+=" } "}else Q+=" {} ";var a=Q;if(Q=y.pop(),!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(["+a+"]); ";else Q+=" validate.errors = ["+a+"]; return false; ";else Q+=" var err = "+a+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" } else { ",R)Q+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ";if(v.opts.allErrors)Q+=" } ";return Q}});var kX=Qv((zz,_X)=>{_X.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.schemaPath+v.util.getProperty(W),D=v.errSchemaPath+"/"+W,M=!v.opts.allErrors,A="data"+(w||""),N="errs__"+P,h=v.util.copy(v),$="";h.level++;var U="valid"+h.level,O={},H={},F=v.opts.ownProperties;for(Z in G){if(Z=="__proto__")continue;var E=G[Z],L=Array.isArray(E)?H:O;L[Z]=E}Q+="var "+N+" = errors;";var R=v.errorPath;Q+="var missing"+P+";";for(var Z in H)if(L=H[Z],L.length){if(Q+=" if ( "+A+v.util.getProperty(Z)+" !== undefined ",F)Q+=" && Object.prototype.hasOwnProperty.call("+A+", '"+v.util.escapeQuotes(Z)+"') ";if(M){Q+=" && ( ";var m=L;if(m){var x,y=-1,a=m.length-1;while(y<a){if(x=m[y+=1],y)Q+=" || ";var p=v.util.getProperty(x),i=A+p;if(Q+=" ( ( "+i+" === undefined ",F)Q+=" || ! Object.prototype.hasOwnProperty.call("+A+", '"+v.util.escapeQuotes(x)+"') ";Q+=") && (missing"+P+" = "+v.util.toQuotedString(v.opts.jsonPointers?x:p)+") ) "}}Q+=")) { ";var T="missing"+P,b="' + "+T+" + '";if(v.opts._errorDataPathProperty)v.errorPath=v.opts.jsonPointers?v.util.getPathExpr(R,T,!0):R+" + "+T;var d=d||[];if(d.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { property: '"+v.util.escapeQuotes(Z)+"', missingProperty: '"+b+"', depsCount: "+L.length+", deps: '"+v.util.escapeQuotes(L.length==1?L[0]:L.join(", "))+"' } ",v.opts.messages!==!1){if(Q+=" , message: 'should have ",L.length==1)Q+="property "+v.util.escapeQuotes(L[0]);else Q+="properties "+v.util.escapeQuotes(L.join(", "));Q+=" when property "+v.util.escapeQuotes(Z)+" is present' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" ";Q+=" } "}else Q+=" {} ";var Av=Q;if(Q=d.pop(),!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(["+Av+"]); ";else Q+=" validate.errors = ["+Av+"]; return false; ";else Q+=" var err = "+Av+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{Q+=" ) { ";var Bv=L;if(Bv){var x,Kv=-1,Gv=Bv.length-1;while(Kv<Gv){x=Bv[Kv+=1];var p=v.util.getProperty(x),b=v.util.escapeQuotes(x),i=A+p;if(v.opts._errorDataPathProperty)v.errorPath=v.util.getPath(R,x,v.opts.jsonPointers);if(Q+=" if ( "+i+" === undefined ",F)Q+=" || ! Object.prototype.hasOwnProperty.call("+A+", '"+v.util.escapeQuotes(x)+"') ";if(Q+=") { var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { property: '"+v.util.escapeQuotes(Z)+"', missingProperty: '"+b+"', depsCount: "+L.length+", deps: '"+v.util.escapeQuotes(L.length==1?L[0]:L.join(", "))+"' } ",v.opts.messages!==!1){if(Q+=" , message: 'should have ",L.length==1)Q+="property "+v.util.escapeQuotes(L[0]);else Q+="properties "+v.util.escapeQuotes(L.join(", "));Q+=" when property "+v.util.escapeQuotes(Z)+" is present' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" ";Q+=" } "}else Q+=" {} ";Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}}if(Q+=" } ",M)$+="}",Q+=" else { "}v.errorPath=R;var e=h.baseId;for(var Z in O){var E=O[Z];if(v.opts.strictKeywords?typeof E=="object"&&Object.keys(E).length>0||E===!1:v.util.schemaHasRules(E,v.RULES.all)){if(Q+=" "+U+" = true; if ( "+A+v.util.getProperty(Z)+" !== undefined ",F)Q+=" && Object.prototype.hasOwnProperty.call("+A+", '"+v.util.escapeQuotes(Z)+"') ";if(Q+=") { ",h.schema=E,h.schemaPath=B+v.util.getProperty(Z),h.errSchemaPath=D+"/"+v.util.escapeFragment(Z),Q+=" "+v.validate(h)+" ",h.baseId=e,Q+=" } ",M)Q+=" if ("+U+") { ",$+="}"}}if(M)Q+=" "+$+" if ("+N+" == errors) {";return Q}});var ZX=Qv((Bz,IX)=>{IX.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.schemaPath+v.util.getProperty(W),D=v.errSchemaPath+"/"+W,M=!v.opts.allErrors,A="data"+(w||""),N="valid"+P,h=v.opts.$data&&G&&G.$data,$;if(h)Q+=" var schema"+P+" = "+v.util.getData(G.$data,w,v.dataPathArr)+"; ",$="schema"+P;else $=G;var U="i"+P,O="schema"+P;if(!h)Q+=" var "+O+" = validate.schema"+B+";";if(Q+="var "+N+";",h)Q+=" if (schema"+P+" === undefined) "+N+" = true; else if (!Array.isArray(schema"+P+")) "+N+" = false; else {";if(Q+=""+N+" = false;for (var "+U+"=0; "+U+"<"+O+".length; "+U+"++) if (equal("+A+", "+O+"["+U+"])) { "+N+" = true; break; }",h)Q+=" } ";Q+=" if (!"+N+") { ";var H=H||[];if(H.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { allowedValues: schema"+P+" } ",v.opts.messages!==!1)Q+=" , message: 'should be equal to one of the allowed values' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" ";Q+=" } "}else Q+=" {} ";var F=Q;if(Q=H.pop(),!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(["+F+"]); ";else Q+=" validate.errors = ["+F+"]; return false; ";else Q+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" }",M)Q+=" else { ";return Q}});var yX=Qv((Kz,CX)=>{CX.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.schemaPath+v.util.getProperty(W),D=v.errSchemaPath+"/"+W,M=!v.opts.allErrors,A="data"+(w||"");if(v.opts.format===!1){if(M)Q+=" if (true) { ";return Q}var N=v.opts.$data&&G&&G.$data,h;if(N)Q+=" var schema"+P+" = "+v.util.getData(G.$data,w,v.dataPathArr)+"; ",h="schema"+P;else h=G;var $=v.opts.unknownFormats,U=Array.isArray($);if(N){var O="format"+P,H="isObject"+P,F="formatType"+P;if(Q+=" var "+O+" = formats["+h+"]; var "+H+" = typeof "+O+" == 'object' && !("+O+" instanceof RegExp) && "+O+".validate; var "+F+" = "+H+" && "+O+".type || 'string'; if ("+H+") { ",v.async)Q+=" var async"+P+" = "+O+".async; ";if(Q+=" "+O+" = "+O+".validate; } if ( ",N)Q+=" ("+h+" !== undefined && typeof "+h+" != 'string') || ";if(Q+=" (",$!="ignore"){if(Q+=" ("+h+" && !"+O+" ",U)Q+=" && self._opts.unknownFormats.indexOf("+h+") == -1 ";Q+=") || "}if(Q+=" ("+O+" && "+F+" == '"+X+"' && !(typeof "+O+" == 'function' ? ",v.async)Q+=" (async"+P+" ? await "+O+"("+A+") : "+O+"("+A+")) ";else Q+=" "+O+"("+A+") ";Q+=" : "+O+".test("+A+"))))) {"}else{var O=v.formats[G];if(!O)if($=="ignore"){if(v.logger.warn('unknown format "'+G+'" ignored in schema at path "'+v.errSchemaPath+'"'),M)Q+=" if (true) { ";return Q}else if(U&&$.indexOf(G)>=0){if(M)Q+=" if (true) { ";return Q}else throw new Error('unknown format "'+G+'" is used in schema at path "'+v.errSchemaPath+'"');var H=typeof O=="object"&&!(O instanceof RegExp)&&O.validate,F=H&&O.type||"string";if(H){var E=O.async===!0;O=O.validate}if(F!=X){if(M)Q+=" if (true) { ";return Q}if(E){if(!v.async)throw new Error("async format in sync schema");var L="formats"+v.util.getProperty(G)+".validate";Q+=" if (!(await "+L+"("+A+"))) { "}else{Q+=" if (! ";var L="formats"+v.util.getProperty(G);if(H)L+=".validate";if(typeof O=="function")Q+=" "+L+"("+A+") ";else Q+=" "+L+".test("+A+") ";Q+=") { "}}var R=R||[];if(R.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'format' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { format: ",N)Q+=""+h;else Q+=""+v.util.toQuotedString(G);if(Q+=" } ",v.opts.messages!==!1){if(Q+=` , message: 'should match format "`,N)Q+="' + "+h+" + '";else Q+=""+v.util.escapeQuotes(G);Q+=`"' `}if(v.opts.verbose){if(Q+=" , schema: ",N)Q+="validate.schema"+B;else Q+=""+v.util.toQuotedString(G);Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" "}Q+=" } "}else Q+=" {} ";var Z=Q;if(Q=R.pop(),!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(["+Z+"]); ";else Q+=" validate.errors = ["+Z+"]; return false; ";else Q+=" var err = "+Z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" } ",M)Q+=" else { ";return Q}});var xX=Qv((hz,TX)=>{TX.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.schemaPath+v.util.getProperty(W),D=v.errSchemaPath+"/"+W,M=!v.opts.allErrors,A="data"+(w||""),N="valid"+P,h="errs__"+P,$=v.util.copy(v);$.level++;var U="valid"+$.level,O=v.schema.then,H=v.schema.else,F=O!==void 0&&(v.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:v.util.schemaHasRules(O,v.RULES.all)),E=H!==void 0&&(v.opts.strictKeywords?typeof H=="object"&&Object.keys(H).length>0||H===!1:v.util.schemaHasRules(H,v.RULES.all)),L=$.baseId;if(F||E){var R;$.createErrors=!1,$.schema=G,$.schemaPath=B,$.errSchemaPath=D,Q+=" var "+h+" = errors; var "+N+" = true; ";var Z=v.compositeRule;if(v.compositeRule=$.compositeRule=!0,Q+=" "+v.validate($)+" ",$.baseId=L,$.createErrors=!0,Q+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",v.compositeRule=$.compositeRule=Z,F){if(Q+=" if ("+U+") { ",$.schema=v.schema.then,$.schemaPath=v.schemaPath+".then",$.errSchemaPath=v.errSchemaPath+"/then",Q+=" "+v.validate($)+" ",$.baseId=L,Q+=" "+N+" = "+U+"; ",F&&E)R="ifClause"+P,Q+=" var "+R+" = 'then'; ";else R="'then'";if(Q+=" } ",E)Q+=" else { "}else Q+=" if (!"+U+") { ";if(E){if($.schema=v.schema.else,$.schemaPath=v.schemaPath+".else",$.errSchemaPath=v.errSchemaPath+"/else",Q+=" "+v.validate($)+" ",$.baseId=L,Q+=" "+N+" = "+U+"; ",F&&E)R="ifClause"+P,Q+=" var "+R+" = 'else'; ";else R="'else'";Q+=" } "}if(Q+=" if (!"+N+") { var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'if' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { failingKeyword: "+R+" } ",v.opts.messages!==!1)Q+=` , message: 'should match "' + `+R+` + '" schema' `;if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" ";Q+=" } "}else Q+=" {} ";if(Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(vErrors); ";else Q+=" validate.errors = vErrors; return false; ";if(Q+=" } ",M)Q+=" else { "}else if(M)Q+=" if (true) { ";return Q}});var bX=Qv(($z,lX)=>{lX.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.schemaPath+v.util.getProperty(W),D=v.errSchemaPath+"/"+W,M=!v.opts.allErrors,A="data"+(w||""),N="valid"+P,h="errs__"+P,$=v.util.copy(v),U="";$.level++;var O="valid"+$.level,H="i"+P,F=$.dataLevel=v.dataLevel+1,E="data"+F,L=v.baseId;if(Q+="var "+h+" = errors;var "+N+";",Array.isArray(G)){var R=v.schema.additionalItems;if(R===!1){Q+=" "+N+" = "+A+".length <= "+G.length+"; ";var Z=D;D=v.errSchemaPath+"/additionalItems",Q+=" if (!"+N+") { ";var m=m||[];if(m.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { limit: "+G.length+" } ",v.opts.messages!==!1)Q+=" , message: 'should NOT have more than "+G.length+" items' ";if(v.opts.verbose)Q+=" , schema: false , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" ";Q+=" } "}else Q+=" {} ";var x=Q;if(Q=m.pop(),!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(["+x+"]); ";else Q+=" validate.errors = ["+x+"]; return false; ";else Q+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" } ",D=Z,M)U+="}",Q+=" else { "}var y=G;if(y){var a,p=-1,i=y.length-1;while(p<i)if(a=y[p+=1],v.opts.strictKeywords?typeof a=="object"&&Object.keys(a).length>0||a===!1:v.util.schemaHasRules(a,v.RULES.all)){Q+=" "+O+" = true; if ("+A+".length > "+p+") { ";var T=A+"["+p+"]";$.schema=a,$.schemaPath=B+"["+p+"]",$.errSchemaPath=D+"/"+p,$.errorPath=v.util.getPathExpr(v.errorPath,p,v.opts.jsonPointers,!0),$.dataPathArr[F]=p;var b=v.validate($);if($.baseId=L,v.util.varOccurences(b,E)<2)Q+=" "+v.util.varReplace(b,E,T)+" ";else Q+=" var "+E+" = "+T+"; "+b+" ";if(Q+=" } ",M)Q+=" if ("+O+") { ",U+="}"}}if(typeof R=="object"&&(v.opts.strictKeywords?typeof R=="object"&&Object.keys(R).length>0||R===!1:v.util.schemaHasRules(R,v.RULES.all))){$.schema=R,$.schemaPath=v.schemaPath+".additionalItems",$.errSchemaPath=v.errSchemaPath+"/additionalItems",Q+=" "+O+" = true; if ("+A+".length > "+G.length+") { for (var "+H+" = "+G.length+"; "+H+" < "+A+".length; "+H+"++) { ",$.errorPath=v.util.getPathExpr(v.errorPath,H,v.opts.jsonPointers,!0);var T=A+"["+H+"]";$.dataPathArr[F]=H;var b=v.validate($);if($.baseId=L,v.util.varOccurences(b,E)<2)Q+=" "+v.util.varReplace(b,E,T)+" ";else Q+=" var "+E+" = "+T+"; "+b+" ";if(M)Q+=" if (!"+O+") break; ";if(Q+=" } } ",M)Q+=" if ("+O+") { ",U+="}"}}else if(v.opts.strictKeywords?typeof G=="object"&&Object.keys(G).length>0||G===!1:v.util.schemaHasRules(G,v.RULES.all)){$.schema=G,$.schemaPath=B,$.errSchemaPath=D,Q+=" for (var "+H+" = 0; "+H+" < "+A+".length; "+H+"++) { ",$.errorPath=v.util.getPathExpr(v.errorPath,H,v.opts.jsonPointers,!0);var T=A+"["+H+"]";$.dataPathArr[F]=H;var b=v.validate($);if($.baseId=L,v.util.varOccurences(b,E)<2)Q+=" "+v.util.varReplace(b,E,T)+" ";else Q+=" var "+E+" = "+T+"; "+b+" ";if(M)Q+=" if (!"+O+") break; ";Q+=" }"}if(M)Q+=" "+U+" if ("+h+" == errors) {";return Q}});var LJ=Qv((Dz,uX)=>{uX.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.schemaPath+v.util.getProperty(W),D=v.errSchemaPath+"/"+W,M=!v.opts.allErrors,L,A="data"+(w||""),N=v.opts.$data&&G&&G.$data,h;if(N)Q+=" var schema"+P+" = "+v.util.getData(G.$data,w,v.dataPathArr)+"; ",h="schema"+P;else h=G;var $=W=="maximum",U=$?"exclusiveMaximum":"exclusiveMinimum",O=v.schema[U],H=v.opts.$data&&O&&O.$data,F=$?"<":">",E=$?">":"<",L=void 0;if(!(N||typeof G=="number"||G===void 0))throw new Error(W+" must be number");if(!(H||O===void 0||typeof O=="number"||typeof O=="boolean"))throw new Error(U+" must be number or boolean");if(H){var R=v.util.getData(O.$data,w,v.dataPathArr),Z="exclusive"+P,m="exclType"+P,x="exclIsNumber"+P,y="op"+P,a="' + "+y+" + '";Q+=" var schemaExcl"+P+" = "+R+"; ",R="schemaExcl"+P,Q+=" var "+Z+"; var "+m+" = typeof "+R+"; if ("+m+" != 'boolean' && "+m+" != 'undefined' && "+m+" != 'number') { ";var L=U,p=p||[];if(p.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(L||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: {} ",v.opts.messages!==!1)Q+=" , message: '"+U+" should be boolean' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" ";Q+=" } "}else Q+=" {} ";var i=Q;if(Q=p.pop(),!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(["+i+"]); ";else Q+=" validate.errors = ["+i+"]; return false; ";else Q+=" var err = "+i+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" } else if ( ",N)Q+=" ("+h+" !== undefined && typeof "+h+" != 'number') || ";if(Q+=" "+m+" == 'number' ? ( ("+Z+" = "+h+" === undefined || "+R+" "+F+"= "+h+") ? "+A+" "+E+"= "+R+" : "+A+" "+E+" "+h+" ) : ( ("+Z+" = "+R+" === true) ? "+A+" "+E+"= "+h+" : "+A+" "+E+" "+h+" ) || "+A+" !== "+A+") { var op"+P+" = "+Z+" ? '"+F+"' : '"+F+"='; ",G===void 0)L=U,D=v.errSchemaPath+"/"+U,h=R,N=H}else{var x=typeof O=="number",a=F;if(x&&N){var y="'"+a+"'";if(Q+=" if ( ",N)Q+=" ("+h+" !== undefined && typeof "+h+" != 'number') || ";Q+=" ( "+h+" === undefined || "+O+" "+F+"= "+h+" ? "+A+" "+E+"= "+O+" : "+A+" "+E+" "+h+" ) || "+A+" !== "+A+") { "}else{if(x&&G===void 0)Z=!0,L=U,D=v.errSchemaPath+"/"+U,h=O,E+="=";else{if(x)h=Math[$?"min":"max"](O,G);if(O===(x?h:!0))Z=!0,L=U,D=v.errSchemaPath+"/"+U,E+="=";else Z=!1,a+="="}var y="'"+a+"'";if(Q+=" if ( ",N)Q+=" ("+h+" !== undefined && typeof "+h+" != 'number') || ";Q+=" "+A+" "+E+" "+h+" || "+A+" !== "+A+") { "}}L=L||W;var p=p||[];if(p.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(L||"_limit")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { comparison: "+y+", limit: "+h+", exclusive: "+Z+" } ",v.opts.messages!==!1)if(Q+=" , message: 'should be "+a+" ",N)Q+="' + "+h;else Q+=""+h+"'";if(v.opts.verbose){if(Q+=" , schema: ",N)Q+="validate.schema"+B;else Q+=""+G;Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" "}Q+=" } "}else Q+=" {} ";var i=Q;if(Q=p.pop(),!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(["+i+"]); ";else Q+=" validate.errors = ["+i+"]; return false; ";else Q+=" var err = "+i+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" } ",M)Q+=" else { ";return Q}});var SJ=Qv((Mz,mX)=>{mX.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.schemaPath+v.util.getProperty(W),D=v.errSchemaPath+"/"+W,M=!v.opts.allErrors,U,A="data"+(w||""),N=v.opts.$data&&G&&G.$data,h;if(N)Q+=" var schema"+P+" = "+v.util.getData(G.$data,w,v.dataPathArr)+"; ",h="schema"+P;else h=G;if(!(N||typeof G=="number"))throw new Error(W+" must be number");var $=W=="maxItems"?">":"<";if(Q+="if ( ",N)Q+=" ("+h+" !== undefined && typeof "+h+" != 'number') || ";Q+=" "+A+".length "+$+" "+h+") { ";var U=W,O=O||[];if(O.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(U||"_limitItems")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { limit: "+h+" } ",v.opts.messages!==!1){if(Q+=" , message: 'should NOT have ",W=="maxItems")Q+="more";else Q+="fewer";if(Q+=" than ",N)Q+="' + "+h+" + '";else Q+=""+G;Q+=" items' "}if(v.opts.verbose){if(Q+=" , schema: ",N)Q+="validate.schema"+B;else Q+=""+G;Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" "}Q+=" } "}else Q+=" {} ";var H=Q;if(Q=O.pop(),!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(["+H+"]); ";else Q+=" validate.errors = ["+H+"]; return false; ";else Q+=" var err = "+H+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+="} ",M)Q+=" else { ";return Q}});var gJ=Qv((Oz,rX)=>{rX.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.schemaPath+v.util.getProperty(W),D=v.errSchemaPath+"/"+W,M=!v.opts.allErrors,U,A="data"+(w||""),N=v.opts.$data&&G&&G.$data,h;if(N)Q+=" var schema"+P+" = "+v.util.getData(G.$data,w,v.dataPathArr)+"; ",h="schema"+P;else h=G;if(!(N||typeof G=="number"))throw new Error(W+" must be number");var $=W=="maxLength"?">":"<";if(Q+="if ( ",N)Q+=" ("+h+" !== undefined && typeof "+h+" != 'number') || ";if(v.opts.unicode===!1)Q+=" "+A+".length ";else Q+=" ucs2length("+A+") ";Q+=" "+$+" "+h+") { ";var U=W,O=O||[];if(O.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(U||"_limitLength")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { limit: "+h+" } ",v.opts.messages!==!1){if(Q+=" , message: 'should NOT be ",W=="maxLength")Q+="longer";else Q+="shorter";if(Q+=" than ",N)Q+="' + "+h+" + '";else Q+=""+G;Q+=" characters' "}if(v.opts.verbose){if(Q+=" , schema: ",N)Q+="validate.schema"+B;else Q+=""+G;Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" "}Q+=" } "}else Q+=" {} ";var H=Q;if(Q=O.pop(),!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(["+H+"]); ";else Q+=" validate.errors = ["+H+"]; return false; ";else Q+=" var err = "+H+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+="} ",M)Q+=" else { ";return Q}});var RJ=Qv((Hz,aX)=>{aX.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.schemaPath+v.util.getProperty(W),D=v.errSchemaPath+"/"+W,M=!v.opts.allErrors,U,A="data"+(w||""),N=v.opts.$data&&G&&G.$data,h;if(N)Q+=" var schema"+P+" = "+v.util.getData(G.$data,w,v.dataPathArr)+"; ",h="schema"+P;else h=G;if(!(N||typeof G=="number"))throw new Error(W+" must be number");var $=W=="maxProperties"?">":"<";if(Q+="if ( ",N)Q+=" ("+h+" !== undefined && typeof "+h+" != 'number') || ";Q+=" Object.keys("+A+").length "+$+" "+h+") { ";var U=W,O=O||[];if(O.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(U||"_limitProperties")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { limit: "+h+" } ",v.opts.messages!==!1){if(Q+=" , message: 'should NOT have ",W=="maxProperties")Q+="more";else Q+="fewer";if(Q+=" than ",N)Q+="' + "+h+" + '";else Q+=""+G;Q+=" properties' "}if(v.opts.verbose){if(Q+=" , schema: ",N)Q+="validate.schema"+B;else Q+=""+G;Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" "}Q+=" } "}else Q+=" {} ";var H=Q;if(Q=O.pop(),!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(["+H+"]); ";else Q+=" validate.errors = ["+H+"]; return false; ";else Q+=" var err = "+H+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+="} ",M)Q+=" else { ";return Q}});var nX=Qv((Vz,cX)=>{cX.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.schemaPath+v.util.getProperty(W),D=v.errSchemaPath+"/"+W,M=!v.opts.allErrors,A="data"+(w||""),N=v.opts.$data&&G&&G.$data,h;if(N)Q+=" var schema"+P+" = "+v.util.getData(G.$data,w,v.dataPathArr)+"; ",h="schema"+P;else h=G;if(!(N||typeof G=="number"))throw new Error(W+" must be number");if(Q+="var division"+P+";if (",N)Q+=" "+h+" !== undefined && ( typeof "+h+" != 'number' || ";if(Q+=" (division"+P+" = "+A+" / "+h+", ",v.opts.multipleOfPrecision)Q+=" Math.abs(Math.round(division"+P+") - division"+P+") > 1e-"+v.opts.multipleOfPrecision+" ";else Q+=" division"+P+" !== parseInt(division"+P+") ";if(Q+=" ) ",N)Q+=" ) ";Q+=" ) { ";var $=$||[];if($.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { multipleOf: "+h+" } ",v.opts.messages!==!1)if(Q+=" , message: 'should be multiple of ",N)Q+="' + "+h;else Q+=""+h+"'";if(v.opts.verbose){if(Q+=" , schema: ",N)Q+="validate.schema"+B;else Q+=""+G;Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" "}Q+=" } "}else Q+=" {} ";var U=Q;if(Q=$.pop(),!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(["+U+"]); ";else Q+=" validate.errors = ["+U+"]; return false; ";else Q+=" var err = "+U+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+="} ",M)Q+=" else { ";return Q}});var iX=Qv((qz,pX)=>{pX.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.schemaPath+v.util.getProperty(W),D=v.errSchemaPath+"/"+W,M=!v.opts.allErrors,A="data"+(w||""),N="errs__"+P,h=v.util.copy(v);h.level++;var $="valid"+h.level;if(v.opts.strictKeywords?typeof G=="object"&&Object.keys(G).length>0||G===!1:v.util.schemaHasRules(G,v.RULES.all)){h.schema=G,h.schemaPath=B,h.errSchemaPath=D,Q+=" var "+N+" = errors; ";var U=v.compositeRule;v.compositeRule=h.compositeRule=!0,h.createErrors=!1;var O;if(h.opts.allErrors)O=h.opts.allErrors,h.opts.allErrors=!1;if(Q+=" "+v.validate(h)+" ",h.createErrors=!0,O)h.opts.allErrors=O;v.compositeRule=h.compositeRule=U,Q+=" if ("+$+") { ";var H=H||[];if(H.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'not' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: {} ",v.opts.messages!==!1)Q+=" , message: 'should NOT be valid' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" ";Q+=" } "}else Q+=" {} ";var F=Q;if(Q=H.pop(),!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(["+F+"]); ";else Q+=" validate.errors = ["+F+"]; return false; ";else Q+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" } else { errors = "+N+"; if (vErrors !== null) { if ("+N+") vErrors.length = "+N+"; else vErrors = null; } ",v.opts.allErrors)Q+=" } "}else{if(Q+=" var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'not' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: {} ",v.opts.messages!==!1)Q+=" , message: 'should NOT be valid' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" ";Q+=" } "}else Q+=" {} ";if(Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",M)Q+=" if (false) { "}return Q}});var sX=Qv((Nz,dX)=>{dX.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.schemaPath+v.util.getProperty(W),D=v.errSchemaPath+"/"+W,M=!v.opts.allErrors,A="data"+(w||""),N="valid"+P,h="errs__"+P,$=v.util.copy(v),U="";$.level++;var O="valid"+$.level,H=$.baseId,F="prevValid"+P,E="passingSchemas"+P;Q+="var "+h+" = errors , "+F+" = false , "+N+" = false , "+E+" = null; ";var L=v.compositeRule;v.compositeRule=$.compositeRule=!0;var R=G;if(R){var Z,m=-1,x=R.length-1;while(m<x){if(Z=R[m+=1],v.opts.strictKeywords?typeof Z=="object"&&Object.keys(Z).length>0||Z===!1:v.util.schemaHasRules(Z,v.RULES.all))$.schema=Z,$.schemaPath=B+"["+m+"]",$.errSchemaPath=D+"/"+m,Q+=" "+v.validate($)+" ",$.baseId=H;else Q+=" var "+O+" = true; ";if(m)Q+=" if ("+O+" && "+F+") { "+N+" = false; "+E+" = ["+E+", "+m+"]; } else { ",U+="}";Q+=" if ("+O+") { "+N+" = "+F+" = true; "+E+" = "+m+"; }"}}if(v.compositeRule=$.compositeRule=L,Q+=""+U+"if (!"+N+") { var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { passingSchemas: "+E+" } ",v.opts.messages!==!1)Q+=" , message: 'should match exactly one schema in oneOf' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" ";Q+=" } "}else Q+=" {} ";if(Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(vErrors); ";else Q+=" validate.errors = vErrors; return false; ";if(Q+="} else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; }",v.opts.allErrors)Q+=" } ";return Q}});var tX=Qv((Ez,oX)=>{oX.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.schemaPath+v.util.getProperty(W),D=v.errSchemaPath+"/"+W,M=!v.opts.allErrors,A="data"+(w||""),N=v.opts.$data&&G&&G.$data,h;if(N)Q+=" var schema"+P+" = "+v.util.getData(G.$data,w,v.dataPathArr)+"; ",h="schema"+P;else h=G;var $=N?"(new RegExp("+h+"))":v.usePattern(G);if(Q+="if ( ",N)Q+=" ("+h+" !== undefined && typeof "+h+" != 'string') || ";Q+=" !"+$+".test("+A+") ) { ";var U=U||[];if(U.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { pattern: ",N)Q+=""+h;else Q+=""+v.util.toQuotedString(G);if(Q+=" } ",v.opts.messages!==!1){if(Q+=` , message: 'should match pattern "`,N)Q+="' + "+h+" + '";else Q+=""+v.util.escapeQuotes(G);Q+=`"' `}if(v.opts.verbose){if(Q+=" , schema: ",N)Q+="validate.schema"+B;else Q+=""+v.util.toQuotedString(G);Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" "}Q+=" } "}else Q+=" {} ";var O=Q;if(Q=U.pop(),!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(["+O+"]); ";else Q+=" validate.errors = ["+O+"]; return false; ";else Q+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+="} ",M)Q+=" else { ";return Q}});var vP=Qv((Az,eX)=>{eX.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.schemaPath+v.util.getProperty(W),D=v.errSchemaPath+"/"+W,M=!v.opts.allErrors,A="data"+(w||""),N="errs__"+P,h=v.util.copy(v),$="";h.level++;var U="valid"+h.level,O="key"+P,H="idx"+P,F=h.dataLevel=v.dataLevel+1,E="data"+F,L="dataProperties"+P,R=Object.keys(G||{}).filter(Kv),Z=v.schema.patternProperties||{},m=Object.keys(Z).filter(Kv),x=v.schema.additionalProperties,y=R.length||m.length,a=x===!1,p=typeof x=="object"&&Object.keys(x).length,i=v.opts.removeAdditional,T=a||p||i,b=v.opts.ownProperties,d=v.baseId,Av=v.schema.required;if(Av&&!(v.opts.$data&&Av.$data)&&Av.length<v.opts.loopRequired)var Bv=v.util.toHash(Av);function Kv(Kf){return Kf!=="__proto__"}if(Q+="var "+N+" = errors;var "+U+" = true;",b)Q+=" var "+L+" = undefined;";if(T){if(b)Q+=" "+L+" = "+L+" || Object.keys("+A+"); for (var "+H+"=0; "+H+"<"+L+".length; "+H+"++) { var "+O+" = "+L+"["+H+"]; ";else Q+=" for (var "+O+" in "+A+") { ";if(y){if(Q+=" var isAdditional"+P+" = !(false ",R.length)if(R.length>8)Q+=" || validate.schema"+B+".hasOwnProperty("+O+") ";else{var Gv=R;if(Gv){var e,Zv=-1,sv=Gv.length-1;while(Zv<sv)e=Gv[Zv+=1],Q+=" || "+O+" == "+v.util.toQuotedString(e)+" "}}if(m.length){var vf=m;if(vf){var Pv,Ev=-1,nv=vf.length-1;while(Ev<nv)Pv=vf[Ev+=1],Q+=" || "+v.usePattern(Pv)+".test("+O+") "}}Q+=" ); if (isAdditional"+P+") { "}if(i=="all")Q+=" delete "+A+"["+O+"]; ";else{var ov=v.errorPath,tv="' + "+O+" + '";if(v.opts._errorDataPathProperty)v.errorPath=v.util.getPathExpr(v.errorPath,O,v.opts.jsonPointers);if(a)if(i)Q+=" delete "+A+"["+O+"]; ";else{Q+=" "+U+" = false; ";var Uf=D;D=v.errSchemaPath+"/additionalProperties";var xv=xv||[];if(xv.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { additionalProperty: '"+tv+"' } ",v.opts.messages!==!1){if(Q+=" , message: '",v.opts._errorDataPathProperty)Q+="is an invalid additional property";else Q+="should NOT have additional properties";Q+="' "}if(v.opts.verbose)Q+=" , schema: false , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" ";Q+=" } "}else Q+=" {} ";var Cv=Q;if(Q=xv.pop(),!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(["+Cv+"]); ";else Q+=" validate.errors = ["+Cv+"]; return false; ";else Q+=" var err = "+Cv+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(D=Uf,M)Q+=" break; "}else if(p)if(i=="failing"){Q+=" var "+N+" = errors; ";var M1=v.compositeRule;v.compositeRule=h.compositeRule=!0,h.schema=x,h.schemaPath=v.schemaPath+".additionalProperties",h.errSchemaPath=v.errSchemaPath+"/additionalProperties",h.errorPath=v.opts._errorDataPathProperty?v.errorPath:v.util.getPathExpr(v.errorPath,O,v.opts.jsonPointers);var pv=A+"["+O+"]";h.dataPathArr[F]=O;var Vv=v.validate(h);if(h.baseId=d,v.util.varOccurences(Vv,E)<2)Q+=" "+v.util.varReplace(Vv,E,pv)+" ";else Q+=" var "+E+" = "+pv+"; "+Vv+" ";Q+=" if (!"+U+") { errors = "+N+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+A+"["+O+"]; } ",v.compositeRule=h.compositeRule=M1}else{h.schema=x,h.schemaPath=v.schemaPath+".additionalProperties",h.errSchemaPath=v.errSchemaPath+"/additionalProperties",h.errorPath=v.opts._errorDataPathProperty?v.errorPath:v.util.getPathExpr(v.errorPath,O,v.opts.jsonPointers);var pv=A+"["+O+"]";h.dataPathArr[F]=O;var Vv=v.validate(h);if(h.baseId=d,v.util.varOccurences(Vv,E)<2)Q+=" "+v.util.varReplace(Vv,E,pv)+" ";else Q+=" var "+E+" = "+pv+"; "+Vv+" ";if(M)Q+=" if (!"+U+") break; "}v.errorPath=ov}if(y)Q+=" } ";if(Q+=" } ",M)Q+=" if ("+U+") { ",$+="}"}var Bf=v.opts.useDefaults&&!v.compositeRule;if(R.length){var Sf=R;if(Sf){var e,bf=-1,gf=Sf.length-1;while(bf<gf){e=Sf[bf+=1];var iv=G[e];if(v.opts.strictKeywords?typeof iv=="object"&&Object.keys(iv).length>0||iv===!1:v.util.schemaHasRules(iv,v.RULES.all)){var rv=v.util.getProperty(e),pv=A+rv,bv=Bf&&iv.default!==void 0;h.schema=iv,h.schemaPath=B+rv,h.errSchemaPath=D+"/"+v.util.escapeFragment(e),h.errorPath=v.util.getPath(v.errorPath,e,v.opts.jsonPointers),h.dataPathArr[F]=v.util.toQuotedString(e);var Vv=v.validate(h);if(h.baseId=d,v.util.varOccurences(Vv,E)<2){Vv=v.util.varReplace(Vv,E,pv);var cv=pv}else{var cv=E;Q+=" var "+E+" = "+pv+"; "}if(bv)Q+=" "+Vv+" ";else{if(Bv&&Bv[e]){if(Q+=" if ( "+cv+" === undefined ",b)Q+=" || ! Object.prototype.hasOwnProperty.call("+A+", '"+v.util.escapeQuotes(e)+"') ";Q+=") { "+U+" = false; ";var ov=v.errorPath,Uf=D,Rf=v.util.escapeQuotes(e);if(v.opts._errorDataPathProperty)v.errorPath=v.util.getPath(ov,e,v.opts.jsonPointers);D=v.errSchemaPath+"/required";var xv=xv||[];if(xv.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'required' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { missingProperty: '"+Rf+"' } ",v.opts.messages!==!1){if(Q+=" , message: '",v.opts._errorDataPathProperty)Q+="is a required property";else Q+="should have required property \\'"+Rf+"\\'";Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" ";Q+=" } "}else Q+=" {} ";var Cv=Q;if(Q=xv.pop(),!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(["+Cv+"]); ";else Q+=" validate.errors = ["+Cv+"]; return false; ";else Q+=" var err = "+Cv+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";D=Uf,v.errorPath=ov,Q+=" } else { "}else if(M){if(Q+=" if ( "+cv+" === undefined ",b)Q+=" || ! Object.prototype.hasOwnProperty.call("+A+", '"+v.util.escapeQuotes(e)+"') ";Q+=") { "+U+" = true; } else { "}else{if(Q+=" if ("+cv+" !== undefined ",b)Q+=" && Object.prototype.hasOwnProperty.call("+A+", '"+v.util.escapeQuotes(e)+"') ";Q+=" ) { "}Q+=" "+Vv+" } "}}if(M)Q+=" if ("+U+") { ",$+="}"}}}if(m.length){var Jf=m;if(Jf){var Pv,O1=-1,XQ=Jf.length-1;while(O1<XQ){Pv=Jf[O1+=1];var iv=Z[Pv];if(v.opts.strictKeywords?typeof iv=="object"&&Object.keys(iv).length>0||iv===!1:v.util.schemaHasRules(iv,v.RULES.all)){if(h.schema=iv,h.schemaPath=v.schemaPath+".patternProperties"+v.util.getProperty(Pv),h.errSchemaPath=v.errSchemaPath+"/patternProperties/"+v.util.escapeFragment(Pv),b)Q+=" "+L+" = "+L+" || Object.keys("+A+"); for (var "+H+"=0; "+H+"<"+L+".length; "+H+"++) { var "+O+" = "+L+"["+H+"]; ";else Q+=" for (var "+O+" in "+A+") { ";Q+=" if ("+v.usePattern(Pv)+".test("+O+")) { ",h.errorPath=v.util.getPathExpr(v.errorPath,O,v.opts.jsonPointers);var pv=A+"["+O+"]";h.dataPathArr[F]=O;var Vv=v.validate(h);if(h.baseId=d,v.util.varOccurences(Vv,E)<2)Q+=" "+v.util.varReplace(Vv,E,pv)+" ";else Q+=" var "+E+" = "+pv+"; "+Vv+" ";if(M)Q+=" if (!"+U+") break; ";if(Q+=" } ",M)Q+=" else "+U+" = true; ";if(Q+=" } ",M)Q+=" if ("+U+") { ",$+="}"}}}}if(M)Q+=" "+$+" if ("+N+" == errors) {";return Q}});var QP=Qv((Uz,fP)=>{fP.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.schemaPath+v.util.getProperty(W),D=v.errSchemaPath+"/"+W,M=!v.opts.allErrors,A="data"+(w||""),N="errs__"+P,h=v.util.copy(v),$="";h.level++;var U="valid"+h.level;if(Q+="var "+N+" = errors;",v.opts.strictKeywords?typeof G=="object"&&Object.keys(G).length>0||G===!1:v.util.schemaHasRules(G,v.RULES.all)){h.schema=G,h.schemaPath=B,h.errSchemaPath=D;var O="key"+P,H="idx"+P,F="i"+P,E="' + "+O+" + '",L=h.dataLevel=v.dataLevel+1,R="data"+L,Z="dataProperties"+P,m=v.opts.ownProperties,x=v.baseId;if(m)Q+=" var "+Z+" = undefined; ";if(m)Q+=" "+Z+" = "+Z+" || Object.keys("+A+"); for (var "+H+"=0; "+H+"<"+Z+".length; "+H+"++) { var "+O+" = "+Z+"["+H+"]; ";else Q+=" for (var "+O+" in "+A+") { ";Q+=" var startErrs"+P+" = errors; ";var y=O,a=v.compositeRule;v.compositeRule=h.compositeRule=!0;var p=v.validate(h);if(h.baseId=x,v.util.varOccurences(p,R)<2)Q+=" "+v.util.varReplace(p,R,y)+" ";else Q+=" var "+R+" = "+y+"; "+p+" ";if(v.compositeRule=h.compositeRule=a,Q+=" if (!"+U+") { for (var "+F+"=startErrs"+P+"; "+F+"<errors; "+F+"++) { vErrors["+F+"].propertyName = "+O+"; } var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { propertyName: '"+E+"' } ",v.opts.messages!==!1)Q+=" , message: 'property name \\'"+E+"\\' is invalid' ";if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" ";Q+=" } "}else Q+=" {} ";if(Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(vErrors); ";else Q+=" validate.errors = vErrors; return false; ";if(M)Q+=" break; ";Q+=" } }"}if(M)Q+=" "+$+" if ("+N+" == errors) {";return Q}});var JP=Qv((jz,WP)=>{WP.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.schemaPath+v.util.getProperty(W),D=v.errSchemaPath+"/"+W,M=!v.opts.allErrors,A="data"+(w||""),N="valid"+P,h=v.opts.$data&&G&&G.$data,$;if(h)Q+=" var schema"+P+" = "+v.util.getData(G.$data,w,v.dataPathArr)+"; ",$="schema"+P;else $=G;var U="schema"+P;if(!h)if(G.length<v.opts.loopRequired&&v.schema.properties&&Object.keys(v.schema.properties).length){var O=[],H=G;if(H){var F,E=-1,L=H.length-1;while(E<L){F=H[E+=1];var R=v.schema.properties[F];if(!(R&&(v.opts.strictKeywords?typeof R=="object"&&Object.keys(R).length>0||R===!1:v.util.schemaHasRules(R,v.RULES.all))))O[O.length]=F}}}else var O=G;if(h||O.length){var Z=v.errorPath,m=h||O.length>=v.opts.loopRequired,x=v.opts.ownProperties;if(M)if(Q+=" var missing"+P+"; ",m){if(!h)Q+=" var "+U+" = validate.schema"+B+"; ";var y="i"+P,a="schema"+P+"["+y+"]",p="' + "+a+" + '";if(v.opts._errorDataPathProperty)v.errorPath=v.util.getPathExpr(Z,a,v.opts.jsonPointers);if(Q+=" var "+N+" = true; ",h)Q+=" if (schema"+P+" === undefined) "+N+" = true; else if (!Array.isArray(schema"+P+")) "+N+" = false; else {";if(Q+=" for (var "+y+" = 0; "+y+" < "+U+".length; "+y+"++) { "+N+" = "+A+"["+U+"["+y+"]] !== undefined ",x)Q+=" && Object.prototype.hasOwnProperty.call("+A+", "+U+"["+y+"]) ";if(Q+="; if (!"+N+") break; } ",h)Q+=" } ";Q+=" if (!"+N+") { ";var i=i||[];if(i.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'required' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { missingProperty: '"+p+"' } ",v.opts.messages!==!1){if(Q+=" , message: '",v.opts._errorDataPathProperty)Q+="is a required property";else Q+="should have required property \\'"+p+"\\'";Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" ";Q+=" } "}else Q+=" {} ";var T=Q;if(Q=i.pop(),!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(["+T+"]); ";else Q+=" validate.errors = ["+T+"]; return false; ";else Q+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";Q+=" } else { "}else{Q+=" if ( ";var b=O;if(b){var d,y=-1,Av=b.length-1;while(y<Av){if(d=b[y+=1],y)Q+=" || ";var Bv=v.util.getProperty(d),Kv=A+Bv;if(Q+=" ( ( "+Kv+" === undefined ",x)Q+=" || ! Object.prototype.hasOwnProperty.call("+A+", '"+v.util.escapeQuotes(d)+"') ";Q+=") && (missing"+P+" = "+v.util.toQuotedString(v.opts.jsonPointers?d:Bv)+") ) "}}Q+=") { ";var a="missing"+P,p="' + "+a+" + '";if(v.opts._errorDataPathProperty)v.errorPath=v.opts.jsonPointers?v.util.getPathExpr(Z,a,!0):Z+" + "+a;var i=i||[];if(i.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'required' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { missingProperty: '"+p+"' } ",v.opts.messages!==!1){if(Q+=" , message: '",v.opts._errorDataPathProperty)Q+="is a required property";else Q+="should have required property \\'"+p+"\\'";Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" ";Q+=" } "}else Q+=" {} ";var T=Q;if(Q=i.pop(),!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(["+T+"]); ";else Q+=" validate.errors = ["+T+"]; return false; ";else Q+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";Q+=" } else { "}else if(m){if(!h)Q+=" var "+U+" = validate.schema"+B+"; ";var y="i"+P,a="schema"+P+"["+y+"]",p="' + "+a+" + '";if(v.opts._errorDataPathProperty)v.errorPath=v.util.getPathExpr(Z,a,v.opts.jsonPointers);if(h){if(Q+=" if ("+U+" && !Array.isArray("+U+")) { var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'required' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { missingProperty: '"+p+"' } ",v.opts.messages!==!1){if(Q+=" , message: '",v.opts._errorDataPathProperty)Q+="is a required property";else Q+="should have required property \\'"+p+"\\'";Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" ";Q+=" } "}else Q+=" {} ";Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+U+" !== undefined) { "}if(Q+=" for (var "+y+" = 0; "+y+" < "+U+".length; "+y+"++) { if ("+A+"["+U+"["+y+"]] === undefined ",x)Q+=" || ! Object.prototype.hasOwnProperty.call("+A+", "+U+"["+y+"]) ";if(Q+=") { var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'required' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { missingProperty: '"+p+"' } ",v.opts.messages!==!1){if(Q+=" , message: '",v.opts._errorDataPathProperty)Q+="is a required property";else Q+="should have required property \\'"+p+"\\'";Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" ";Q+=" } "}else Q+=" {} ";if(Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",h)Q+=" } "}else{var Gv=O;if(Gv){var d,e=-1,Zv=Gv.length-1;while(e<Zv){d=Gv[e+=1];var Bv=v.util.getProperty(d),p=v.util.escapeQuotes(d),Kv=A+Bv;if(v.opts._errorDataPathProperty)v.errorPath=v.util.getPath(Z,d,v.opts.jsonPointers);if(Q+=" if ( "+Kv+" === undefined ",x)Q+=" || ! Object.prototype.hasOwnProperty.call("+A+", '"+v.util.escapeQuotes(d)+"') ";if(Q+=") { var err = ",v.createErrors!==!1){if(Q+=" { keyword: 'required' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { missingProperty: '"+p+"' } ",v.opts.messages!==!1){if(Q+=" , message: '",v.opts._errorDataPathProperty)Q+="is a required property";else Q+="should have required property \\'"+p+"\\'";Q+="' "}if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" ";Q+=" } "}else Q+=" {} ";Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}}v.errorPath=Z}else if(M)Q+=" if (true) {";return Q}});var PP=Qv((Fz,XP)=>{XP.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.schemaPath+v.util.getProperty(W),D=v.errSchemaPath+"/"+W,M=!v.opts.allErrors,A="data"+(w||""),N="valid"+P,h=v.opts.$data&&G&&G.$data,$;if(h)Q+=" var schema"+P+" = "+v.util.getData(G.$data,w,v.dataPathArr)+"; ",$="schema"+P;else $=G;if((G||h)&&v.opts.uniqueItems!==!1){if(h)Q+=" var "+N+"; if ("+$+" === false || "+$+" === undefined) "+N+" = true; else if (typeof "+$+" != 'boolean') "+N+" = false; else { ";Q+=" var i = "+A+".length , "+N+" = true , j; if (i > 1) { ";var U=v.schema.items&&v.schema.items.type,O=Array.isArray(U);if(!U||U=="object"||U=="array"||O&&(U.indexOf("object")>=0||U.indexOf("array")>=0))Q+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+A+"[i], "+A+"[j])) { "+N+" = false; break outer; } } } ";else{Q+=" var itemIndices = {}, item; for (;i--;) { var item = "+A+"[i]; ";var H="checkDataType"+(O?"s":"");if(Q+=" if ("+v.util[H](U,"item",v.opts.strictNumbers,!0)+") continue; ",O)Q+=` if (typeof item == 'string') item = '"' + item; `;Q+=" if (typeof itemIndices[item] == 'number') { "+N+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}if(Q+=" } ",h)Q+=" } ";Q+=" if (!"+N+") { ";var F=F||[];if(F.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { i: i, j: j } ",v.opts.messages!==!1)Q+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' ";if(v.opts.verbose){if(Q+=" , schema: ",h)Q+="validate.schema"+B;else Q+=""+G;Q+=" , parentSchema: validate.schema"+v.schemaPath+" , data: "+A+" "}Q+=" } "}else Q+=" {} ";var E=Q;if(Q=F.pop(),!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(["+E+"]); ";else Q+=" validate.errors = ["+E+"]; return false; ";else Q+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(Q+=" } ",M)Q+=" else { "}else if(M)Q+=" if (true) { ";return Q}});var wP=Qv((Lz,YP)=>{YP.exports={$ref:qX(),allOf:EX(),anyOf:UX(),$comment:FX(),const:SX(),contains:RX(),dependencies:kX(),enum:ZX(),format:yX(),if:xX(),items:bX(),maximum:LJ(),minimum:LJ(),maxItems:SJ(),minItems:SJ(),maxLength:gJ(),minLength:gJ(),maxProperties:RJ(),minProperties:RJ(),multipleOf:nX(),not:iX(),oneOf:sX(),pattern:tX(),properties:vP(),propertyNames:QP(),required:JP(),uniqueItems:PP(),validate:jJ()}});var BP=Qv((Sz,zP)=>{var GP=wP(),_J=O0().toHash;zP.exports=function f(){var v=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],W=["type","$comment"],X=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],Q=["number","integer","string","array","object","boolean","null"];return v.all=_J(W),v.types=_J(Q),v.forEach(function(P){if(P.rules=P.rules.map(function(w){var G;if(typeof w=="object"){var B=Object.keys(w)[0];G=w[B],w=B,G.forEach(function(M){W.push(M),v.all[M]=!0})}W.push(w);var D=v.all[w]={keyword:w,code:GP[w],implements:G};return D}),v.all.$comment={keyword:"$comment",code:GP.$comment},P.type)v.types[P.type]=P}),v.keywords=_J(W.concat(X)),v.custom={},v}});var $P=Qv((gz,hP)=>{var KP=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];hP.exports=function(f,v){for(var W=0;W<v.length;W++){f=JSON.parse(JSON.stringify(f));var X=v[W].split("/"),Q=f,P;for(P=1;P<X.length;P++)Q=Q[X[P]];for(P=0;P<KP.length;P++){var w=KP[P],G=Q[w];if(G)Q[w]={anyOf:[G,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}}}return f}});var OP=Qv((Rz,MP)=>{var Cw=o8().MissingRef;MP.exports=DP;function DP(f,v,W){var X=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");if(typeof v=="function")W=v,v=void 0;var Q=P(f).then(function(){var G=X._addSchema(f,void 0,v);return G.validate||w(G)});if(W)Q.then(function(G){W(null,G)},W);return Q;function P(G){var B=G.$schema;return B&&!X.getSchema(B)?DP.call(X,{$ref:B},!0):Promise.resolve()}function w(G){try{return X._compile(G)}catch(D){if(D instanceof Cw)return B(D);throw D}function B(D){var M=D.missingSchema;if(h(M))throw new Error("Schema "+M+" is loaded but "+D.missingRef+" cannot be resolved");var A=X._loadingSchemas[M];if(!A)A=X._loadingSchemas[M]=X._opts.loadSchema(M),A.then(N,N);return A.then(function($){if(!h(M))return P($).then(function(){if(!h(M))X.addSchema($,M,void 0,v)})}).then(function(){return w(G)});function N(){delete X._loadingSchemas[M]}function h($){return X._refs[$]||X._schemas[$]}}}}});var VP=Qv((_z,HP)=>{HP.exports=function f(v,W,X){var Q=" ",P=v.level,w=v.dataLevel,G=v.schema[W],B=v.schemaPath+v.util.getProperty(W),D=v.errSchemaPath+"/"+W,M=!v.opts.allErrors,A,N="data"+(w||""),h="valid"+P,$="errs__"+P,U=v.opts.$data&&G&&G.$data,O;if(U)Q+=" var schema"+P+" = "+v.util.getData(G.$data,w,v.dataPathArr)+"; ",O="schema"+P;else O=G;var H=this,F="definition"+P,E=H.definition,L="",R,Z,m,x,y;if(U&&E.$data){y="keywordValidate"+P;var a=E.validateSchema;Q+=" var "+F+" = RULES.custom['"+W+"'].definition; var "+y+" = "+F+".validate;"}else{if(x=v.useCustomRule(H,G,v.schema,v),!x)return;O="validate.schema"+B,y=x.code,R=E.compile,Z=E.inline,m=E.macro}var p=y+".errors",i="i"+P,T="ruleErr"+P,b=E.async;if(b&&!v.async)throw new Error("async keyword in sync schema");if(!(Z||m))Q+=""+p+" = null;";if(Q+="var "+$+" = errors;var "+h+";",U&&E.$data){if(L+="}",Q+=" if ("+O+" === undefined) { "+h+" = true; } else { ",a)L+="}",Q+=" "+h+" = "+F+".validateSchema("+O+"); if ("+h+") { "}if(Z)if(E.statements)Q+=" "+x.validate+" ";else Q+=" "+h+" = "+x.validate+"; ";else if(m){var d=v.util.copy(v),L="";d.level++;var Av="valid"+d.level;d.schema=x.validate,d.schemaPath="";var Bv=v.compositeRule;v.compositeRule=d.compositeRule=!0;var Kv=v.validate(d).replace(/validate\.schema/g,y);v.compositeRule=d.compositeRule=Bv,Q+=" "+Kv}else{var Gv=Gv||[];if(Gv.push(Q),Q="",Q+=" "+y+".call( ",v.opts.passContext)Q+="this";else Q+="self";if(R||E.schema===!1)Q+=" , "+N+" ";else Q+=" , "+O+" , "+N+" , validate.schema"+v.schemaPath+" ";if(Q+=" , (dataPath || '')",v.errorPath!='""')Q+=" + "+v.errorPath;var e=w?"data"+(w-1||""):"parentData",Zv=w?v.dataPathArr[w]:"parentDataProperty";Q+=" , "+e+" , "+Zv+" , rootData ) ";var sv=Q;if(Q=Gv.pop(),E.errors===!1){if(Q+=" "+h+" = ",b)Q+="await ";Q+=""+sv+"; "}else if(b)p="customErrors"+P,Q+=" var "+p+" = null; try { "+h+" = await "+sv+"; } catch (e) { "+h+" = false; if (e instanceof ValidationError) "+p+" = e.errors; else throw e; } ";else Q+=" "+p+" = null; "+h+" = "+sv+"; "}if(E.modifying)Q+=" if ("+e+") "+N+" = "+e+"["+Zv+"];";if(Q+=""+L,E.valid){if(M)Q+=" if (true) { "}else{if(Q+=" if ( ",E.valid===void 0)if(Q+=" !",m)Q+=""+Av;else Q+=""+h;else Q+=" "+!E.valid+" ";Q+=") { ",A=H.keyword;var Gv=Gv||[];Gv.push(Q),Q="";var Gv=Gv||[];if(Gv.push(Q),Q="",v.createErrors!==!1){if(Q+=" { keyword: '"+(A||"custom")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { keyword: '"+H.keyword+"' } ",v.opts.messages!==!1)Q+=` , message: 'should pass "`+H.keyword+`" keyword validation' `;if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+N+" ";Q+=" } "}else Q+=" {} ";var vf=Q;if(Q=Gv.pop(),!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(["+vf+"]); ";else Q+=" validate.errors = ["+vf+"]; return false; ";else Q+=" var err = "+vf+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var Pv=Q;if(Q=Gv.pop(),Z)if(E.errors){if(E.errors!="full"){if(Q+=" for (var "+i+"="+$+"; "+i+"<errors; "+i+"++) { var "+T+" = vErrors["+i+"]; if ("+T+".dataPath === undefined) "+T+".dataPath = (dataPath || '') + "+v.errorPath+"; if ("+T+".schemaPath === undefined) { "+T+'.schemaPath = "'+D+'"; } ',v.opts.verbose)Q+=" "+T+".schema = "+O+"; "+T+".data = "+N+"; ";Q+=" } "}}else if(E.errors===!1)Q+=" "+Pv+" ";else{if(Q+=" if ("+$+" == errors) { "+Pv+" } else { for (var "+i+"="+$+"; "+i+"<errors; "+i+"++) { var "+T+" = vErrors["+i+"]; if ("+T+".dataPath === undefined) "+T+".dataPath = (dataPath || '') + "+v.errorPath+"; if ("+T+".schemaPath === undefined) { "+T+'.schemaPath = "'+D+'"; } ',v.opts.verbose)Q+=" "+T+".schema = "+O+"; "+T+".data = "+N+"; ";Q+=" } } "}else if(m){if(Q+=" var err = ",v.createErrors!==!1){if(Q+=" { keyword: '"+(A||"custom")+"' , dataPath: (dataPath || '') + "+v.errorPath+" , schemaPath: "+v.util.toQuotedString(D)+" , params: { keyword: '"+H.keyword+"' } ",v.opts.messages!==!1)Q+=` , message: 'should pass "`+H.keyword+`" keyword validation' `;if(v.opts.verbose)Q+=" , schema: validate.schema"+B+" , parentSchema: validate.schema"+v.schemaPath+" , data: "+N+" ";Q+=" } "}else Q+=" {} ";if(Q+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!v.compositeRule&&M)if(v.async)Q+=" throw new ValidationError(vErrors); ";else Q+=" validate.errors = vErrors; return false; "}else if(E.errors===!1)Q+=" "+Pv+" ";else{if(Q+=" if (Array.isArray("+p+")) { if (vErrors === null) vErrors = "+p+"; else vErrors = vErrors.concat("+p+"); errors = vErrors.length; for (var "+i+"="+$+"; "+i+"<errors; "+i+"++) { var "+T+" = vErrors["+i+"]; if ("+T+".dataPath === undefined) "+T+".dataPath = (dataPath || '') + "+v.errorPath+"; "+T+'.schemaPath = "'+D+'"; ',v.opts.verbose)Q+=" "+T+".schema = "+O+"; "+T+".data = "+N+"; ";Q+=" } } else { "+Pv+" } "}if(Q+=" } ",M)Q+=" else { "}return Q}});var kJ=Qv((kz,yw)=>{yw.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 EP=Qv((Iz,NP)=>{var qP=kJ();NP.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:qP.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:qP.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}});var UP=Qv((Zz,AP)=>{var Tw=/^[a-z_$][a-z0-9_$-]*$/i,xw=VP(),lw=EP();AP.exports={add:bw,get:uw,remove:mw,validate:IJ};function bw(f,v){var W=this.RULES;if(W.keywords[f])throw new Error("Keyword "+f+" is already defined");if(!Tw.test(f))throw new Error("Keyword "+f+" is not a valid identifier");if(v){this.validateKeyword(v,!0);var X=v.type;if(Array.isArray(X))for(var Q=0;Q<X.length;Q++)w(f,X[Q],v);else w(f,X,v);var P=v.metaSchema;if(P){if(v.$data&&this._opts.$data)P={anyOf:[P,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]};v.validateSchema=this.compile(P,!0)}}W.keywords[f]=W.all[f]=!0;function w(G,B,D){var M;for(var A=0;A<W.length;A++){var N=W[A];if(N.type==B){M=N;break}}if(!M)M={type:B,rules:[]},W.push(M);var h={keyword:G,definition:D,custom:!0,code:xw,implements:D.implements};M.rules.push(h),W.custom[G]=h}return this}function uw(f){var v=this.RULES.custom[f];return v?v.definition:this.RULES.keywords[f]||!1}function mw(f){var v=this.RULES;delete v.keywords[f],delete v.all[f],delete v.custom[f];for(var W=0;W<v.length;W++){var X=v[W].rules;for(var Q=0;Q<X.length;Q++)if(X[Q].keyword==f){X.splice(Q,1);break}}return this}function IJ(f,v){IJ.errors=null;var W=this._validateKeyword=this._validateKeyword||this.compile(lw,!0);if(W(f))return!0;if(IJ.errors=W.errors,v)throw new Error("custom keyword definition is invalid: "+this.errorsText(W.errors));else return!1}});var jP=Qv((Cz,rw)=>{rw.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var CP=Qv((yz,ZP)=>{var LP=JX(),H0=s8(),aw=PX(),SP=HJ(),cw=UJ(),nw=HX(),pw=BP(),gP=$P(),RP=O0();ZP.exports=av;av.prototype.validate=dw;av.prototype.compile=sw;av.prototype.addSchema=ow;av.prototype.addMetaSchema=tw;av.prototype.validateSchema=ew;av.prototype.getSchema=fG;av.prototype.removeSchema=WG;av.prototype.addFormat=BG;av.prototype.errorsText=zG;av.prototype._addSchema=JG;av.prototype._compile=XG;av.prototype.compileAsync=OP();var XW=UP();av.prototype.addKeyword=XW.add;av.prototype.getKeyword=XW.get;av.prototype.removeKeyword=XW.remove;av.prototype.validateKeyword=XW.validate;var _P=o8();av.ValidationError=_P.Validation;av.MissingRefError=_P.MissingRef;av.$dataMetaSchema=gP;var JW="http://json-schema.org/draft-07/schema",FP=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],iw=["/properties"];function av(f){if(!(this instanceof av))return new av(f);if(f=this._opts=RP.copy(f)||{},OG(this),this._schemas={},this._refs={},this._fragments={},this._formats=nw(f.format),this._cache=f.cache||new aw,this._loadingSchemas={},this._compilations=[],this.RULES=pw(),this._getId=PG(f),f.loopRequired=f.loopRequired||1/0,f.errorDataPath=="property")f._errorDataPathProperty=!0;if(f.serialize===void 0)f.serialize=cw;if(this._metaOpts=MG(this),f.formats)$G(this);if(f.keywords)DG(this);if(KG(this),typeof f.meta=="object")this.addMetaSchema(f.meta);if(f.nullable)this.addKeyword("nullable",{metaSchema:{type:"boolean"}});hG(this)}function dw(f,v){var W;if(typeof f=="string"){if(W=this.getSchema(f),!W)throw new Error('no schema with key or ref "'+f+'"')}else{var X=this._addSchema(f);W=X.validate||this._compile(X)}var Q=W(v);if(W.$async!==!0)this.errors=W.errors;return Q}function sw(f,v){var W=this._addSchema(f,void 0,v);return W.validate||this._compile(W)}function ow(f,v,W,X){if(Array.isArray(f)){for(var Q=0;Q<f.length;Q++)this.addSchema(f[Q],void 0,W,X);return this}var P=this._getId(f);if(P!==void 0&&typeof P!="string")throw new Error("schema id must be string");return v=H0.normalizeId(v||P),IP(this,v),this._schemas[v]=this._addSchema(f,W,X,!0),this}function tw(f,v,W){return this.addSchema(f,v,W,!0),this}function ew(f,v){var W=f.$schema;if(W!==void 0&&typeof W!="string")throw new Error("$schema must be a string");if(W=W||this._opts.defaultMeta||vG(this),!W)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var X=this.validate(W,f);if(!X&&v){var Q="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(Q);else throw new Error(Q)}return X}function vG(f){var v=f._opts.meta;return f._opts.defaultMeta=typeof v=="object"?f._getId(v)||v:f.getSchema(JW)?JW:void 0,f._opts.defaultMeta}function fG(f){var v=kP(this,f);switch(typeof v){case"object":return v.validate||this._compile(v);case"string":return this.getSchema(v);case"undefined":return QG(this,f)}}function QG(f,v){var W=H0.schema.call(f,{schema:{}},v);if(W){var{schema:X,root:Q,baseId:P}=W,w=LP.call(f,X,Q,void 0,P);return f._fragments[v]=new SP({ref:v,fragment:!0,schema:X,root:Q,baseId:P,validate:w}),w}}function kP(f,v){return v=H0.normalizeId(v),f._schemas[v]||f._refs[v]||f._fragments[v]}function WG(f){if(f instanceof RegExp)return WW(this,this._schemas,f),WW(this,this._refs,f),this;switch(typeof f){case"undefined":return WW(this,this._schemas),WW(this,this._refs),this._cache.clear(),this;case"string":var v=kP(this,f);if(v)this._cache.del(v.cacheKey);return delete this._schemas[f],delete this._refs[f],this;case"object":var W=this._opts.serialize,X=W?W(f):f;this._cache.del(X);var Q=this._getId(f);if(Q)Q=H0.normalizeId(Q),delete this._schemas[Q],delete this._refs[Q]}return this}function WW(f,v,W){for(var X in v){var Q=v[X];if(!Q.meta&&(!W||W.test(X)))f._cache.del(Q.cacheKey),delete v[X]}}function JG(f,v,W,X){if(typeof f!="object"&&typeof f!="boolean")throw new Error("schema should be object or boolean");var Q=this._opts.serialize,P=Q?Q(f):f,w=this._cache.get(P);if(w)return w;X=X||this._opts.addUsedSchema!==!1;var G=H0.normalizeId(this._getId(f));if(G&&X)IP(this,G);var B=this._opts.validateSchema!==!1&&!v,D;if(B&&!(D=G&&G==H0.normalizeId(f.$schema)))this.validateSchema(f,!0);var M=H0.ids.call(this,f),A=new SP({id:G,schema:f,localRefs:M,cacheKey:P,meta:W});if(G[0]!="#"&&X)this._refs[G]=A;if(this._cache.put(P,A),B&&D)this.validateSchema(f,!0);return A}function XG(f,v){if(f.compiling){if(f.validate=Q,Q.schema=f.schema,Q.errors=null,Q.root=v?v:Q,f.schema.$async===!0)Q.$async=!0;return Q}f.compiling=!0;var W;if(f.meta)W=this._opts,this._opts=this._metaOpts;var X;try{X=LP.call(this,f.schema,v,f.localRefs)}catch(P){throw delete f.validate,P}finally{if(f.compiling=!1,f.meta)this._opts=W}return f.validate=X,f.refs=X.refs,f.refVal=X.refVal,f.root=X.root,X;function Q(){var P=f.validate,w=P.apply(this,arguments);return Q.errors=P.errors,w}}function PG(f){switch(f.schemaId){case"auto":return GG;case"id":return YG;default:return wG}}function YG(f){if(f.$id)this.logger.warn("schema $id ignored",f.$id);return f.id}function wG(f){if(f.id)this.logger.warn("schema id ignored",f.id);return f.$id}function GG(f){if(f.$id&&f.id&&f.$id!=f.id)throw new Error("schema $id is different from id");return f.$id||f.id}function zG(f,v){if(f=f||this.errors,!f)return"No errors";v=v||{};var W=v.separator===void 0?", ":v.separator,X=v.dataVar===void 0?"data":v.dataVar,Q="";for(var P=0;P<f.length;P++){var w=f[P];if(w)Q+=X+w.dataPath+" "+w.message+W}return Q.slice(0,-W.length)}function BG(f,v){if(typeof v=="string")v=new RegExp(v);return this._formats[f]=v,this}function KG(f){var v;if(f._opts.$data)v=jP(),f.addMetaSchema(v,v.$id,!0);if(f._opts.meta===!1)return;var W=kJ();if(f._opts.$data)W=gP(W,iw);f.addMetaSchema(W,JW,!0),f._refs["http://json-schema.org/schema"]=JW}function hG(f){var v=f._opts.schemas;if(!v)return;if(Array.isArray(v))f.addSchema(v);else for(var W in v)f.addSchema(v[W],W)}function $G(f){for(var v in f._opts.formats){var W=f._opts.formats[v];f.addFormat(v,W)}}function DG(f){for(var v in f._opts.keywords){var W=f._opts.keywords[v];f.addKeyword(v,W)}}function IP(f,v){if(f._schemas[v]||f._refs[v])throw new Error('schema with key or id "'+v+'" already exists')}function MG(f){var v=RP.copy(f._opts);for(var W=0;W<FP.length;W++)delete v[FP[W]];return v}function OG(f){var v=f._opts.logger;if(v===!1)f.logger={log:ZJ,warn:ZJ,error:ZJ};else{if(v===void 0)v=console;if(!(typeof v=="object"&&v.log&&v.warn&&v.error))throw new Error("logger must implement log, warn and error methods");f.logger=v}}function ZJ(){}});function OY(f,v){let W=process.argv,X=`--${f}=`;for(let Q of W)if(Q.startsWith(X))return Q.substring(X.length);return v}function RG(){let f=process.argv.join(" ");return f.includes("streamable-http.js")||f.includes("streamable-http.ts")}class VY{context;level;constructor(f,v=1){this.context=f,this.level=v}setLevel(f){this.level=f}log(...f){if(HY)console.log(...f);else console.error(...f)}logWarn(...f){if(HY)console.warn(...f);else console.error(...f)}debug(...f){if(this.level<=0)this.log(`[DEBUG] [${this.context}]`,...f)}info(...f){if(this.level<=1)this.log(`[INFO] [${this.context}]`,...f)}warn(...f){if(this.level<=2)this.logWarn(`[WARN] [${this.context}]`,...f)}error(...f){if(this.level<=3)console.error(`[ERROR] [${this.context}]`,...f)}}var HY,xf=(f,v=1)=>new VY(f,v);var V0=jv(()=>{HY=RG()});class qY{serverName="F2C MCP";serverVersion=process.env.FIGMA_VERSION||"0.0.1";_personalToken=OY("figma-api-key")||process.env.FIGMA_API_KEY||process.env.personalToken||"";get personalToken(){return this._personalToken}set personalToken(f){this._personalToken=f,kG.debug("personalToken",f)}}var kG,g1;var KW=jv(()=>{V0();kG=xf("FigmaConfig",1);g1=new qY});function IG(f){if(!/^data:/i.test(f))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');f=f.replace(/\r?\n/g,"");let v=f.indexOf(",");if(v===-1||v<=4)throw new TypeError("malformed data: URI");let W=f.substring(5,v).split(";"),X="",Q=!1,P=W[0]||"text/plain",w=P;for(let M=1;M<W.length;M++)if(W[M]==="base64")Q=!0;else if(W[M]){if(w+=`;${W[M]}`,W[M].indexOf("charset=")===0)X=W[M].substring(8)}if(!W[0]&&!X.length)w+=";charset=US-ASCII",X="US-ASCII";let G=Q?"base64":"ascii",B=unescape(f.substring(v+1)),D=Buffer.from(B,G);return D.type=P,D.typeFull=w,D.charset=X,D}var AY;var UY=jv(()=>{AY=IG});var FY=Qv((hW,jY)=>{(function(f,v){typeof hW==="object"&&typeof jY!=="undefined"?v(hW):typeof define==="function"&&define.amd?define(["exports"],v):(f=typeof globalThis!=="undefined"?globalThis:f||self,v(f.WebStreamsPolyfill={}))})(hW,function(f){function v(){return}function W(J){return typeof J==="object"&&J!==null||typeof J==="function"}let X=v;function Q(J,Y){try{Object.defineProperty(J,"name",{value:Y,configurable:!0})}catch(z){}}let P=Promise,w=Promise.prototype.then,G=Promise.reject.bind(P);function B(J){return new P(J)}function D(J){return B((Y)=>Y(J))}function M(J){return G(J)}function A(J,Y,z){return w.call(J,Y,z)}function N(J,Y,z){A(A(J,Y,z),void 0,X)}function h(J,Y){N(J,Y)}function $(J,Y){N(J,void 0,Y)}function U(J,Y,z){return A(J,Y,z)}function O(J){A(J,void 0,X)}let H=(J)=>{if(typeof queueMicrotask==="function")H=queueMicrotask;else{let Y=D(void 0);H=(z)=>A(Y,z)}return H(J)};function F(J,Y,z){if(typeof J!=="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(J,Y,z)}function E(J,Y,z){try{return D(F(J,Y,z))}catch(q){return M(q)}}let L=16384;class R{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(J){let Y=this._back,z=Y;if(Y._elements.length===L-1)z={_elements:[],_next:void 0};if(Y._elements.push(J),z!==Y)this._back=z,Y._next=z;++this._size}shift(){let J=this._front,Y=J,z=this._cursor,q=z+1,g=J._elements,k=g[z];if(q===L)Y=J._next,q=0;if(--this._size,this._cursor=q,J!==Y)this._front=Y;return g[z]=void 0,k}forEach(J){let Y=this._cursor,z=this._front,q=z._elements;while(Y!==q.length||z._next!==void 0){if(Y===q.length){if(z=z._next,q=z._elements,Y=0,q.length===0)break}J(q[Y]),++Y}}peek(){let J=this._front,Y=this._cursor;return J._elements[Y]}}let Z=Symbol("[[AbortSteps]]"),m=Symbol("[[ErrorSteps]]"),x=Symbol("[[CancelSteps]]"),y=Symbol("[[PullSteps]]"),a=Symbol("[[ReleaseSteps]]");function p(J,Y){if(J._ownerReadableStream=Y,Y._reader=J,Y._state==="readable")d(J);else if(Y._state==="closed")Bv(J);else Av(J,Y._storedError)}function i(J,Y){let z=J._ownerReadableStream;return af(z,Y)}function T(J){let Y=J._ownerReadableStream;if(Y._state==="readable")Kv(J,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness"));else Gv(J,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness"));Y._readableStreamController[a](),Y._reader=void 0,J._ownerReadableStream=void 0}function b(J){return new TypeError("Cannot "+J+" a stream using a released reader")}function d(J){J._closedPromise=B((Y,z)=>{J._closedPromise_resolve=Y,J._closedPromise_reject=z})}function Av(J,Y){d(J),Kv(J,Y)}function Bv(J){d(J),e(J)}function Kv(J,Y){if(J._closedPromise_reject===void 0)return;O(J._closedPromise),J._closedPromise_reject(Y),J._closedPromise_resolve=void 0,J._closedPromise_reject=void 0}function Gv(J,Y){Av(J,Y)}function e(J){if(J._closedPromise_resolve===void 0)return;J._closedPromise_resolve(void 0),J._closedPromise_resolve=void 0,J._closedPromise_reject=void 0}let Zv=Number.isFinite||function(J){return typeof J==="number"&&isFinite(J)},sv=Math.trunc||function(J){return J<0?Math.ceil(J):Math.floor(J)};function vf(J){return typeof J==="object"||typeof J==="function"}function Pv(J,Y){if(J!==void 0&&!vf(J))throw new TypeError(`${Y} is not an object.`)}function Ev(J,Y){if(typeof J!=="function")throw new TypeError(`${Y} is not a function.`)}function nv(J){return typeof J==="object"&&J!==null||typeof J==="function"}function ov(J,Y){if(!nv(J))throw new TypeError(`${Y} is not an object.`)}function tv(J,Y,z){if(J===void 0)throw new TypeError(`Parameter ${Y} is required in '${z}'.`)}function Uf(J,Y,z){if(J===void 0)throw new TypeError(`${Y} is required in '${z}'.`)}function xv(J){return Number(J)}function Cv(J){return J===0?0:J}function M1(J){return Cv(sv(J))}function pv(J,Y){let q=Number.MAX_SAFE_INTEGER,g=Number(J);if(g=Cv(g),!Zv(g))throw new TypeError(`${Y} is not a finite number`);if(g=M1(g),g<0||g>q)throw new TypeError(`${Y} is outside the accepted range of 0 to ${q}, inclusive`);if(!Zv(g)||g===0)return 0;return g}function Vv(J,Y){if(!x1(J))throw new TypeError(`${Y} is not a ReadableStream.`)}function Bf(J){return new rv(J)}function Sf(J,Y){J._reader._readRequests.push(Y)}function bf(J,Y,z){let g=J._reader._readRequests.shift();if(z)g._closeSteps();else g._chunkSteps(Y)}function gf(J){return J._reader._readRequests.length}function iv(J){let Y=J._reader;if(Y===void 0)return!1;if(!bv(Y))return!1;return!0}class rv{constructor(J){if(tv(J,1,"ReadableStreamDefaultReader"),Vv(J,"First parameter"),l1(J))throw new TypeError("This stream has already been locked for exclusive reading by another reader");p(this,J),this._readRequests=new R}get closed(){if(!bv(this))return M(O1("closed"));return this._closedPromise}cancel(J=void 0){if(!bv(this))return M(O1("cancel"));if(this._ownerReadableStream===void 0)return M(b("cancel"));return i(this,J)}read(){if(!bv(this))return M(O1("read"));if(this._ownerReadableStream===void 0)return M(b("read from"));let J,Y,z=B((g,k)=>{J=g,Y=k});return cv(this,{_chunkSteps:(g)=>J({value:g,done:!1}),_closeSteps:()=>J({value:void 0,done:!0}),_errorSteps:(g)=>Y(g)}),z}releaseLock(){if(!bv(this))throw O1("releaseLock");if(this._ownerReadableStream===void 0)return;Rf(this)}}if(Object.defineProperties(rv.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),Q(rv.prototype.cancel,"cancel"),Q(rv.prototype.read,"read"),Q(rv.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag==="symbol")Object.defineProperty(rv.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function bv(J){if(!W(J))return!1;if(!Object.prototype.hasOwnProperty.call(J,"_readRequests"))return!1;return J instanceof rv}function cv(J,Y){let z=J._ownerReadableStream;if(z._disturbed=!0,z._state==="closed")Y._closeSteps();else if(z._state==="errored")Y._errorSteps(z._storedError);else z._readableStreamController[y](Y)}function Rf(J){T(J);let Y=new TypeError("Reader was released");Jf(J,Y)}function Jf(J,Y){let z=J._readRequests;J._readRequests=new R,z.forEach((q)=>{q._errorSteps(Y)})}function O1(J){return new TypeError(`ReadableStreamDefaultReader.prototype.${J} can only be used on a ReadableStreamDefaultReader`)}let XQ=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class Kf{constructor(J,Y){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=J,this._preventCancel=Y}next(){let J=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?U(this._ongoingPromise,J,J):J(),this._ongoingPromise}return(J){let Y=()=>this._returnSteps(J);return this._ongoingPromise?U(this._ongoingPromise,Y,Y):Y()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let J=this._reader,Y,z,q=B((k,C)=>{Y=k,z=C});return cv(J,{_chunkSteps:(k)=>{this._ongoingPromise=void 0,H(()=>Y({value:k,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,T(J),Y({value:void 0,done:!0})},_errorSteps:(k)=>{this._ongoingPromise=void 0,this._isFinished=!0,T(J),z(k)}}),q}_returnSteps(J){if(this._isFinished)return Promise.resolve({value:J,done:!0});this._isFinished=!0;let Y=this._reader;if(!this._preventCancel){let z=i(Y,J);return T(Y),U(z,()=>({value:J,done:!0}))}return T(Y),D({value:J,done:!0})}}let k1={next(){if(!PQ(this))return M(I1("next"));return this._asyncIteratorImpl.next()},return(J){if(!PQ(this))return M(I1("return"));return this._asyncIteratorImpl.return(J)}};Object.setPrototypeOf(k1,XQ);function nQ(J,Y){let z=Bf(J),q=new Kf(z,Y),g=Object.create(k1);return g._asyncIteratorImpl=q,g}function PQ(J){if(!W(J))return!1;if(!Object.prototype.hasOwnProperty.call(J,"_asyncIteratorImpl"))return!1;try{return J._asyncIteratorImpl instanceof Kf}catch(Y){return!1}}function I1(J){return new TypeError(`ReadableStreamAsyncIterator.${J} can only be used on a ReadableSteamAsyncIterator`)}let YQ=Number.isNaN||function(J){return J!==J};var wQ,GQ,U0;function Xf(J){return J.slice()}function pQ(J,Y,z,q,g){new Uint8Array(J).set(new Uint8Array(z,q,g),Y)}let uf=(J)=>{if(typeof J.transfer==="function")uf=(Y)=>Y.transfer();else if(typeof structuredClone==="function")uf=(Y)=>structuredClone(Y,{transfer:[Y]});else uf=(Y)=>Y;return uf(J)},Q1=(J)=>{if(typeof J.detached==="boolean")Q1=(Y)=>Y.detached;else Q1=(Y)=>Y.byteLength===0;return Q1(J)};function iQ(J,Y,z){if(J.slice)return J.slice(Y,z);let q=z-Y,g=new ArrayBuffer(q);return pQ(g,0,J,Y,q),g}function j0(J,Y){let z=J[Y];if(z===void 0||z===null)return;if(typeof z!=="function")throw new TypeError(`${String(Y)} is not a function`);return z}function LW(J){let Y={[Symbol.iterator]:()=>J.iterator},z=async function*(){return yield*Y}(),q=z.next;return{iterator:z,nextMethod:q,done:!1}}let W1=(U0=(wQ=Symbol.asyncIterator)!==null&&wQ!==void 0?wQ:(GQ=Symbol.for)===null||GQ===void 0?void 0:GQ.call(Symbol,"Symbol.asyncIterator"))!==null&&U0!==void 0?U0:"@@asyncIterator";function dQ(J,Y="sync",z){if(z===void 0)if(Y==="async"){if(z=j0(J,W1),z===void 0){let k=j0(J,Symbol.iterator),C=dQ(J,"sync",k);return LW(C)}}else z=j0(J,Symbol.iterator);if(z===void 0)throw new TypeError("The object is not iterable");let q=F(z,J,[]);if(!W(q))throw new TypeError("The iterator method must return an object");let g=q.next;return{iterator:q,nextMethod:g,done:!1}}function sQ(J){let Y=F(J.nextMethod,J.iterator,[]);if(!W(Y))throw new TypeError("The iterator.next() method must return an object");return Y}function SW(J){return Boolean(J.done)}function zQ(J){return J.value}function oQ(J){if(typeof J!=="number")return!1;if(YQ(J))return!1;if(J<0)return!1;return!0}function tQ(J){let Y=iQ(J.buffer,J.byteOffset,J.byteOffset+J.byteLength);return new Uint8Array(Y)}function F0(J){let Y=J._queue.shift();if(J._queueTotalSize-=Y.size,J._queueTotalSize<0)J._queueTotalSize=0;return Y.value}function BQ(J,Y,z){if(!oQ(z)||z===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");J._queue.push({value:Y,size:z}),J._queueTotalSize+=z}function eQ(J){return J._queue.peek().value}function j(J){J._queue=new R,J._queueTotalSize=0}function V(J){return J===DataView}function S(J){return V(J.constructor)}function I(J){if(V(J))return 1;return J.BYTES_PER_ELEMENT}class _{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Dv(this))throw V1("view");return this._view}respond(J){if(!Dv(this))throw V1("respond");if(tv(J,1,"respond"),J=pv(J,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Q1(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");If(this._associatedReadableByteStreamController,J)}respondWithNewView(J){if(!Dv(this))throw V1("respondWithNewView");if(tv(J,1,"respondWithNewView"),!ArrayBuffer.isView(J))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Q1(J.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");S0(this._associatedReadableByteStreamController,J)}}if(Object.defineProperties(_.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),Q(_.prototype.respond,"respond"),Q(_.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag==="symbol")Object.defineProperty(_.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class c{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Wv(this))throw Z1("byobRequest");return Y1(this)}get desiredSize(){if(!Wv(this))throw Z1("desiredSize");return L0(this)}close(){if(!Wv(this))throw Z1("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let J=this._controlledReadableByteStream._state;if(J!=="readable")throw new TypeError(`The stream (in ${J} state) is not in the readable state and cannot be closed`);P1(this)}enqueue(J){if(!Wv(this))throw Z1("enqueue");if(tv(J,1,"enqueue"),!ArrayBuffer.isView(J))throw new TypeError("chunk must be an array buffer view");if(J.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(J.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let Y=this._controlledReadableByteStream._state;if(Y!=="readable")throw new TypeError(`The stream (in ${Y} state) is not in the readable state and cannot be enqueued to`);mf(this,J)}error(J=void 0){if(!Wv(this))throw Z1("error");dv(this,J)}[x](J){uv(this),j(this);let Y=this._cancelAlgorithm(J);return H1(this),Y}[y](J){let Y=this._controlledReadableByteStream;if(this._queueTotalSize>0){kf(this,J);return}let z=this._autoAllocateChunkSize;if(z!==void 0){let q;try{q=new ArrayBuffer(z)}catch(k){J._errorSteps(k);return}let g={buffer:q,bufferByteLength:z,byteOffset:0,byteLength:z,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(g)}Sf(Y,J),hv(this)}[a](){if(this._pendingPullIntos.length>0){let J=this._pendingPullIntos.peek();J.readerType="none",this._pendingPullIntos=new R,this._pendingPullIntos.push(J)}}}if(Object.defineProperties(c.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),Q(c.prototype.close,"close"),Q(c.prototype.enqueue,"enqueue"),Q(c.prototype.error,"error"),typeof Symbol.toStringTag==="symbol")Object.defineProperty(c.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function Wv(J){if(!W(J))return!1;if(!Object.prototype.hasOwnProperty.call(J,"_controlledReadableByteStream"))return!1;return J instanceof c}function Dv(J){if(!W(J))return!1;if(!Object.prototype.hasOwnProperty.call(J,"_associatedReadableByteStreamController"))return!1;return J instanceof _}function hv(J){if(!Q0(J))return;if(J._pulling){J._pullAgain=!0;return}J._pulling=!0;let z=J._pullAlgorithm();N(z,()=>{if(J._pulling=!1,J._pullAgain)J._pullAgain=!1,hv(J);return null},(q)=>{return dv(J,q),null})}function uv(J){ff(J),J._pendingPullIntos=new R}function $v(J,Y){let z=!1;if(J._state==="closed")z=!0;let q=gv(Y);if(Y.readerType==="default")bf(J,q,z);else C1(J,q,z)}function gv(J){let{bytesFilled:Y,elementSize:z}=J;return new J.viewConstructor(J.buffer,J.byteOffset,Y/z)}function yv(J,Y,z,q){J._queue.push({buffer:Y,byteOffset:z,byteLength:q}),J._queueTotalSize+=q}function Lv(J,Y,z,q){let g;try{g=iQ(Y,z,z+q)}catch(k){throw dv(J,k),k}yv(J,g,0,q)}function qv(J,Y){if(Y.bytesFilled>0)Lv(J,Y.buffer,Y.byteOffset,Y.bytesFilled);Yf(J)}function Rv(J,Y){let z=Math.min(J._queueTotalSize,Y.byteLength-Y.bytesFilled),q=Y.bytesFilled+z,g=z,k=!1,C=q%Y.elementSize,s=q-C;if(s>=Y.minimumFill)g=s-Y.bytesFilled,k=!0;let t=J._queue;while(g>0){let Xv=t.peek(),Yv=Math.min(g,Xv.byteLength),Mv=Y.byteOffset+Y.bytesFilled;if(pQ(Y.buffer,Mv,Xv.buffer,Xv.byteOffset,Yv),Xv.byteLength===Yv)t.shift();else Xv.byteOffset+=Yv,Xv.byteLength-=Yv;J._queueTotalSize-=Yv,Uv(J,Yv,Y),g-=Yv}return k}function Uv(J,Y,z){z.bytesFilled+=Y}function J1(J){if(J._queueTotalSize===0&&J._closeRequested)H1(J),HQ(J._controlledReadableByteStream);else hv(J)}function ff(J){if(J._byobRequest===null)return;J._byobRequest._associatedReadableByteStreamController=void 0,J._byobRequest._view=null,J._byobRequest=null}function Pf(J){while(J._pendingPullIntos.length>0){if(J._queueTotalSize===0)return;let Y=J._pendingPullIntos.peek();if(Rv(J,Y))Yf(J),$v(J._controlledReadableByteStream,Y)}}function Fv(J){let Y=J._controlledReadableByteStream._reader;while(Y._readRequests.length>0){if(J._queueTotalSize===0)return;let z=Y._readRequests.shift();kf(J,z)}}function hf(J,Y,z,q){let g=J._controlledReadableByteStream,k=Y.constructor,C=I(k),{byteOffset:s,byteLength:t}=Y,Xv=z*C,Yv;try{Yv=uf(Y.buffer)}catch(Sv){q._errorSteps(Sv);return}let Mv={buffer:Yv,bufferByteLength:Yv.byteLength,byteOffset:s,byteLength:t,bytesFilled:0,minimumFill:Xv,elementSize:C,viewConstructor:k,readerType:"byob"};if(J._pendingPullIntos.length>0){J._pendingPullIntos.push(Mv),Zf(g,q);return}if(g._state==="closed"){let Sv=new k(Mv.buffer,Mv.byteOffset,0);q._closeSteps(Sv);return}if(J._queueTotalSize>0){if(Rv(J,Mv)){let Sv=gv(Mv);J1(J),q._chunkSteps(Sv);return}if(J._closeRequested){let Sv=new TypeError("Insufficient bytes to fill elements in the given buffer");dv(J,Sv),q._errorSteps(Sv);return}}J._pendingPullIntos.push(Mv),Zf(g,q),hv(J)}function Mf(J,Y){if(Y.readerType==="none")Yf(J);let z=J._controlledReadableByteStream;if(y1(z))while(g0(z)>0){let q=Yf(J);$v(z,q)}}function _f(J,Y,z){if(Uv(J,Y,z),z.readerType==="none"){qv(J,z),Pf(J);return}if(z.bytesFilled<z.minimumFill)return;Yf(J);let q=z.bytesFilled%z.elementSize;if(q>0){let g=z.byteOffset+z.bytesFilled;Lv(J,z.buffer,g-q,q)}z.bytesFilled-=q,$v(J._controlledReadableByteStream,z),Pf(J)}function X1(J,Y){let z=J._pendingPullIntos.peek();if(ff(J),J._controlledReadableByteStream._state==="closed")Mf(J,z);else _f(J,Y,z);hv(J)}function Yf(J){return J._pendingPullIntos.shift()}function Q0(J){let Y=J._controlledReadableByteStream;if(Y._state!=="readable")return!1;if(J._closeRequested)return!1;if(!J._started)return!1;if(iv(Y)&&gf(Y)>0)return!0;if(y1(Y)&&g0(Y)>0)return!0;if(L0(J)>0)return!0;return!1}function H1(J){J._pullAlgorithm=void 0,J._cancelAlgorithm=void 0}function P1(J){let Y=J._controlledReadableByteStream;if(J._closeRequested||Y._state!=="readable")return;if(J._queueTotalSize>0){J._closeRequested=!0;return}if(J._pendingPullIntos.length>0){let z=J._pendingPullIntos.peek();if(z.bytesFilled%z.elementSize!==0){let q=new TypeError("Insufficient bytes to fill elements in the given buffer");throw dv(J,q),q}}H1(J),HQ(Y)}function mf(J,Y){let z=J._controlledReadableByteStream;if(J._closeRequested||z._state!=="readable")return;let{buffer:q,byteOffset:g,byteLength:k}=Y;if(Q1(q))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let C=uf(q);if(J._pendingPullIntos.length>0){let s=J._pendingPullIntos.peek();if(Q1(s.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");if(ff(J),s.buffer=uf(s.buffer),s.readerType==="none")qv(J,s)}if(iv(z))if(Fv(J),gf(z)===0)yv(J,C,g,k);else{if(J._pendingPullIntos.length>0)Yf(J);let s=new Uint8Array(C,g,k);bf(z,s,!1)}else if(y1(z))yv(J,C,g,k),Pf(J);else yv(J,C,g,k);hv(J)}function dv(J,Y){let z=J._controlledReadableByteStream;if(z._state!=="readable")return;uv(J),j(J),H1(J),x9(z,Y)}function kf(J,Y){let z=J._queue.shift();J._queueTotalSize-=z.byteLength,J1(J);let q=new Uint8Array(z.buffer,z.byteOffset,z.byteLength);Y._chunkSteps(q)}function Y1(J){if(J._byobRequest===null&&J._pendingPullIntos.length>0){let Y=J._pendingPullIntos.peek(),z=new Uint8Array(Y.buffer,Y.byteOffset+Y.bytesFilled,Y.byteLength-Y.bytesFilled),q=Object.create(_.prototype);W0(q,J,z),J._byobRequest=q}return J._byobRequest}function L0(J){let Y=J._controlledReadableByteStream._state;if(Y==="errored")return null;if(Y==="closed")return 0;return J._strategyHWM-J._queueTotalSize}function If(J,Y){let z=J._pendingPullIntos.peek();if(J._controlledReadableByteStream._state==="closed"){if(Y!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(Y===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(z.bytesFilled+Y>z.byteLength)throw new RangeError("bytesWritten out of range")}z.buffer=uf(z.buffer),X1(J,Y)}function S0(J,Y){let z=J._pendingPullIntos.peek();if(J._controlledReadableByteStream._state==="closed"){if(Y.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(Y.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(z.byteOffset+z.bytesFilled!==Y.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(z.bufferByteLength!==Y.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(z.bytesFilled+Y.byteLength>z.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let g=Y.byteLength;z.buffer=uf(Y.buffer),X1(J,g)}function v8(J,Y,z,q,g,k,C){Y._controlledReadableByteStream=J,Y._pullAgain=!1,Y._pulling=!1,Y._byobRequest=null,Y._queue=Y._queueTotalSize=void 0,j(Y),Y._closeRequested=!1,Y._started=!1,Y._strategyHWM=k,Y._pullAlgorithm=q,Y._cancelAlgorithm=g,Y._autoAllocateChunkSize=C,Y._pendingPullIntos=new R,J._readableStreamController=Y;let s=z();N(D(s),()=>{return Y._started=!0,hv(Y),null},(t)=>{return dv(Y,t),null})}function f8(J,Y,z){let q=Object.create(c.prototype),g,k,C;if(Y.start!==void 0)g=()=>Y.start(q);else g=()=>{return};if(Y.pull!==void 0)k=()=>Y.pull(q);else k=()=>D(void 0);if(Y.cancel!==void 0)C=(t)=>Y.cancel(t);else C=()=>D(void 0);let s=Y.autoAllocateChunkSize;if(s===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");v8(J,q,g,k,C,z,s)}function W0(J,Y,z){J._associatedReadableByteStreamController=Y,J._view=z}function V1(J){return new TypeError(`ReadableStreamBYOBRequest.prototype.${J} can only be used on a ReadableStreamBYOBRequest`)}function Z1(J){return new TypeError(`ReadableByteStreamController.prototype.${J} can only be used on a ReadableByteStreamController`)}function J0(J,Y){Pv(J,Y);let z=J===null||J===void 0?void 0:J.mode;return{mode:z===void 0?void 0:gW(z,`${Y} has member 'mode' that`)}}function gW(J,Y){if(J=`${J}`,J!=="byob")throw new TypeError(`${Y} '${J}' is not a valid enumeration value for ReadableStreamReaderMode`);return J}function Q8(J,Y){var z;Pv(J,Y);let q=(z=J===null||J===void 0?void 0:J.min)!==null&&z!==void 0?z:1;return{min:pv(q,`${Y} has member 'min' that`)}}function W8(J){return new wf(J)}function Zf(J,Y){J._reader._readIntoRequests.push(Y)}function C1(J,Y,z){let g=J._reader._readIntoRequests.shift();if(z)g._closeSteps(Y);else g._chunkSteps(Y)}function g0(J){return J._reader._readIntoRequests.length}function y1(J){let Y=J._reader;if(Y===void 0)return!1;if(!T1(Y))return!1;return!0}class wf{constructor(J){if(tv(J,1,"ReadableStreamBYOBReader"),Vv(J,"First parameter"),l1(J))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Wv(J._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");p(this,J),this._readIntoRequests=new R}get closed(){if(!T1(this))return M(R0("closed"));return this._closedPromise}cancel(J=void 0){if(!T1(this))return M(R0("cancel"));if(this._ownerReadableStream===void 0)return M(b("cancel"));return i(this,J)}read(J,Y={}){if(!T1(this))return M(R0("read"));if(!ArrayBuffer.isView(J))return M(new TypeError("view must be an array buffer view"));if(J.byteLength===0)return M(new TypeError("view must have non-zero byteLength"));if(J.buffer.byteLength===0)return M(new TypeError("view's buffer must have non-zero byteLength"));if(Q1(J.buffer))return M(new TypeError("view's buffer has been detached"));let z;try{z=Q8(Y,"options")}catch(t){return M(t)}let q=z.min;if(q===0)return M(new TypeError("options.min must be greater than 0"));if(!S(J)){if(q>J.length)return M(new RangeError("options.min must be less than or equal to view's length"))}else if(q>J.byteLength)return M(new RangeError("options.min must be less than or equal to view's byteLength"));if(this._ownerReadableStream===void 0)return M(b("read from"));let g,k,C=B((t,Xv)=>{g=t,k=Xv});return q1(this,J,q,{_chunkSteps:(t)=>g({value:t,done:!1}),_closeSteps:(t)=>g({value:t,done:!0}),_errorSteps:(t)=>k(t)}),C}releaseLock(){if(!T1(this))throw R0("releaseLock");if(this._ownerReadableStream===void 0)return;X0(this)}}if(Object.defineProperties(wf.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),Q(wf.prototype.cancel,"cancel"),Q(wf.prototype.read,"read"),Q(wf.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag==="symbol")Object.defineProperty(wf.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function T1(J){if(!W(J))return!1;if(!Object.prototype.hasOwnProperty.call(J,"_readIntoRequests"))return!1;return J instanceof wf}function q1(J,Y,z,q){let g=J._ownerReadableStream;if(g._disturbed=!0,g._state==="errored")q._errorSteps(g._storedError);else hf(g._readableStreamController,Y,z,q)}function X0(J){T(J);let Y=new TypeError("Reader was released");KQ(J,Y)}function KQ(J,Y){let z=J._readIntoRequests;J._readIntoRequests=new R,z.forEach((q)=>{q._errorSteps(Y)})}function R0(J){return new TypeError(`ReadableStreamBYOBReader.prototype.${J} can only be used on a ReadableStreamBYOBReader`)}function P0(J,Y){let{highWaterMark:z}=J;if(z===void 0)return Y;if(YQ(z)||z<0)throw new RangeError("Invalid highWaterMark");return z}function _0(J){let{size:Y}=J;if(!Y)return()=>1;return Y}function hQ(J,Y){Pv(J,Y);let z=J===null||J===void 0?void 0:J.highWaterMark,q=J===null||J===void 0?void 0:J.size;return{highWaterMark:z===void 0?void 0:xv(z),size:q===void 0?void 0:B9(q,`${Y} has member 'size' that`)}}function B9(J,Y){return Ev(J,Y),(z)=>xv(J(z))}function K9(J,Y){Pv(J,Y);let z=J===null||J===void 0?void 0:J.abort,q=J===null||J===void 0?void 0:J.close,g=J===null||J===void 0?void 0:J.start,k=J===null||J===void 0?void 0:J.type,C=J===null||J===void 0?void 0:J.write;return{abort:z===void 0?void 0:h9(z,J,`${Y} has member 'abort' that`),close:q===void 0?void 0:$9(q,J,`${Y} has member 'close' that`),start:g===void 0?void 0:D9(g,J,`${Y} has member 'start' that`),write:C===void 0?void 0:M9(C,J,`${Y} has member 'write' that`),type:k}}function h9(J,Y,z){return Ev(J,z),(q)=>E(J,Y,[q])}function $9(J,Y,z){return Ev(J,z),()=>E(J,Y,[])}function D9(J,Y,z){return Ev(J,z),(q)=>F(J,Y,[q])}function M9(J,Y,z){return Ev(J,z),(q,g)=>E(J,Y,[q,g])}function O9(J,Y){if(!k0(J))throw new TypeError(`${Y} is not a WritableStream.`)}function L4(J){if(typeof J!=="object"||J===null)return!1;try{return typeof J.aborted==="boolean"}catch(Y){return!1}}let S4=typeof AbortController==="function";function g4(){if(S4)return new AbortController;return}class N1{constructor(J={},Y={}){if(J===void 0)J=null;else ov(J,"First parameter");let z=hQ(Y,"Second parameter"),q=K9(J,"First parameter");if(V9(this),q.type!==void 0)throw new RangeError("Invalid type is specified");let k=_0(z),C=P0(z,1);r4(this,q,C,k)}get locked(){if(!k0(this))throw w8("locked");return I0(this)}abort(J=void 0){if(!k0(this))return M(w8("abort"));if(I0(this))return M(new TypeError("Cannot abort a stream that already has a writer"));return J8(this,J)}close(){if(!k0(this))return M(w8("close"));if(I0(this))return M(new TypeError("Cannot close a stream that already has a writer"));if(w1(this))return M(new TypeError("Cannot close an already-closing stream"));return q9(this)}getWriter(){if(!k0(this))throw w8("getWriter");return H9(this)}}if(Object.defineProperties(N1.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),Q(N1.prototype.abort,"abort"),Q(N1.prototype.close,"close"),Q(N1.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag==="symbol")Object.defineProperty(N1.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function H9(J){return new G1(J)}function R4(J,Y,z,q,g=1,k=()=>1){let C=Object.create(N1.prototype);V9(C);let s=Object.create(w0.prototype);return F9(C,s,J,Y,z,q,g,k),C}function V9(J){J._state="writable",J._storedError=void 0,J._writer=void 0,J._writableStreamController=void 0,J._writeRequests=new R,J._inFlightWriteRequest=void 0,J._closeRequest=void 0,J._inFlightCloseRequest=void 0,J._pendingAbortRequest=void 0,J._backpressure=!1}function k0(J){if(!W(J))return!1;if(!Object.prototype.hasOwnProperty.call(J,"_writableStreamController"))return!1;return J instanceof N1}function I0(J){if(J._writer===void 0)return!1;return!0}function J8(J,Y){var z;if(J._state==="closed"||J._state==="errored")return D(void 0);J._writableStreamController._abortReason=Y,(z=J._writableStreamController._abortController)===null||z===void 0||z.abort(Y);let q=J._state;if(q==="closed"||q==="errored")return D(void 0);if(J._pendingAbortRequest!==void 0)return J._pendingAbortRequest._promise;let g=!1;if(q==="erroring")g=!0,Y=void 0;let k=B((C,s)=>{J._pendingAbortRequest={_promise:void 0,_resolve:C,_reject:s,_reason:Y,_wasAlreadyErroring:g}});if(J._pendingAbortRequest._promise=k,!g)_W(J,Y);return k}function q9(J){let Y=J._state;if(Y==="closed"||Y==="errored")return M(new TypeError(`The stream (in ${Y} state) is not in the writable state and cannot be closed`));let z=B((g,k)=>{let C={_resolve:g,_reject:k};J._closeRequest=C}),q=J._writer;if(q!==void 0&&J._backpressure&&Y==="writable")lW(q);return a4(J._writableStreamController),z}function _4(J){return B((z,q)=>{let g={_resolve:z,_reject:q};J._writeRequests.push(g)})}function RW(J,Y){if(J._state==="writable"){_W(J,Y);return}kW(J)}function _W(J,Y){let z=J._writableStreamController;J._state="erroring",J._storedError=Y;let q=J._writer;if(q!==void 0)E9(q,Y);if(!y4(J)&&z._started)kW(J)}function kW(J){J._state="errored",J._writableStreamController[m]();let Y=J._storedError;if(J._writeRequests.forEach((g)=>{g._reject(Y)}),J._writeRequests=new R,J._pendingAbortRequest===void 0){X8(J);return}let z=J._pendingAbortRequest;if(J._pendingAbortRequest=void 0,z._wasAlreadyErroring){z._reject(Y),X8(J);return}let q=J._writableStreamController[Z](z._reason);N(q,()=>{return z._resolve(),X8(J),null},(g)=>{return z._reject(g),X8(J),null})}function k4(J){J._inFlightWriteRequest._resolve(void 0),J._inFlightWriteRequest=void 0}function I4(J,Y){J._inFlightWriteRequest._reject(Y),J._inFlightWriteRequest=void 0,RW(J,Y)}function Z4(J){if(J._inFlightCloseRequest._resolve(void 0),J._inFlightCloseRequest=void 0,J._state==="erroring"){if(J._storedError=void 0,J._pendingAbortRequest!==void 0)J._pendingAbortRequest._resolve(),J._pendingAbortRequest=void 0}J._state="closed";let z=J._writer;if(z!==void 0)R9(z)}function C4(J,Y){if(J._inFlightCloseRequest._reject(Y),J._inFlightCloseRequest=void 0,J._pendingAbortRequest!==void 0)J._pendingAbortRequest._reject(Y),J._pendingAbortRequest=void 0;RW(J,Y)}function w1(J){if(J._closeRequest===void 0&&J._inFlightCloseRequest===void 0)return!1;return!0}function y4(J){if(J._inFlightWriteRequest===void 0&&J._inFlightCloseRequest===void 0)return!1;return!0}function T4(J){J._inFlightCloseRequest=J._closeRequest,J._closeRequest=void 0}function x4(J){J._inFlightWriteRequest=J._writeRequests.shift()}function X8(J){if(J._closeRequest!==void 0)J._closeRequest._reject(J._storedError),J._closeRequest=void 0;let Y=J._writer;if(Y!==void 0)TW(Y,J._storedError)}function IW(J,Y){let z=J._writer;if(z!==void 0&&Y!==J._backpressure)if(Y)o4(z);else lW(z);J._backpressure=Y}class G1{constructor(J){if(tv(J,1,"WritableStreamDefaultWriter"),O9(J,"First parameter"),I0(J))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=J,J._writer=this;let Y=J._state;if(Y==="writable"){if(!w1(J)&&J._backpressure)z8(this);else _9(this);G8(this)}else if(Y==="erroring")xW(this,J._storedError),G8(this);else if(Y==="closed")_9(this),d4(this);else{let z=J._storedError;xW(this,z),g9(this,z)}}get closed(){if(!Y0(this))return M(G0("closed"));return this._closedPromise}get desiredSize(){if(!Y0(this))throw G0("desiredSize");if(this._ownerWritableStream===void 0)throw DQ("desiredSize");return m4(this)}get ready(){if(!Y0(this))return M(G0("ready"));return this._readyPromise}abort(J=void 0){if(!Y0(this))return M(G0("abort"));if(this._ownerWritableStream===void 0)return M(DQ("abort"));return l4(this,J)}close(){if(!Y0(this))return M(G0("close"));let J=this._ownerWritableStream;if(J===void 0)return M(DQ("close"));if(w1(J))return M(new TypeError("Cannot close an already-closing stream"));return N9(this)}releaseLock(){if(!Y0(this))throw G0("releaseLock");if(this._ownerWritableStream===void 0)return;A9(this)}write(J=void 0){if(!Y0(this))return M(G0("write"));if(this._ownerWritableStream===void 0)return M(DQ("write to"));return U9(this,J)}}if(Object.defineProperties(G1.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),Q(G1.prototype.abort,"abort"),Q(G1.prototype.close,"close"),Q(G1.prototype.releaseLock,"releaseLock"),Q(G1.prototype.write,"write"),typeof Symbol.toStringTag==="symbol")Object.defineProperty(G1.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function Y0(J){if(!W(J))return!1;if(!Object.prototype.hasOwnProperty.call(J,"_ownerWritableStream"))return!1;return J instanceof G1}function l4(J,Y){let z=J._ownerWritableStream;return J8(z,Y)}function N9(J){let Y=J._ownerWritableStream;return q9(Y)}function b4(J){let Y=J._ownerWritableStream,z=Y._state;if(w1(Y)||z==="closed")return D(void 0);if(z==="errored")return M(Y._storedError);return N9(J)}function u4(J,Y){if(J._closedPromiseState==="pending")TW(J,Y);else s4(J,Y)}function E9(J,Y){if(J._readyPromiseState==="pending")k9(J,Y);else t4(J,Y)}function m4(J){let Y=J._ownerWritableStream,z=Y._state;if(z==="errored"||z==="erroring")return null;if(z==="closed")return 0;return L9(Y._writableStreamController)}function A9(J){let Y=J._ownerWritableStream,z=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");E9(J,z),u4(J,z),Y._writer=void 0,J._ownerWritableStream=void 0}function U9(J,Y){let z=J._ownerWritableStream,q=z._writableStreamController,g=c4(q,Y);if(z!==J._ownerWritableStream)return M(DQ("write to"));let k=z._state;if(k==="errored")return M(z._storedError);if(w1(z)||k==="closed")return M(new TypeError("The stream is closing or closed and cannot be written to"));if(k==="erroring")return M(z._storedError);let C=_4(z);return n4(q,Y,g),C}let j9={};class w0{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!ZW(this))throw yW("abortReason");return this._abortReason}get signal(){if(!ZW(this))throw yW("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(J=void 0){if(!ZW(this))throw yW("error");if(this._controlledWritableStream._state!=="writable")return;S9(this,J)}[Z](J){let Y=this._abortAlgorithm(J);return P8(this),Y}[m](){j(this)}}if(Object.defineProperties(w0.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag==="symbol")Object.defineProperty(w0.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function ZW(J){if(!W(J))return!1;if(!Object.prototype.hasOwnProperty.call(J,"_controlledWritableStream"))return!1;return J instanceof w0}function F9(J,Y,z,q,g,k,C,s){Y._controlledWritableStream=J,J._writableStreamController=Y,Y._queue=void 0,Y._queueTotalSize=void 0,j(Y),Y._abortReason=void 0,Y._abortController=g4(),Y._started=!1,Y._strategySizeAlgorithm=s,Y._strategyHWM=C,Y._writeAlgorithm=q,Y._closeAlgorithm=g,Y._abortAlgorithm=k;let t=CW(Y);IW(J,t);let Xv=z(),Yv=D(Xv);N(Yv,()=>{return Y._started=!0,Y8(Y),null},(Mv)=>{return Y._started=!0,RW(J,Mv),null})}function r4(J,Y,z,q){let g=Object.create(w0.prototype),k,C,s,t;if(Y.start!==void 0)k=()=>Y.start(g);else k=()=>{return};if(Y.write!==void 0)C=(Xv)=>Y.write(Xv,g);else C=()=>D(void 0);if(Y.close!==void 0)s=()=>Y.close();else s=()=>D(void 0);if(Y.abort!==void 0)t=(Xv)=>Y.abort(Xv);else t=()=>D(void 0);F9(J,g,k,C,s,t,z,q)}function P8(J){J._writeAlgorithm=void 0,J._closeAlgorithm=void 0,J._abortAlgorithm=void 0,J._strategySizeAlgorithm=void 0}function a4(J){BQ(J,j9,0),Y8(J)}function c4(J,Y){try{return J._strategySizeAlgorithm(Y)}catch(z){return $Q(J,z),1}}function L9(J){return J._strategyHWM-J._queueTotalSize}function n4(J,Y,z){try{BQ(J,Y,z)}catch(g){$Q(J,g);return}let q=J._controlledWritableStream;if(!w1(q)&&q._state==="writable"){let g=CW(J);IW(q,g)}Y8(J)}function Y8(J){let Y=J._controlledWritableStream;if(!J._started)return;if(Y._inFlightWriteRequest!==void 0)return;if(Y._state==="erroring"){kW(Y);return}if(J._queue.length===0)return;let q=eQ(J);if(q===j9)p4(J);else i4(J,q)}function $Q(J,Y){if(J._controlledWritableStream._state==="writable")S9(J,Y)}function p4(J){let Y=J._controlledWritableStream;T4(Y),F0(J);let z=J._closeAlgorithm();P8(J),N(z,()=>{return Z4(Y),null},(q)=>{return C4(Y,q),null})}function i4(J,Y){let z=J._controlledWritableStream;x4(z);let q=J._writeAlgorithm(Y);N(q,()=>{k4(z);let g=z._state;if(F0(J),!w1(z)&&g==="writable"){let k=CW(J);IW(z,k)}return Y8(J),null},(g)=>{if(z._state==="writable")P8(J);return I4(z,g),null})}function CW(J){return L9(J)<=0}function S9(J,Y){let z=J._controlledWritableStream;P8(J),_W(z,Y)}function w8(J){return new TypeError(`WritableStream.prototype.${J} can only be used on a WritableStream`)}function yW(J){return new TypeError(`WritableStreamDefaultController.prototype.${J} can only be used on a WritableStreamDefaultController`)}function G0(J){return new TypeError(`WritableStreamDefaultWriter.prototype.${J} can only be used on a WritableStreamDefaultWriter`)}function DQ(J){return new TypeError("Cannot "+J+" a stream using a released writer")}function G8(J){J._closedPromise=B((Y,z)=>{J._closedPromise_resolve=Y,J._closedPromise_reject=z,J._closedPromiseState="pending"})}function g9(J,Y){G8(J),TW(J,Y)}function d4(J){G8(J),R9(J)}function TW(J,Y){if(J._closedPromise_reject===void 0)return;O(J._closedPromise),J._closedPromise_reject(Y),J._closedPromise_resolve=void 0,J._closedPromise_reject=void 0,J._closedPromiseState="rejected"}function s4(J,Y){g9(J,Y)}function R9(J){if(J._closedPromise_resolve===void 0)return;J._closedPromise_resolve(void 0),J._closedPromise_resolve=void 0,J._closedPromise_reject=void 0,J._closedPromiseState="resolved"}function z8(J){J._readyPromise=B((Y,z)=>{J._readyPromise_resolve=Y,J._readyPromise_reject=z}),J._readyPromiseState="pending"}function xW(J,Y){z8(J),k9(J,Y)}function _9(J){z8(J),lW(J)}function k9(J,Y){if(J._readyPromise_reject===void 0)return;O(J._readyPromise),J._readyPromise_reject(Y),J._readyPromise_resolve=void 0,J._readyPromise_reject=void 0,J._readyPromiseState="rejected"}function o4(J){z8(J)}function t4(J,Y){xW(J,Y)}function lW(J){if(J._readyPromise_resolve===void 0)return;J._readyPromise_resolve(void 0),J._readyPromise_resolve=void 0,J._readyPromise_reject=void 0,J._readyPromiseState="fulfilled"}function e4(){if(typeof globalThis!=="undefined")return globalThis;else if(typeof self!=="undefined")return self;else if(typeof global!=="undefined")return global;return}let bW=e4();function v5(J){if(!(typeof J==="function"||typeof J==="object"))return!1;if(J.name!=="DOMException")return!1;try{return new J,!0}catch(Y){return!1}}function f5(){let J=bW===null||bW===void 0?void 0:bW.DOMException;return v5(J)?J:void 0}function Q5(){let J=function Y(z,q){if(this.message=z||"",this.name=q||"Error",Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)};return Q(J,"DOMException"),J.prototype=Object.create(Error.prototype),Object.defineProperty(J.prototype,"constructor",{value:J,writable:!0,configurable:!0}),J}let W5=f5()||Q5();function I9(J,Y,z,q,g,k){let C=Bf(J),s=H9(Y);J._disturbed=!0;let t=!1,Xv=D(void 0);return B((Yv,Mv)=>{let Sv;if(k!==void 0){if(Sv=()=>{let vv=k.reason!==void 0?k.reason:new W5("Aborted","AbortError"),Hv=[];if(!q)Hv.push(()=>{if(Y._state==="writable")return J8(Y,vv);return D(void 0)});if(!g)Hv.push(()=>{if(J._state==="readable")return af(J,vv);return D(void 0)});Of(()=>Promise.all(Hv.map((_v)=>_v())),!0,vv)},k.aborted){Sv();return}k.addEventListener("abort",Sv)}function A1(){return B((vv,Hv)=>{function _v(jf){if(jf)vv();else A(T0(),_v,Hv)}_v(!1)})}function T0(){if(t)return D(!0);return A(s._readyPromise,()=>{return B((vv,Hv)=>{cv(C,{_chunkSteps:(_v)=>{Xv=A(U9(s,_v),void 0,v),vv(!1)},_closeSteps:()=>vv(!0),_errorSteps:Hv})})})}if(U1(J,C._closedPromise,(vv)=>{if(!q)Of(()=>J8(Y,vv),!0,vv);else Cf(!0,vv);return null}),U1(Y,s._closedPromise,(vv)=>{if(!g)Of(()=>af(J,vv),!0,vv);else Cf(!0,vv);return null}),$f(J,C._closedPromise,()=>{if(!z)Of(()=>b4(s));else Cf();return null}),w1(Y)||Y._state==="closed"){let vv=new TypeError("the destination writable stream closed before all data could be piped to it");if(!g)Of(()=>af(J,vv),!0,vv);else Cf(!0,vv)}O(A1());function b1(){let vv=Xv;return A(Xv,()=>vv!==Xv?b1():void 0)}function U1(vv,Hv,_v){if(vv._state==="errored")_v(vv._storedError);else $(Hv,_v)}function $f(vv,Hv,_v){if(vv._state==="closed")_v();else h(Hv,_v)}function Of(vv,Hv,_v){if(t)return;if(t=!0,Y._state==="writable"&&!w1(Y))h(b1(),jf);else jf();function jf(){return N(vv(),()=>j1(Hv,_v),(x0)=>j1(!0,x0)),null}}function Cf(vv,Hv){if(t)return;if(t=!0,Y._state==="writable"&&!w1(Y))h(b1(),()=>j1(vv,Hv));else j1(vv,Hv)}function j1(vv,Hv){if(A9(s),T(C),k!==void 0)k.removeEventListener("abort",Sv);if(vv)Mv(Hv);else Yv(void 0);return null}})}class z1{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!B8(this))throw h8("desiredSize");return uW(this)}close(){if(!B8(this))throw h8("close");if(!C0(this))throw new TypeError("The stream is not in a state that permits close");z0(this)}enqueue(J=void 0){if(!B8(this))throw h8("enqueue");if(!C0(this))throw new TypeError("The stream is not in a state that permits enqueue");return Z0(this,J)}error(J=void 0){if(!B8(this))throw h8("error");rf(this,J)}[x](J){j(this);let Y=this._cancelAlgorithm(J);return K8(this),Y}[y](J){let Y=this._controlledReadableStream;if(this._queue.length>0){let z=F0(this);if(this._closeRequested&&this._queue.length===0)K8(this),HQ(Y);else MQ(this);J._chunkSteps(z)}else Sf(Y,J),MQ(this)}[a](){}}if(Object.defineProperties(z1.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),Q(z1.prototype.close,"close"),Q(z1.prototype.enqueue,"enqueue"),Q(z1.prototype.error,"error"),typeof Symbol.toStringTag==="symbol")Object.defineProperty(z1.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function B8(J){if(!W(J))return!1;if(!Object.prototype.hasOwnProperty.call(J,"_controlledReadableStream"))return!1;return J instanceof z1}function MQ(J){if(!Z9(J))return;if(J._pulling){J._pullAgain=!0;return}J._pulling=!0;let z=J._pullAlgorithm();N(z,()=>{if(J._pulling=!1,J._pullAgain)J._pullAgain=!1,MQ(J);return null},(q)=>{return rf(J,q),null})}function Z9(J){let Y=J._controlledReadableStream;if(!C0(J))return!1;if(!J._started)return!1;if(l1(Y)&&gf(Y)>0)return!0;if(uW(J)>0)return!0;return!1}function K8(J){J._pullAlgorithm=void 0,J._cancelAlgorithm=void 0,J._strategySizeAlgorithm=void 0}function z0(J){if(!C0(J))return;let Y=J._controlledReadableStream;if(J._closeRequested=!0,J._queue.length===0)K8(J),HQ(Y)}function Z0(J,Y){if(!C0(J))return;let z=J._controlledReadableStream;if(l1(z)&&gf(z)>0)bf(z,Y,!1);else{let q;try{q=J._strategySizeAlgorithm(Y)}catch(g){throw rf(J,g),g}try{BQ(J,Y,q)}catch(g){throw rf(J,g),g}}MQ(J)}function rf(J,Y){let z=J._controlledReadableStream;if(z._state!=="readable")return;j(J),K8(J),x9(z,Y)}function uW(J){let Y=J._controlledReadableStream._state;if(Y==="errored")return null;if(Y==="closed")return 0;return J._strategyHWM-J._queueTotalSize}function J5(J){if(Z9(J))return!1;return!0}function C0(J){let Y=J._controlledReadableStream._state;if(!J._closeRequested&&Y==="readable")return!0;return!1}function C9(J,Y,z,q,g,k,C){Y._controlledReadableStream=J,Y._queue=void 0,Y._queueTotalSize=void 0,j(Y),Y._started=!1,Y._closeRequested=!1,Y._pullAgain=!1,Y._pulling=!1,Y._strategySizeAlgorithm=C,Y._strategyHWM=k,Y._pullAlgorithm=q,Y._cancelAlgorithm=g,J._readableStreamController=Y;let s=z();N(D(s),()=>{return Y._started=!0,MQ(Y),null},(t)=>{return rf(Y,t),null})}function X5(J,Y,z,q){let g=Object.create(z1.prototype),k,C,s;if(Y.start!==void 0)k=()=>Y.start(g);else k=()=>{return};if(Y.pull!==void 0)C=()=>Y.pull(g);else C=()=>D(void 0);if(Y.cancel!==void 0)s=(t)=>Y.cancel(t);else s=()=>D(void 0);C9(J,g,k,C,s,z,q)}function h8(J){return new TypeError(`ReadableStreamDefaultController.prototype.${J} can only be used on a ReadableStreamDefaultController`)}function P5(J,Y){if(Wv(J._readableStreamController))return w5(J);return Y5(J)}function Y5(J,Y){let z=Bf(J),q=!1,g=!1,k=!1,C=!1,s,t,Xv,Yv,Mv,Sv=B(($f)=>{Mv=$f});function A1(){if(q)return g=!0,D(void 0);return q=!0,cv(z,{_chunkSteps:(Of)=>{H(()=>{g=!1;let Cf=Of,j1=Of;if(!k)Z0(Xv._readableStreamController,Cf);if(!C)Z0(Yv._readableStreamController,j1);if(q=!1,g)A1()})},_closeSteps:()=>{if(q=!1,!k)z0(Xv._readableStreamController);if(!C)z0(Yv._readableStreamController);if(!k||!C)Mv(void 0)},_errorSteps:()=>{q=!1}}),D(void 0)}function T0($f){if(k=!0,s=$f,C){let Of=Xf([s,t]),Cf=af(J,Of);Mv(Cf)}return Sv}function b1($f){if(C=!0,t=$f,k){let Of=Xf([s,t]),Cf=af(J,Of);Mv(Cf)}return Sv}function U1(){}return Xv=OQ(U1,A1,T0),Yv=OQ(U1,A1,b1),$(z._closedPromise,($f)=>{if(rf(Xv._readableStreamController,$f),rf(Yv._readableStreamController,$f),!k||!C)Mv(void 0);return null}),[Xv,Yv]}function w5(J){let Y=Bf(J),z=!1,q=!1,g=!1,k=!1,C=!1,s,t,Xv,Yv,Mv,Sv=B((vv)=>{Mv=vv});function A1(vv){$(vv._closedPromise,(Hv)=>{if(vv!==Y)return null;if(dv(Xv._readableStreamController,Hv),dv(Yv._readableStreamController,Hv),!k||!C)Mv(void 0);return null})}function T0(){if(T1(Y))T(Y),Y=Bf(J),A1(Y);cv(Y,{_chunkSteps:(Hv)=>{H(()=>{q=!1,g=!1;let _v=Hv,jf=Hv;if(!k&&!C)try{jf=tQ(Hv)}catch(x0){dv(Xv._readableStreamController,x0),dv(Yv._readableStreamController,x0),Mv(af(J,x0));return}if(!k)mf(Xv._readableStreamController,_v);if(!C)mf(Yv._readableStreamController,jf);if(z=!1,q)U1();else if(g)$f()})},_closeSteps:()=>{if(z=!1,!k)P1(Xv._readableStreamController);if(!C)P1(Yv._readableStreamController);if(Xv._readableStreamController._pendingPullIntos.length>0)If(Xv._readableStreamController,0);if(Yv._readableStreamController._pendingPullIntos.length>0)If(Yv._readableStreamController,0);if(!k||!C)Mv(void 0)},_errorSteps:()=>{z=!1}})}function b1(vv,Hv){if(bv(Y))T(Y),Y=W8(J),A1(Y);let _v=Hv?Yv:Xv,jf=Hv?Xv:Yv;q1(Y,vv,1,{_chunkSteps:(l0)=>{H(()=>{q=!1,g=!1;let b0=Hv?C:k;if(!(Hv?k:C)){let o9;try{o9=tQ(l0)}catch(nW){dv(_v._readableStreamController,nW),dv(jf._readableStreamController,nW),Mv(af(J,nW));return}if(!b0)S0(_v._readableStreamController,l0);mf(jf._readableStreamController,o9)}else if(!b0)S0(_v._readableStreamController,l0);if(z=!1,q)U1();else if(g)$f()})},_closeSteps:(l0)=>{z=!1;let b0=Hv?C:k,H8=Hv?k:C;if(!b0)P1(_v._readableStreamController);if(!H8)P1(jf._readableStreamController);if(l0!==void 0){if(!b0)S0(_v._readableStreamController,l0);if(!H8&&jf._readableStreamController._pendingPullIntos.length>0)If(jf._readableStreamController,0)}if(!b0||!H8)Mv(void 0)},_errorSteps:()=>{z=!1}})}function U1(){if(z)return q=!0,D(void 0);z=!0;let vv=Y1(Xv._readableStreamController);if(vv===null)T0();else b1(vv._view,!1);return D(void 0)}function $f(){if(z)return g=!0,D(void 0);z=!0;let vv=Y1(Yv._readableStreamController);if(vv===null)T0();else b1(vv._view,!0);return D(void 0)}function Of(vv){if(k=!0,s=vv,C){let Hv=Xf([s,t]),_v=af(J,Hv);Mv(_v)}return Sv}function Cf(vv){if(C=!0,t=vv,k){let Hv=Xf([s,t]),_v=af(J,Hv);Mv(_v)}return Sv}function j1(){return}return Xv=T9(j1,U1,Of),Yv=T9(j1,$f,Cf),A1(Y),[Xv,Yv]}function G5(J){return W(J)&&typeof J.getReader!=="undefined"}function z5(J){if(G5(J))return K5(J.getReader());return B5(J)}function B5(J){let Y,z=dQ(J,"async"),q=v;function g(){let C;try{C=sQ(z)}catch(t){return M(t)}let s=D(C);return U(s,(t)=>{if(!W(t))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(SW(t))z0(Y._readableStreamController);else{let Yv=zQ(t);Z0(Y._readableStreamController,Yv)}})}function k(C){let s=z.iterator,t;try{t=j0(s,"return")}catch(Mv){return M(Mv)}if(t===void 0)return D(void 0);let Xv;try{Xv=F(t,s,[C])}catch(Mv){return M(Mv)}let Yv=D(Xv);return U(Yv,(Mv)=>{if(!W(Mv))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object");return})}return Y=OQ(q,g,k,0),Y}function K5(J){let Y,z=v;function q(){let k;try{k=J.read()}catch(C){return M(C)}return U(k,(C)=>{if(!W(C))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(C.done)z0(Y._readableStreamController);else{let s=C.value;Z0(Y._readableStreamController,s)}})}function g(k){try{return D(J.cancel(k))}catch(C){return M(C)}}return Y=OQ(z,q,g,0),Y}function h5(J,Y){Pv(J,Y);let z=J,q=z===null||z===void 0?void 0:z.autoAllocateChunkSize,g=z===null||z===void 0?void 0:z.cancel,k=z===null||z===void 0?void 0:z.pull,C=z===null||z===void 0?void 0:z.start,s=z===null||z===void 0?void 0:z.type;return{autoAllocateChunkSize:q===void 0?void 0:pv(q,`${Y} has member 'autoAllocateChunkSize' that`),cancel:g===void 0?void 0:$5(g,z,`${Y} has member 'cancel' that`),pull:k===void 0?void 0:D5(k,z,`${Y} has member 'pull' that`),start:C===void 0?void 0:M5(C,z,`${Y} has member 'start' that`),type:s===void 0?void 0:O5(s,`${Y} has member 'type' that`)}}function $5(J,Y,z){return Ev(J,z),(q)=>E(J,Y,[q])}function D5(J,Y,z){return Ev(J,z),(q)=>E(J,Y,[q])}function M5(J,Y,z){return Ev(J,z),(q)=>F(J,Y,[q])}function O5(J,Y){if(J=`${J}`,J!=="bytes")throw new TypeError(`${Y} '${J}' is not a valid enumeration value for ReadableStreamType`);return J}function H5(J,Y){Pv(J,Y);let z=J===null||J===void 0?void 0:J.preventCancel;return{preventCancel:Boolean(z)}}function y9(J,Y){Pv(J,Y);let z=J===null||J===void 0?void 0:J.preventAbort,q=J===null||J===void 0?void 0:J.preventCancel,g=J===null||J===void 0?void 0:J.preventClose,k=J===null||J===void 0?void 0:J.signal;if(k!==void 0)V5(k,`${Y} has member 'signal' that`);return{preventAbort:Boolean(z),preventCancel:Boolean(q),preventClose:Boolean(g),signal:k}}function V5(J,Y){if(!L4(J))throw new TypeError(`${Y} is not an AbortSignal.`)}function q5(J,Y){Pv(J,Y);let z=J===null||J===void 0?void 0:J.readable;Uf(z,"readable","ReadableWritablePair"),Vv(z,`${Y} has member 'readable' that`);let q=J===null||J===void 0?void 0:J.writable;return Uf(q,"writable","ReadableWritablePair"),O9(q,`${Y} has member 'writable' that`),{readable:z,writable:q}}class Qf{constructor(J={},Y={}){if(J===void 0)J=null;else ov(J,"First parameter");let z=hQ(Y,"Second parameter"),q=h5(J,"First parameter");if(mW(this),q.type==="bytes"){if(z.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let g=P0(z,0);f8(this,q,g)}else{let g=_0(z),k=P0(z,1);X5(this,q,k,g)}}get locked(){if(!x1(this))throw B0("locked");return l1(this)}cancel(J=void 0){if(!x1(this))return M(B0("cancel"));if(l1(this))return M(new TypeError("Cannot cancel a stream that already has a reader"));return af(this,J)}getReader(J=void 0){if(!x1(this))throw B0("getReader");if(J0(J,"First parameter").mode===void 0)return Bf(this);return W8(this)}pipeThrough(J,Y={}){if(!x1(this))throw B0("pipeThrough");tv(J,1,"pipeThrough");let z=q5(J,"First parameter"),q=y9(Y,"Second parameter");if(l1(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(I0(z.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let g=I9(this,z.writable,q.preventClose,q.preventAbort,q.preventCancel,q.signal);return O(g),z.readable}pipeTo(J,Y={}){if(!x1(this))return M(B0("pipeTo"));if(J===void 0)return M("Parameter 1 is required in 'pipeTo'.");if(!k0(J))return M(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let z;try{z=y9(Y,"Second parameter")}catch(q){return M(q)}if(l1(this))return M(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream"));if(I0(J))return M(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream"));return I9(this,J,z.preventClose,z.preventAbort,z.preventCancel,z.signal)}tee(){if(!x1(this))throw B0("tee");let J=P5(this);return Xf(J)}values(J=void 0){if(!x1(this))throw B0("values");let Y=H5(J,"First parameter");return nQ(this,Y.preventCancel)}[W1](J){return this.values(J)}static from(J){return z5(J)}}if(Object.defineProperties(Qf,{from:{enumerable:!0}}),Object.defineProperties(Qf.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),Q(Qf.from,"from"),Q(Qf.prototype.cancel,"cancel"),Q(Qf.prototype.getReader,"getReader"),Q(Qf.prototype.pipeThrough,"pipeThrough"),Q(Qf.prototype.pipeTo,"pipeTo"),Q(Qf.prototype.tee,"tee"),Q(Qf.prototype.values,"values"),typeof Symbol.toStringTag==="symbol")Object.defineProperty(Qf.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0});Object.defineProperty(Qf.prototype,W1,{value:Qf.prototype.values,writable:!0,configurable:!0});function OQ(J,Y,z,q=1,g=()=>1){let k=Object.create(Qf.prototype);mW(k);let C=Object.create(z1.prototype);return C9(k,C,J,Y,z,q,g),k}function T9(J,Y,z){let q=Object.create(Qf.prototype);mW(q);let g=Object.create(c.prototype);return v8(q,g,J,Y,z,0,void 0),q}function mW(J){J._state="readable",J._reader=void 0,J._storedError=void 0,J._disturbed=!1}function x1(J){if(!W(J))return!1;if(!Object.prototype.hasOwnProperty.call(J,"_readableStreamController"))return!1;return J instanceof Qf}function l1(J){if(J._reader===void 0)return!1;return!0}function af(J,Y){if(J._disturbed=!0,J._state==="closed")return D(void 0);if(J._state==="errored")return M(J._storedError);HQ(J);let z=J._reader;if(z!==void 0&&T1(z)){let g=z._readIntoRequests;z._readIntoRequests=new R,g.forEach((k)=>{k._closeSteps(void 0)})}let q=J._readableStreamController[x](Y);return U(q,v)}function HQ(J){J._state="closed";let Y=J._reader;if(Y===void 0)return;if(e(Y),bv(Y)){let z=Y._readRequests;Y._readRequests=new R,z.forEach((q)=>{q._closeSteps()})}}function x9(J,Y){J._state="errored",J._storedError=Y;let z=J._reader;if(z===void 0)return;if(Kv(z,Y),bv(z))Jf(z,Y);else KQ(z,Y)}function B0(J){return new TypeError(`ReadableStream.prototype.${J} can only be used on a ReadableStream`)}function l9(J,Y){Pv(J,Y);let z=J===null||J===void 0?void 0:J.highWaterMark;return Uf(z,"highWaterMark","QueuingStrategyInit"),{highWaterMark:xv(z)}}let b9=(J)=>{return J.byteLength};Q(b9,"size");class VQ{constructor(J){tv(J,1,"ByteLengthQueuingStrategy"),J=l9(J,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=J.highWaterMark}get highWaterMark(){if(!m9(this))throw u9("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!m9(this))throw u9("size");return b9}}if(Object.defineProperties(VQ.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag==="symbol")Object.defineProperty(VQ.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function u9(J){return new TypeError(`ByteLengthQueuingStrategy.prototype.${J} can only be used on a ByteLengthQueuingStrategy`)}function m9(J){if(!W(J))return!1;if(!Object.prototype.hasOwnProperty.call(J,"_byteLengthQueuingStrategyHighWaterMark"))return!1;return J instanceof VQ}let r9=()=>{return 1};Q(r9,"size");class qQ{constructor(J){tv(J,1,"CountQueuingStrategy"),J=l9(J,"First parameter"),this._countQueuingStrategyHighWaterMark=J.highWaterMark}get highWaterMark(){if(!c9(this))throw a9("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!c9(this))throw a9("size");return r9}}if(Object.defineProperties(qQ.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag==="symbol")Object.defineProperty(qQ.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function a9(J){return new TypeError(`CountQueuingStrategy.prototype.${J} can only be used on a CountQueuingStrategy`)}function c9(J){if(!W(J))return!1;if(!Object.prototype.hasOwnProperty.call(J,"_countQueuingStrategyHighWaterMark"))return!1;return J instanceof qQ}function N5(J,Y){Pv(J,Y);let z=J===null||J===void 0?void 0:J.cancel,q=J===null||J===void 0?void 0:J.flush,g=J===null||J===void 0?void 0:J.readableType,k=J===null||J===void 0?void 0:J.start,C=J===null||J===void 0?void 0:J.transform,s=J===null||J===void 0?void 0:J.writableType;return{cancel:z===void 0?void 0:j5(z,J,`${Y} has member 'cancel' that`),flush:q===void 0?void 0:E5(q,J,`${Y} has member 'flush' that`),readableType:g,start:k===void 0?void 0:A5(k,J,`${Y} has member 'start' that`),transform:C===void 0?void 0:U5(C,J,`${Y} has member 'transform' that`),writableType:s}}function E5(J,Y,z){return Ev(J,z),(q)=>E(J,Y,[q])}function A5(J,Y,z){return Ev(J,z),(q)=>F(J,Y,[q])}function U5(J,Y,z){return Ev(J,z),(q,g)=>E(J,Y,[q,g])}function j5(J,Y,z){return Ev(J,z),(q)=>E(J,Y,[q])}class NQ{constructor(J={},Y={},z={}){if(J===void 0)J=null;let q=hQ(Y,"Second parameter"),g=hQ(z,"Third parameter"),k=N5(J,"First parameter");if(k.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(k.writableType!==void 0)throw new RangeError("Invalid writableType specified");let C=P0(g,0),s=_0(g),t=P0(q,1),Xv=_0(q),Yv,Mv=B((Sv)=>{Yv=Sv});if(F5(this,Mv,t,Xv,C,s),S5(this,k),k.start!==void 0)Yv(k.start(this._transformStreamController));else Yv(void 0)}get readable(){if(!n9(this))throw s9("readable");return this._readable}get writable(){if(!n9(this))throw s9("writable");return this._writable}}if(Object.defineProperties(NQ.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag==="symbol")Object.defineProperty(NQ.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function F5(J,Y,z,q,g,k){function C(){return Y}function s(Sv){return _5(J,Sv)}function t(Sv){return k5(J,Sv)}function Xv(){return I5(J)}J._writable=R4(C,s,Xv,t,z,q);function Yv(){return Z5(J)}function Mv(Sv){return C5(J,Sv)}J._readable=OQ(C,Yv,Mv,g,k),J._backpressure=void 0,J._backpressureChangePromise=void 0,J._backpressureChangePromise_resolve=void 0,$8(J,!0),J._transformStreamController=void 0}function n9(J){if(!W(J))return!1;if(!Object.prototype.hasOwnProperty.call(J,"_transformStreamController"))return!1;return J instanceof NQ}function p9(J,Y){rf(J._readable._readableStreamController,Y),rW(J,Y)}function rW(J,Y){M8(J._transformStreamController),$Q(J._writable._writableStreamController,Y),aW(J)}function aW(J){if(J._backpressure)$8(J,!1)}function $8(J,Y){if(J._backpressureChangePromise!==void 0)J._backpressureChangePromise_resolve();J._backpressureChangePromise=B((z)=>{J._backpressureChangePromise_resolve=z}),J._backpressure=Y}class E1{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!D8(this))throw O8("desiredSize");let J=this._controlledTransformStream._readable._readableStreamController;return uW(J)}enqueue(J=void 0){if(!D8(this))throw O8("enqueue");i9(this,J)}error(J=void 0){if(!D8(this))throw O8("error");g5(this,J)}terminate(){if(!D8(this))throw O8("terminate");R5(this)}}if(Object.defineProperties(E1.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),Q(E1.prototype.enqueue,"enqueue"),Q(E1.prototype.error,"error"),Q(E1.prototype.terminate,"terminate"),typeof Symbol.toStringTag==="symbol")Object.defineProperty(E1.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function D8(J){if(!W(J))return!1;if(!Object.prototype.hasOwnProperty.call(J,"_controlledTransformStream"))return!1;return J instanceof E1}function L5(J,Y,z,q,g){Y._controlledTransformStream=J,J._transformStreamController=Y,Y._transformAlgorithm=z,Y._flushAlgorithm=q,Y._cancelAlgorithm=g,Y._finishPromise=void 0,Y._finishPromise_resolve=void 0,Y._finishPromise_reject=void 0}function S5(J,Y){let z=Object.create(E1.prototype),q,g,k;if(Y.transform!==void 0)q=(C)=>Y.transform(C,z);else q=(C)=>{try{return i9(z,C),D(void 0)}catch(s){return M(s)}};if(Y.flush!==void 0)g=()=>Y.flush(z);else g=()=>D(void 0);if(Y.cancel!==void 0)k=(C)=>Y.cancel(C);else k=()=>D(void 0);L5(J,z,q,g,k)}function M8(J){J._transformAlgorithm=void 0,J._flushAlgorithm=void 0,J._cancelAlgorithm=void 0}function i9(J,Y){let z=J._controlledTransformStream,q=z._readable._readableStreamController;if(!C0(q))throw new TypeError("Readable side is not in a state that permits enqueue");try{Z0(q,Y)}catch(k){throw rW(z,k),z._readable._storedError}if(J5(q)!==z._backpressure)$8(z,!0)}function g5(J,Y){p9(J._controlledTransformStream,Y)}function d9(J,Y){let z=J._transformAlgorithm(Y);return U(z,void 0,(q)=>{throw p9(J._controlledTransformStream,q),q})}function R5(J){let Y=J._controlledTransformStream,z=Y._readable._readableStreamController;z0(z);let q=new TypeError("TransformStream terminated");rW(Y,q)}function _5(J,Y){let z=J._transformStreamController;if(J._backpressure){let q=J._backpressureChangePromise;return U(q,()=>{let g=J._writable;if(g._state==="erroring")throw g._storedError;return d9(z,Y)})}return d9(z,Y)}function k5(J,Y){let z=J._transformStreamController;if(z._finishPromise!==void 0)return z._finishPromise;let q=J._readable;z._finishPromise=B((k,C)=>{z._finishPromise_resolve=k,z._finishPromise_reject=C});let g=z._cancelAlgorithm(Y);return M8(z),N(g,()=>{if(q._state==="errored")y0(z,q._storedError);else rf(q._readableStreamController,Y),cW(z);return null},(k)=>{return rf(q._readableStreamController,k),y0(z,k),null}),z._finishPromise}function I5(J){let Y=J._transformStreamController;if(Y._finishPromise!==void 0)return Y._finishPromise;let z=J._readable;Y._finishPromise=B((g,k)=>{Y._finishPromise_resolve=g,Y._finishPromise_reject=k});let q=Y._flushAlgorithm();return M8(Y),N(q,()=>{if(z._state==="errored")y0(Y,z._storedError);else z0(z._readableStreamController),cW(Y);return null},(g)=>{return rf(z._readableStreamController,g),y0(Y,g),null}),Y._finishPromise}function Z5(J){return $8(J,!1),J._backpressureChangePromise}function C5(J,Y){let z=J._transformStreamController;if(z._finishPromise!==void 0)return z._finishPromise;let q=J._writable;z._finishPromise=B((k,C)=>{z._finishPromise_resolve=k,z._finishPromise_reject=C});let g=z._cancelAlgorithm(Y);return M8(z),N(g,()=>{if(q._state==="errored")y0(z,q._storedError);else $Q(q._writableStreamController,Y),aW(J),cW(z);return null},(k)=>{return $Q(q._writableStreamController,k),aW(J),y0(z,k),null}),z._finishPromise}function O8(J){return new TypeError(`TransformStreamDefaultController.prototype.${J} can only be used on a TransformStreamDefaultController`)}function cW(J){if(J._finishPromise_resolve===void 0)return;J._finishPromise_resolve(),J._finishPromise_resolve=void 0,J._finishPromise_reject=void 0}function y0(J,Y){if(J._finishPromise_reject===void 0)return;O(J._finishPromise),J._finishPromise_reject(Y),J._finishPromise_resolve=void 0,J._finishPromise_reject=void 0}function s9(J){return new TypeError(`TransformStream.prototype.${J} can only be used on a TransformStream`)}f.ByteLengthQueuingStrategy=VQ,f.CountQueuingStrategy=qQ,f.ReadableByteStreamController=c,f.ReadableStream=Qf,f.ReadableStreamBYOBReader=wf,f.ReadableStreamBYOBRequest=_,f.ReadableStreamDefaultController=z1,f.ReadableStreamDefaultReader=rv,f.TransformStream=NQ,f.TransformStreamDefaultController=E1,f.WritableStream=N1,f.WritableStreamDefaultController=w0,f.WritableStreamDefaultWriter=G1})});var LY=Qv(()=>{if(!globalThis.ReadableStream)try{let f=require("node:process"),{emitWarning:v}=f;try{f.emitWarning=()=>{},Object.assign(globalThis,require("node:stream/web")),f.emitWarning=v}catch(W){throw f.emitWarning=v,W}}catch(f){Object.assign(globalThis,FY())}try{let{Blob:f}=require("buffer");if(f&&!f.prototype.stream)f.prototype.stream=function v(W){let X=0,Q=this;return new ReadableStream({type:"bytes",async pull(P){let G=await Q.slice(X,Math.min(Q.size,X+65536)).arrayBuffer();if(X+=G.byteLength,P.enqueue(new Uint8Array(G)),X===Q.size)P.close()}})}}catch(f){}});async function*rJ(f,v=!0){for(let W of f)if("stream"in W)yield*W.stream();else if(ArrayBuffer.isView(W))if(v){let X=W.byteOffset,Q=W.byteOffset+W.byteLength;while(X!==Q){let P=Math.min(Q-X,SY),w=W.buffer.slice(X,X+P);X+=w.byteLength,yield new Uint8Array(w)}}else yield W;else{let X=0,Q=W;while(X!==Q.size){let w=await Q.slice(X,Math.min(Q.size,X+SY)).arrayBuffer();X+=w.byteLength,yield new Uint8Array(w)}}}var eh,SY=65536,gY,ZG,ef;var TQ=jv(()=>{eh=Hf(LY());/*! fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */gY=class f{#v=[];#f="";#Q=0;#W="transparent";constructor(v=[],W={}){if(typeof v!=="object"||v===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof v[Symbol.iterator]!=="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof W!=="object"&&typeof W!=="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");if(W===null)W={};let X=new TextEncoder;for(let P of v){let w;if(ArrayBuffer.isView(P))w=new Uint8Array(P.buffer.slice(P.byteOffset,P.byteOffset+P.byteLength));else if(P instanceof ArrayBuffer)w=new Uint8Array(P.slice(0));else if(P instanceof f)w=P;else w=X.encode(`${P}`);this.#Q+=ArrayBuffer.isView(w)?w.byteLength:w.size,this.#v.push(w)}this.#W=`${W.endings===void 0?"transparent":W.endings}`;let Q=W.type===void 0?"":String(W.type);this.#f=/^[\x20-\x7E]*$/.test(Q)?Q:""}get size(){return this.#Q}get type(){return this.#f}async text(){let v=new TextDecoder,W="";for await(let X of rJ(this.#v,!1))W+=v.decode(X,{stream:!0});return W+=v.decode(),W}async arrayBuffer(){let v=new Uint8Array(this.size),W=0;for await(let X of rJ(this.#v,!1))v.set(X,W),W+=X.length;return v.buffer}stream(){let v=rJ(this.#v,!0);return new globalThis.ReadableStream({type:"bytes",async pull(W){let X=await v.next();X.done?W.close():W.enqueue(X.value)},async cancel(){await v.return()}})}slice(v=0,W=this.size,X=""){let{size:Q}=this,P=v<0?Math.max(Q+v,0):Math.min(v,Q),w=W<0?Math.max(Q+W,0):Math.min(W,Q),G=Math.max(w-P,0),B=this.#v,D=[],M=0;for(let N of B){if(M>=G)break;let h=ArrayBuffer.isView(N)?N.byteLength:N.size;if(P&&h<=P)P-=h,w-=h;else{let $;if(ArrayBuffer.isView(N))$=N.subarray(P,Math.min(h,w)),M+=$.byteLength;else $=N.slice(P,Math.min(h,w)),M+=$.size;w-=h,D.push($),P=0}}let A=new f([],{type:String(X).toLowerCase()});return A.#Q=G,A.#v=D,A}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](v){return v&&typeof v==="object"&&typeof v.constructor==="function"&&(typeof v.stream==="function"||typeof v.arrayBuffer==="function")&&/^(Blob|File)$/.test(v[Symbol.toStringTag])}};Object.defineProperties(gY.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});ZG=gY,ef=ZG});var CG,yG,s1;var aJ=jv(()=>{TQ();CG=class f extends ef{#v=0;#f="";constructor(v,W,X={}){if(arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(v,X);if(X===null)X={};let Q=X.lastModified===void 0?Date.now():Number(X.lastModified);if(!Number.isNaN(Q))this.#v=Q;this.#f=String(W)}get name(){return this.#f}get lastModified(){return this.#v}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](v){return!!v&&v instanceof ef&&/^(File)$/.test(v[Symbol.toStringTag])}},yG=CG,s1=yG});function kY(f,v=ef){var W=`${RY()}${RY()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),X=[],Q=`--${W}\r
|
|
3
|
+
Content-Disposition: form-data; name="`;return f.forEach((P,w)=>typeof P=="string"?X.push(Q+cJ(w)+`"\r
|
|
4
|
+
\r
|
|
5
|
+
${P.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
|
|
6
|
+
`)}\r
|
|
7
|
+
`):X.push(Q+cJ(w)+`"; filename="${cJ(P.name,1)}"\r
|
|
8
|
+
Content-Type: ${P.type||"application/octet-stream"}\r
|
|
9
|
+
\r
|
|
10
|
+
`,P,`\r
|
|
11
|
+
`)),X.push(`--${W}--`),new v(X,{type:"multipart/form-data; boundary="+W})}var xQ,TG,xG,RY,lG,_Y=(f,v,W)=>(f+="",/^(Blob|File)$/.test(v&&v[xQ])?[(W=W!==void 0?W+"":v[xQ]=="File"?v.name:"blob",f),v.name!==W||v[xQ]=="blob"?new s1([v],W,v):v]:[f,v+""]),cJ=(f,v)=>(v?f:f.replace(/\r?\n|\r/g,`\r
|
|
12
|
+
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),q0=(f,v,W)=>{if(v.length<W)throw new TypeError(`Failed to execute '${f}' on 'FormData': ${W} arguments required, but only ${v.length} present.`)},o1;var $W=jv(()=>{TQ();aJ();/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */({toStringTag:xQ,iterator:TG,hasInstance:xG}=Symbol),RY=Math.random,lG="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),o1=class f{#v=[];constructor(...v){if(v.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[xQ](){return"FormData"}[TG](){return this.entries()}static[xG](v){return v&&typeof v==="object"&&v[xQ]==="FormData"&&!lG.some((W)=>typeof v[W]!="function")}append(...v){q0("append",arguments,2),this.#v.push(_Y(...v))}delete(v){q0("delete",arguments,1),v+="",this.#v=this.#v.filter(([W])=>W!==v)}get(v){q0("get",arguments,1),v+="";for(var W=this.#v,X=W.length,Q=0;Q<X;Q++)if(W[Q][0]===v)return W[Q][1];return null}getAll(v,W){return q0("getAll",arguments,1),W=[],v+="",this.#v.forEach((X)=>X[0]===v&&W.push(X[1])),W}has(v){return q0("has",arguments,1),v+="",this.#v.some((W)=>W[0]===v)}forEach(v,W){q0("forEach",arguments,1);for(var[X,Q]of this)v.call(W,Q,X,this)}set(...v){q0("set",arguments,2);var W=[],X=!0;v=_Y(...v),this.#v.forEach((Q)=>{Q[0]===v[0]?X&&(X=!W.push(v)):W.push(Q)}),X&&W.push(v),this.#v=W}*entries(){yield*this.#v}*keys(){for(var[v]of this)yield v}*values(){for(var[,v]of this)yield v}}});var t1;var DW=jv(()=>{t1=class t1 extends Error{constructor(f,v){super(f);Error.captureStackTrace(this,this.constructor),this.type=v}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}}});var Nf;var nJ=jv(()=>{DW();Nf=class Nf extends t1{constructor(f,v,W){super(f,v);if(W)this.code=this.errno=W.code,this.erroredSysCall=W.syscall}}});var MW,pJ=(f)=>{return typeof f==="object"&&typeof f.append==="function"&&typeof f.delete==="function"&&typeof f.get==="function"&&typeof f.getAll==="function"&&typeof f.has==="function"&&typeof f.set==="function"&&typeof f.sort==="function"&&f[MW]==="URLSearchParams"},lQ=(f)=>{return f&&typeof f==="object"&&typeof f.arrayBuffer==="function"&&typeof f.type==="string"&&typeof f.stream==="function"&&typeof f.constructor==="function"&&/^(Blob|File)$/.test(f[MW])},IY=(f)=>{return typeof f==="object"&&(f[MW]==="AbortSignal"||f[MW]==="EventTarget")},ZY=(f,v)=>{let W=new URL(v).hostname,X=new URL(f).hostname;return W===X||W.endsWith(`.${X}`)},CY=(f,v)=>{let W=new URL(v).protocol,X=new URL(f).protocol;return W===X};var OW=jv(()=>{MW=Symbol.toStringTag});var TY=Qv((z$,yY)=>{/*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */if(!globalThis.DOMException)try{let{MessageChannel:f}=require("worker_threads"),v=new f().port1,W=new ArrayBuffer;v.postMessage(W,[W,W])}catch(f){f.constructor.name==="DOMException"&&(globalThis.DOMException=f.constructor)}yY.exports=globalThis.DOMException});var N0,xY,lY,iJ,bY=(f,v)=>aY(N0.statSync(f),f,v),uY=(f,v)=>iJ(f).then((W)=>aY(W,f,v)),mY=(f,v)=>iJ(f).then((W)=>cY(W,f,v)),rY=(f,v)=>cY(N0.statSync(f),f,v),aY=(f,v,W="")=>new ef([new HW({path:v,size:f.size,lastModified:f.mtimeMs,start:0})],{type:W}),cY=(f,v,W="")=>new s1([new HW({path:v,size:f.size,lastModified:f.mtimeMs,start:0})],xY.basename(v),{type:W,lastModified:f.mtimeMs}),HW;var dJ=jv(()=>{N0=require("node:fs"),xY=require("node:path"),lY=Hf(TY());aJ();TQ();({stat:iJ}=N0.promises);HW=class HW{#v;#f;constructor(f){this.#v=f.path,this.#f=f.start,this.size=f.size,this.lastModified=f.lastModified}slice(f,v){return new HW({path:this.#v,lastModified:this.lastModified,size:v-f,start:this.#f+f})}async*stream(){let{mtimeMs:f}=await iJ(this.#v);if(f>this.lastModified)throw new lY.default("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.","NotReadableError");yield*N0.createReadStream(this.#v,{start:this.#f,end:this.#f+this.size-1})}get[Symbol.toStringTag](){return"Blob"}}});var iY={};pW(iY,{toFormData:()=>nG});class pY{constructor(f){this.index=0,this.flags=0,this.onHeaderEnd=E0,this.onHeaderField=E0,this.onHeadersEnd=E0,this.onHeaderValue=E0,this.onPartBegin=E0,this.onPartData=E0,this.onPartEnd=E0,this.boundaryChars={},f=`\r
|
|
13
|
+
--`+f;let v=new Uint8Array(f.length);for(let W=0;W<f.length;W++)v[W]=f.charCodeAt(W),this.boundaryChars[v[W]]=!0;this.boundary=v,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=Iv.START_BOUNDARY}write(f){let v=0,W=f.length,X=this.index,{lookbehind:Q,boundary:P,boundaryChars:w,index:G,state:B,flags:D}=this,M=this.boundary.length,A=M-1,N=f.length,h,$,U=(E)=>{this[E+"Mark"]=v},O=(E)=>{delete this[E+"Mark"]},H=(E,L,R,Z)=>{if(L===void 0||L!==R)this[E](Z&&Z.subarray(L,R))},F=(E,L)=>{let R=E+"Mark";if(!(R in this))return;if(L)H(E,this[R],v,f),delete this[R];else H(E,this[R],f.length,f),this[R]=0};for(v=0;v<W;v++)switch(h=f[v],B){case Iv.START_BOUNDARY:if(G===P.length-2){if(h===bQ)D|=e1.LAST_BOUNDARY;else if(h!==qW)return;G++;break}else if(G-1===P.length-2){if(D&e1.LAST_BOUNDARY&&h===bQ)B=Iv.END,D=0;else if(!(D&e1.LAST_BOUNDARY)&&h===VW)G=0,H("onPartBegin"),B=Iv.HEADER_FIELD_START;else return;break}if(h!==P[G+2])G=-2;if(h===P[G+2])G++;break;case Iv.HEADER_FIELD_START:B=Iv.HEADER_FIELD,U("onHeaderField"),G=0;case Iv.HEADER_FIELD:if(h===qW){O("onHeaderField"),B=Iv.HEADERS_ALMOST_DONE;break}if(G++,h===bQ)break;if(h===uG){if(G===1)return;F("onHeaderField",!0),B=Iv.HEADER_VALUE_START;break}if($=aG(h),$<mG||$>rG)return;break;case Iv.HEADER_VALUE_START:if(h===bG)break;U("onHeaderValue"),B=Iv.HEADER_VALUE;case Iv.HEADER_VALUE:if(h===qW)F("onHeaderValue",!0),H("onHeaderEnd"),B=Iv.HEADER_VALUE_ALMOST_DONE;break;case Iv.HEADER_VALUE_ALMOST_DONE:if(h!==VW)return;B=Iv.HEADER_FIELD_START;break;case Iv.HEADERS_ALMOST_DONE:if(h!==VW)return;H("onHeadersEnd"),B=Iv.PART_DATA_START;break;case Iv.PART_DATA_START:B=Iv.PART_DATA,U("onPartData");case Iv.PART_DATA:if(X=G,G===0){v+=A;while(v<N&&!(f[v]in w))v+=M;v-=A,h=f[v]}if(G<P.length)if(P[G]===h){if(G===0)F("onPartData",!0);G++}else G=0;else if(G===P.length)if(G++,h===qW)D|=e1.PART_BOUNDARY;else if(h===bQ)D|=e1.LAST_BOUNDARY;else G=0;else if(G-1===P.length)if(D&e1.PART_BOUNDARY){if(G=0,h===VW){D&=~e1.PART_BOUNDARY,H("onPartEnd"),H("onPartBegin"),B=Iv.HEADER_FIELD_START;break}}else if(D&e1.LAST_BOUNDARY)if(h===bQ)H("onPartEnd"),B=Iv.END,D=0;else G=0;else G=0;if(G>0)Q[G-1]=h;else if(X>0){let E=new Uint8Array(Q.buffer,Q.byteOffset,Q.byteLength);H("onPartData",0,X,E),X=0,U("onPartData"),v--}break;case Iv.END:break;default:throw new Error(`Unexpected state entered: ${B}`)}F("onHeaderField"),F("onHeaderValue"),F("onPartData"),this.index=G,this.state=B,this.flags=D}end(){if(this.state===Iv.HEADER_FIELD_START&&this.index===0||this.state===Iv.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==Iv.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}function cG(f){let v=f.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!v)return;let W=v[2]||v[3]||"",X=W.slice(W.lastIndexOf("\\")+1);return X=X.replace(/%22/g,'"'),X=X.replace(/&#(\d{4});/g,(Q,P)=>{return String.fromCharCode(P)}),X}async function nG(f,v){if(!/multipart/i.test(v))throw new TypeError("Failed to fetch");let W=v.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!W)throw new TypeError("no or bad content-type header, no multipart boundary");let X=new pY(W[1]||W[2]),Q,P,w,G,B,D,M=[],A=new o1,N=(H)=>{w+=O.decode(H,{stream:!0})},h=(H)=>{M.push(H)},$=()=>{let H=new s1(M,D,{type:B});A.append(G,H)},U=()=>{A.append(G,w)},O=new TextDecoder("utf-8");O.decode(),X.onPartBegin=function(){X.onPartData=N,X.onPartEnd=U,Q="",P="",w="",G="",B="",D=null,M.length=0},X.onHeaderField=function(H){Q+=O.decode(H,{stream:!0})},X.onHeaderValue=function(H){P+=O.decode(H,{stream:!0})},X.onHeaderEnd=function(){if(P+=O.decode(),Q=Q.toLowerCase(),Q==="content-disposition"){let H=P.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);if(H)G=H[2]||H[3]||"";if(D=cG(P),D)X.onPartData=h,X.onPartEnd=$}else if(Q==="content-type")B=P;P="",Q=""};for await(let H of f)X.write(H);return X.end(),A}var D1=0,Iv,nY=1,e1,VW=10,qW=13,bG=32,bQ=45,uG=58,mG=97,rG=122,aG=(f)=>f|32,E0=()=>{};var dY=jv(()=>{dJ();$W();Iv={START_BOUNDARY:D1++,HEADER_FIELD_START:D1++,HEADER_FIELD:D1++,HEADER_VALUE_START:D1++,HEADER_VALUE:D1++,HEADER_VALUE_ALMOST_DONE:D1++,HEADERS_ALMOST_DONE:D1++,PART_DATA_START:D1++,PART_DATA:D1++,END:D1++},e1={PART_BOUNDARY:nY,LAST_BOUNDARY:nY*=2}});class R1{constructor(f,{size:v=0}={}){let W=null;if(f===null)f=null;else if(pJ(f))f=Ff.Buffer.from(f.toString());else if(lQ(f));else if(Ff.Buffer.isBuffer(f));else if(_1.types.isAnyArrayBuffer(f))f=Ff.Buffer.from(f);else if(ArrayBuffer.isView(f))f=Ff.Buffer.from(f.buffer,f.byteOffset,f.byteLength);else if(f instanceof lf.default);else if(f instanceof o1)f=kY(f),W=f.type.split("=")[1];else f=Ff.Buffer.from(String(f));let X=f;if(Ff.Buffer.isBuffer(f))X=lf.default.Readable.from(f);else if(lQ(f))X=lf.default.Readable.from(f.stream());if(this[Ef]={body:f,stream:X,boundary:W,disturbed:!1,error:null},this.size=v,f instanceof lf.default)f.on("error",(Q)=>{let P=Q instanceof t1?Q:new Nf(`Invalid response body while trying to fetch ${this.url}: ${Q.message}`,"system",Q);this[Ef].error=P})}get body(){return this[Ef].stream}get bodyUsed(){return this[Ef].disturbed}async arrayBuffer(){let{buffer:f,byteOffset:v,byteLength:W}=await sJ(this);return f.slice(v,v+W)}async formData(){let f=this.headers.get("content-type");if(f.startsWith("application/x-www-form-urlencoded")){let W=new o1,X=new URLSearchParams(await this.text());for(let[Q,P]of X)W.append(Q,P);return W}let{toFormData:v}=await Promise.resolve().then(() => (dY(),iY));return v(this.body,f)}async blob(){let f=this.headers&&this.headers.get("content-type")||this[Ef].body&&this[Ef].body.type||"",v=await this.arrayBuffer();return new ef([v],{type:f})}async json(){let f=await this.text();return JSON.parse(f)}async text(){let f=await sJ(this);return new TextDecoder().decode(f)}buffer(){return sJ(this)}}async function sJ(f){if(f[Ef].disturbed)throw new TypeError(`body used already for: ${f.url}`);if(f[Ef].disturbed=!0,f[Ef].error)throw f[Ef].error;let{body:v}=f;if(v===null)return Ff.Buffer.alloc(0);if(!(v instanceof lf.default))return Ff.Buffer.alloc(0);let W=[],X=0;try{for await(let Q of v){if(f.size>0&&X+Q.length>f.size){let P=new Nf(`content size at ${f.url} over limit: ${f.size}`,"max-size");throw v.destroy(P),P}X+=Q.length,W.push(Q)}}catch(Q){throw Q instanceof t1?Q:new Nf(`Invalid response body while trying to fetch ${f.url}: ${Q.message}`,"system",Q)}if(v.readableEnded===!0||v._readableState.ended===!0)try{if(W.every((Q)=>typeof Q==="string"))return Ff.Buffer.from(W.join(""));return Ff.Buffer.concat(W,X)}catch(Q){throw new Nf(`Could not create Buffer from response body for ${f.url}: ${Q.message}`,"system",Q)}else throw new Nf(`Premature close of server response while trying to fetch ${f.url}`)}var lf,_1,Ff,pG,Ef,QQ=(f,v)=>{let W,X,{body:Q}=f[Ef];if(f.bodyUsed)throw new Error("cannot clone body after it is used");if(Q instanceof lf.default&&typeof Q.getBoundary!=="function")W=new lf.PassThrough({highWaterMark:v}),X=new lf.PassThrough({highWaterMark:v}),Q.pipe(W),Q.pipe(X),f[Ef].stream=W,Q=X;return Q},iG,NW=(f,v)=>{if(f===null)return null;if(typeof f==="string")return"text/plain;charset=UTF-8";if(pJ(f))return"application/x-www-form-urlencoded;charset=UTF-8";if(lQ(f))return f.type||null;if(Ff.Buffer.isBuffer(f)||_1.types.isAnyArrayBuffer(f)||ArrayBuffer.isView(f))return null;if(f instanceof o1)return`multipart/form-data; boundary=${v[Ef].boundary}`;if(f&&typeof f.getBoundary==="function")return`multipart/form-data;boundary=${iG(f)}`;if(f instanceof lf.default)return null;return"text/plain;charset=UTF-8"},sY=(f)=>{let{body:v}=f[Ef];if(v===null)return 0;if(lQ(v))return v.size;if(Ff.Buffer.isBuffer(v))return v.length;if(v&&typeof v.getLengthSync==="function")return v.hasKnownLength&&v.hasKnownLength()?v.getLengthSync():null;return null},oY=async(f,{body:v})=>{if(v===null)f.end();else await pG(v,f)};var EW=jv(()=>{lf=Hf(require("node:stream")),_1=require("node:util"),Ff=require("node:buffer");TQ();$W();nJ();DW();OW();pG=_1.promisify(lf.default.pipeline),Ef=Symbol("Body internals");R1.prototype.buffer=_1.deprecate(R1.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(R1.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:_1.deprecate(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});iG=_1.deprecate((f)=>f.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167")});function tY(f=[]){return new Af(f.reduce((v,W,X,Q)=>{if(X%2===0)v.push(Q.slice(X,X+2));return v},[]).filter(([v,W])=>{try{return AW(v),tJ(v,String(W)),!0}catch{return!1}}))}var oJ,uQ,AW,tJ,Af;var UW=jv(()=>{oJ=require("node:util"),uQ=Hf(require("node:http")),AW=typeof uQ.default.validateHeaderName==="function"?uQ.default.validateHeaderName:(f)=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(f)){let v=new TypeError(`Header name must be a valid HTTP token [${f}]`);throw Object.defineProperty(v,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),v}},tJ=typeof uQ.default.validateHeaderValue==="function"?uQ.default.validateHeaderValue:(f,v)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(v)){let W=new TypeError(`Invalid character in header content ["${f}"]`);throw Object.defineProperty(W,"code",{value:"ERR_INVALID_CHAR"}),W}};Af=class Af extends URLSearchParams{constructor(f){let v=[];if(f instanceof Af){let W=f.raw();for(let[X,Q]of Object.entries(W))v.push(...Q.map((P)=>[X,P]))}else if(f==null);else if(typeof f==="object"&&!oJ.types.isBoxedPrimitive(f)){let W=f[Symbol.iterator];if(W==null)v.push(...Object.entries(f));else{if(typeof W!=="function")throw new TypeError("Header pairs must be iterable");v=[...f].map((X)=>{if(typeof X!=="object"||oJ.types.isBoxedPrimitive(X))throw new TypeError("Each header pair must be an iterable object");return[...X]}).map((X)=>{if(X.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...X]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");v=v.length>0?v.map(([W,X])=>{return AW(W),tJ(W,String(X)),[String(W).toLowerCase(),String(X)]}):void 0;super(v);return new Proxy(this,{get(W,X,Q){switch(X){case"append":case"set":return(P,w)=>{return AW(P),tJ(P,String(w)),URLSearchParams.prototype[X].call(W,String(P).toLowerCase(),String(w))};case"delete":case"has":case"getAll":return(P)=>{return AW(P),URLSearchParams.prototype[X].call(W,String(P).toLowerCase())};case"keys":return()=>{return W.sort(),new Set(URLSearchParams.prototype.keys.call(W)).keys()};default:return Reflect.get(W,X,Q)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(f){let v=this.getAll(f);if(v.length===0)return null;let W=v.join(", ");if(/^content-encoding$/i.test(f))W=W.toLowerCase();return W}forEach(f,v=void 0){for(let W of this.keys())Reflect.apply(f,v,[this.get(W),W,this])}*values(){for(let f of this.keys())yield this.get(f)}*entries(){for(let f of this.keys())yield[f,this.get(f)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((f,v)=>{return f[v]=this.getAll(v),f},{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((f,v)=>{let W=this.getAll(v);if(v==="host")f[v]=W[0];else f[v]=W.length>1?W:W[0];return f},{})}};Object.defineProperties(Af.prototype,["get","entries","forEach","values"].reduce((f,v)=>{return f[v]={enumerable:!0},f},{}))});var dG,mQ=(f)=>{return dG.has(f)};var eJ=jv(()=>{dG=new Set([301,302,303,307,308])});var v1,zf;var eY=jv(()=>{UW();EW();eJ();v1=Symbol("Response internals");zf=class zf extends R1{constructor(f=null,v={}){super(f,v);let W=v.status!=null?v.status:200,X=new Af(v.headers);if(f!==null&&!X.has("Content-Type")){let Q=NW(f,this);if(Q)X.append("Content-Type",Q)}this[v1]={type:"default",url:v.url,status:W,statusText:v.statusText||"",headers:X,counter:v.counter,highWaterMark:v.highWaterMark}}get type(){return this[v1].type}get url(){return this[v1].url||""}get status(){return this[v1].status}get ok(){return this[v1].status>=200&&this[v1].status<300}get redirected(){return this[v1].counter>0}get statusText(){return this[v1].statusText}get headers(){return this[v1].headers}get highWaterMark(){return this[v1].highWaterMark}clone(){return new zf(QQ(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(f,v=302){if(!mQ(v))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new zf(null,{headers:{location:new URL(f).toString()},status:v})}static error(){let f=new zf(null,{status:0,statusText:""});return f[v1].type="error",f}static json(f=void 0,v={}){let W=JSON.stringify(f);if(W===void 0)throw new TypeError("data is not JSON serializable");let X=new Af(v&&v.headers);if(!X.has("content-type"))X.set("content-type","application/json");return new zf(W,{...v,headers:X})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(zf.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var v4=(f)=>{if(f.search)return f.search;let v=f.href.length-1,W=f.hash||(f.href[v]==="#"?"#":"");return f.href[v-W.length]==="?"?"?":""};function f4(f,v=!1){if(f==null)return"no-referrer";if(f=new URL(f),/^(about|blob|data):$/.test(f.protocol))return"no-referrer";if(f.username="",f.password="",f.hash="",v)f.pathname="",f.search="";return f}function X4(f){if(!W4.has(f))throw new TypeError(`Invalid referrerPolicy: ${f}`);return f}function sG(f){if(/^(http|ws)s:$/.test(f.protocol))return!0;let v=f.host.replace(/(^\[)|(]$)/g,""),W=Q4.isIP(v);if(W===4&&/^127\./.test(v))return!0;if(W===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(v))return!0;if(f.host==="localhost"||f.host.endsWith(".localhost"))return!1;if(f.protocol==="file:")return!0;return!1}function WQ(f){if(/^about:(blank|srcdoc)$/.test(f))return!0;if(f.protocol==="data:")return!0;if(/^(blob|filesystem):$/.test(f.protocol))return!0;return sG(f)}function P4(f,{referrerURLCallback:v,referrerOriginCallback:W}={}){if(f.referrer==="no-referrer"||f.referrerPolicy==="")return null;let X=f.referrerPolicy;if(f.referrer==="about:client")return"no-referrer";let Q=f.referrer,P=f4(Q),w=f4(Q,!0);if(P.toString().length>4096)P=w;if(v)P=v(P);if(W)w=W(w);let G=new URL(f.url);switch(X){case"no-referrer":return"no-referrer";case"origin":return w;case"unsafe-url":return P;case"strict-origin":if(WQ(P)&&!WQ(G))return"no-referrer";return w.toString();case"strict-origin-when-cross-origin":if(P.origin===G.origin)return P;if(WQ(P)&&!WQ(G))return"no-referrer";return w;case"same-origin":if(P.origin===G.origin)return P;return"no-referrer";case"origin-when-cross-origin":if(P.origin===G.origin)return P;return w;case"no-referrer-when-downgrade":if(WQ(P)&&!WQ(G))return"no-referrer";return P;default:throw new TypeError(`Invalid referrerPolicy: ${X}`)}}function Y4(f){let v=(f.get("referrer-policy")||"").split(/[,\s]+/),W="";for(let X of v)if(X&&W4.has(X))W=X;return W}var Q4,W4,J4="strict-origin-when-cross-origin";var v9=jv(()=>{Q4=require("node:net");W4=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"])});var w4,G4,ev,rQ=(f)=>{return typeof f==="object"&&typeof f[ev]==="object"},oG,v0,z4=(f)=>{let{parsedURL:v}=f[ev],W=new Af(f[ev].headers);if(!W.has("Accept"))W.set("Accept","*/*");let X=null;if(f.body===null&&/^(post|put)$/i.test(f.method))X="0";if(f.body!==null){let G=sY(f);if(typeof G==="number"&&!Number.isNaN(G))X=String(G)}if(X)W.set("Content-Length",X);if(f.referrerPolicy==="")f.referrerPolicy=J4;if(f.referrer&&f.referrer!=="no-referrer")f[ev].referrer=P4(f);else f[ev].referrer="no-referrer";if(f[ev].referrer instanceof URL)W.set("Referer",f.referrer);if(!W.has("User-Agent"))W.set("User-Agent","node-fetch");if(f.compress&&!W.has("Accept-Encoding"))W.set("Accept-Encoding","gzip, deflate, br");let{agent:Q}=f;if(typeof Q==="function")Q=Q(v);let P=v4(v),w={path:v.pathname+P,method:f.method,headers:W[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:f.insecureHTTPParser,agent:Q};return{parsedURL:v,options:w}};var B4=jv(()=>{w4=require("node:url"),G4=require("node:util");UW();EW();OW();v9();ev=Symbol("Request internals"),oG=G4.deprecate(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)");v0=class v0 extends R1{constructor(f,v={}){let W;if(rQ(f))W=new URL(f.url);else W=new URL(f),f={};if(W.username!==""||W.password!=="")throw new TypeError(`${W} is an url with embedded credentials.`);let X=v.method||f.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(X))X=X.toUpperCase();if(!rQ(v)&&"data"in v)oG();if((v.body!=null||rQ(f)&&f.body!==null)&&(X==="GET"||X==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let Q=v.body?v.body:rQ(f)&&f.body!==null?QQ(f):null;super(Q,{size:v.size||f.size||0});let P=new Af(v.headers||f.headers||{});if(Q!==null&&!P.has("Content-Type")){let B=NW(Q,this);if(B)P.set("Content-Type",B)}let w=rQ(f)?f.signal:null;if("signal"in v)w=v.signal;if(w!=null&&!IY(w))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let G=v.referrer==null?f.referrer:v.referrer;if(G==="")G="no-referrer";else if(G){let B=new URL(G);G=/^about:(\/\/)?client$/.test(B)?"client":B}else G=void 0;this[ev]={method:X,redirect:v.redirect||f.redirect||"follow",headers:P,parsedURL:W,signal:w,referrer:G},this.follow=v.follow===void 0?f.follow===void 0?20:f.follow:v.follow,this.compress=v.compress===void 0?f.compress===void 0?!0:f.compress:v.compress,this.counter=v.counter||f.counter||0,this.agent=v.agent||f.agent,this.highWaterMark=v.highWaterMark||f.highWaterMark||16384,this.insecureHTTPParser=v.insecureHTTPParser||f.insecureHTTPParser||!1,this.referrerPolicy=v.referrerPolicy||f.referrerPolicy||""}get method(){return this[ev].method}get url(){return w4.format(this[ev].parsedURL)}get headers(){return this[ev].headers}get redirect(){return this[ev].redirect}get signal(){return this[ev].signal}get referrer(){if(this[ev].referrer==="no-referrer")return"";if(this[ev].referrer==="client")return"about:client";if(this[ev].referrer)return this[ev].referrer.toString();return}get referrerPolicy(){return this[ev].referrerPolicy}set referrerPolicy(f){this[ev].referrerPolicy=X4(f)}clone(){return new v0(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(v0.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}})});var jW;var K4=jv(()=>{DW();jW=class jW extends t1{constructor(f,v="aborted"){super(f,v)}}});var Q9={};pW(Q9,{isRedirect:()=>mQ,fileFromSync:()=>rY,fileFrom:()=>mY,default:()=>f9,blobFromSync:()=>bY,blobFrom:()=>uY,Response:()=>zf,Request:()=>v0,Headers:()=>Af,FormData:()=>o1,File:()=>s1,FetchError:()=>Nf,Blob:()=>ef,AbortError:()=>jW});async function f9(f,v){return new Promise((W,X)=>{let Q=new v0(f,v),{parsedURL:P,options:w}=z4(Q);if(!tG.has(P.protocol))throw new TypeError(`node-fetch cannot load ${f}. URL scheme "${P.protocol.replace(/:$/,"")}" is not supported.`);if(P.protocol==="data:"){let $=AY(Q.url),U=new zf($,{headers:{"Content-Type":$.typeFull}});W(U);return}let G=(P.protocol==="https:"?$4.default:h4.default).request,{signal:B}=Q,D=null,M=()=>{let $=new jW("The operation was aborted.");if(X($),Q.body&&Q.body instanceof Lf.default.Readable)Q.body.destroy($);if(!D||!D.body)return;D.body.emit("error",$)};if(B&&B.aborted){M();return}let A=()=>{M(),h()},N=G(P.toString(),w);if(B)B.addEventListener("abort",A);let h=()=>{if(N.abort(),B)B.removeEventListener("abort",A)};if(N.on("error",($)=>{X(new Nf(`request to ${Q.url} failed, reason: ${$.message}`,"system",$)),h()}),eG(N,($)=>{if(D&&D.body)D.body.destroy($)}),process.version<"v14")N.on("socket",($)=>{let U;$.prependListener("end",()=>{U=$._eventsCount}),$.prependListener("close",(O)=>{if(D&&U<$._eventsCount&&!O){let H=new Error("Premature close");H.code="ERR_STREAM_PREMATURE_CLOSE",D.body.emit("error",H)}})});N.on("response",($)=>{N.setTimeout(0);let U=tY($.rawHeaders);if(mQ($.statusCode)){let L=U.get("Location"),R=null;try{R=L===null?null:new URL(L,Q.url)}catch{if(Q.redirect!=="manual"){X(new Nf(`uri requested responds with an invalid redirect URL: ${L}`,"invalid-redirect")),h();return}}switch(Q.redirect){case"error":X(new Nf(`uri requested responds with a redirect, redirect mode is set to error: ${Q.url}`,"no-redirect")),h();return;case"manual":break;case"follow":{if(R===null)break;if(Q.counter>=Q.follow){X(new Nf(`maximum redirect reached at: ${Q.url}`,"max-redirect")),h();return}let Z={headers:new Af(Q.headers),follow:Q.follow,counter:Q.counter+1,agent:Q.agent,compress:Q.compress,method:Q.method,body:QQ(Q),signal:Q.signal,size:Q.size,referrer:Q.referrer,referrerPolicy:Q.referrerPolicy};if(!ZY(Q.url,R)||!CY(Q.url,R))for(let x of["authorization","www-authenticate","cookie","cookie2"])Z.headers.delete(x);if($.statusCode!==303&&Q.body&&v.body instanceof Lf.default.Readable){X(new Nf("Cannot follow redirect with body being a readable stream","unsupported-redirect")),h();return}if($.statusCode===303||($.statusCode===301||$.statusCode===302)&&Q.method==="POST")Z.method="GET",Z.body=void 0,Z.headers.delete("content-length");let m=Y4(U);if(m)Z.referrerPolicy=m;W(f9(new v0(R,Z))),h();return}default:return X(new TypeError(`Redirect option '${Q.redirect}' is not a valid value of RequestRedirect`))}}if(B)$.once("end",()=>{B.removeEventListener("abort",A)});let O=Lf.pipeline($,new Lf.PassThrough,(L)=>{if(L)X(L)});if(process.version<"v12.10")$.on("aborted",A);let H={url:Q.url,status:$.statusCode,statusText:$.statusMessage,headers:U,size:Q.size,counter:Q.counter,highWaterMark:Q.highWaterMark},F=U.get("Content-Encoding");if(!Q.compress||Q.method==="HEAD"||F===null||$.statusCode===204||$.statusCode===304){D=new zf(O,H),W(D);return}let E={flush:A0.default.Z_SYNC_FLUSH,finishFlush:A0.default.Z_SYNC_FLUSH};if(F==="gzip"||F==="x-gzip"){O=Lf.pipeline(O,A0.default.createGunzip(E),(L)=>{if(L)X(L)}),D=new zf(O,H),W(D);return}if(F==="deflate"||F==="x-deflate"){let L=Lf.pipeline($,new Lf.PassThrough,(R)=>{if(R)X(R)});L.once("data",(R)=>{if((R[0]&15)===8)O=Lf.pipeline(O,A0.default.createInflate(),(Z)=>{if(Z)X(Z)});else O=Lf.pipeline(O,A0.default.createInflateRaw(),(Z)=>{if(Z)X(Z)});D=new zf(O,H),W(D)}),L.once("end",()=>{if(!D)D=new zf(O,H),W(D)});return}if(F==="br"){O=Lf.pipeline(O,A0.default.createBrotliDecompress(),(L)=>{if(L)X(L)}),D=new zf(O,H),W(D);return}D=new zf(O,H),W(D)}),oY(N,Q).catch(X)})}function eG(f,v){let W=aQ.Buffer.from(`0\r
|
|
14
|
+
\r
|
|
15
|
+
`),X=!1,Q=!1,P;f.on("response",(w)=>{let{headers:G}=w;X=G["transfer-encoding"]==="chunked"&&!G["content-length"]}),f.on("socket",(w)=>{let G=()=>{if(X&&!Q){let D=new Error("Premature close");D.code="ERR_STREAM_PREMATURE_CLOSE",v(D)}},B=(D)=>{if(Q=aQ.Buffer.compare(D.slice(-5),W)===0,!Q&&P)Q=aQ.Buffer.compare(P.slice(-3),W.slice(0,3))===0&&aQ.Buffer.compare(D.slice(-2),W.slice(3))===0;P=D};w.prependListener("close",G),w.on("data",B),f.on("close",()=>{w.removeListener("close",G),w.removeListener("data",B)})})}var h4,$4,A0,Lf,aQ,tG;var W9=jv(()=>{h4=Hf(require("node:http")),$4=Hf(require("node:https")),A0=Hf(require("node:zlib")),Lf=Hf(require("node:stream")),aQ=require("node:buffer");UY();EW();eY();UW();B4();nJ();K4();eJ();$W();OW();v9();dJ();tG=new Set(["data:","http:","https:"])});var q4=Qv((XD,V4)=>{(()=>{var f={52:(Q,P)=>{Object.defineProperty(P,"__esModule",{value:!0}),P.ReportType=P.ReportUrl=void 0,P.ReportUrl="https://statistcs-hdpt.yy.com/reportGeneralStatistics";var w;(function(G){G.pluginOpenCount="f2c_plugin_open_count"})(w||(P.ReportType=w={}))},248:(Q)=>{Q.exports=(W9(),l5(Q9))},428:(Q,P,w)=>{Object.defineProperty(P,"__esModule",{value:!0}),P.getGitUserInfo=B,P.getIsGitRepository=D,P.getUserInfoWithFallback=M;let G=w(646);function B(){let h={};try{let $=G.execSync("git config user.name",{encoding:"utf8"}).trim();if($)h.name=$;let U=G.execSync("git config user.email",{encoding:"utf8"}).trim();if(U)h.email=U}catch($){return h}return h}function D(){try{return G.execSync("git rev-parse --git-dir",{encoding:"utf8",stdio:"ignore"}),!0}catch(h){return!1}}function M(){if(D())try{let U=B(),O=U.email||U.name;if(O)return O}catch(U){}let h=A();if(h)return h;let $=N();if($)return $;return"f2c_匿名"}function A(){let h=["GIT_AUTHOR_EMAIL","GIT_COMMITTER_EMAIL","EMAIL","GIT_AUTHOR_NAME","GIT_COMMITTER_NAME","USER","USERNAME","LOGNAME"];for(let $ of h){let U=process.env[$];if(U&&U.trim())return U.trim()}return""}function N(){try{let h=G.execSync("whoami",{encoding:"utf8",timeout:5000}).trim();if(process.platform==="win32"&&h.includes("\\"))return h.split("\\").pop()||"";return h}catch(h){return""}}},445:(Q)=>{/*!
|
|
16
|
+
* Determine if an object is a Buffer
|
|
17
|
+
*
|
|
18
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
19
|
+
* @license MIT
|
|
20
|
+
*/Q.exports=function(G){return G!=null&&(P(G)||w(G)||!!G._isBuffer)};function P(G){return!!G.constructor&&typeof G.constructor.isBuffer==="function"&&G.constructor.isBuffer(G)}function w(G){return typeof G.readFloatLE==="function"&&typeof G.slice==="function"&&P(G.slice(0,0))}},539:(Q)=>{var P={utf8:{stringToBytes:function(w){return P.bin.stringToBytes(unescape(encodeURIComponent(w)))},bytesToString:function(w){return decodeURIComponent(escape(P.bin.bytesToString(w)))}},bin:{stringToBytes:function(w){for(var G=[],B=0;B<w.length;B++)G.push(w.charCodeAt(B)&255);return G},bytesToString:function(w){for(var G=[],B=0;B<w.length;B++)G.push(String.fromCharCode(w[B]));return G.join("")}}};Q.exports=P},635:(Q)=>{(function(){var P="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w={rotl:function(G,B){return G<<B|G>>>32-B},rotr:function(G,B){return G<<32-B|G>>>B},endian:function(G){if(G.constructor==Number)return w.rotl(G,8)&16711935|w.rotl(G,24)&4278255360;for(var B=0;B<G.length;B++)G[B]=w.endian(G[B]);return G},randomBytes:function(G){for(var B=[];G>0;G--)B.push(Math.floor(Math.random()*256));return B},bytesToWords:function(G){for(var B=[],D=0,M=0;D<G.length;D++,M+=8)B[M>>>5]|=G[D]<<24-M%32;return B},wordsToBytes:function(G){for(var B=[],D=0;D<G.length*32;D+=8)B.push(G[D>>>5]>>>24-D%32&255);return B},bytesToHex:function(G){for(var B=[],D=0;D<G.length;D++)B.push((G[D]>>>4).toString(16)),B.push((G[D]&15).toString(16));return B.join("")},hexToBytes:function(G){for(var B=[],D=0;D<G.length;D+=2)B.push(parseInt(G.substr(D,2),16));return B},bytesToBase64:function(G){for(var B=[],D=0;D<G.length;D+=3){var M=G[D]<<16|G[D+1]<<8|G[D+2];for(var A=0;A<4;A++)if(D*8+A*6<=G.length*8)B.push(P.charAt(M>>>6*(3-A)&63));else B.push("=")}return B.join("")},base64ToBytes:function(G){G=G.replace(/[^A-Z0-9+\/]/ig,"");for(var B=[],D=0,M=0;D<G.length;M=++D%4){if(M==0)continue;B.push((P.indexOf(G.charAt(D-1))&Math.pow(2,-2*M+8)-1)<<M*2|P.indexOf(G.charAt(D))>>>6-M*2)}return B}};Q.exports=w})()},646:(Q)=>{Q.exports=require("child_process")},680:function(Q,P,w){var G=this&&this.__createBinding||(Object.create?function(h,$,U,O){if(O===void 0)O=U;var H=Object.getOwnPropertyDescriptor($,U);if(!H||("get"in H?!$.__esModule:H.writable||H.configurable))H={enumerable:!0,get:function(){return $[U]}};Object.defineProperty(h,O,H)}:function(h,$,U,O){if(O===void 0)O=U;h[O]=$[U]}),B=this&&this.__setModuleDefault||(Object.create?function(h,$){Object.defineProperty(h,"default",{enumerable:!0,value:$})}:function(h,$){h.default=$}),D=this&&this.__importStar||function(){var h=function($){return h=Object.getOwnPropertyNames||function(U){var O=[];for(var H in U)if(Object.prototype.hasOwnProperty.call(U,H))O[O.length]=H;return O},h($)};return function($){if($&&$.__esModule)return $;var U={};if($!=null){for(var O=h($),H=0;H<O.length;H++)if(O[H]!=="default")G(U,$,O[H])}return B(U,$),U}}();Object.defineProperty(P,"__esModule",{value:!0}),P.compatFetch=N;let M=null;async function A(){if(typeof global!=="undefined"&&global.fetch)return global.fetch;if(typeof globalThis.fetch!=="undefined")return globalThis.fetch;if(!M)try{M=await Promise.resolve().then(()=>D(w(248)))}catch(h){throw new Error("Neither native fetch nor node-fetch is available. Please install node-fetch or upgrade to Node.js 18+")}return M.default}async function N(h,$){return(await A())(h,$)}P.default=N},782:(Q,P)=>{Object.defineProperty(P,"__esModule",{value:!0}),P.createLogger=P.Logger=P.isHttp=P.LogLevel=void 0;var w;(function(M){M[M.DEBUG=0]="DEBUG",M[M.INFO=1]="INFO",M[M.WARN=2]="WARN",M[M.ERROR=3]="ERROR"})(w||(P.LogLevel=w={}));function G(){let M=process.argv.join(" ");return M.includes("streamable-http.js")||M.includes("streamable-http.ts")}P.isHttp=G();class B{constructor(M,A=w.INFO){this.context=M,this.level=A}setLevel(M){this.level=M}log(...M){if(P.isHttp)console.log(...M);else console.error(...M)}logWarn(...M){if(P.isHttp)console.warn(...M);else console.error(...M)}debug(...M){if(this.level<=w.DEBUG)this.log(`[DEBUG] [${this.context}]`,...M)}info(...M){if(this.level<=w.INFO)this.log(`[INFO] [${this.context}]`,...M)}warn(...M){if(this.level<=w.WARN)this.logWarn(`[WARN] [${this.context}]`,...M)}error(...M){if(this.level<=w.ERROR)console.error(`[ERROR] [${this.context}]`,...M)}}P.Logger=B;let D=(M,A=w.INFO)=>new B(M,A);P.createLogger=D},799:(Q,P)=>{Object.defineProperty(P,"__esModule",{value:!0}),P.detectIDE=w;function w(){try{let G=process.env,B=()=>{try{if(typeof globalThis!=="undefined"){if(globalThis.vscode||globalThis.__vscode_extension_context||globalThis.acquireVsCodeApi)return!0}}catch{}try{if(process&&process.env){if(process.env.VSCODE_EXTENSION_ID||process.env.VSCODE_EXTENSION_VERSION||process.env.npm_config_user_agent&&process.env.npm_config_user_agent.includes("vscode"))return!0}}catch{}try{if(process&&process.argv){let N=process.argv.join(" ");if(N.includes("extensionHost")||N.includes("vscode")||N.includes("code.exe"))return!0}if(process.title&&(process.title.includes("Code")||process.title.includes("vscode")||process.title.includes("extensionHost")))return!0}catch{}return!1},D=process.cwd().toLowerCase(),M="other";if([D.includes("codebuddy"),G.CODEBUDDY_VERSION!==void 0,G.CODEBUDDY_MODE!==void 0,process.title?.toLowerCase().includes("codebuddy"),typeof globalThis!=="undefined"&&globalThis.CODEBUDDY_CONTEXT!==void 0].some((N)=>N))M="codeBuddy";else if(G?.VSCODE_CWD?.toLowerCase().includes("trae")||D.includes("trae"))M="trae";else if(G?.IDE?.toLowerCase().includes("comate")||G?.VSCODE_CWD?.toLowerCase().includes("comate")||D.includes("comate"))M="comate";else if(G?.CURSOR_USER_DATA_DIR!==void 0||G?.VSCODE_CWD?.toLowerCase().includes("cursor")||D.includes("cursor"))M="cursor";else if(G?.VSCODE_CWD!==void 0||G?.VSCODE_PID!==void 0||G?.VSCODE_IPC_HOOK!==void 0||G?.VSCODE_IPC_HOOK_EXTHOST!==void 0||B())M="vscode";else if(G?.PATH?.includes("Microsoft VS Code")&&!D.includes("cursor")&&!D.includes("comate")&&!D.includes("codebuddy")&&!D.includes("trae"))M="vscode";return M}catch(G){return"other"}}},867:function(Q,P,w){var G=this&&this.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(P,"__esModule",{value:!0}),P.f2cDataReport=O,P.addParamsToUrl=H,P.reportMcpLoader=E,P.reportPTDMcpLoader=L;let B=w(680),D=w(428),M=w(782),A=w(52),N=w(799),h=G(w(892)),$=M.createLogger("F2c-Report");function U(R){return(Z,m)=>{let x=new AbortController;m=m||{},m.signal=x.signal;let y=setTimeout(()=>{clearTimeout(y),x.abort()},R);return B.compatFetch(A.ReportUrl,m)}}async function O(R,Z,m,x){let y="",a=D.getGitUserInfo();y=a.name?a.name+"-"+a.email:a.email?a.email:"f2c_匿名";let p={...x,account:y,appid:1,dataType:R,data_type:R,dim1:y,dim3:Z,value1:m};F("webhdf2cgeneralstatistics",p,!1)}function H(R,Z){try{let m=new URL(R);return Object.keys(Z).forEach((x)=>{let y=Z[x];if(y!==null&&y!==void 0)m.searchParams.append(x,String(y))}),m.toString()}catch(m){let x=Object.keys(Z).filter((a)=>Z[a]!==null&&Z[a]!==void 0).map((a)=>`${encodeURIComponent(a)}=${encodeURIComponent(String(Z[a]))}`).join("&"),y=R.includes("?")?"&":"?";return x?`${R}${y}${x}`:R}}function F(R,Z,m){try{let x=Math.floor(new Date().getTime()/1000),y=R+x+"HiidoYYSystem",a=h.default(y),p=Object.assign({time:x},Z),i="mlog.bigda.com",T=H("https://mlog.bigda.com/c.gif?act="+R+"&key="+a,p);B.compatFetch(T,{method:"GET"}).then(async(b)=>{if(b&&b.status!=200)$.log("上报失败",b.status);else $.log("上报成功")})}catch(x){}}async function E(){try{let R=N.detectIDE();return $.log("当前运行环境",R),O(A.ReportType.pluginOpenCount,"",1,{dim5:"f2c-mcp-"+R}),R}catch(R){}}async function L(){try{let R=N.detectIDE();return $.log("当前运行环境",R),O(A.ReportType.pluginOpenCount,"",1,{dim5:"f2c-ptd-mcp-"+R}),R}catch(R){}}},892:(Q,P,w)=>{(function(){var G=w(635),B=w(539).utf8,D=w(445),M=w(539).bin,A=function(N,h){if(N.constructor==String)if(h&&h.encoding==="binary")N=M.stringToBytes(N);else N=B.stringToBytes(N);else if(D(N))N=Array.prototype.slice.call(N,0);else if(!Array.isArray(N)&&N.constructor!==Uint8Array)N=N.toString();var $=G.bytesToWords(N),U=N.length*8,O=1732584193,H=-271733879,F=-1732584194,E=271733878;for(var L=0;L<$.length;L++)$[L]=($[L]<<8|$[L]>>>24)&16711935|($[L]<<24|$[L]>>>8)&4278255360;$[U>>>5]|=128<<U%32,$[(U+64>>>9<<4)+14]=U;var{_ff:R,_gg:Z,_hh:m,_ii:x}=A;for(var L=0;L<$.length;L+=16){var y=O,a=H,p=F,i=E;O=R(O,H,F,E,$[L+0],7,-680876936),E=R(E,O,H,F,$[L+1],12,-389564586),F=R(F,E,O,H,$[L+2],17,606105819),H=R(H,F,E,O,$[L+3],22,-1044525330),O=R(O,H,F,E,$[L+4],7,-176418897),E=R(E,O,H,F,$[L+5],12,1200080426),F=R(F,E,O,H,$[L+6],17,-1473231341),H=R(H,F,E,O,$[L+7],22,-45705983),O=R(O,H,F,E,$[L+8],7,1770035416),E=R(E,O,H,F,$[L+9],12,-1958414417),F=R(F,E,O,H,$[L+10],17,-42063),H=R(H,F,E,O,$[L+11],22,-1990404162),O=R(O,H,F,E,$[L+12],7,1804603682),E=R(E,O,H,F,$[L+13],12,-40341101),F=R(F,E,O,H,$[L+14],17,-1502002290),H=R(H,F,E,O,$[L+15],22,1236535329),O=Z(O,H,F,E,$[L+1],5,-165796510),E=Z(E,O,H,F,$[L+6],9,-1069501632),F=Z(F,E,O,H,$[L+11],14,643717713),H=Z(H,F,E,O,$[L+0],20,-373897302),O=Z(O,H,F,E,$[L+5],5,-701558691),E=Z(E,O,H,F,$[L+10],9,38016083),F=Z(F,E,O,H,$[L+15],14,-660478335),H=Z(H,F,E,O,$[L+4],20,-405537848),O=Z(O,H,F,E,$[L+9],5,568446438),E=Z(E,O,H,F,$[L+14],9,-1019803690),F=Z(F,E,O,H,$[L+3],14,-187363961),H=Z(H,F,E,O,$[L+8],20,1163531501),O=Z(O,H,F,E,$[L+13],5,-1444681467),E=Z(E,O,H,F,$[L+2],9,-51403784),F=Z(F,E,O,H,$[L+7],14,1735328473),H=Z(H,F,E,O,$[L+12],20,-1926607734),O=m(O,H,F,E,$[L+5],4,-378558),E=m(E,O,H,F,$[L+8],11,-2022574463),F=m(F,E,O,H,$[L+11],16,1839030562),H=m(H,F,E,O,$[L+14],23,-35309556),O=m(O,H,F,E,$[L+1],4,-1530992060),E=m(E,O,H,F,$[L+4],11,1272893353),F=m(F,E,O,H,$[L+7],16,-155497632),H=m(H,F,E,O,$[L+10],23,-1094730640),O=m(O,H,F,E,$[L+13],4,681279174),E=m(E,O,H,F,$[L+0],11,-358537222),F=m(F,E,O,H,$[L+3],16,-722521979),H=m(H,F,E,O,$[L+6],23,76029189),O=m(O,H,F,E,$[L+9],4,-640364487),E=m(E,O,H,F,$[L+12],11,-421815835),F=m(F,E,O,H,$[L+15],16,530742520),H=m(H,F,E,O,$[L+2],23,-995338651),O=x(O,H,F,E,$[L+0],6,-198630844),E=x(E,O,H,F,$[L+7],10,1126891415),F=x(F,E,O,H,$[L+14],15,-1416354905),H=x(H,F,E,O,$[L+5],21,-57434055),O=x(O,H,F,E,$[L+12],6,1700485571),E=x(E,O,H,F,$[L+3],10,-1894986606),F=x(F,E,O,H,$[L+10],15,-1051523),H=x(H,F,E,O,$[L+1],21,-2054922799),O=x(O,H,F,E,$[L+8],6,1873313359),E=x(E,O,H,F,$[L+15],10,-30611744),F=x(F,E,O,H,$[L+6],15,-1560198380),H=x(H,F,E,O,$[L+13],21,1309151649),O=x(O,H,F,E,$[L+4],6,-145523070),E=x(E,O,H,F,$[L+11],10,-1120210379),F=x(F,E,O,H,$[L+2],15,718787259),H=x(H,F,E,O,$[L+9],21,-343485551),O=O+y>>>0,H=H+a>>>0,F=F+p>>>0,E=E+i>>>0}return G.endian([O,H,F,E])};A._ff=function(N,h,$,U,O,H,F){var E=N+(h&$|~h&U)+(O>>>0)+F;return(E<<H|E>>>32-H)+h},A._gg=function(N,h,$,U,O,H,F){var E=N+(h&U|$&~U)+(O>>>0)+F;return(E<<H|E>>>32-H)+h},A._hh=function(N,h,$,U,O,H,F){var E=N+(h^$^U)+(O>>>0)+F;return(E<<H|E>>>32-H)+h},A._ii=function(N,h,$,U,O,H,F){var E=N+($^(h|~U))+(O>>>0)+F;return(E<<H|E>>>32-H)+h},A._blocksize=16,A._digestsize=16,Q.exports=function(N,h){if(N===void 0||N===null)throw new Error("Illegal argument "+N);var $=G.wordsToBytes(A(N,h));return h&&h.asBytes?$:h&&h.asString?M.bytesToString($):G.bytesToHex($)}})()}},v={};function W(Q){var P=v[Q];if(P!==void 0)return P.exports;var w=v[Q]={exports:{}};return f[Q].call(w.exports,w,w.exports,W),w.exports}var X={};(()=>{var Q=X;Object.defineProperty(Q,"__esModule",{value:!0}),Q.ReportType=Q.addParamsToUrl=Q.reportPTDMcpLoader=Q.reportMcpLoader=Q.f2cDataReport=void 0;var P=W(867);Object.defineProperty(Q,"f2cDataReport",{enumerable:!0,get:function(){return P.f2cDataReport}}),Object.defineProperty(Q,"reportMcpLoader",{enumerable:!0,get:function(){return P.reportMcpLoader}}),Object.defineProperty(Q,"reportPTDMcpLoader",{enumerable:!0,get:function(){return P.reportPTDMcpLoader}}),Object.defineProperty(Q,"addParamsToUrl",{enumerable:!0,get:function(){return P.addParamsToUrl}});var w=W(52);Object.defineProperty(Q,"ReportType",{enumerable:!0,get:function(){return w.ReportType}})})(),V4.exports=X})()});IQ();var l2=60000;class zJ{constructor(f){this._options=f,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(S8,(v)=>{let W=this._requestHandlerAbortControllers.get(v.params.requestId);W===null||W===void 0||W.abort(v.params.reason)}),this.setNotificationHandler(_8,(v)=>{this._onprogress(v)}),this.setRequestHandler(R8,(v)=>({}))}_setupTimeout(f,v,W,X,Q=!1){this._timeoutInfo.set(f,{timeoutId:setTimeout(X,v),startTime:Date.now(),timeout:v,maxTotalTimeout:W,resetTimeoutOnProgress:Q,onTimeout:X})}_resetTimeout(f){let v=this._timeoutInfo.get(f);if(!v)return!1;let W=Date.now()-v.startTime;if(v.maxTotalTimeout&&W>=v.maxTotalTimeout)throw this._timeoutInfo.delete(f),new Tv(kv.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:v.maxTotalTimeout,totalElapsed:W});return clearTimeout(v.timeoutId),v.timeoutId=setTimeout(v.onTimeout,v.timeout),!0}_cleanupTimeout(f){let v=this._timeoutInfo.get(f);if(v)clearTimeout(v.timeoutId),this._timeoutInfo.delete(f)}async connect(f){var v,W,X;this._transport=f;let Q=(v=this.transport)===null||v===void 0?void 0:v.onclose;this._transport.onclose=()=>{Q===null||Q===void 0||Q(),this._onclose()};let P=(W=this.transport)===null||W===void 0?void 0:W.onerror;this._transport.onerror=(G)=>{P===null||P===void 0||P(G),this._onerror(G)};let w=(X=this._transport)===null||X===void 0?void 0:X.onmessage;this._transport.onmessage=(G,B)=>{if(w===null||w===void 0||w(G,B),fJ(G)||U6(G))this._onresponse(G);else if(V6(G))this._onrequest(G,B);else if(N6(G))this._onnotification(G);else this._onerror(new Error(`Unknown message type: ${JSON.stringify(G)}`))},await this._transport.start()}_onclose(){var f;let v=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,(f=this.onclose)===null||f===void 0||f.call(this);let W=new Tv(kv.ConnectionClosed,"Connection closed");for(let X of v.values())X(W)}_onerror(f){var v;(v=this.onerror)===null||v===void 0||v.call(this,f)}_onnotification(f){var v;let W=(v=this._notificationHandlers.get(f.method))!==null&&v!==void 0?v:this.fallbackNotificationHandler;if(W===void 0)return;Promise.resolve().then(()=>W(f)).catch((X)=>this._onerror(new Error(`Uncaught error in notification handler: ${X}`)))}_onrequest(f,v){var W,X;let Q=(W=this._requestHandlers.get(f.method))!==null&&W!==void 0?W:this.fallbackRequestHandler,P=this._transport;if(Q===void 0){P===null||P===void 0||P.send({jsonrpc:"2.0",id:f.id,error:{code:kv.MethodNotFound,message:"Method not found"}}).catch((B)=>this._onerror(new Error(`Failed to send an error response: ${B}`)));return}let w=new AbortController;this._requestHandlerAbortControllers.set(f.id,w);let G={signal:w.signal,sessionId:P===null||P===void 0?void 0:P.sessionId,_meta:(X=f.params)===null||X===void 0?void 0:X._meta,sendNotification:(B)=>this.notification(B,{relatedRequestId:f.id}),sendRequest:(B,D,M)=>this.request(B,D,{...M,relatedRequestId:f.id}),authInfo:v===null||v===void 0?void 0:v.authInfo,requestId:f.id,requestInfo:v===null||v===void 0?void 0:v.requestInfo};Promise.resolve().then(()=>Q(f,G)).then((B)=>{if(w.signal.aborted)return;return P===null||P===void 0?void 0:P.send({result:B,jsonrpc:"2.0",id:f.id})},(B)=>{var D;if(w.signal.aborted)return;return P===null||P===void 0?void 0:P.send({jsonrpc:"2.0",id:f.id,error:{code:Number.isSafeInteger(B.code)?B.code:kv.InternalError,message:(D=B.message)!==null&&D!==void 0?D:"Internal error"}})}).catch((B)=>this._onerror(new Error(`Failed to send response: ${B}`))).finally(()=>{this._requestHandlerAbortControllers.delete(f.id)})}_onprogress(f){let{progressToken:v,...W}=f.params,X=Number(v),Q=this._progressHandlers.get(X);if(!Q){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(f)}`));return}let P=this._responseHandlers.get(X),w=this._timeoutInfo.get(X);if(w&&P&&w.resetTimeoutOnProgress)try{this._resetTimeout(X)}catch(G){P(G);return}Q(W)}_onresponse(f){let v=Number(f.id),W=this._responseHandlers.get(v);if(W===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(f)}`));return}if(this._responseHandlers.delete(v),this._progressHandlers.delete(v),this._cleanupTimeout(v),fJ(f))W(f);else{let X=new Tv(f.error.code,f.error.message,f.error.data);W(X)}}get transport(){return this._transport}async close(){var f;await((f=this._transport)===null||f===void 0?void 0:f.close())}request(f,v,W){let{relatedRequestId:X,resumptionToken:Q,onresumptiontoken:P}=W!==null&&W!==void 0?W:{};return new Promise((w,G)=>{var B,D,M,A,N,h;if(!this._transport){G(new Error("Not connected"));return}if(((B=this._options)===null||B===void 0?void 0:B.enforceStrictCapabilities)===!0)this.assertCapabilityForMethod(f.method);(D=W===null||W===void 0?void 0:W.signal)===null||D===void 0||D.throwIfAborted();let $=this._requestMessageId++,U={...f,jsonrpc:"2.0",id:$};if(W===null||W===void 0?void 0:W.onprogress)this._progressHandlers.set($,W.onprogress),U.params={...f.params,_meta:{...((M=f.params)===null||M===void 0?void 0:M._meta)||{},progressToken:$}};let O=(E)=>{var L;this._responseHandlers.delete($),this._progressHandlers.delete($),this._cleanupTimeout($),(L=this._transport)===null||L===void 0||L.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:$,reason:String(E)}},{relatedRequestId:X,resumptionToken:Q,onresumptiontoken:P}).catch((R)=>this._onerror(new Error(`Failed to send cancellation: ${R}`))),G(E)};this._responseHandlers.set($,(E)=>{var L;if((L=W===null||W===void 0?void 0:W.signal)===null||L===void 0?void 0:L.aborted)return;if(E instanceof Error)return G(E);try{let R=v.parse(E.result);w(R)}catch(R){G(R)}}),(A=W===null||W===void 0?void 0:W.signal)===null||A===void 0||A.addEventListener("abort",()=>{var E;O((E=W===null||W===void 0?void 0:W.signal)===null||E===void 0?void 0:E.reason)});let H=(N=W===null||W===void 0?void 0:W.timeout)!==null&&N!==void 0?N:l2,F=()=>O(new Tv(kv.RequestTimeout,"Request timed out",{timeout:H}));this._setupTimeout($,H,W===null||W===void 0?void 0:W.maxTotalTimeout,F,(h=W===null||W===void 0?void 0:W.resetTimeoutOnProgress)!==null&&h!==void 0?h:!1),this._transport.send(U,{relatedRequestId:X,resumptionToken:Q,onresumptiontoken:P}).catch((E)=>{this._cleanupTimeout($),G(E)})})}async notification(f,v){var W,X;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(f.method),((X=(W=this._options)===null||W===void 0?void 0:W.debouncedNotificationMethods)!==null&&X!==void 0?X:[]).includes(f.method)&&!f.params&&!(v===null||v===void 0?void 0:v.relatedRequestId)){if(this._pendingDebouncedNotifications.has(f.method))return;this._pendingDebouncedNotifications.add(f.method),Promise.resolve().then(()=>{var G;if(this._pendingDebouncedNotifications.delete(f.method),!this._transport)return;let B={...f,jsonrpc:"2.0"};(G=this._transport)===null||G===void 0||G.send(B,v).catch((D)=>this._onerror(D))});return}let w={...f,jsonrpc:"2.0"};await this._transport.send(w,v)}setRequestHandler(f,v){let W=f.shape.method.value;this.assertRequestHandlerCapability(W),this._requestHandlers.set(W,(X,Q)=>{return Promise.resolve(v(f.parse(X),Q))})}removeRequestHandler(f){this._requestHandlers.delete(f)}assertCanSetRequestHandler(f){if(this._requestHandlers.has(f))throw new Error(`A request handler for ${f} already exists, which would be overridden`)}setNotificationHandler(f,v){this._notificationHandlers.set(f.shape.method.value,(W)=>Promise.resolve(v(f.parse(W))))}removeNotificationHandler(f){this._notificationHandlers.delete(f)}}function Z6(f,v){return Object.entries(v).reduce((W,[X,Q])=>{if(Q&&typeof Q==="object")W[X]=W[X]?{...W[X],...Q}:Q;else W[X]=Q;return W},{...f})}IQ();var yP=Hf(CP());class CJ extends zJ{constructor(f,v){var W;super(v);this._serverInfo=f,this._capabilities=(W=v===null||v===void 0?void 0:v.capabilities)!==null&&W!==void 0?W:{},this._instructions=v===null||v===void 0?void 0:v.instructions,this.setRequestHandler(g8,(X)=>this._oninitialize(X)),this.setNotificationHandler(QJ,()=>{var X;return(X=this.oninitialized)===null||X===void 0?void 0:X.call(this)})}registerCapabilities(f){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Z6(this._capabilities,f)}assertCapabilityForMethod(f){var v,W,X;switch(f){case"sampling/createMessage":if(!((v=this._clientCapabilities)===null||v===void 0?void 0:v.sampling))throw new Error(`Client does not support sampling (required for ${f})`);break;case"elicitation/create":if(!((W=this._clientCapabilities)===null||W===void 0?void 0:W.elicitation))throw new Error(`Client does not support elicitation (required for ${f})`);break;case"roots/list":if(!((X=this._clientCapabilities)===null||X===void 0?void 0:X.roots))throw new Error(`Client does not support listing roots (required for ${f})`);break;case"ping":break}}assertNotificationCapability(f){switch(f){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${f})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${f})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${f})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${f})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(f){switch(f){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Server does not support sampling (required for ${f})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${f})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${f})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${f})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${f})`);break;case"ping":case"initialize":break}}async _oninitialize(f){let v=f.params.protocolVersion;return this._clientCapabilities=f.params.capabilities,this._clientVersion=f.params.clientInfo,{protocolVersion:D6.includes(v)?v:vJ,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},L8)}async createMessage(f,v){return this.request({method:"sampling/createMessage",params:f},YJ,v)}async elicitInput(f,v){let W=await this.request({method:"elicitation/create",params:f},wJ,v);if(W.action==="accept"&&W.content)try{let X=new yP.default,Q=X.compile(f.requestedSchema);if(!Q(W.content))throw new Tv(kv.InvalidParams,`Elicitation response content does not match requested schema: ${X.errorsText(Q.errors)}`)}catch(X){if(X instanceof Tv)throw X;throw new Tv(kv.InternalError,`Error validating elicitation response: ${X}`)}return W}async listRoots(f,v){return this.request({method:"roots/list",params:f},GJ,v)}async sendLoggingMessage(f){return this.notification({method:"notifications/message",params:f})}async sendResourceUpdated(f){return this.notification({method:"notifications/resources/updated",params:f})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}var xP=Symbol("Let zodToJsonSchema decide on which parser to use");var TP={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},lP=(f)=>typeof f==="string"?{...TP,name:f}:{...TP,...f};var bP=(f)=>{let v=lP(f),W=v.name!==void 0?[...v.basePath,v.definitionPath,v.name]:v.basePath;return{...v,flags:{hasReferencedOpenAiAnyType:!1},currentPath:W,propertyPath:void 0,seen:new Map(Object.entries(v.definitions).map(([X,Q])=>[Q._def,{def:Q._def,path:[...v.basePath,v.definitionPath,X],jsonSchema:void 0}]))}};function yJ(f,v,W,X){if(!X?.errorMessages)return;if(W)f.errorMessage={...f.errorMessage,[v]:W}}function Nv(f,v,W,X,Q){f[v]=W,yJ(f,v,X,Q)}var PW=(f,v)=>{let W=0;for(;W<f.length&&W<v.length;W++)if(f[W]!==v[W])break;return[(f.length-W).toString(),...v.slice(W)].join("/")};n1();function lv(f){if(f.target!=="openAi")return{};let v=[...f.basePath,f.definitionPath,f.openAiAnyTypeName];return f.flags.hasReferencedOpenAiAnyType=!0,{$ref:f.$refStrategy==="relative"?PW(v,f.currentPath):v.join("/")}}n1();function uP(f,v){let W={type:"array"};if(f.type?._def&&f.type?._def?.typeName!==u.ZodAny)W.items=Jv(f.type._def,{...v,currentPath:[...v.currentPath,"items"]});if(f.minLength)Nv(W,"minItems",f.minLength.value,f.minLength.message,v);if(f.maxLength)Nv(W,"maxItems",f.maxLength.value,f.maxLength.message,v);if(f.exactLength)Nv(W,"minItems",f.exactLength.value,f.exactLength.message,v),Nv(W,"maxItems",f.exactLength.value,f.exactLength.message,v);return W}function mP(f,v){let W={type:"integer",format:"int64"};if(!f.checks)return W;for(let X of f.checks)switch(X.kind){case"min":if(v.target==="jsonSchema7")if(X.inclusive)Nv(W,"minimum",X.value,X.message,v);else Nv(W,"exclusiveMinimum",X.value,X.message,v);else{if(!X.inclusive)W.exclusiveMinimum=!0;Nv(W,"minimum",X.value,X.message,v)}break;case"max":if(v.target==="jsonSchema7")if(X.inclusive)Nv(W,"maximum",X.value,X.message,v);else Nv(W,"exclusiveMaximum",X.value,X.message,v);else{if(!X.inclusive)W.exclusiveMaximum=!0;Nv(W,"maximum",X.value,X.message,v)}break;case"multipleOf":Nv(W,"multipleOf",X.value,X.message,v);break}return W}function rP(){return{type:"boolean"}}function YW(f,v){return Jv(f.type._def,v)}var aP=(f,v)=>{return Jv(f.innerType._def,v)};function TJ(f,v,W){let X=W??v.dateStrategy;if(Array.isArray(X))return{anyOf:X.map((Q,P)=>TJ(f,v,Q))};switch(X){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return HG(f,v)}}var HG=(f,v)=>{let W={type:"integer",format:"unix-time"};if(v.target==="openApi3")return W;for(let X of f.checks)switch(X.kind){case"min":Nv(W,"minimum",X.value,X.message,v);break;case"max":Nv(W,"maximum",X.value,X.message,v);break}return W};function cP(f,v){return{...Jv(f.innerType._def,v),default:f.defaultValue()}}function nP(f,v){return v.effectStrategy==="input"?Jv(f.schema._def,v):lv(v)}function pP(f){return{type:"string",enum:Array.from(f.values)}}var VG=(f)=>{if("type"in f&&f.type==="string")return!1;return"allOf"in f};function iP(f,v){let W=[Jv(f.left._def,{...v,currentPath:[...v.currentPath,"allOf","0"]}),Jv(f.right._def,{...v,currentPath:[...v.currentPath,"allOf","1"]})].filter((P)=>!!P),X=v.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,Q=[];return W.forEach((P)=>{if(VG(P)){if(Q.push(...P.allOf),P.unevaluatedProperties===void 0)X=void 0}else{let w=P;if("additionalProperties"in P&&P.additionalProperties===!1){let{additionalProperties:G,...B}=P;w=B}else X=void 0;Q.push(w)}}),Q.length?{allOf:Q,...X}:void 0}function dP(f,v){let W=typeof f.value;if(W!=="bigint"&&W!=="number"&&W!=="boolean"&&W!=="string")return{type:Array.isArray(f.value)?"array":"object"};if(v.target==="openApi3")return{type:W==="bigint"?"integer":W,enum:[f.value]};return{type:W==="bigint"?"integer":W,const:f.value}}n1();var xJ=void 0,of={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>{if(xJ===void 0)xJ=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return xJ},uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function wW(f,v){let W={type:"string"};if(f.checks)for(let X of f.checks)switch(X.kind){case"min":Nv(W,"minLength",typeof W.minLength==="number"?Math.max(W.minLength,X.value):X.value,X.message,v);break;case"max":Nv(W,"maxLength",typeof W.maxLength==="number"?Math.min(W.maxLength,X.value):X.value,X.message,v);break;case"email":switch(v.emailStrategy){case"format:email":tf(W,"email",X.message,v);break;case"format:idn-email":tf(W,"idn-email",X.message,v);break;case"pattern:zod":Df(W,of.email,X.message,v);break}break;case"url":tf(W,"uri",X.message,v);break;case"uuid":tf(W,"uuid",X.message,v);break;case"regex":Df(W,X.regex,X.message,v);break;case"cuid":Df(W,of.cuid,X.message,v);break;case"cuid2":Df(W,of.cuid2,X.message,v);break;case"startsWith":Df(W,RegExp(`^${lJ(X.value,v)}`),X.message,v);break;case"endsWith":Df(W,RegExp(`${lJ(X.value,v)}$`),X.message,v);break;case"datetime":tf(W,"date-time",X.message,v);break;case"date":tf(W,"date",X.message,v);break;case"time":tf(W,"time",X.message,v);break;case"duration":tf(W,"duration",X.message,v);break;case"length":Nv(W,"minLength",typeof W.minLength==="number"?Math.max(W.minLength,X.value):X.value,X.message,v),Nv(W,"maxLength",typeof W.maxLength==="number"?Math.min(W.maxLength,X.value):X.value,X.message,v);break;case"includes":{Df(W,RegExp(lJ(X.value,v)),X.message,v);break}case"ip":{if(X.version!=="v6")tf(W,"ipv4",X.message,v);if(X.version!=="v4")tf(W,"ipv6",X.message,v);break}case"base64url":Df(W,of.base64url,X.message,v);break;case"jwt":Df(W,of.jwt,X.message,v);break;case"cidr":{if(X.version!=="v6")Df(W,of.ipv4Cidr,X.message,v);if(X.version!=="v4")Df(W,of.ipv6Cidr,X.message,v);break}case"emoji":Df(W,of.emoji(),X.message,v);break;case"ulid":{Df(W,of.ulid,X.message,v);break}case"base64":{switch(v.base64Strategy){case"format:binary":{tf(W,"binary",X.message,v);break}case"contentEncoding:base64":{Nv(W,"contentEncoding","base64",X.message,v);break}case"pattern:zod":{Df(W,of.base64,X.message,v);break}}break}case"nanoid":Df(W,of.nanoid,X.message,v);case"toLowerCase":case"toUpperCase":case"trim":break;default:((Q)=>{})(X)}return W}function lJ(f,v){return v.patternStrategy==="escape"?NG(f):f}var qG=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function NG(f){let v="";for(let W=0;W<f.length;W++){if(!qG.has(f[W]))v+="\\";v+=f[W]}return v}function tf(f,v,W,X){if(f.format||f.anyOf?.some((Q)=>Q.format)){if(!f.anyOf)f.anyOf=[];if(f.format){if(f.anyOf.push({format:f.format,...f.errorMessage&&X.errorMessages&&{errorMessage:{format:f.errorMessage.format}}}),delete f.format,f.errorMessage){if(delete f.errorMessage.format,Object.keys(f.errorMessage).length===0)delete f.errorMessage}}f.anyOf.push({format:v,...W&&X.errorMessages&&{errorMessage:{format:W}}})}else Nv(f,"format",v,W,X)}function Df(f,v,W,X){if(f.pattern||f.allOf?.some((Q)=>Q.pattern)){if(!f.allOf)f.allOf=[];if(f.pattern){if(f.allOf.push({pattern:f.pattern,...f.errorMessage&&X.errorMessages&&{errorMessage:{pattern:f.errorMessage.pattern}}}),delete f.pattern,f.errorMessage){if(delete f.errorMessage.pattern,Object.keys(f.errorMessage).length===0)delete f.errorMessage}}f.allOf.push({pattern:sP(v,X),...W&&X.errorMessages&&{errorMessage:{pattern:W}}})}else Nv(f,"pattern",sP(v,X),W,X)}function sP(f,v){if(!v.applyRegexFlags||!f.flags)return f.source;let W={i:f.flags.includes("i"),m:f.flags.includes("m"),s:f.flags.includes("s")},X=W.i?f.source.toLowerCase():f.source,Q="",P=!1,w=!1,G=!1;for(let B=0;B<X.length;B++){if(P){Q+=X[B],P=!1;continue}if(W.i){if(w){if(X[B].match(/[a-z]/)){if(G)Q+=X[B],Q+=`${X[B-2]}-${X[B]}`.toUpperCase(),G=!1;else if(X[B+1]==="-"&&X[B+2]?.match(/[a-z]/))Q+=X[B],G=!0;else Q+=`${X[B]}${X[B].toUpperCase()}`;continue}}else if(X[B].match(/[a-z]/)){Q+=`[${X[B]}${X[B].toUpperCase()}]`;continue}}if(W.m){if(X[B]==="^"){Q+=`(^|(?<=[\r
|
|
21
|
+
]))`;continue}else if(X[B]==="$"){Q+=`($|(?=[\r
|
|
22
|
+
]))`;continue}}if(W.s&&X[B]==="."){Q+=w?`${X[B]}\r
|
|
23
|
+
`:`[${X[B]}\r
|
|
24
|
+
]`;continue}if(Q+=X[B],X[B]==="\\")P=!0;else if(w&&X[B]==="]")w=!1;else if(!w&&X[B]==="[")w=!0}try{new RegExp(Q)}catch{return console.warn(`Could not convert regex pattern at ${v.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),f.source}return Q}function GW(f,v){if(v.target==="openAi")console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");if(v.target==="openApi3"&&f.keyType?._def.typeName===u.ZodEnum)return{type:"object",required:f.keyType._def.values,properties:f.keyType._def.values.reduce((X,Q)=>({...X,[Q]:Jv(f.valueType._def,{...v,currentPath:[...v.currentPath,"properties",Q]})??lv(v)}),{}),additionalProperties:v.rejectedAdditionalProperties};let W={type:"object",additionalProperties:Jv(f.valueType._def,{...v,currentPath:[...v.currentPath,"additionalProperties"]})??v.allowedAdditionalProperties};if(v.target==="openApi3")return W;if(f.keyType?._def.typeName===u.ZodString&&f.keyType._def.checks?.length){let{type:X,...Q}=wW(f.keyType._def,v);return{...W,propertyNames:Q}}else if(f.keyType?._def.typeName===u.ZodEnum)return{...W,propertyNames:{enum:f.keyType._def.values}};else if(f.keyType?._def.typeName===u.ZodBranded&&f.keyType._def.type._def.typeName===u.ZodString&&f.keyType._def.type._def.checks?.length){let{type:X,...Q}=YW(f.keyType._def,v);return{...W,propertyNames:Q}}return W}function oP(f,v){if(v.mapStrategy==="record")return GW(f,v);let W=Jv(f.keyType._def,{...v,currentPath:[...v.currentPath,"items","items","0"]})||lv(v),X=Jv(f.valueType._def,{...v,currentPath:[...v.currentPath,"items","items","1"]})||lv(v);return{type:"array",maxItems:125,items:{type:"array",items:[W,X],minItems:2,maxItems:2}}}function tP(f){let v=f.values,X=Object.keys(f.values).filter((P)=>{return typeof v[v[P]]!=="number"}).map((P)=>v[P]),Q=Array.from(new Set(X.map((P)=>typeof P)));return{type:Q.length===1?Q[0]==="string"?"string":"number":["string","number"],enum:X}}function eP(f){return f.target==="openAi"?void 0:{not:lv({...f,currentPath:[...f.currentPath,"not"]})}}function vY(f){return f.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var CQ={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function QY(f,v){if(v.target==="openApi3")return fY(f,v);let W=f.options instanceof Map?Array.from(f.options.values()):f.options;if(W.every((X)=>(X._def.typeName in CQ)&&(!X._def.checks||!X._def.checks.length))){let X=W.reduce((Q,P)=>{let w=CQ[P._def.typeName];return w&&!Q.includes(w)?[...Q,w]:Q},[]);return{type:X.length>1?X:X[0]}}else if(W.every((X)=>X._def.typeName==="ZodLiteral"&&!X.description)){let X=W.reduce((Q,P)=>{let w=typeof P._def.value;switch(w){case"string":case"number":case"boolean":return[...Q,w];case"bigint":return[...Q,"integer"];case"object":if(P._def.value===null)return[...Q,"null"];case"symbol":case"undefined":case"function":default:return Q}},[]);if(X.length===W.length){let Q=X.filter((P,w,G)=>G.indexOf(P)===w);return{type:Q.length>1?Q:Q[0],enum:W.reduce((P,w)=>{return P.includes(w._def.value)?P:[...P,w._def.value]},[])}}}else if(W.every((X)=>X._def.typeName==="ZodEnum"))return{type:"string",enum:W.reduce((X,Q)=>[...X,...Q._def.values.filter((P)=>!X.includes(P))],[])};return fY(f,v)}var fY=(f,v)=>{let W=(f.options instanceof Map?Array.from(f.options.values()):f.options).map((X,Q)=>Jv(X._def,{...v,currentPath:[...v.currentPath,"anyOf",`${Q}`]})).filter((X)=>!!X&&(!v.strictUnions||typeof X==="object"&&Object.keys(X).length>0));return W.length?{anyOf:W}:void 0};function WY(f,v){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(f.innerType._def.typeName)&&(!f.innerType._def.checks||!f.innerType._def.checks.length)){if(v.target==="openApi3")return{type:CQ[f.innerType._def.typeName],nullable:!0};return{type:[CQ[f.innerType._def.typeName],"null"]}}if(v.target==="openApi3"){let X=Jv(f.innerType._def,{...v,currentPath:[...v.currentPath]});if(X&&"$ref"in X)return{allOf:[X],nullable:!0};return X&&{...X,nullable:!0}}let W=Jv(f.innerType._def,{...v,currentPath:[...v.currentPath,"anyOf","0"]});return W&&{anyOf:[W,{type:"null"}]}}function JY(f,v){let W={type:"number"};if(!f.checks)return W;for(let X of f.checks)switch(X.kind){case"int":W.type="integer",yJ(W,"type",X.message,v);break;case"min":if(v.target==="jsonSchema7")if(X.inclusive)Nv(W,"minimum",X.value,X.message,v);else Nv(W,"exclusiveMinimum",X.value,X.message,v);else{if(!X.inclusive)W.exclusiveMinimum=!0;Nv(W,"minimum",X.value,X.message,v)}break;case"max":if(v.target==="jsonSchema7")if(X.inclusive)Nv(W,"maximum",X.value,X.message,v);else Nv(W,"exclusiveMaximum",X.value,X.message,v);else{if(!X.inclusive)W.exclusiveMaximum=!0;Nv(W,"maximum",X.value,X.message,v)}break;case"multipleOf":Nv(W,"multipleOf",X.value,X.message,v);break}return W}function XY(f,v){let W=v.target==="openAi",X={type:"object",properties:{}},Q=[],P=f.shape();for(let G in P){let B=P[G];if(B===void 0||B._def===void 0)continue;let D=AG(B);if(D&&W){if(B._def.typeName==="ZodOptional")B=B._def.innerType;if(!B.isNullable())B=B.nullable();D=!1}let M=Jv(B._def,{...v,currentPath:[...v.currentPath,"properties",G],propertyPath:[...v.currentPath,"properties",G]});if(M===void 0)continue;if(X.properties[G]=M,!D)Q.push(G)}if(Q.length)X.required=Q;let w=EG(f,v);if(w!==void 0)X.additionalProperties=w;return X}function EG(f,v){if(f.catchall._def.typeName!=="ZodNever")return Jv(f.catchall._def,{...v,currentPath:[...v.currentPath,"additionalProperties"]});switch(f.unknownKeys){case"passthrough":return v.allowedAdditionalProperties;case"strict":return v.rejectedAdditionalProperties;case"strip":return v.removeAdditionalStrategy==="strict"?v.allowedAdditionalProperties:v.rejectedAdditionalProperties}}function AG(f){try{return f.isOptional()}catch{return!0}}var PY=(f,v)=>{if(v.currentPath.toString()===v.propertyPath?.toString())return Jv(f.innerType._def,v);let W=Jv(f.innerType._def,{...v,currentPath:[...v.currentPath,"anyOf","1"]});return W?{anyOf:[{not:lv(v)},W]}:lv(v)};var YY=(f,v)=>{if(v.pipeStrategy==="input")return Jv(f.in._def,v);else if(v.pipeStrategy==="output")return Jv(f.out._def,v);let W=Jv(f.in._def,{...v,currentPath:[...v.currentPath,"allOf","0"]}),X=Jv(f.out._def,{...v,currentPath:[...v.currentPath,"allOf",W?"1":"0"]});return{allOf:[W,X].filter((Q)=>Q!==void 0)}};function wY(f,v){return Jv(f.type._def,v)}function GY(f,v){let X={type:"array",uniqueItems:!0,items:Jv(f.valueType._def,{...v,currentPath:[...v.currentPath,"items"]})};if(f.minSize)Nv(X,"minItems",f.minSize.value,f.minSize.message,v);if(f.maxSize)Nv(X,"maxItems",f.maxSize.value,f.maxSize.message,v);return X}function zY(f,v){if(f.rest)return{type:"array",minItems:f.items.length,items:f.items.map((W,X)=>Jv(W._def,{...v,currentPath:[...v.currentPath,"items",`${X}`]})).reduce((W,X)=>X===void 0?W:[...W,X],[]),additionalItems:Jv(f.rest._def,{...v,currentPath:[...v.currentPath,"additionalItems"]})};else return{type:"array",minItems:f.items.length,maxItems:f.items.length,items:f.items.map((W,X)=>Jv(W._def,{...v,currentPath:[...v.currentPath,"items",`${X}`]})).reduce((W,X)=>X===void 0?W:[...W,X],[])}}function BY(f){return{not:lv(f)}}function KY(f){return lv(f)}var hY=(f,v)=>{return Jv(f.innerType._def,v)};var $Y=(f,v,W)=>{switch(v){case u.ZodString:return wW(f,W);case u.ZodNumber:return JY(f,W);case u.ZodObject:return XY(f,W);case u.ZodBigInt:return mP(f,W);case u.ZodBoolean:return rP();case u.ZodDate:return TJ(f,W);case u.ZodUndefined:return BY(W);case u.ZodNull:return vY(W);case u.ZodArray:return uP(f,W);case u.ZodUnion:case u.ZodDiscriminatedUnion:return QY(f,W);case u.ZodIntersection:return iP(f,W);case u.ZodTuple:return zY(f,W);case u.ZodRecord:return GW(f,W);case u.ZodLiteral:return dP(f,W);case u.ZodEnum:return pP(f);case u.ZodNativeEnum:return tP(f);case u.ZodNullable:return WY(f,W);case u.ZodOptional:return PY(f,W);case u.ZodMap:return oP(f,W);case u.ZodSet:return GY(f,W);case u.ZodLazy:return()=>f.getter()._def;case u.ZodPromise:return wY(f,W);case u.ZodNaN:case u.ZodNever:return eP(W);case u.ZodEffects:return nP(f,W);case u.ZodAny:return lv(W);case u.ZodUnknown:return KY(W);case u.ZodDefault:return cP(f,W);case u.ZodBranded:return YW(f,W);case u.ZodReadonly:return hY(f,W);case u.ZodCatch:return aP(f,W);case u.ZodPipeline:return YY(f,W);case u.ZodFunction:case u.ZodVoid:case u.ZodSymbol:return;default:return((X)=>{return})(v)}};function Jv(f,v,W=!1){let X=v.seen.get(f);if(v.override){let G=v.override?.(f,v,X,W);if(G!==xP)return G}if(X&&!W){let G=UG(X,v);if(G!==void 0)return G}let Q={def:f,path:v.currentPath,jsonSchema:void 0};v.seen.set(f,Q);let P=$Y(f,f.typeName,v),w=typeof P==="function"?Jv(P(),v):P;if(w)jG(f,v,w);if(v.postProcess){let G=v.postProcess(w,f,v);return Q.jsonSchema=w,G}return Q.jsonSchema=w,w}var UG=(f,v)=>{switch(v.$refStrategy){case"root":return{$ref:f.path.join("/")};case"relative":return{$ref:PW(v.currentPath,f.path)};case"none":case"seen":{if(f.path.length<v.currentPath.length&&f.path.every((W,X)=>v.currentPath[X]===W))return console.warn(`Recursive reference detected at ${v.currentPath.join("/")}! Defaulting to any`),lv(v);return v.$refStrategy==="seen"?lv(v):void 0}}},jG=(f,v,W)=>{if(f.description){if(W.description=f.description,v.markdownDescription)W.markdownDescription=f.description}return W};var zW=(f,v)=>{let W=bP(v),X=typeof v==="object"&&v.definitions?Object.entries(v.definitions).reduce((B,[D,M])=>({...B,[D]:Jv(M._def,{...W,currentPath:[...W.basePath,W.definitionPath,D]},!0)??lv(W)}),{}):void 0,Q=typeof v==="string"?v:v?.nameStrategy==="title"?void 0:v?.name,P=Jv(f._def,Q===void 0?W:{...W,currentPath:[...W.basePath,W.definitionPath,Q]},!1)??lv(W),w=typeof v==="object"&&v.name!==void 0&&v.nameStrategy==="title"?v.name:void 0;if(w!==void 0)P.title=w;if(W.flags.hasReferencedOpenAiAnyType){if(!X)X={};if(!X[W.openAiAnyTypeName])X[W.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:W.$refStrategy==="relative"?"1":[...W.basePath,W.definitionPath,W.openAiAnyTypeName].join("/")}}}let G=Q===void 0?X?{...P,[W.definitionPath]:X}:P:{$ref:[...W.$refStrategy==="relative"?[]:W.basePath,W.definitionPath,Q].join("/"),[W.definitionPath]:{...X,[Q]:P}};if(W.target==="jsonSchema7")G.$schema="http://json-schema.org/draft-07/schema#";else if(W.target==="jsonSchema2019-09"||W.target==="openAi")G.$schema="https://json-schema.org/draft/2019-09/schema#";if(W.target==="openAi"&&(("anyOf"in G)||("oneOf"in G)||("allOf"in G)||("type"in G)&&Array.isArray(G.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return G};n1();IQ();n1();var bJ;(function(f){f.Completable="McpCompletable"})(bJ||(bJ={}));class yQ extends zv{_parse(f){let{ctx:v}=this._processInputParams(f),W=v.data;return this._def.type._parse({data:W,path:v.path,parent:v})}unwrap(){return this._def.type}}yQ.create=(f,v)=>{return new yQ({type:f,typeName:bJ.Completable,complete:v.complete,...FG(v)})};function FG(f){if(!f)return{};let{errorMap:v,invalid_type_error:W,required_error:X,description:Q}=f;if(v&&(W||X))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(v)return{errorMap:v,description:Q};return{errorMap:(w,G)=>{var B,D;let{message:M}=f;if(w.code==="invalid_enum_value")return{message:M!==null&&M!==void 0?M:G.defaultError};if(typeof G.data==="undefined")return{message:(B=M!==null&&M!==void 0?M:X)!==null&&B!==void 0?B:G.defaultError};if(w.code!=="invalid_type")return{message:G.defaultError};return{message:(D=M!==null&&M!==void 0?M:W)!==null&&D!==void 0?D:G.defaultError}},description:Q}}class uJ{constructor(f,v){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new CJ(f,v)}async connect(f){return await this.server.connect(f)}async close(){await this.server.close()}setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler(l8.shape.method.value),this.server.assertCanSetRequestHandler(b8.shape.method.value),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(l8,()=>({tools:Object.entries(this._registeredTools).filter(([,f])=>f.enabled).map(([f,v])=>{let W={name:f,title:v.title,description:v.description,inputSchema:v.inputSchema?zW(v.inputSchema,{strictUnions:!0}):LG,annotations:v.annotations};if(v.outputSchema)W.outputSchema=zW(v.outputSchema,{strictUnions:!0});return W})})),this.server.setRequestHandler(b8,async(f,v)=>{let W=this._registeredTools[f.params.name];if(!W)throw new Tv(kv.InvalidParams,`Tool ${f.params.name} not found`);if(!W.enabled)throw new Tv(kv.InvalidParams,`Tool ${f.params.name} disabled`);let X;if(W.inputSchema){let Q=await W.inputSchema.safeParseAsync(f.params.arguments);if(!Q.success)throw new Tv(kv.InvalidParams,`Invalid arguments for tool ${f.params.name}: ${Q.error.message}`);let P=Q.data,w=W.callback;try{X=await Promise.resolve(w(P,v))}catch(G){X={content:[{type:"text",text:G instanceof Error?G.message:String(G)}],isError:!0}}}else{let Q=W.callback;try{X=await Promise.resolve(Q(v))}catch(P){X={content:[{type:"text",text:P instanceof Error?P.message:String(P)}],isError:!0}}}if(W.outputSchema&&!X.isError){if(!X.structuredContent)throw new Tv(kv.InvalidParams,`Tool ${f.params.name} has an output schema but no structured content was provided`);let Q=await W.outputSchema.safeParseAsync(X.structuredContent);if(!Q.success)throw new Tv(kv.InvalidParams,`Invalid structured content for tool ${f.params.name}: ${Q.error.message}`)}return X}),this._toolHandlersInitialized=!0}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(u8.shape.method.value),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(u8,async(f)=>{switch(f.params.ref.type){case"ref/prompt":return this.handlePromptCompletion(f,f.params.ref);case"ref/resource":return this.handleResourceCompletion(f,f.params.ref);default:throw new Tv(kv.InvalidParams,`Invalid completion reference: ${f.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion(f,v){let W=this._registeredPrompts[v.name];if(!W)throw new Tv(kv.InvalidParams,`Prompt ${v.name} not found`);if(!W.enabled)throw new Tv(kv.InvalidParams,`Prompt ${v.name} disabled`);if(!W.argsSchema)return BW;let X=W.argsSchema.shape[f.params.argument.name];if(!(X instanceof yQ))return BW;let P=await X._def.complete(f.params.argument.value,f.params.context);return MY(P)}async handleResourceCompletion(f,v){let W=Object.values(this._registeredResourceTemplates).find((P)=>P.resourceTemplate.uriTemplate.toString()===v.uri);if(!W){if(this._registeredResources[v.uri])return BW;throw new Tv(kv.InvalidParams,`Resource template ${f.params.ref.uri} not found`)}let X=W.resourceTemplate.completeCallback(f.params.argument.name);if(!X)return BW;let Q=await X(f.params.argument.value,f.params.context);return MY(Q)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(Z8.shape.method.value),this.server.assertCanSetRequestHandler(C8.shape.method.value),this.server.assertCanSetRequestHandler(y8.shape.method.value),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(Z8,async(f,v)=>{let W=Object.entries(this._registeredResources).filter(([Q,P])=>P.enabled).map(([Q,P])=>({uri:Q,name:P.name,...P.metadata})),X=[];for(let Q of Object.values(this._registeredResourceTemplates)){if(!Q.resourceTemplate.listCallback)continue;let P=await Q.resourceTemplate.listCallback(v);for(let w of P.resources)X.push({...Q.metadata,...w})}return{resources:[...W,...X]}}),this.server.setRequestHandler(C8,async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([v,W])=>({name:v,uriTemplate:W.resourceTemplate.uriTemplate.toString(),...W.metadata}))}}),this.server.setRequestHandler(y8,async(f,v)=>{let W=new URL(f.params.uri),X=this._registeredResources[W.toString()];if(X){if(!X.enabled)throw new Tv(kv.InvalidParams,`Resource ${W} disabled`);return X.readCallback(W,v)}for(let Q of Object.values(this._registeredResourceTemplates)){let P=Q.resourceTemplate.uriTemplate.match(W.toString());if(P)return Q.readCallback(W,P,v)}throw new Tv(kv.InvalidParams,`Resource ${W} not found`)}),this.setCompletionRequestHandler(),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(T8.shape.method.value),this.server.assertCanSetRequestHandler(x8.shape.method.value),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(T8,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,f])=>f.enabled).map(([f,v])=>{return{name:f,title:v.title,description:v.description,arguments:v.argsSchema?gG(v.argsSchema):void 0}})})),this.server.setRequestHandler(x8,async(f,v)=>{let W=this._registeredPrompts[f.params.name];if(!W)throw new Tv(kv.InvalidParams,`Prompt ${f.params.name} not found`);if(!W.enabled)throw new Tv(kv.InvalidParams,`Prompt ${f.params.name} disabled`);if(W.argsSchema){let X=await W.argsSchema.safeParseAsync(f.params.arguments);if(!X.success)throw new Tv(kv.InvalidParams,`Invalid arguments for prompt ${f.params.name}: ${X.error.message}`);let Q=X.data,P=W.callback;return await Promise.resolve(P(Q,v))}else{let X=W.callback;return await Promise.resolve(X(v))}}),this.setCompletionRequestHandler(),this._promptHandlersInitialized=!0}resource(f,v,...W){let X;if(typeof W[0]==="object")X=W.shift();let Q=W[0];if(typeof v==="string"){if(this._registeredResources[v])throw new Error(`Resource ${v} is already registered`);let P=this._createRegisteredResource(f,void 0,v,X,Q);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),P}else{if(this._registeredResourceTemplates[f])throw new Error(`Resource template ${f} is already registered`);let P=this._createRegisteredResourceTemplate(f,void 0,v,X,Q);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),P}}registerResource(f,v,W,X){if(typeof v==="string"){if(this._registeredResources[v])throw new Error(`Resource ${v} is already registered`);let Q=this._createRegisteredResource(f,W.title,v,W,X);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),Q}else{if(this._registeredResourceTemplates[f])throw new Error(`Resource template ${f} is already registered`);let Q=this._createRegisteredResourceTemplate(f,W.title,v,W,X);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),Q}}_createRegisteredResource(f,v,W,X,Q){let P={name:f,title:v,metadata:X,readCallback:Q,enabled:!0,disable:()=>P.update({enabled:!1}),enable:()=>P.update({enabled:!0}),remove:()=>P.update({uri:null}),update:(w)=>{if(typeof w.uri!=="undefined"&&w.uri!==W){if(delete this._registeredResources[W],w.uri)this._registeredResources[w.uri]=P}if(typeof w.name!=="undefined")P.name=w.name;if(typeof w.title!=="undefined")P.title=w.title;if(typeof w.metadata!=="undefined")P.metadata=w.metadata;if(typeof w.callback!=="undefined")P.readCallback=w.callback;if(typeof w.enabled!=="undefined")P.enabled=w.enabled;this.sendResourceListChanged()}};return this._registeredResources[W]=P,P}_createRegisteredResourceTemplate(f,v,W,X,Q){let P={resourceTemplate:W,title:v,metadata:X,readCallback:Q,enabled:!0,disable:()=>P.update({enabled:!1}),enable:()=>P.update({enabled:!0}),remove:()=>P.update({name:null}),update:(w)=>{if(typeof w.name!=="undefined"&&w.name!==f){if(delete this._registeredResourceTemplates[f],w.name)this._registeredResourceTemplates[w.name]=P}if(typeof w.title!=="undefined")P.title=w.title;if(typeof w.template!=="undefined")P.resourceTemplate=w.template;if(typeof w.metadata!=="undefined")P.metadata=w.metadata;if(typeof w.callback!=="undefined")P.readCallback=w.callback;if(typeof w.enabled!=="undefined")P.enabled=w.enabled;this.sendResourceListChanged()}};return this._registeredResourceTemplates[f]=P,P}_createRegisteredPrompt(f,v,W,X,Q){let P={title:v,description:W,argsSchema:X===void 0?void 0:K.object(X),callback:Q,enabled:!0,disable:()=>P.update({enabled:!1}),enable:()=>P.update({enabled:!0}),remove:()=>P.update({name:null}),update:(w)=>{if(typeof w.name!=="undefined"&&w.name!==f){if(delete this._registeredPrompts[f],w.name)this._registeredPrompts[w.name]=P}if(typeof w.title!=="undefined")P.title=w.title;if(typeof w.description!=="undefined")P.description=w.description;if(typeof w.argsSchema!=="undefined")P.argsSchema=K.object(w.argsSchema);if(typeof w.callback!=="undefined")P.callback=w.callback;if(typeof w.enabled!=="undefined")P.enabled=w.enabled;this.sendPromptListChanged()}};return this._registeredPrompts[f]=P,P}_createRegisteredTool(f,v,W,X,Q,P,w){let G={title:v,description:W,inputSchema:X===void 0?void 0:K.object(X),outputSchema:Q===void 0?void 0:K.object(Q),annotations:P,callback:w,enabled:!0,disable:()=>G.update({enabled:!1}),enable:()=>G.update({enabled:!0}),remove:()=>G.update({name:null}),update:(B)=>{if(typeof B.name!=="undefined"&&B.name!==f){if(delete this._registeredTools[f],B.name)this._registeredTools[B.name]=G}if(typeof B.title!=="undefined")G.title=B.title;if(typeof B.description!=="undefined")G.description=B.description;if(typeof B.paramsSchema!=="undefined")G.inputSchema=K.object(B.paramsSchema);if(typeof B.callback!=="undefined")G.callback=B.callback;if(typeof B.annotations!=="undefined")G.annotations=B.annotations;if(typeof B.enabled!=="undefined")G.enabled=B.enabled;this.sendToolListChanged()}};return this._registeredTools[f]=G,this.setToolRequestHandlers(),this.sendToolListChanged(),G}tool(f,...v){if(this._registeredTools[f])throw new Error(`Tool ${f} is already registered`);let W,X,Q,P;if(typeof v[0]==="string")W=v.shift();if(v.length>1){let G=v[0];if(DY(G)){if(X=v.shift(),v.length>1&&typeof v[0]==="object"&&v[0]!==null&&!DY(v[0]))P=v.shift()}else if(typeof G==="object"&&G!==null)P=v.shift()}let w=v[0];return this._createRegisteredTool(f,void 0,W,X,Q,P,w)}registerTool(f,v,W){if(this._registeredTools[f])throw new Error(`Tool ${f} is already registered`);let{title:X,description:Q,inputSchema:P,outputSchema:w,annotations:G}=v;return this._createRegisteredTool(f,X,Q,P,w,G,W)}prompt(f,...v){if(this._registeredPrompts[f])throw new Error(`Prompt ${f} is already registered`);let W;if(typeof v[0]==="string")W=v.shift();let X;if(v.length>1)X=v.shift();let Q=v[0],P=this._createRegisteredPrompt(f,void 0,W,X,Q);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),P}registerPrompt(f,v,W){if(this._registeredPrompts[f])throw new Error(`Prompt ${f} is already registered`);let{title:X,description:Q,argsSchema:P}=v,w=this._createRegisteredPrompt(f,X,Q,P,W);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),w}isConnected(){return this.server.transport!==void 0}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}}var LG={type:"object",properties:{}};function DY(f){if(typeof f!=="object"||f===null)return!1;return Object.keys(f).length===0||Object.values(f).some(SG)}function SG(f){return f!==null&&typeof f==="object"&&"parse"in f&&typeof f.parse==="function"&&"safeParse"in f&&typeof f.safeParse==="function"}function gG(f){return Object.entries(f.shape).map(([v,W])=>({name:v,description:W.description,required:!W.isOptional()}))}function MY(f){return{completion:{values:f.slice(0,100),total:f.length,hasMore:f.length>100}}}var BW={completion:{values:[],hasMore:!1}};KW();var NY=(f)=>{};var EY=(f)=>{NY(f)};KW();var J9=null;async function v3(){if(typeof global!=="undefined"&&global.fetch)return global.fetch;if(typeof globalThis.fetch!=="undefined")return globalThis.fetch;if(!J9)try{J9=await Promise.resolve().then(() => (W9(),Q9))}catch(f){throw new Error("Neither native fetch nor node-fetch is available. Please install node-fetch or upgrade to Node.js 18+")}return J9.default}async function f3(f,v){return(await v3())(f,v)}var JQ=f3;V0();var X9=xf("F2cApi",1);class D4{f2cHost="https://f2c-figma-api.yy.com/api";async nodeToCode(f){let v={fileKey:f.fileKey,nodeIds:f.ids,personal_token:f.personalToken||g1.personalToken,option:{cssFramework:"inlinecss",imgFormat:f.imgFormat||"png",scaleSize:f.scaleSize||2},format:"files"};if(f.format==="react-cssmodules")v.option.cssFramework="cssmodules";else if(f.format==="react-tailwind")v.option.cssFramework="tailwindcss";let W=this.opToUrl(`${this.f2cHost}/nodes`,v);return this.fetch(W,"json",f.ideInfo||"other")}async fetch(f,v="json",W){X9.debug("fetch",f,g1.personalToken);try{let X={method:"GET",headers:{"F2c-Api-Platform":`mcp-${W}`}};X9.debug("fetch",f);let Q=await JQ(f,X);if(!Q.ok)throw new Error(`HTTP error! status: ${Q.status}`);return v==="text"?await Q.text():await Q.json()}catch(X){throw X9.error("HTTP error",X),X}}opToUrl(f,v={}){if(Object.keys(v).length===0)return f;let W=new URL(f);for(let[X,Q]of Object.entries(v))if(typeof Q==="object"&&Q!==null)for(let[P,w]of Object.entries(Q))W.searchParams.append(`${X}[${P}]`,w);else W.searchParams.append(X,Q);return W.toString()}}var M4=new D4;KW();V0();var Q3=xf("FigmaRestApi");class O4{figmaHost="https://api.figma.com/v1";async files(f){let v;if(f.ids)v=this.opToUrl(`${this.figmaHost}/files/${f.fileKey}/nodes`,f);else v=this.opToUrl(`${this.figmaHost}/files/${f.fileKey}`,f);return this.fetch(v)}async images(f){let v=this.opToUrl(`${this.figmaHost}/images/${f.fileKey}`,f);return this.fetch(v)}async imageFills(f){let v=this.opToUrl(`${this.figmaHost}/files/${f.fileKey}/images`,f);return this.fetch(v)}async meta(f){let v=this.opToUrl(`${this.figmaHost}/files/${f.fileKey}/meta`,f);return this.fetch(v)}async fetch(f,v="json"){try{let W={method:"GET",headers:{"X-FIGMA-TOKEN":g1.personalToken}},X=await JQ(f,W);if(!X.ok)throw new Error(`HTTP error! status: ${X.status}`);return v==="text"?await X.text():await X.json()}catch(W){throw Q3.error("HTTP error",W),W}}opToUrl(f,v={},W=["fileKey","personalToken"]){if(Object.keys(v).length===0)return f;if(v.personalToken)g1.personalToken=v.personalToken;let X=new URL(f);for(let[Q,P]of Object.entries(v))if(!W.includes(Q))X.searchParams.append(Q,P);return X.toString()}}var H4=new O4;V0();var A4=Hf(q4());n1();var cQ=Hf(require("fs")),f0=Hf(require("path")),P9=Hf(require("fs/promises"));V0();var f1=xf("Downloader");class N4{op;assetsPath="";savePath="";setup(f){if(this.op=f,this.op.localPath)this.assetsPath=f0.default.join(this.op.localPath,"assets"),this.savePath=this.op.localPath}async downloadImage(f,v){let{imgFormat:W}=this.op,X=this.assetsPath;try{if(!cQ.default.existsSync(X))cQ.default.mkdirSync(X,{recursive:!0});let Q=`${v}.${W}`,P=f0.default.join(X,Q),w=await JQ(f);if(!w.ok)throw new Error(`下载失败: ${w.status} ${w.statusText}`);let G=await w.arrayBuffer();return cQ.default.writeFileSync(P,new Uint8Array(G)),f0.default.join(f0.default.basename(X),Q).replace(/\\/g,"/")}catch(Q){throw f1.error("图片下载错误:",Q),Q}}async downLoadImageAndReplaceContent(f){try{let v=/https:\/\/figma-alpha-api\.s3\.us-west-2\.amazonaws\.com\/images\/[a-f0-9-]+/g,W=f.match(v);if(!W)return f;let X=[...new Set(W)],Q=new Map;await Promise.all(X.map(async(w)=>{let G=f0.default.basename(w),B=await this.downloadImage(w,G);Q.set(w,B)}));let P=f;for(let[w,G]of Q.entries()){let B=new RegExp(w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g");P=P.replace(B,G)}return P}catch(v){throw f1.error("内容处理错误:",v),v}}async checkLocalAndDownload(f){if(!this.op.localPath)return;await Promise.all(f.map(async(v)=>{v.content=await this.downLoadImageAndReplaceContent(v.content)}));for(let v of f)try{let W=await this.saveContentToFile(v.content,v.path);f1.debug(`Successfully saved: ${W}`)}catch(W){f1.error(`Failed to save file ${v.path}:`,W)}}async ensureDirectoryExists(f){if(!cQ.default.existsSync(f))f1.debug(`Creating directory: ${f}`),await P9.default.mkdir(f,{recursive:!0})}async saveContentToFile(f,v){try{let W=f0.default.join(this.savePath,v),X=f0.default.dirname(W);if(f1.debug(`Full path: ${W}, directory: ${X}`),await this.ensureDirectoryExists(X),v.endsWith(".html"))f1.debug("Wrapping content with HTML template"),f=this.wrapHtmlContent(f);return f1.debug(`Writing ${f.length} bytes to file`),await P9.default.writeFile(W,f),f1.info(`File saved: ${W}`),W}catch(W){throw f1.error("File save error:",v,W),W}}wrapHtmlContent(f){return f1.debug("Wrapping content with HTML template"),`<!DOCTYPE html>
|
|
25
|
+
<html>
|
|
26
|
+
<head>
|
|
27
|
+
<meta charset="UTF-8">
|
|
28
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
29
|
+
<title>F2C Generated</title>
|
|
30
|
+
</head>
|
|
31
|
+
<body>
|
|
32
|
+
${f}
|
|
33
|
+
</body>
|
|
34
|
+
</html>`}}var Y9=new N4;var W3=xf("V3Tool"),E4="",U4=(f)=>{A4.reportMcpLoader().then((v)=>{E4=v||"other"}),f.tool("get_code","Generate UI code for a given node or the currently selected node in the Figma desktop app. Use the nodeId parameter to specify a node id. If no node id is provided, the currently selected node will be used. If a URL is provided, extract the node id from the URL, for example, if given the URL https://figma.com/design/:fileKey/:fileName?node-id=1-2, the extracted nodeId would be 1:2.",{fileKey:K.string().describe("The Figma file identifier found in the file URL (e.g., https://www.figma.com/file/XXXXXXXXXXXX/). Extract the XXXXXXXXXXXX portion as the fileKey."),ids:K.string().describe('Comma-separated list of Figma node IDs for conversion. To obtain node IDs, select elements in Figma, right-click and select "Copy/Paste as" → "Copy ID".'),personalToken:K.string().optional().describe("Figma personal access token for API authentication.The parameters are not required when the tool is called."),localPath:K.string().optional().describe("Absolute path for asset(e.g., images) and code storage. Directory will be created if non-existent. Path must follow OS-specific format without special character escaping. When this path is set, all code-related static resources are stored in this directory, while other assets (e.g., images) will be saved into the subdirectory named assets under this path."),imgFormat:K.enum(["png","jpg","svg"]).default("png").describe('Export format for image assets: "png" for lossless quality, "jpg" for compressed files, or "svg" for vector graphics.'),scaleSize:K.number().min(1).max(4).default(1).describe("Image export scale factor (1-4). Higher values yield better quality at the cost of larger file sizes.")},async(v)=>{Y9.setup(v);try{let W=await M4.nodeToCode({...v,format:"react-tailwind",ideInfo:E4})||[];if(await Y9.checkLocalAndDownload(W),!W)return{content:[{type:"text",text:"Failed to generate any code. Please check if the provided Figma node IDs are correct or if the nodes can be converted to code."}]};let X=Array.isArray(W)?W:[W];if(X.length===0)return{content:[{type:"text",text:"Conversion succeeded but no files were generated. Please check if the selected Figma nodes contain convertible content."}]};let Q=X.filter((w)=>!w.path.endsWith("/index.scss")).map((w,G)=>`${G+1}. ${w.path}`).join(`
|
|
35
|
+
`);if(v.localPath)return{content:[{type:"text",text:`# Files Saved Locally
|
|
36
|
+
|
|
37
|
+
## Save Location
|
|
38
|
+
${v.localPath}
|
|
39
|
+
|
|
40
|
+
## Generated Files
|
|
41
|
+
${Q}. Convert the Tailwind to vanilla CSS if not already used in the codebase. Do not install any dependencies.`}]};return{content:[{type:"text",text:`${X.filter((w)=>w.path.endsWith(".tsx")).map((w)=>w.content).join(`
|
|
42
|
+
|
|
43
|
+
`)} Convert the Tailwind to vanilla CSS if not already used in the codebase. Do not install any dependencies.`}]}}catch(W){return W3.error("Tool execution error:",W),{content:[{type:"text",text:`Error: ${W.message}`}]}}}),f.tool("get_image","Generate an image for a given node or the currently selected node in the Figma desktop app. Use the nodeId parameter to specify a node id. If no node id is provided, the currently selected node will be used. If a URL is provided, extract the node id from the URL, for example, if given the URL https://figma.com/design/:fileKey/:fileName?node-id=1-2, the extracted nodeId would be 1:2. Also export Figma design images for visual verification and design fidelity validation. Essential for comparing generated code output against original designs, ensuring pixel-perfect implementation and catching visual discrepancies during the design-to-code process.",{fileKey:K.string().describe("Figma file identifier from the URL for accessing the design source"),ids:K.string().describe('Comma-separated node IDs to export. Use "Copy ID" from Figma context menu to get precise element references for comparison'),format:K.enum(["jpg","png","svg","pdf"]).optional().describe('Export format for verification: "png" for pixel-perfect comparison with transparency, "jpg" for quick previews, "svg" for scalable reference, "pdf" for print validation'),scale:K.number().optional().describe("Scale factor (1-4x) for high-resolution comparison. Use 2x+ for detailed fidelity checks on retina displays"),svg_include_id:K.boolean().optional().describe("Include element IDs in SVG for precise element mapping during code validation"),svg_simplify_stroke:K.boolean().optional().describe("Simplify stroke paths for cleaner reference images during visual comparison"),use_absolute_bounds:K.boolean().optional().describe("Use absolute positioning for accurate layout verification against implemented code"),version:K.string().optional().describe("Specific design version for consistent comparison baseline"),personalToken:K.string().optional().describe("Figma personal access token for authenticated access to design files")},async(v)=>{try{let W=await H4.images(v);return{content:[{type:"text",text:JSON.stringify(W)}]}}catch(W){return{content:[{type:"text",text:`Error: ${W.message}`}]}}})};var FW=new uJ({name:g1.serverName,version:g1.serverVersion},{capabilities:{logging:{}}});EY(FW);U4(FW);var G9=Hf(require("node:process"));IQ();class w9{append(f){this._buffer=this._buffer?Buffer.concat([this._buffer,f]):f}readMessage(){if(!this._buffer)return null;let f=this._buffer.indexOf(`
|
|
44
|
+
`);if(f===-1)return null;let v=this._buffer.toString("utf8",0,f).replace(/\r$/,"");return this._buffer=this._buffer.subarray(f+1),J3(v)}clear(){this._buffer=void 0}}function J3(f){return j6.parse(JSON.parse(f))}function j4(f){return JSON.stringify(f)+`
|
|
45
|
+
`}class z9{constructor(f=G9.default.stdin,v=G9.default.stdout){this._stdin=f,this._stdout=v,this._readBuffer=new w9,this._started=!1,this._ondata=(W)=>{this._readBuffer.append(W),this.processReadBuffer()},this._onerror=(W)=>{var X;(X=this.onerror)===null||X===void 0||X.call(this,W)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){var f,v;while(!0)try{let W=this._readBuffer.readMessage();if(W===null)break;(f=this.onmessage)===null||f===void 0||f.call(this,W)}catch(W){(v=this.onerror)===null||v===void 0||v.call(this,W)}}async close(){var f;if(this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),(f=this.onclose)===null||f===void 0||f.call(this)}send(f){return new Promise((v)=>{let W=j4(f);if(this._stdout.write(W))v();else this._stdout.once("drain",v)})}}V0();var X3=xf("StdioTransport");async function F4(f){try{let v=new z9;await f.connect(v)}catch(v){X3.info(JSON.stringify({jsonrpc:"2.0",id:null,error:{code:-32000,message:`Server startup failed: ${v.message}`}})),process.exit(1)}}F4(FW);
|
|
46
|
+
|
|
47
|
+
//# debugId=597DD9CE2279A33E64756E2164756E21
|
|
515
48
|
//# sourceMappingURL=cli.js.map
|