logseq-mcp 0.2.0 → 0.3.1

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.
Files changed (2) hide show
  1. package/dist/index.js +180 -81
  2. package/package.json +9 -11
package/dist/index.js CHANGED
@@ -1,45 +1,78 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as i4}from"node:module";var l4=Object.create;var{getPrototypeOf:n4,defineProperty:G2,getOwnPropertyNames:u4}=Object;var c4=Object.prototype.hasOwnProperty;var p4=($,X,W)=>{W=$!=null?l4(n4($)):{};let J=X||!$||!$.__esModule?G2(W,"default",{value:$,enumerable:!0}):W;for(let Y of u4($))if(!c4.call(J,Y))G2(J,Y,{get:()=>$[Y],enumerable:!0});return J};var Q2=($,X)=>()=>(X||$((X={exports:{}}).exports,X),X.exports);var $1=i4(import.meta.url);var O4=Q2((m8,e$)=>{e$.exports={name:"dotenv",version:"16.4.7",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var K4=Q2((l8,B0)=>{var s1=$1("fs"),e1=$1("path"),$3=$1("os"),X3=$1("crypto"),W3=O4(),$2=W3.version,J3=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Y3($){let X={},W=$.toString();W=W.replace(/\r\n?/mg,`
3
- `);let J;while((J=J3.exec(W))!=null){let Y=J[1],G=J[2]||"";G=G.trim();let H=G[0];if(G=G.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),H==='"')G=G.replace(/\\n/g,`
4
- `),G=G.replace(/\\r/g,"\r");X[Y]=G}return X}function G3($){let X=U4($),W=k.configDotenv({path:X});if(!W.parsed){let H=new Error(`MISSING_DATA: Cannot parse ${X} for an unknown reason`);throw H.code="MISSING_DATA",H}let J=z4($).split(","),Y=J.length,G;for(let H=0;H<Y;H++)try{let w=J[H].trim(),B=w3(W,w);G=k.decrypt(B.ciphertext,B.key);break}catch(w){if(H+1>=Y)throw w}return k.parse(G)}function Q3($){console.log(`[dotenv@${$2}][INFO] ${$}`)}function H3($){console.log(`[dotenv@${$2}][WARN] ${$}`)}function C1($){console.log(`[dotenv@${$2}][DEBUG] ${$}`)}function z4($){if($&&$.DOTENV_KEY&&$.DOTENV_KEY.length>0)return $.DOTENV_KEY;if(process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0)return process.env.DOTENV_KEY;return""}function w3($,X){let W;try{W=new URL(X)}catch(w){if(w.code==="ERR_INVALID_URL"){let B=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw B.code="INVALID_DOTENV_KEY",B}throw w}let J=W.password;if(!J){let w=new Error("INVALID_DOTENV_KEY: Missing key part");throw w.code="INVALID_DOTENV_KEY",w}let Y=W.searchParams.get("environment");if(!Y){let w=new Error("INVALID_DOTENV_KEY: Missing environment part");throw w.code="INVALID_DOTENV_KEY",w}let G=`DOTENV_VAULT_${Y.toUpperCase()}`,H=$.parsed[G];if(!H){let w=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${G} in your .env.vault file.`);throw w.code="NOT_FOUND_DOTENV_ENVIRONMENT",w}return{ciphertext:H,key:J}}function U4($){let X=null;if($&&$.path&&$.path.length>0)if(Array.isArray($.path)){for(let W of $.path)if(s1.existsSync(W))X=W.endsWith(".vault")?W:`${W}.vault`}else X=$.path.endsWith(".vault")?$.path:`${$.path}.vault`;else X=e1.resolve(process.cwd(),".env.vault");if(s1.existsSync(X))return X;return null}function A4($){return $[0]==="~"?e1.join($3.homedir(),$.slice(1)):$}function B3($){Q3("Loading env from encrypted .env.vault");let X=k._parseVault($),W=process.env;if($&&$.processEnv!=null)W=$.processEnv;return k.populate(W,X,$),{parsed:X}}function D3($){let X=e1.resolve(process.cwd(),".env"),W="utf8",J=Boolean($&&$.debug);if($&&$.encoding)W=$.encoding;else if(J)C1("No encoding is specified. UTF-8 is used by default");let Y=[X];if($&&$.path)if(!Array.isArray($.path))Y=[A4($.path)];else{Y=[];for(let B of $.path)Y.push(A4(B))}let G,H={};for(let B of Y)try{let D=k.parse(s1.readFileSync(B,{encoding:W}));k.populate(H,D,$)}catch(D){if(J)C1(`Failed to load ${B} ${D.message}`);G=D}let w=process.env;if($&&$.processEnv!=null)w=$.processEnv;if(k.populate(w,H,$),G)return{parsed:H,error:G};else return{parsed:H}}function M3($){if(z4($).length===0)return k.configDotenv($);let X=U4($);if(!X)return H3(`You set DOTENV_KEY but you are missing a .env.vault file at ${X}. Did you forget to build it?`),k.configDotenv($);return k._configVault($)}function V3($,X){let W=Buffer.from(X.slice(-64),"hex"),J=Buffer.from($,"base64"),Y=J.subarray(0,12),G=J.subarray(-16);J=J.subarray(12,-16);try{let H=X3.createDecipheriv("aes-256-gcm",W,Y);return H.setAuthTag(G),`${H.update(J)}${H.final()}`}catch(H){let w=H instanceof RangeError,B=H.message==="Invalid key length",D=H.message==="Unsupported state or unable to authenticate data";if(w||B){let j=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw j.code="INVALID_DOTENV_KEY",j}else if(D){let j=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw j.code="DECRYPTION_FAILED",j}else throw H}}function j3($,X,W={}){let J=Boolean(W&&W.debug),Y=Boolean(W&&W.override);if(typeof X!=="object"){let G=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw G.code="OBJECT_REQUIRED",G}for(let G of Object.keys(X))if(Object.prototype.hasOwnProperty.call($,G)){if(Y===!0)$[G]=X[G];if(J)if(Y===!0)C1(`"${G}" is already defined and WAS overwritten`);else C1(`"${G}" is already defined and was NOT overwritten`)}else $[G]=X[G]}var k={configDotenv:D3,_configVault:B3,_parseVault:G3,config:M3,decrypt:V3,parse:Y3,populate:j3};l8.configDotenv=k.configDotenv;l8._configVault=k._configVault;l8._parseVault=k._parseVault;l8.config=k.config;l8.decrypt=k.decrypt;l8.parse=k.parse;l8.populate=k.populate;B0.exports=k});var _;(function($){$.assertEqual=(Y)=>Y;function X(Y){}$.assertIs=X;function W(Y){throw new Error}$.assertNever=W,$.arrayToEnum=(Y)=>{let G={};for(let H of Y)G[H]=H;return G},$.getValidEnumValues=(Y)=>{let G=$.objectKeys(Y).filter((w)=>typeof Y[Y[w]]!=="number"),H={};for(let w of G)H[w]=Y[w];return $.objectValues(H)},$.objectValues=(Y)=>{return $.objectKeys(Y).map(function(G){return Y[G]})},$.objectKeys=typeof Object.keys==="function"?(Y)=>Object.keys(Y):(Y)=>{let G=[];for(let H in Y)if(Object.prototype.hasOwnProperty.call(Y,H))G.push(H);return G},$.find=(Y,G)=>{for(let H of Y)if(G(H))return H;return},$.isInteger=typeof Number.isInteger==="function"?(Y)=>Number.isInteger(Y):(Y)=>typeof Y==="number"&&isFinite(Y)&&Math.floor(Y)===Y;function J(Y,G=" | "){return Y.map((H)=>typeof H==="string"?`'${H}'`:H).join(G)}$.joinValues=J,$.jsonStringifyReplacer=(Y,G)=>{if(typeof G==="bigint")return G.toString();return G}})(_||(_={}));var P1;(function($){$.mergeShapes=(X,W)=>{return{...X,...W}}})(P1||(P1={}));var A=_.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Q0=($)=>{switch(typeof $){case"undefined":return A.undefined;case"string":return A.string;case"number":return isNaN($)?A.nan:A.number;case"boolean":return A.boolean;case"function":return A.function;case"bigint":return A.bigint;case"symbol":return A.symbol;case"object":if(Array.isArray($))return A.array;if($===null)return A.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return A.promise;if(typeof Map!=="undefined"&&$ instanceof Map)return A.map;if(typeof Set!=="undefined"&&$ instanceof Set)return A.set;if(typeof Date!=="undefined"&&$ instanceof Date)return A.date;return A.object;default:return A.unknown}},M=_.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"]),d4=($)=>{return JSON.stringify($,null,2).replace(/"([^"]+)":/g,"$1:")};class n extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(W)=>{this.issues=[...this.issues,W]},this.addIssues=(W=[])=>{this.issues=[...this.issues,...W]};let X=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,X);else this.__proto__=X;this.name="ZodError",this.issues=$}format($){let X=$||function(Y){return Y.message},W={_errors:[]},J=(Y)=>{for(let G of Y.issues)if(G.code==="invalid_union")G.unionErrors.map(J);else if(G.code==="invalid_return_type")J(G.returnTypeError);else if(G.code==="invalid_arguments")J(G.argumentsError);else if(G.path.length===0)W._errors.push(X(G));else{let H=W,w=0;while(w<G.path.length){let B=G.path[w];if(w!==G.path.length-1)H[B]=H[B]||{_errors:[]};else H[B]=H[B]||{_errors:[]},H[B]._errors.push(X(G));H=H[B],w++}}};return J(this),W}static assert($){if(!($ instanceof n))throw new Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(X)=>X.message){let X={},W=[];for(let J of this.issues)if(J.path.length>0)X[J.path[0]]=X[J.path[0]]||[],X[J.path[0]].push($(J));else W.push($(J));return{formErrors:W,fieldErrors:X}}get formErrors(){return this.flatten()}}n.create=($)=>{return new n($)};var _0=($,X)=>{let W;switch($.code){case M.invalid_type:if($.received===A.undefined)W="Required";else W=`Expected ${$.expected}, received ${$.received}`;break;case M.invalid_literal:W=`Invalid literal value, expected ${JSON.stringify($.expected,_.jsonStringifyReplacer)}`;break;case M.unrecognized_keys:W=`Unrecognized key(s) in object: ${_.joinValues($.keys,", ")}`;break;case M.invalid_union:W="Invalid input";break;case M.invalid_union_discriminator:W=`Invalid discriminator value. Expected ${_.joinValues($.options)}`;break;case M.invalid_enum_value:W=`Invalid enum value. Expected ${_.joinValues($.options)}, received '${$.received}'`;break;case M.invalid_arguments:W="Invalid function arguments";break;case M.invalid_return_type:W="Invalid function return type";break;case M.invalid_date:W="Invalid date";break;case M.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(W=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")W=`${W} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)W=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)W=`Invalid input: must end with "${$.validation.endsWith}"`;else _.assertNever($.validation);else if($.validation!=="regex")W=`Invalid ${$.validation}`;else W="Invalid";break;case M.too_small:if($.type==="array")W=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")W=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")W=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")W=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else W="Invalid input";break;case M.too_big:if($.type==="array")W=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")W=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")W=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")W=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")W=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else W="Invalid input";break;case M.custom:W="Invalid input";break;case M.invalid_intersection_types:W="Intersection results could not be merged";break;case M.not_multiple_of:W=`Number must be a multiple of ${$.multipleOf}`;break;case M.not_finite:W="Number must be finite";break;default:W=X.defaultError,_.assertNever($)}return{message:W}},D2=_0;function o4($){D2=$}function X1(){return D2}var W1=($)=>{let{data:X,path:W,errorMaps:J,issueData:Y}=$,G=[...W,...Y.path||[]],H={...Y,path:G};if(Y.message!==void 0)return{...Y,path:G,message:Y.message};let w="",B=J.filter((D)=>!!D).slice().reverse();for(let D of B)w=D(H,{data:X,defaultError:w}).message;return{...Y,path:G,message:w}},r4=[];function O($,X){let W=X1(),J=W1({issueData:X,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,W,W===_0?void 0:_0].filter((Y)=>!!Y)});$.common.issues.push(J)}class g{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,X){let W=[];for(let J of X){if(J.status==="aborted")return S;if(J.status==="dirty")$.dirty();W.push(J.value)}return{status:$.value,value:W}}static async mergeObjectAsync($,X){let W=[];for(let J of X){let Y=await J.key,G=await J.value;W.push({key:Y,value:G})}return g.mergeObjectSync($,W)}static mergeObjectSync($,X){let W={};for(let J of X){let{key:Y,value:G}=J;if(Y.status==="aborted")return S;if(G.status==="aborted")return S;if(Y.status==="dirty")$.dirty();if(G.status==="dirty")$.dirty();if(Y.value!=="__proto__"&&(typeof G.value!=="undefined"||J.alwaysSet))W[Y.value]=G.value}return{status:$.value,value:W}}}var S=Object.freeze({status:"aborted"}),R0=($)=>({status:"dirty",value:$}),Z=($)=>({status:"valid",value:$}),T1=($)=>$.status==="aborted",k1=($)=>$.status==="dirty",A0=($)=>$.status==="valid",Z0=($)=>typeof Promise!=="undefined"&&$ instanceof Promise;function J1($,X,W,J){if(W==="a"&&!J)throw new TypeError("Private accessor was defined without a getter");if(typeof X==="function"?$!==X||!J:!X.has($))throw new TypeError("Cannot read private member from an object whose class did not declare it");return W==="m"?J:W==="a"?J.call($):J?J.value:X.get($)}function M2($,X,W,J,Y){if(J==="m")throw new TypeError("Private method is not writable");if(J==="a"&&!Y)throw new TypeError("Private accessor was defined without a setter");if(typeof X==="function"?$!==X||!Y:!X.has($))throw new TypeError("Cannot write private member to an object whose class did not declare it");return J==="a"?Y.call($,W):Y?Y.value=W:X.set($,W),W}var U;(function($){$.errToObj=(X)=>typeof X==="string"?{message:X}:X||{},$.toString=(X)=>typeof X==="string"?X:X===null||X===void 0?void 0:X.message})(U||(U={}));var g0,y0;class a{constructor($,X,W,J){this._cachedPath=[],this.parent=$,this.data=X,this._path=W,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}}var H2=($,X)=>{if(A0(X))return{success:!0,data:X.value};else{if(!$.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 n($.common.issues);return this._error=W,this._error}}}};function q($){if(!$)return{};let{errorMap:X,invalid_type_error:W,required_error:J,description:Y}=$;if(X&&(W||J))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(X)return{errorMap:X,description:Y};return{errorMap:(H,w)=>{var B,D;let{message:j}=$;if(H.code==="invalid_enum_value")return{message:j!==null&&j!==void 0?j:w.defaultError};if(typeof w.data==="undefined")return{message:(B=j!==null&&j!==void 0?j:J)!==null&&B!==void 0?B:w.defaultError};if(H.code!=="invalid_type")return{message:w.defaultError};return{message:(D=j!==null&&j!==void 0?j:W)!==null&&D!==void 0?D:w.defaultError}},description:Y}}class N{get description(){return this._def.description}_getType($){return Q0($.data)}_getOrReturnCtx($,X){return X||{common:$.parent.common,data:$.data,parsedType:Q0($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new g,ctx:{common:$.parent.common,data:$.data,parsedType:Q0($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let X=this._parse($);if(Z0(X))throw new Error("Synchronous parse encountered promise.");return X}_parseAsync($){let X=this._parse($);return Promise.resolve(X)}parse($,X){let W=this.safeParse($,X);if(W.success)return W.data;throw W.error}safeParse($,X){var W;let J={common:{issues:[],async:(W=X===null||X===void 0?void 0:X.async)!==null&&W!==void 0?W:!1,contextualErrorMap:X===null||X===void 0?void 0:X.errorMap},path:(X===null||X===void 0?void 0:X.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:Q0($)},Y=this._parseSync({data:$,path:J.path,parent:J});return H2(J,Y)}"~validate"($){var X,W;let J={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:Q0($)};if(!this["~standard"].async)try{let Y=this._parseSync({data:$,path:[],parent:J});return A0(Y)?{value:Y.value}:{issues:J.common.issues}}catch(Y){if((W=(X=Y===null||Y===void 0?void 0:Y.message)===null||X===void 0?void 0:X.toLowerCase())===null||W===void 0?void 0:W.includes("encountered"))this["~standard"].async=!0;J.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:J}).then((Y)=>A0(Y)?{value:Y.value}:{issues:J.common.issues})}async parseAsync($,X){let W=await this.safeParseAsync($,X);if(W.success)return W.data;throw W.error}async safeParseAsync($,X){let W={common:{issues:[],contextualErrorMap:X===null||X===void 0?void 0:X.errorMap,async:!0},path:(X===null||X===void 0?void 0:X.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:Q0($)},J=this._parse({data:$,path:W.path,parent:W}),Y=await(Z0(J)?J:Promise.resolve(J));return H2(W,Y)}refine($,X){let W=(J)=>{if(typeof X==="string"||typeof X==="undefined")return{message:X};else if(typeof X==="function")return X(J);else return X};return this._refinement((J,Y)=>{let G=$(J),H=()=>Y.addIssue({code:M.custom,...W(J)});if(typeof Promise!=="undefined"&&G instanceof Promise)return G.then((w)=>{if(!w)return H(),!1;else return!0});if(!G)return H(),!1;else return!0})}refinement($,X){return this._refinement((W,J)=>{if(!$(W))return J.addIssue(typeof X==="function"?X(W,J):X),!1;else return!0})}_refinement($){return new i({schema:this,typeName:V.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,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:(X)=>this["~validate"](X)}}optional(){return u.create(this,this._def)}nullable(){return H0.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return r.create(this)}promise(){return F0.create(this,this._def)}or($){return I0.create([this,$],this._def)}and($){return b0.create(this,$,this._def)}transform($){return new i({...q(this._def),schema:this,typeName:V.ZodEffects,effect:{type:"transform",transform:$}})}default($){let X=typeof $==="function"?$:()=>$;return new k0({...q(this._def),innerType:this,defaultValue:X,typeName:V.ZodDefault})}brand(){return new G1({typeName:V.ZodBranded,type:this,...q(this._def)})}catch($){let X=typeof $==="function"?$:()=>$;return new x0({...q(this._def),innerType:this,catchValue:X,typeName:V.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return p0.create(this,$)}readonly(){return h0.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var a4=/^c[^\s-]{8,}$/i,t4=/^[0-9a-z]+$/,s4=/^[0-9A-HJKMNP-TV-Z]{26}$/i,e4=/^[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,$6=/^[a-z0-9_-]{21}$/i,X6=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,W6=/^[-+]?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)?)??$/,J6=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Y6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",v1,G6=/^(?:(?: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])$/,Q6=/^(?:(?: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])$/,H6=/^(([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]))$/,w6=/^(([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])$/,B6=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,D6=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,V2="((\\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])))",M6=new RegExp(`^${V2}$`);function j2($){let X="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";if($.precision)X=`${X}\\.\\d{${$.precision}}`;else if($.precision==null)X=`${X}(\\.\\d+)?`;return X}function V6($){return new RegExp(`^${j2($)}$`)}function O2($){let X=`${V2}T${j2($)}`,W=[];if(W.push($.local?"Z?":"Z"),$.offset)W.push("([+-]\\d{2}:?\\d{2})");return X=`${X}(${W.join("|")})`,new RegExp(`^${X}$`)}function j6($,X){if((X==="v4"||!X)&&G6.test($))return!0;if((X==="v6"||!X)&&H6.test($))return!0;return!1}function O6($,X){if(!X6.test($))return!1;try{let[W]=$.split("."),J=W.replace(/-/g,"+").replace(/_/g,"/").padEnd(W.length+(4-W.length%4)%4,"="),Y=JSON.parse(atob(J));if(typeof Y!=="object"||Y===null)return!1;if(!Y.typ||!Y.alg)return!1;if(X&&Y.alg!==X)return!1;return!0}catch(W){return!1}}function A6($,X){if((X==="v4"||!X)&&Q6.test($))return!0;if((X==="v6"||!X)&&w6.test($))return!0;return!1}class o extends N{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==A.string){let Y=this._getOrReturnCtx($);return O(Y,{code:M.invalid_type,expected:A.string,received:Y.parsedType}),S}let W=new g,J=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if($.data.length<Y.value)J=this._getOrReturnCtx($,J),O(J,{code:M.too_small,minimum:Y.value,type:"string",inclusive:!0,exact:!1,message:Y.message}),W.dirty()}else if(Y.kind==="max"){if($.data.length>Y.value)J=this._getOrReturnCtx($,J),O(J,{code:M.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!1,message:Y.message}),W.dirty()}else if(Y.kind==="length"){let G=$.data.length>Y.value,H=$.data.length<Y.value;if(G||H){if(J=this._getOrReturnCtx($,J),G)O(J,{code:M.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});else if(H)O(J,{code:M.too_small,minimum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});W.dirty()}}else if(Y.kind==="email"){if(!J6.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"email",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="emoji"){if(!v1)v1=new RegExp(Y6,"u");if(!v1.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"emoji",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="uuid"){if(!e4.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"uuid",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="nanoid"){if(!$6.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"nanoid",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="cuid"){if(!a4.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"cuid",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="cuid2"){if(!t4.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"cuid2",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="ulid"){if(!s4.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"ulid",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="url")try{new URL($.data)}catch(G){J=this._getOrReturnCtx($,J),O(J,{validation:"url",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="regex"){if(Y.regex.lastIndex=0,!Y.regex.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"regex",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="trim")$.data=$.data.trim();else if(Y.kind==="includes"){if(!$.data.includes(Y.value,Y.position))J=this._getOrReturnCtx($,J),O(J,{code:M.invalid_string,validation:{includes:Y.value,position:Y.position},message:Y.message}),W.dirty()}else if(Y.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(Y.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(Y.kind==="startsWith"){if(!$.data.startsWith(Y.value))J=this._getOrReturnCtx($,J),O(J,{code:M.invalid_string,validation:{startsWith:Y.value},message:Y.message}),W.dirty()}else if(Y.kind==="endsWith"){if(!$.data.endsWith(Y.value))J=this._getOrReturnCtx($,J),O(J,{code:M.invalid_string,validation:{endsWith:Y.value},message:Y.message}),W.dirty()}else if(Y.kind==="datetime"){if(!O2(Y).test($.data))J=this._getOrReturnCtx($,J),O(J,{code:M.invalid_string,validation:"datetime",message:Y.message}),W.dirty()}else if(Y.kind==="date"){if(!M6.test($.data))J=this._getOrReturnCtx($,J),O(J,{code:M.invalid_string,validation:"date",message:Y.message}),W.dirty()}else if(Y.kind==="time"){if(!V6(Y).test($.data))J=this._getOrReturnCtx($,J),O(J,{code:M.invalid_string,validation:"time",message:Y.message}),W.dirty()}else if(Y.kind==="duration"){if(!W6.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"duration",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="ip"){if(!j6($.data,Y.version))J=this._getOrReturnCtx($,J),O(J,{validation:"ip",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="jwt"){if(!O6($.data,Y.alg))J=this._getOrReturnCtx($,J),O(J,{validation:"jwt",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="cidr"){if(!A6($.data,Y.version))J=this._getOrReturnCtx($,J),O(J,{validation:"cidr",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="base64"){if(!B6.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"base64",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="base64url"){if(!D6.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"base64url",code:M.invalid_string,message:Y.message}),W.dirty()}else _.assertNever(Y);return{status:W.value,value:$.data}}_regex($,X,W){return this.refinement((J)=>$.test(J),{validation:X,code:M.invalid_string,...U.errToObj(W)})}_addCheck($){return new o({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...U.errToObj($)})}url($){return this._addCheck({kind:"url",...U.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...U.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...U.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...U.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...U.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...U.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...U.errToObj($)})}base64($){return this._addCheck({kind:"base64",...U.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...U.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...U.errToObj($)})}ip($){return this._addCheck({kind:"ip",...U.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...U.errToObj($)})}datetime($){var X,W;if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof($===null||$===void 0?void 0:$.precision)==="undefined"?null:$===null||$===void 0?void 0:$.precision,offset:(X=$===null||$===void 0?void 0:$.offset)!==null&&X!==void 0?X:!1,local:(W=$===null||$===void 0?void 0:$.local)!==null&&W!==void 0?W:!1,...U.errToObj($===null||$===void 0?void 0:$.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof($===null||$===void 0?void 0:$.precision)==="undefined"?null:$===null||$===void 0?void 0:$.precision,...U.errToObj($===null||$===void 0?void 0:$.message)})}duration($){return this._addCheck({kind:"duration",...U.errToObj($)})}regex($,X){return this._addCheck({kind:"regex",regex:$,...U.errToObj(X)})}includes($,X){return this._addCheck({kind:"includes",value:$,position:X===null||X===void 0?void 0:X.position,...U.errToObj(X===null||X===void 0?void 0:X.message)})}startsWith($,X){return this._addCheck({kind:"startsWith",value:$,...U.errToObj(X)})}endsWith($,X){return this._addCheck({kind:"endsWith",value:$,...U.errToObj(X)})}min($,X){return this._addCheck({kind:"min",value:$,...U.errToObj(X)})}max($,X){return this._addCheck({kind:"max",value:$,...U.errToObj(X)})}length($,X){return this._addCheck({kind:"length",value:$,...U.errToObj(X)})}nonempty($){return this.min(1,U.errToObj($))}trim(){return new o({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new o({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new o({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let X of this._def.checks)if(X.kind==="min"){if($===null||X.value>$)$=X.value}return $}get maxLength(){let $=null;for(let X of this._def.checks)if(X.kind==="max"){if($===null||X.value<$)$=X.value}return $}}o.create=($)=>{var X;return new o({checks:[],typeName:V.ZodString,coerce:(X=$===null||$===void 0?void 0:$.coerce)!==null&&X!==void 0?X:!1,...q($)})};function z6($,X){let W=($.toString().split(".")[1]||"").length,J=(X.toString().split(".")[1]||"").length,Y=W>J?W:J,G=parseInt($.toFixed(Y).replace(".","")),H=parseInt(X.toFixed(Y).replace(".",""));return G%H/Math.pow(10,Y)}class M0 extends N{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==A.number){let Y=this._getOrReturnCtx($);return O(Y,{code:M.invalid_type,expected:A.number,received:Y.parsedType}),S}let W=void 0,J=new g;for(let Y of this._def.checks)if(Y.kind==="int"){if(!_.isInteger($.data))W=this._getOrReturnCtx($,W),O(W,{code:M.invalid_type,expected:"integer",received:"float",message:Y.message}),J.dirty()}else if(Y.kind==="min"){if(Y.inclusive?$.data<Y.value:$.data<=Y.value)W=this._getOrReturnCtx($,W),O(W,{code:M.too_small,minimum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),J.dirty()}else if(Y.kind==="max"){if(Y.inclusive?$.data>Y.value:$.data>=Y.value)W=this._getOrReturnCtx($,W),O(W,{code:M.too_big,maximum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),J.dirty()}else if(Y.kind==="multipleOf"){if(z6($.data,Y.value)!==0)W=this._getOrReturnCtx($,W),O(W,{code:M.not_multiple_of,multipleOf:Y.value,message:Y.message}),J.dirty()}else if(Y.kind==="finite"){if(!Number.isFinite($.data))W=this._getOrReturnCtx($,W),O(W,{code:M.not_finite,message:Y.message}),J.dirty()}else _.assertNever(Y);return{status:J.value,value:$.data}}gte($,X){return this.setLimit("min",$,!0,U.toString(X))}gt($,X){return this.setLimit("min",$,!1,U.toString(X))}lte($,X){return this.setLimit("max",$,!0,U.toString(X))}lt($,X){return this.setLimit("max",$,!1,U.toString(X))}setLimit($,X,W,J){return new M0({...this._def,checks:[...this._def.checks,{kind:$,value:X,inclusive:W,message:U.toString(J)}]})}_addCheck($){return new M0({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:U.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:U.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:U.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:U.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:U.toString($)})}multipleOf($,X){return this._addCheck({kind:"multipleOf",value:$,message:U.toString(X)})}finite($){return this._addCheck({kind:"finite",message:U.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:U.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:U.toString($)})}get minValue(){let $=null;for(let X of this._def.checks)if(X.kind==="min"){if($===null||X.value>$)$=X.value}return $}get maxValue(){let $=null;for(let X of this._def.checks)if(X.kind==="max"){if($===null||X.value<$)$=X.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&_.isInteger($.value))}get isFinite(){let $=null,X=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(X===null||W.value>X)X=W.value}else if(W.kind==="max"){if($===null||W.value<$)$=W.value}return Number.isFinite(X)&&Number.isFinite($)}}M0.create=($)=>{return new M0({checks:[],typeName:V.ZodNumber,coerce:($===null||$===void 0?void 0:$.coerce)||!1,...q($)})};class V0 extends N{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch(Y){return this._getInvalidInput($)}if(this._getType($)!==A.bigint)return this._getInvalidInput($);let W=void 0,J=new g;for(let Y of this._def.checks)if(Y.kind==="min"){if(Y.inclusive?$.data<Y.value:$.data<=Y.value)W=this._getOrReturnCtx($,W),O(W,{code:M.too_small,type:"bigint",minimum:Y.value,inclusive:Y.inclusive,message:Y.message}),J.dirty()}else if(Y.kind==="max"){if(Y.inclusive?$.data>Y.value:$.data>=Y.value)W=this._getOrReturnCtx($,W),O(W,{code:M.too_big,type:"bigint",maximum:Y.value,inclusive:Y.inclusive,message:Y.message}),J.dirty()}else if(Y.kind==="multipleOf"){if($.data%Y.value!==BigInt(0))W=this._getOrReturnCtx($,W),O(W,{code:M.not_multiple_of,multipleOf:Y.value,message:Y.message}),J.dirty()}else _.assertNever(Y);return{status:J.value,value:$.data}}_getInvalidInput($){let X=this._getOrReturnCtx($);return O(X,{code:M.invalid_type,expected:A.bigint,received:X.parsedType}),S}gte($,X){return this.setLimit("min",$,!0,U.toString(X))}gt($,X){return this.setLimit("min",$,!1,U.toString(X))}lte($,X){return this.setLimit("max",$,!0,U.toString(X))}lt($,X){return this.setLimit("max",$,!1,U.toString(X))}setLimit($,X,W,J){return new V0({...this._def,checks:[...this._def.checks,{kind:$,value:X,inclusive:W,message:U.toString(J)}]})}_addCheck($){return new V0({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:U.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:U.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:U.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:U.toString($)})}multipleOf($,X){return this._addCheck({kind:"multipleOf",value:$,message:U.toString(X)})}get minValue(){let $=null;for(let X of this._def.checks)if(X.kind==="min"){if($===null||X.value>$)$=X.value}return $}get maxValue(){let $=null;for(let X of this._def.checks)if(X.kind==="max"){if($===null||X.value<$)$=X.value}return $}}V0.create=($)=>{var X;return new V0({checks:[],typeName:V.ZodBigInt,coerce:(X=$===null||$===void 0?void 0:$.coerce)!==null&&X!==void 0?X:!1,...q($)})};class E0 extends N{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==A.boolean){let W=this._getOrReturnCtx($);return O(W,{code:M.invalid_type,expected:A.boolean,received:W.parsedType}),S}return Z($.data)}}E0.create=($)=>{return new E0({typeName:V.ZodBoolean,coerce:($===null||$===void 0?void 0:$.coerce)||!1,...q($)})};class z0 extends N{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==A.date){let Y=this._getOrReturnCtx($);return O(Y,{code:M.invalid_type,expected:A.date,received:Y.parsedType}),S}if(isNaN($.data.getTime())){let Y=this._getOrReturnCtx($);return O(Y,{code:M.invalid_date}),S}let W=new g,J=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if($.data.getTime()<Y.value)J=this._getOrReturnCtx($,J),O(J,{code:M.too_small,message:Y.message,inclusive:!0,exact:!1,minimum:Y.value,type:"date"}),W.dirty()}else if(Y.kind==="max"){if($.data.getTime()>Y.value)J=this._getOrReturnCtx($,J),O(J,{code:M.too_big,message:Y.message,inclusive:!0,exact:!1,maximum:Y.value,type:"date"}),W.dirty()}else _.assertNever(Y);return{status:W.value,value:new Date($.data.getTime())}}_addCheck($){return new z0({...this._def,checks:[...this._def.checks,$]})}min($,X){return this._addCheck({kind:"min",value:$.getTime(),message:U.toString(X)})}max($,X){return this._addCheck({kind:"max",value:$.getTime(),message:U.toString(X)})}get minDate(){let $=null;for(let X of this._def.checks)if(X.kind==="min"){if($===null||X.value>$)$=X.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let X of this._def.checks)if(X.kind==="max"){if($===null||X.value<$)$=X.value}return $!=null?new Date($):null}}z0.create=($)=>{return new z0({checks:[],coerce:($===null||$===void 0?void 0:$.coerce)||!1,typeName:V.ZodDate,...q($)})};class m0 extends N{_parse($){if(this._getType($)!==A.symbol){let W=this._getOrReturnCtx($);return O(W,{code:M.invalid_type,expected:A.symbol,received:W.parsedType}),S}return Z($.data)}}m0.create=($)=>{return new m0({typeName:V.ZodSymbol,...q($)})};class f0 extends N{_parse($){if(this._getType($)!==A.undefined){let W=this._getOrReturnCtx($);return O(W,{code:M.invalid_type,expected:A.undefined,received:W.parsedType}),S}return Z($.data)}}f0.create=($)=>{return new f0({typeName:V.ZodUndefined,...q($)})};class C0 extends N{_parse($){if(this._getType($)!==A.null){let W=this._getOrReturnCtx($);return O(W,{code:M.invalid_type,expected:A.null,received:W.parsedType}),S}return Z($.data)}}C0.create=($)=>{return new C0({typeName:V.ZodNull,...q($)})};class U0 extends N{constructor(){super(...arguments);this._any=!0}_parse($){return Z($.data)}}U0.create=($)=>{return new U0({typeName:V.ZodAny,...q($)})};class D0 extends N{constructor(){super(...arguments);this._unknown=!0}_parse($){return Z($.data)}}D0.create=($)=>{return new D0({typeName:V.ZodUnknown,...q($)})};class X0 extends N{_parse($){let X=this._getOrReturnCtx($);return O(X,{code:M.invalid_type,expected:A.never,received:X.parsedType}),S}}X0.create=($)=>{return new X0({typeName:V.ZodNever,...q($)})};class l0 extends N{_parse($){if(this._getType($)!==A.undefined){let W=this._getOrReturnCtx($);return O(W,{code:M.invalid_type,expected:A.void,received:W.parsedType}),S}return Z($.data)}}l0.create=($)=>{return new l0({typeName:V.ZodVoid,...q($)})};class r extends N{_parse($){let{ctx:X,status:W}=this._processInputParams($),J=this._def;if(X.parsedType!==A.array)return O(X,{code:M.invalid_type,expected:A.array,received:X.parsedType}),S;if(J.exactLength!==null){let G=X.data.length>J.exactLength.value,H=X.data.length<J.exactLength.value;if(G||H)O(X,{code:G?M.too_big:M.too_small,minimum:H?J.exactLength.value:void 0,maximum:G?J.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:J.exactLength.message}),W.dirty()}if(J.minLength!==null){if(X.data.length<J.minLength.value)O(X,{code:M.too_small,minimum:J.minLength.value,type:"array",inclusive:!0,exact:!1,message:J.minLength.message}),W.dirty()}if(J.maxLength!==null){if(X.data.length>J.maxLength.value)O(X,{code:M.too_big,maximum:J.maxLength.value,type:"array",inclusive:!0,exact:!1,message:J.maxLength.message}),W.dirty()}if(X.common.async)return Promise.all([...X.data].map((G,H)=>{return J.type._parseAsync(new a(X,G,X.path,H))})).then((G)=>{return g.mergeArray(W,G)});let Y=[...X.data].map((G,H)=>{return J.type._parseSync(new a(X,G,X.path,H))});return g.mergeArray(W,Y)}get element(){return this._def.type}min($,X){return new r({...this._def,minLength:{value:$,message:U.toString(X)}})}max($,X){return new r({...this._def,maxLength:{value:$,message:U.toString(X)}})}length($,X){return new r({...this._def,exactLength:{value:$,message:U.toString(X)}})}nonempty($){return this.min(1,$)}}r.create=($,X)=>{return new r({type:$,minLength:null,maxLength:null,exactLength:null,typeName:V.ZodArray,...q(X)})};function q0($){if($ instanceof P){let X={};for(let W in $.shape){let J=$.shape[W];X[W]=u.create(q0(J))}return new P({...$._def,shape:()=>X})}else if($ instanceof r)return new r({...$._def,type:q0($.element)});else if($ instanceof u)return u.create(q0($.unwrap()));else if($ instanceof H0)return H0.create(q0($.unwrap()));else if($ instanceof W0)return W0.create($.items.map((X)=>q0(X)));else return $}class P extends N{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),X=_.objectKeys($);return this._cached={shape:$,keys:X}}_parse($){if(this._getType($)!==A.object){let B=this._getOrReturnCtx($);return O(B,{code:M.invalid_type,expected:A.object,received:B.parsedType}),S}let{status:W,ctx:J}=this._processInputParams($),{shape:Y,keys:G}=this._getCached(),H=[];if(!(this._def.catchall instanceof X0&&this._def.unknownKeys==="strip")){for(let B in J.data)if(!G.includes(B))H.push(B)}let w=[];for(let B of G){let D=Y[B],j=J.data[B];w.push({key:{status:"valid",value:B},value:D._parse(new a(J,j,J.path,B)),alwaysSet:B in J.data})}if(this._def.catchall instanceof X0){let B=this._def.unknownKeys;if(B==="passthrough")for(let D of H)w.push({key:{status:"valid",value:D},value:{status:"valid",value:J.data[D]}});else if(B==="strict"){if(H.length>0)O(J,{code:M.unrecognized_keys,keys:H}),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 H){let j=J.data[D];w.push({key:{status:"valid",value:D},value:B._parse(new a(J,j,J.path,D)),alwaysSet:D in J.data})}}if(J.common.async)return Promise.resolve().then(async()=>{let B=[];for(let D of w){let j=await D.key,R=await D.value;B.push({key:j,value:R,alwaysSet:D.alwaysSet})}return B}).then((B)=>{return g.mergeObjectSync(W,B)});else return g.mergeObjectSync(W,w)}get shape(){return this._def.shape()}strict($){return U.errToObj,new P({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(X,W)=>{var J,Y,G,H;let w=(G=(Y=(J=this._def).errorMap)===null||Y===void 0?void 0:Y.call(J,X,W).message)!==null&&G!==void 0?G:W.defaultError;if(X.code==="unrecognized_keys")return{message:(H=U.errToObj($).message)!==null&&H!==void 0?H:w};return{message:w}}}:{}})}strip(){return new P({...this._def,unknownKeys:"strip"})}passthrough(){return new P({...this._def,unknownKeys:"passthrough"})}extend($){return new P({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new P({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:V.ZodObject})}setKey($,X){return this.augment({[$]:X})}catchall($){return new P({...this._def,catchall:$})}pick($){let X={};return _.objectKeys($).forEach((W)=>{if($[W]&&this.shape[W])X[W]=this.shape[W]}),new P({...this._def,shape:()=>X})}omit($){let X={};return _.objectKeys(this.shape).forEach((W)=>{if(!$[W])X[W]=this.shape[W]}),new P({...this._def,shape:()=>X})}deepPartial(){return q0(this)}partial($){let X={};return _.objectKeys(this.shape).forEach((W)=>{let J=this.shape[W];if($&&!$[W])X[W]=J;else X[W]=J.optional()}),new P({...this._def,shape:()=>X})}required($){let X={};return _.objectKeys(this.shape).forEach((W)=>{if($&&!$[W])X[W]=this.shape[W];else{let Y=this.shape[W];while(Y instanceof u)Y=Y._def.innerType;X[W]=Y}}),new P({...this._def,shape:()=>X})}keyof(){return A2(_.objectKeys(this.shape))}}P.create=($,X)=>{return new P({shape:()=>$,unknownKeys:"strip",catchall:X0.create(),typeName:V.ZodObject,...q(X)})};P.strictCreate=($,X)=>{return new P({shape:()=>$,unknownKeys:"strict",catchall:X0.create(),typeName:V.ZodObject,...q(X)})};P.lazycreate=($,X)=>{return new P({shape:$,unknownKeys:"strip",catchall:X0.create(),typeName:V.ZodObject,...q(X)})};class I0 extends N{_parse($){let{ctx:X}=this._processInputParams($),W=this._def.options;function J(Y){for(let H of Y)if(H.result.status==="valid")return H.result;for(let H of Y)if(H.result.status==="dirty")return X.common.issues.push(...H.ctx.common.issues),H.result;let G=Y.map((H)=>new n(H.ctx.common.issues));return O(X,{code:M.invalid_union,unionErrors:G}),S}if(X.common.async)return Promise.all(W.map(async(Y)=>{let G={...X,common:{...X.common,issues:[]},parent:null};return{result:await Y._parseAsync({data:X.data,path:X.path,parent:G}),ctx:G}})).then(J);else{let Y=void 0,G=[];for(let w of W){let B={...X,common:{...X.common,issues:[]},parent:null},D=w._parseSync({data:X.data,path:X.path,parent:B});if(D.status==="valid")return D;else if(D.status==="dirty"&&!Y)Y={result:D,ctx:B};if(B.common.issues.length)G.push(B.common.issues)}if(Y)return X.common.issues.push(...Y.ctx.common.issues),Y.result;let H=G.map((w)=>new n(w));return O(X,{code:M.invalid_union,unionErrors:H}),S}}get options(){return this._def.options}}I0.create=($,X)=>{return new I0({options:$,typeName:V.ZodUnion,...q(X)})};var G0=($)=>{if($ instanceof v0)return G0($.schema);else if($ instanceof i)return G0($.innerType());else if($ instanceof P0)return[$.value];else if($ instanceof j0)return $.options;else if($ instanceof T0)return _.objectValues($.enum);else if($ instanceof k0)return G0($._def.innerType);else if($ instanceof f0)return[void 0];else if($ instanceof C0)return[null];else if($ instanceof u)return[void 0,...G0($.unwrap())];else if($ instanceof H0)return[null,...G0($.unwrap())];else if($ instanceof G1)return G0($.unwrap());else if($ instanceof h0)return G0($.unwrap());else if($ instanceof x0)return G0($._def.innerType);else return[]};class Y1 extends N{_parse($){let{ctx:X}=this._processInputParams($);if(X.parsedType!==A.object)return O(X,{code:M.invalid_type,expected:A.object,received:X.parsedType}),S;let W=this.discriminator,J=X.data[W],Y=this.optionsMap.get(J);if(!Y)return O(X,{code:M.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[W]}),S;if(X.common.async)return Y._parseAsync({data:X.data,path:X.path,parent:X});else return Y._parseSync({data:X.data,path:X.path,parent:X})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,X,W){let J=new Map;for(let Y of X){let G=G0(Y.shape[$]);if(!G.length)throw new Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let H of G){if(J.has(H))throw new Error(`Discriminator property ${String($)} has duplicate value ${String(H)}`);J.set(H,Y)}}return new Y1({typeName:V.ZodDiscriminatedUnion,discriminator:$,options:X,optionsMap:J,...q(W)})}}function x1($,X){let W=Q0($),J=Q0(X);if($===X)return{valid:!0,data:$};else if(W===A.object&&J===A.object){let Y=_.objectKeys(X),G=_.objectKeys($).filter((w)=>Y.indexOf(w)!==-1),H={...$,...X};for(let w of G){let B=x1($[w],X[w]);if(!B.valid)return{valid:!1};H[w]=B.data}return{valid:!0,data:H}}else if(W===A.array&&J===A.array){if($.length!==X.length)return{valid:!1};let Y=[];for(let G=0;G<$.length;G++){let H=$[G],w=X[G],B=x1(H,w);if(!B.valid)return{valid:!1};Y.push(B.data)}return{valid:!0,data:Y}}else if(W===A.date&&J===A.date&&+$===+X)return{valid:!0,data:$};else return{valid:!1}}class b0 extends N{_parse($){let{status:X,ctx:W}=this._processInputParams($),J=(Y,G)=>{if(T1(Y)||T1(G))return S;let H=x1(Y.value,G.value);if(!H.valid)return O(W,{code:M.invalid_intersection_types}),S;if(k1(Y)||k1(G))X.dirty();return{status:X.value,value:H.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(([Y,G])=>J(Y,G));else return J(this._def.left._parseSync({data:W.data,path:W.path,parent:W}),this._def.right._parseSync({data:W.data,path:W.path,parent:W}))}}b0.create=($,X,W)=>{return new b0({left:$,right:X,typeName:V.ZodIntersection,...q(W)})};class W0 extends N{_parse($){let{status:X,ctx:W}=this._processInputParams($);if(W.parsedType!==A.array)return O(W,{code:M.invalid_type,expected:A.array,received:W.parsedType}),S;if(W.data.length<this._def.items.length)return O(W,{code:M.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),S;if(!this._def.rest&&W.data.length>this._def.items.length)O(W,{code:M.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),X.dirty();let Y=[...W.data].map((G,H)=>{let w=this._def.items[H]||this._def.rest;if(!w)return null;return w._parse(new a(W,G,W.path,H))}).filter((G)=>!!G);if(W.common.async)return Promise.all(Y).then((G)=>{return g.mergeArray(X,G)});else return g.mergeArray(X,Y)}get items(){return this._def.items}rest($){return new W0({...this._def,rest:$})}}W0.create=($,X)=>{if(!Array.isArray($))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new W0({items:$,typeName:V.ZodTuple,rest:null,...q(X)})};class n0 extends N{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:X,ctx:W}=this._processInputParams($);if(W.parsedType!==A.object)return O(W,{code:M.invalid_type,expected:A.object,received:W.parsedType}),S;let J=[],Y=this._def.keyType,G=this._def.valueType;for(let H in W.data)J.push({key:Y._parse(new a(W,H,W.path,H)),value:G._parse(new a(W,W.data[H],W.path,H)),alwaysSet:H in W.data});if(W.common.async)return g.mergeObjectAsync(X,J);else return g.mergeObjectSync(X,J)}get element(){return this._def.valueType}static create($,X,W){if(X instanceof N)return new n0({keyType:$,valueType:X,typeName:V.ZodRecord,...q(W)});return new n0({keyType:o.create(),valueType:$,typeName:V.ZodRecord,...q(X)})}}class u0 extends N{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:X,ctx:W}=this._processInputParams($);if(W.parsedType!==A.map)return O(W,{code:M.invalid_type,expected:A.map,received:W.parsedType}),S;let J=this._def.keyType,Y=this._def.valueType,G=[...W.data.entries()].map(([H,w],B)=>{return{key:J._parse(new a(W,H,W.path,[B,"key"])),value:Y._parse(new a(W,w,W.path,[B,"value"]))}});if(W.common.async){let H=new Map;return Promise.resolve().then(async()=>{for(let w of G){let B=await w.key,D=await w.value;if(B.status==="aborted"||D.status==="aborted")return S;if(B.status==="dirty"||D.status==="dirty")X.dirty();H.set(B.value,D.value)}return{status:X.value,value:H}})}else{let H=new Map;for(let w of G){let{key:B,value:D}=w;if(B.status==="aborted"||D.status==="aborted")return S;if(B.status==="dirty"||D.status==="dirty")X.dirty();H.set(B.value,D.value)}return{status:X.value,value:H}}}}u0.create=($,X,W)=>{return new u0({valueType:X,keyType:$,typeName:V.ZodMap,...q(W)})};class K0 extends N{_parse($){let{status:X,ctx:W}=this._processInputParams($);if(W.parsedType!==A.set)return O(W,{code:M.invalid_type,expected:A.set,received:W.parsedType}),S;let J=this._def;if(J.minSize!==null){if(W.data.size<J.minSize.value)O(W,{code:M.too_small,minimum:J.minSize.value,type:"set",inclusive:!0,exact:!1,message:J.minSize.message}),X.dirty()}if(J.maxSize!==null){if(W.data.size>J.maxSize.value)O(W,{code:M.too_big,maximum:J.maxSize.value,type:"set",inclusive:!0,exact:!1,message:J.maxSize.message}),X.dirty()}let Y=this._def.valueType;function G(w){let B=new Set;for(let D of w){if(D.status==="aborted")return S;if(D.status==="dirty")X.dirty();B.add(D.value)}return{status:X.value,value:B}}let H=[...W.data.values()].map((w,B)=>Y._parse(new a(W,w,W.path,B)));if(W.common.async)return Promise.all(H).then((w)=>G(w));else return G(H)}min($,X){return new K0({...this._def,minSize:{value:$,message:U.toString(X)}})}max($,X){return new K0({...this._def,maxSize:{value:$,message:U.toString(X)}})}size($,X){return this.min($,X).max($,X)}nonempty($){return this.min(1,$)}}K0.create=($,X)=>{return new K0({valueType:$,minSize:null,maxSize:null,typeName:V.ZodSet,...q(X)})};class L0 extends N{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:X}=this._processInputParams($);if(X.parsedType!==A.function)return O(X,{code:M.invalid_type,expected:A.function,received:X.parsedType}),S;function W(H,w){return W1({data:H,path:X.path,errorMaps:[X.common.contextualErrorMap,X.schemaErrorMap,X1(),_0].filter((B)=>!!B),issueData:{code:M.invalid_arguments,argumentsError:w}})}function J(H,w){return W1({data:H,path:X.path,errorMaps:[X.common.contextualErrorMap,X.schemaErrorMap,X1(),_0].filter((B)=>!!B),issueData:{code:M.invalid_return_type,returnTypeError:w}})}let Y={errorMap:X.common.contextualErrorMap},G=X.data;if(this._def.returns instanceof F0){let H=this;return Z(async function(...w){let B=new n([]),D=await H._def.args.parseAsync(w,Y).catch((f)=>{throw B.addIssue(W(w,f)),B}),j=await Reflect.apply(G,this,D);return await H._def.returns._def.type.parseAsync(j,Y).catch((f)=>{throw B.addIssue(J(j,f)),B})})}else{let H=this;return Z(function(...w){let B=H._def.args.safeParse(w,Y);if(!B.success)throw new n([W(w,B.error)]);let D=Reflect.apply(G,this,B.data),j=H._def.returns.safeParse(D,Y);if(!j.success)throw new n([J(D,j.error)]);return j.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new L0({...this._def,args:W0.create($).rest(D0.create())})}returns($){return new L0({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,X,W){return new L0({args:$?$:W0.create([]).rest(D0.create()),returns:X||D0.create(),typeName:V.ZodFunction,...q(W)})}}class v0 extends N{get schema(){return this._def.getter()}_parse($){let{ctx:X}=this._processInputParams($);return this._def.getter()._parse({data:X.data,path:X.path,parent:X})}}v0.create=($,X)=>{return new v0({getter:$,typeName:V.ZodLazy,...q(X)})};class P0 extends N{_parse($){if($.data!==this._def.value){let X=this._getOrReturnCtx($);return O(X,{received:X.data,code:M.invalid_literal,expected:this._def.value}),S}return{status:"valid",value:$.data}}get value(){return this._def.value}}P0.create=($,X)=>{return new P0({value:$,typeName:V.ZodLiteral,...q(X)})};function A2($,X){return new j0({values:$,typeName:V.ZodEnum,...q(X)})}class j0 extends N{constructor(){super(...arguments);g0.set(this,void 0)}_parse($){if(typeof $.data!=="string"){let X=this._getOrReturnCtx($),W=this._def.values;return O(X,{expected:_.joinValues(W),received:X.parsedType,code:M.invalid_type}),S}if(!J1(this,g0,"f"))M2(this,g0,new Set(this._def.values),"f");if(!J1(this,g0,"f").has($.data)){let X=this._getOrReturnCtx($),W=this._def.values;return O(X,{received:X.data,code:M.invalid_enum_value,options:W}),S}return Z($.data)}get options(){return this._def.values}get enum(){let $={};for(let X of this._def.values)$[X]=X;return $}get Values(){let $={};for(let X of this._def.values)$[X]=X;return $}get Enum(){let $={};for(let X of this._def.values)$[X]=X;return $}extract($,X=this._def){return j0.create($,{...this._def,...X})}exclude($,X=this._def){return j0.create(this.options.filter((W)=>!$.includes(W)),{...this._def,...X})}}g0=new WeakMap;j0.create=A2;class T0 extends N{constructor(){super(...arguments);y0.set(this,void 0)}_parse($){let X=_.getValidEnumValues(this._def.values),W=this._getOrReturnCtx($);if(W.parsedType!==A.string&&W.parsedType!==A.number){let J=_.objectValues(X);return O(W,{expected:_.joinValues(J),received:W.parsedType,code:M.invalid_type}),S}if(!J1(this,y0,"f"))M2(this,y0,new Set(_.getValidEnumValues(this._def.values)),"f");if(!J1(this,y0,"f").has($.data)){let J=_.objectValues(X);return O(W,{received:W.data,code:M.invalid_enum_value,options:J}),S}return Z($.data)}get enum(){return this._def.values}}y0=new WeakMap;T0.create=($,X)=>{return new T0({values:$,typeName:V.ZodNativeEnum,...q(X)})};class F0 extends N{unwrap(){return this._def.type}_parse($){let{ctx:X}=this._processInputParams($);if(X.parsedType!==A.promise&&X.common.async===!1)return O(X,{code:M.invalid_type,expected:A.promise,received:X.parsedType}),S;let W=X.parsedType===A.promise?X.data:Promise.resolve(X.data);return Z(W.then((J)=>{return this._def.type.parseAsync(J,{path:X.path,errorMap:X.common.contextualErrorMap})}))}}F0.create=($,X)=>{return new F0({type:$,typeName:V.ZodPromise,...q(X)})};class i extends N{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===V.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:X,ctx:W}=this._processInputParams($),J=this._def.effect||null,Y={addIssue:(G)=>{if(O(W,G),G.fatal)X.abort();else X.dirty()},get path(){return W.path}};if(Y.addIssue=Y.addIssue.bind(Y),J.type==="preprocess"){let G=J.transform(W.data,Y);if(W.common.async)return Promise.resolve(G).then(async(H)=>{if(X.value==="aborted")return S;let w=await this._def.schema._parseAsync({data:H,path:W.path,parent:W});if(w.status==="aborted")return S;if(w.status==="dirty")return R0(w.value);if(X.value==="dirty")return R0(w.value);return w});else{if(X.value==="aborted")return S;let H=this._def.schema._parseSync({data:G,path:W.path,parent:W});if(H.status==="aborted")return S;if(H.status==="dirty")return R0(H.value);if(X.value==="dirty")return R0(H.value);return H}}if(J.type==="refinement"){let G=(H)=>{let w=J.refinement(H,Y);if(W.common.async)return Promise.resolve(w);if(w instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return H};if(W.common.async===!1){let H=this._def.schema._parseSync({data:W.data,path:W.path,parent:W});if(H.status==="aborted")return S;if(H.status==="dirty")X.dirty();return G(H.value),{status:X.value,value:H.value}}else return this._def.schema._parseAsync({data:W.data,path:W.path,parent:W}).then((H)=>{if(H.status==="aborted")return S;if(H.status==="dirty")X.dirty();return G(H.value).then(()=>{return{status:X.value,value:H.value}})})}if(J.type==="transform")if(W.common.async===!1){let G=this._def.schema._parseSync({data:W.data,path:W.path,parent:W});if(!A0(G))return G;let H=J.transform(G.value,Y);if(H instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:X.value,value:H}}else return this._def.schema._parseAsync({data:W.data,path:W.path,parent:W}).then((G)=>{if(!A0(G))return G;return Promise.resolve(J.transform(G.value,Y)).then((H)=>({status:X.value,value:H}))});_.assertNever(J)}}i.create=($,X,W)=>{return new i({schema:$,typeName:V.ZodEffects,effect:X,...q(W)})};i.createWithPreprocess=($,X,W)=>{return new i({schema:X,effect:{type:"preprocess",transform:$},typeName:V.ZodEffects,...q(W)})};class u extends N{_parse($){if(this._getType($)===A.undefined)return Z(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}u.create=($,X)=>{return new u({innerType:$,typeName:V.ZodOptional,...q(X)})};class H0 extends N{_parse($){if(this._getType($)===A.null)return Z(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}H0.create=($,X)=>{return new H0({innerType:$,typeName:V.ZodNullable,...q(X)})};class k0 extends N{_parse($){let{ctx:X}=this._processInputParams($),W=X.data;if(X.parsedType===A.undefined)W=this._def.defaultValue();return this._def.innerType._parse({data:W,path:X.path,parent:X})}removeDefault(){return this._def.innerType}}k0.create=($,X)=>{return new k0({innerType:$,typeName:V.ZodDefault,defaultValue:typeof X.default==="function"?X.default:()=>X.default,...q(X)})};class x0 extends N{_parse($){let{ctx:X}=this._processInputParams($),W={...X,common:{...X.common,issues:[]}},J=this._def.innerType._parse({data:W.data,path:W.path,parent:{...W}});if(Z0(J))return J.then((Y)=>{return{status:"valid",value:Y.status==="valid"?Y.value:this._def.catchValue({get error(){return new n(W.common.issues)},input:W.data})}});else return{status:"valid",value:J.status==="valid"?J.value:this._def.catchValue({get error(){return new n(W.common.issues)},input:W.data})}}removeCatch(){return this._def.innerType}}x0.create=($,X)=>{return new x0({innerType:$,typeName:V.ZodCatch,catchValue:typeof X.catch==="function"?X.catch:()=>X.catch,...q(X)})};class c0 extends N{_parse($){if(this._getType($)!==A.nan){let W=this._getOrReturnCtx($);return O(W,{code:M.invalid_type,expected:A.nan,received:W.parsedType}),S}return{status:"valid",value:$.data}}}c0.create=($)=>{return new c0({typeName:V.ZodNaN,...q($)})};var U6=Symbol("zod_brand");class G1 extends N{_parse($){let{ctx:X}=this._processInputParams($),W=X.data;return this._def.type._parse({data:W,path:X.path,parent:X})}unwrap(){return this._def.type}}class p0 extends N{_parse($){let{status:X,ctx:W}=this._processInputParams($);if(W.common.async)return(async()=>{let Y=await this._def.in._parseAsync({data:W.data,path:W.path,parent:W});if(Y.status==="aborted")return S;if(Y.status==="dirty")return X.dirty(),R0(Y.value);else return this._def.out._parseAsync({data:Y.value,path:W.path,parent:W})})();else{let J=this._def.in._parseSync({data:W.data,path:W.path,parent:W});if(J.status==="aborted")return S;if(J.status==="dirty")return X.dirty(),{status:"dirty",value:J.value};else return this._def.out._parseSync({data:J.value,path:W.path,parent:W})}}static create($,X){return new p0({in:$,out:X,typeName:V.ZodPipeline})}}class h0 extends N{_parse($){let X=this._def.innerType._parse($),W=(J)=>{if(A0(J))J.value=Object.freeze(J.value);return J};return Z0(X)?X.then((J)=>W(J)):W(X)}unwrap(){return this._def.innerType}}h0.create=($,X)=>{return new h0({innerType:$,typeName:V.ZodReadonly,...q(X)})};function w2($,X){let W=typeof $==="function"?$(X):typeof $==="string"?{message:$}:$;return typeof W==="string"?{message:W}:W}function z2($,X={},W){if($)return U0.create().superRefine((J,Y)=>{var G,H;let w=$(J);if(w instanceof Promise)return w.then((B)=>{var D,j;if(!B){let R=w2(X,J),f=(j=(D=R.fatal)!==null&&D!==void 0?D:W)!==null&&j!==void 0?j:!0;Y.addIssue({code:"custom",...R,fatal:f})}});if(!w){let B=w2(X,J),D=(H=(G=B.fatal)!==null&&G!==void 0?G:W)!==null&&H!==void 0?H:!0;Y.addIssue({code:"custom",...B,fatal:D})}return});return U0.create()}var K6={object:P.lazycreate},V;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(V||(V={}));var F6=($,X={message:`Input not instance of ${$.name}`})=>z2((W)=>W instanceof $,X),U2=o.create,K2=M0.create,S6=c0.create,N6=V0.create,F2=E0.create,q6=z0.create,R6=m0.create,L6=f0.create,_6=C0.create,E6=U0.create,f6=D0.create,C6=X0.create,I6=l0.create,b6=r.create,v6=P.create,P6=P.strictCreate,T6=I0.create,k6=Y1.create,x6=b0.create,h6=W0.create,g6=n0.create,y6=u0.create,Z6=K0.create,m6=L0.create,l6=v0.create,n6=P0.create,u6=j0.create,c6=T0.create,p6=F0.create,B2=i.create,i6=u.create,d6=H0.create,o6=i.createWithPreprocess,r6=p0.create,a6=()=>U2().optional(),t6=()=>K2().optional(),s6=()=>F2().optional(),e6={string:($)=>o.create({...$,coerce:!0}),number:($)=>M0.create({...$,coerce:!0}),boolean:($)=>E0.create({...$,coerce:!0}),bigint:($)=>V0.create({...$,coerce:!0}),date:($)=>z0.create({...$,coerce:!0})},$$=S,Q=Object.freeze({__proto__:null,defaultErrorMap:_0,setErrorMap:o4,getErrorMap:X1,makeIssue:W1,EMPTY_PATH:r4,addIssueToContext:O,ParseStatus:g,INVALID:S,DIRTY:R0,OK:Z,isAborted:T1,isDirty:k1,isValid:A0,isAsync:Z0,get util(){return _},get objectUtil(){return P1},ZodParsedType:A,getParsedType:Q0,ZodType:N,datetimeRegex:O2,ZodString:o,ZodNumber:M0,ZodBigInt:V0,ZodBoolean:E0,ZodDate:z0,ZodSymbol:m0,ZodUndefined:f0,ZodNull:C0,ZodAny:U0,ZodUnknown:D0,ZodNever:X0,ZodVoid:l0,ZodArray:r,ZodObject:P,ZodUnion:I0,ZodDiscriminatedUnion:Y1,ZodIntersection:b0,ZodTuple:W0,ZodRecord:n0,ZodMap:u0,ZodSet:K0,ZodFunction:L0,ZodLazy:v0,ZodLiteral:P0,ZodEnum:j0,ZodNativeEnum:T0,ZodPromise:F0,ZodEffects:i,ZodTransformer:i,ZodOptional:u,ZodNullable:H0,ZodDefault:k0,ZodCatch:x0,ZodNaN:c0,BRAND:U6,ZodBranded:G1,ZodPipeline:p0,ZodReadonly:h0,custom:z2,Schema:N,ZodSchema:N,late:K6,get ZodFirstPartyTypeKind(){return V},coerce:e6,any:E6,array:b6,bigint:N6,boolean:F2,date:q6,discriminatedUnion:k6,effect:B2,enum:u6,function:m6,instanceof:F6,intersection:x6,lazy:l6,literal:n6,map:y6,nan:S6,nativeEnum:c6,never:C6,null:_6,nullable:d6,number:K2,object:v6,oboolean:s6,onumber:t6,optional:i6,ostring:a6,pipeline:r6,preprocess:o6,promise:p6,record:g6,set:Z6,strictObject:P6,string:U2,symbol:R6,transformer:B2,tuple:h6,undefined:L6,union:T6,unknown:f6,void:I6,NEVER:$$,ZodIssueCode:M,quotelessJson:d4,ZodError:n});var h1="2024-11-05",S2=[h1,"2024-10-07"],Q1="2.0",N2=Q.union([Q.string(),Q.number().int()]),q2=Q.string(),t=Q.object({_meta:Q.optional(Q.object({progressToken:Q.optional(N2)}).passthrough())}).passthrough(),c=Q.object({method:Q.string(),params:Q.optional(t)}),i0=Q.object({_meta:Q.optional(Q.object({}).passthrough())}).passthrough(),J0=Q.object({method:Q.string(),params:Q.optional(i0)}),s=Q.object({_meta:Q.optional(Q.object({}).passthrough())}).passthrough(),H1=Q.union([Q.string(),Q.number().int()]),X$=Q.object({jsonrpc:Q.literal(Q1),id:H1}).merge(c).strict(),W$=Q.object({jsonrpc:Q.literal(Q1)}).merge(J0).strict(),J$=Q.object({jsonrpc:Q.literal(Q1),id:H1,result:s}).strict(),h;(function($){$[$.ConnectionClosed=-32000]="ConnectionClosed",$[$.RequestTimeout=-32001]="RequestTimeout",$[$.ParseError=-32700]="ParseError",$[$.InvalidRequest=-32600]="InvalidRequest",$[$.MethodNotFound=-32601]="MethodNotFound",$[$.InvalidParams=-32602]="InvalidParams",$[$.InternalError=-32603]="InternalError"})(h||(h={}));var Y$=Q.object({jsonrpc:Q.literal(Q1),id:H1,error:Q.object({code:Q.number().int(),message:Q.string(),data:Q.optional(Q.unknown())})}).strict(),R2=Q.union([X$,W$,J$,Y$]),w1=s.strict(),B1=J0.extend({method:Q.literal("notifications/cancelled"),params:i0.extend({requestId:H1,reason:Q.string().optional()})}),L2=Q.object({name:Q.string(),version:Q.string()}).passthrough(),G$=Q.object({experimental:Q.optional(Q.object({}).passthrough()),sampling:Q.optional(Q.object({}).passthrough()),roots:Q.optional(Q.object({listChanged:Q.optional(Q.boolean())}).passthrough())}).passthrough(),g1=c.extend({method:Q.literal("initialize"),params:t.extend({protocolVersion:Q.string(),capabilities:G$,clientInfo:L2})}),Q$=Q.object({experimental:Q.optional(Q.object({}).passthrough()),logging:Q.optional(Q.object({}).passthrough()),prompts:Q.optional(Q.object({listChanged:Q.optional(Q.boolean())}).passthrough()),resources:Q.optional(Q.object({subscribe:Q.optional(Q.boolean()),listChanged:Q.optional(Q.boolean())}).passthrough()),tools:Q.optional(Q.object({listChanged:Q.optional(Q.boolean())}).passthrough())}).passthrough(),H$=s.extend({protocolVersion:Q.string(),capabilities:Q$,serverInfo:L2,instructions:Q.optional(Q.string())}),y1=J0.extend({method:Q.literal("notifications/initialized")}),D1=c.extend({method:Q.literal("ping")}),w$=Q.object({progress:Q.number(),total:Q.optional(Q.number())}).passthrough(),M1=J0.extend({method:Q.literal("notifications/progress"),params:i0.merge(w$).extend({progressToken:N2})}),V1=c.extend({params:t.extend({cursor:Q.optional(q2)}).optional()}),j1=s.extend({nextCursor:Q.optional(q2)}),_2=Q.object({uri:Q.string(),mimeType:Q.optional(Q.string())}).passthrough(),E2=_2.extend({text:Q.string()}),f2=_2.extend({blob:Q.string().base64()}),B$=Q.object({uri:Q.string(),name:Q.string(),description:Q.optional(Q.string()),mimeType:Q.optional(Q.string())}).passthrough(),D$=Q.object({uriTemplate:Q.string(),name:Q.string(),description:Q.optional(Q.string()),mimeType:Q.optional(Q.string())}).passthrough(),O1=V1.extend({method:Q.literal("resources/list")}),M$=j1.extend({resources:Q.array(B$)}),A1=V1.extend({method:Q.literal("resources/templates/list")}),V$=j1.extend({resourceTemplates:Q.array(D$)}),z1=c.extend({method:Q.literal("resources/read"),params:t.extend({uri:Q.string()})}),j$=s.extend({contents:Q.array(Q.union([E2,f2]))}),O$=J0.extend({method:Q.literal("notifications/resources/list_changed")}),A$=c.extend({method:Q.literal("resources/subscribe"),params:t.extend({uri:Q.string()})}),z$=c.extend({method:Q.literal("resources/unsubscribe"),params:t.extend({uri:Q.string()})}),U$=J0.extend({method:Q.literal("notifications/resources/updated"),params:i0.extend({uri:Q.string()})}),K$=Q.object({name:Q.string(),description:Q.optional(Q.string()),required:Q.optional(Q.boolean())}).passthrough(),F$=Q.object({name:Q.string(),description:Q.optional(Q.string()),arguments:Q.optional(Q.array(K$))}).passthrough(),U1=V1.extend({method:Q.literal("prompts/list")}),S$=j1.extend({prompts:Q.array(F$)}),K1=c.extend({method:Q.literal("prompts/get"),params:t.extend({name:Q.string(),arguments:Q.optional(Q.record(Q.string()))})}),F1=Q.object({type:Q.literal("text"),text:Q.string()}).passthrough(),S1=Q.object({type:Q.literal("image"),data:Q.string().base64(),mimeType:Q.string()}).passthrough(),C2=Q.object({type:Q.literal("resource"),resource:Q.union([E2,f2])}).passthrough(),N$=Q.object({role:Q.enum(["user","assistant"]),content:Q.union([F1,S1,C2])}).passthrough(),q$=s.extend({description:Q.optional(Q.string()),messages:Q.array(N$)}),R$=J0.extend({method:Q.literal("notifications/prompts/list_changed")}),L$=Q.object({name:Q.string(),description:Q.optional(Q.string()),inputSchema:Q.object({type:Q.literal("object"),properties:Q.optional(Q.object({}).passthrough())}).passthrough()}).passthrough(),N1=V1.extend({method:Q.literal("tools/list")}),_$=j1.extend({tools:Q.array(L$)}),I2=s.extend({content:Q.array(Q.union([F1,S1,C2])),isError:Q.boolean().default(!1).optional()}),T3=I2.or(s.extend({toolResult:Q.unknown()})),q1=c.extend({method:Q.literal("tools/call"),params:t.extend({name:Q.string(),arguments:Q.optional(Q.record(Q.unknown()))})}),E$=J0.extend({method:Q.literal("notifications/tools/list_changed")}),b2=Q.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),f$=c.extend({method:Q.literal("logging/setLevel"),params:t.extend({level:b2})}),C$=J0.extend({method:Q.literal("notifications/message"),params:i0.extend({level:b2,logger:Q.optional(Q.string()),data:Q.unknown()})}),I$=Q.object({name:Q.string().optional()}).passthrough(),b$=Q.object({hints:Q.optional(Q.array(I$)),costPriority:Q.optional(Q.number().min(0).max(1)),speedPriority:Q.optional(Q.number().min(0).max(1)),intelligencePriority:Q.optional(Q.number().min(0).max(1))}).passthrough(),v$=Q.object({role:Q.enum(["user","assistant"]),content:Q.union([F1,S1])}).passthrough(),P$=c.extend({method:Q.literal("sampling/createMessage"),params:t.extend({messages:Q.array(v$),systemPrompt:Q.optional(Q.string()),includeContext:Q.optional(Q.enum(["none","thisServer","allServers"])),temperature:Q.optional(Q.number()),maxTokens:Q.number().int(),stopSequences:Q.optional(Q.array(Q.string())),metadata:Q.optional(Q.object({}).passthrough()),modelPreferences:Q.optional(b$)})}),Z1=s.extend({model:Q.string(),stopReason:Q.optional(Q.enum(["endTurn","stopSequence","maxTokens"]).or(Q.string())),role:Q.enum(["user","assistant"]),content:Q.discriminatedUnion("type",[F1,S1])}),T$=Q.object({type:Q.literal("ref/resource"),uri:Q.string()}).passthrough(),k$=Q.object({type:Q.literal("ref/prompt"),name:Q.string()}).passthrough(),R1=c.extend({method:Q.literal("completion/complete"),params:t.extend({ref:Q.union([k$,T$]),argument:Q.object({name:Q.string(),value:Q.string()}).passthrough()})}),x$=s.extend({completion:Q.object({values:Q.array(Q.string()).max(100),total:Q.optional(Q.number().int()),hasMore:Q.optional(Q.boolean())}).passthrough()}),h$=Q.object({uri:Q.string().startsWith("file://"),name:Q.optional(Q.string())}).passthrough(),g$=c.extend({method:Q.literal("roots/list")}),m1=s.extend({roots:Q.array(h$)}),y$=J0.extend({method:Q.literal("notifications/roots/list_changed")}),k3=Q.union([D1,g1,R1,f$,K1,U1,O1,A1,z1,A$,z$,q1,N1]),x3=Q.union([B1,M1,y1,y$]),h3=Q.union([w1,Z1,m1]),g3=Q.union([D1,P$,g$]),y3=Q.union([B1,M1,C$,U$,O$,E$,R$]),Z3=Q.union([w1,H$,x$,q$,S$,M$,V$,j$,I2,_$]);class m extends Error{constructor($,X,W){super(`MCP error ${$}: ${X}`);this.code=$,this.data=W,this.name="McpError"}}var Z$=60000;class l1{constructor($){this._options=$,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.setNotificationHandler(B1,(X)=>{let W=this._requestHandlerAbortControllers.get(X.params.requestId);W===null||W===void 0||W.abort(X.params.reason)}),this.setNotificationHandler(M1,(X)=>{this._onprogress(X)}),this.setRequestHandler(D1,(X)=>({}))}_setupTimeout($,X,W,J){this._timeoutInfo.set($,{timeoutId:setTimeout(J,X),startTime:Date.now(),timeout:X,maxTotalTimeout:W,onTimeout:J})}_resetTimeout($){let X=this._timeoutInfo.get($);if(!X)return!1;let W=Date.now()-X.startTime;if(X.maxTotalTimeout&&W>=X.maxTotalTimeout)throw this._timeoutInfo.delete($),new m(h.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:X.maxTotalTimeout,totalElapsed:W});return clearTimeout(X.timeoutId),X.timeoutId=setTimeout(X.onTimeout,X.timeout),!0}_cleanupTimeout($){let X=this._timeoutInfo.get($);if(X)clearTimeout(X.timeoutId),this._timeoutInfo.delete($)}async connect($){this._transport=$,this._transport.onclose=()=>{this._onclose()},this._transport.onerror=(X)=>{this._onerror(X)},this._transport.onmessage=(X)=>{if(!("method"in X))this._onresponse(X);else if("id"in X)this._onrequest(X);else this._onnotification(X)},await this._transport.start()}_onclose(){var $;let X=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._transport=void 0,($=this.onclose)===null||$===void 0||$.call(this);let W=new m(h.ConnectionClosed,"Connection closed");for(let J of X.values())J(W)}_onerror($){var X;(X=this.onerror)===null||X===void 0||X.call(this,$)}_onnotification($){var X;let W=(X=this._notificationHandlers.get($.method))!==null&&X!==void 0?X:this.fallbackNotificationHandler;if(W===void 0)return;Promise.resolve().then(()=>W($)).catch((J)=>this._onerror(new Error(`Uncaught error in notification handler: ${J}`)))}_onrequest($){var X,W,J;let Y=(X=this._requestHandlers.get($.method))!==null&&X!==void 0?X:this.fallbackRequestHandler;if(Y===void 0){(W=this._transport)===null||W===void 0||W.send({jsonrpc:"2.0",id:$.id,error:{code:h.MethodNotFound,message:"Method not found"}}).catch((w)=>this._onerror(new Error(`Failed to send an error response: ${w}`)));return}let G=new AbortController;this._requestHandlerAbortControllers.set($.id,G);let H={signal:G.signal,sessionId:(J=this._transport)===null||J===void 0?void 0:J.sessionId};Promise.resolve().then(()=>Y($,H)).then((w)=>{var B;if(G.signal.aborted)return;return(B=this._transport)===null||B===void 0?void 0:B.send({result:w,jsonrpc:"2.0",id:$.id})},(w)=>{var B,D;if(G.signal.aborted)return;return(B=this._transport)===null||B===void 0?void 0:B.send({jsonrpc:"2.0",id:$.id,error:{code:Number.isSafeInteger(w.code)?w.code:h.InternalError,message:(D=w.message)!==null&&D!==void 0?D:"Internal error"}})}).catch((w)=>this._onerror(new Error(`Failed to send response: ${w}`))).finally(()=>{this._requestHandlerAbortControllers.delete($.id)})}_onprogress($){let{progressToken:X,...W}=$.params,J=Number(X),Y=this._progressHandlers.get(J);if(!Y){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify($)}`));return}let G=this._responseHandlers.get(J);if(this._timeoutInfo.has(J)&&G)try{this._resetTimeout(J)}catch(H){G(H);return}Y(W)}_onresponse($){let X=Number($.id),W=this._responseHandlers.get(X);if(W===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify($)}`));return}if(this._responseHandlers.delete(X),this._progressHandlers.delete(X),this._cleanupTimeout(X),"result"in $)W($);else{let J=new m($.error.code,$.error.message,$.error.data);W(J)}}get transport(){return this._transport}async close(){var $;await(($=this._transport)===null||$===void 0?void 0:$.close())}request($,X,W){return new Promise((J,Y)=>{var G,H,w,B;if(!this._transport){Y(new Error("Not connected"));return}if(((G=this._options)===null||G===void 0?void 0:G.enforceStrictCapabilities)===!0)this.assertCapabilityForMethod($.method);(H=W===null||W===void 0?void 0:W.signal)===null||H===void 0||H.throwIfAborted();let D=this._requestMessageId++,j={...$,jsonrpc:"2.0",id:D};if(W===null||W===void 0?void 0:W.onprogress)this._progressHandlers.set(D,W.onprogress),j.params={...$.params,_meta:{progressToken:D}};let R=(v)=>{var T;this._responseHandlers.delete(D),this._progressHandlers.delete(D),this._cleanupTimeout(D),(T=this._transport)===null||T===void 0||T.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:D,reason:String(v)}}).catch((y)=>this._onerror(new Error(`Failed to send cancellation: ${y}`))),Y(v)};this._responseHandlers.set(D,(v)=>{var T;if((T=W===null||W===void 0?void 0:W.signal)===null||T===void 0?void 0:T.aborted)return;if(v instanceof Error)return Y(v);try{let y=X.parse(v.result);J(y)}catch(y){Y(y)}}),(w=W===null||W===void 0?void 0:W.signal)===null||w===void 0||w.addEventListener("abort",()=>{var v;R((v=W===null||W===void 0?void 0:W.signal)===null||v===void 0?void 0:v.reason)});let f=(B=W===null||W===void 0?void 0:W.timeout)!==null&&B!==void 0?B:Z$,b=()=>R(new m(h.RequestTimeout,"Request timed out",{timeout:f}));this._setupTimeout(D,f,W===null||W===void 0?void 0:W.maxTotalTimeout,b),this._transport.send(j).catch((v)=>{this._cleanupTimeout(D),Y(v)})})}async notification($){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability($.method);let X={...$,jsonrpc:"2.0"};await this._transport.send(X)}setRequestHandler($,X){let W=$.shape.method.value;this.assertRequestHandlerCapability(W),this._requestHandlers.set(W,(J,Y)=>Promise.resolve(X($.parse(J),Y)))}removeRequestHandler($){this._requestHandlers.delete($)}assertCanSetRequestHandler($){if(this._requestHandlers.has($))throw new Error(`A request handler for ${$} already exists, which would be overridden`)}setNotificationHandler($,X){this._notificationHandlers.set($.shape.method.value,(W)=>Promise.resolve(X($.parse(W))))}removeNotificationHandler($){this._notificationHandlers.delete($)}}function v2($,X){return Object.entries(X).reduce((W,[J,Y])=>{if(Y&&typeof Y==="object")W[J]=W[J]?{...W[J],...Y}:Y;else W[J]=Y;return W},{...$})}class n1 extends l1{constructor($,X){var W;super(X);this._serverInfo=$,this._capabilities=(W=X===null||X===void 0?void 0:X.capabilities)!==null&&W!==void 0?W:{},this._instructions=X===null||X===void 0?void 0:X.instructions,this.setRequestHandler(g1,(J)=>this._oninitialize(J)),this.setNotificationHandler(y1,()=>{var J;return(J=this.oninitialized)===null||J===void 0?void 0:J.call(this)})}registerCapabilities($){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=v2(this._capabilities,$)}assertCapabilityForMethod($){var X,W;switch($){case"sampling/createMessage":if(!((X=this._clientCapabilities)===null||X===void 0?void 0:X.sampling))throw new Error(`Client does not support sampling (required for ${$})`);break;case"roots/list":if(!((W=this._clientCapabilities)===null||W===void 0?void 0:W.roots))throw new Error(`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){switch($){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${$})`);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 ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability($){switch($){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Server does not support sampling (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${$})`);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 ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${$})`);break;case"ping":case"initialize":break}}async _oninitialize($){let X=$.params.protocolVersion;return this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo,{protocolVersion:S2.includes(X)?X:h1,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"},w1)}async createMessage($,X){return this.request({method:"sampling/createMessage",params:$},Z1,X)}async listRoots($,X){return this.request({method:"roots/list",params:$},m1,X)}async sendLoggingMessage($){return this.notification({method:"notifications/message",params:$})}async sendResourceUpdated($){return this.notification({method:"notifications/resources/updated",params:$})}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 T2=Symbol("Let zodToJsonSchema decide on which parser to use");var P2={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"},k2=($)=>typeof $==="string"?{...P2,name:$}:{...P2,...$};var x2=($)=>{let X=k2($),W=X.name!==void 0?[...X.basePath,X.definitionPath,X.name]:X.basePath;return{...X,currentPath:W,propertyPath:void 0,seen:new Map(Object.entries(X.definitions).map(([J,Y])=>[Y._def,{def:Y._def,path:[...X.basePath,X.definitionPath,J],jsonSchema:void 0}]))}};function u1($,X,W,J){if(!J?.errorMessages)return;if(W)$.errorMessage={...$.errorMessage,[X]:W}}function L($,X,W,J,Y){$[X]=W,u1($,X,J,Y)}function h2(){return{}}function g2($,X){let W={type:"array"};if($.type?._def&&$.type?._def?.typeName!==V.ZodAny)W.items=F($.type._def,{...X,currentPath:[...X.currentPath,"items"]});if($.minLength)L(W,"minItems",$.minLength.value,$.minLength.message,X);if($.maxLength)L(W,"maxItems",$.maxLength.value,$.maxLength.message,X);if($.exactLength)L(W,"minItems",$.exactLength.value,$.exactLength.message,X),L(W,"maxItems",$.exactLength.value,$.exactLength.message,X);return W}function y2($,X){let W={type:"integer",format:"int64"};if(!$.checks)return W;for(let J of $.checks)switch(J.kind){case"min":if(X.target==="jsonSchema7")if(J.inclusive)L(W,"minimum",J.value,J.message,X);else L(W,"exclusiveMinimum",J.value,J.message,X);else{if(!J.inclusive)W.exclusiveMinimum=!0;L(W,"minimum",J.value,J.message,X)}break;case"max":if(X.target==="jsonSchema7")if(J.inclusive)L(W,"maximum",J.value,J.message,X);else L(W,"exclusiveMaximum",J.value,J.message,X);else{if(!J.inclusive)W.exclusiveMaximum=!0;L(W,"maximum",J.value,J.message,X)}break;case"multipleOf":L(W,"multipleOf",J.value,J.message,X);break}return W}function Z2(){return{type:"boolean"}}function L1($,X){return F($.type._def,X)}var m2=($,X)=>{return F($.innerType._def,X)};function c1($,X,W){let J=W??X.dateStrategy;if(Array.isArray(J))return{anyOf:J.map((Y,G)=>c1($,X,Y))};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 m$($,X)}}var m$=($,X)=>{let W={type:"integer",format:"unix-time"};if(X.target==="openApi3")return W;for(let J of $.checks)switch(J.kind){case"min":L(W,"minimum",J.value,J.message,X);break;case"max":L(W,"maximum",J.value,J.message,X);break}return W};function l2($,X){return{...F($.innerType._def,X),default:$.defaultValue()}}function n2($,X){return X.effectStrategy==="input"?F($.schema._def,X):{}}function u2($){return{type:"string",enum:Array.from($.values)}}var l$=($)=>{if("type"in $&&$.type==="string")return!1;return"allOf"in $};function c2($,X){let W=[F($.left._def,{...X,currentPath:[...X.currentPath,"allOf","0"]}),F($.right._def,{...X,currentPath:[...X.currentPath,"allOf","1"]})].filter((G)=>!!G),J=X.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,Y=[];return W.forEach((G)=>{if(l$(G)){if(Y.push(...G.allOf),G.unevaluatedProperties===void 0)J=void 0}else{let H=G;if("additionalProperties"in G&&G.additionalProperties===!1){let{additionalProperties:w,...B}=G;H=B}else J=void 0;Y.push(H)}}),Y.length?{allOf:Y,...J}:void 0}function p2($,X){let W=typeof $.value;if(W!=="bigint"&&W!=="number"&&W!=="boolean"&&W!=="string")return{type:Array.isArray($.value)?"array":"object"};if(X.target==="openApi3")return{type:W==="bigint"?"integer":W,enum:[$.value]};return{type:W==="bigint"?"integer":W,const:$.value}}var p1=void 0,e={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(p1===void 0)p1=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return p1},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 _1($,X){let W={type:"string"};if($.checks)for(let J of $.checks)switch(J.kind){case"min":L(W,"minLength",typeof W.minLength==="number"?Math.max(W.minLength,J.value):J.value,J.message,X);break;case"max":L(W,"maxLength",typeof W.maxLength==="number"?Math.min(W.maxLength,J.value):J.value,J.message,X);break;case"email":switch(X.emailStrategy){case"format:email":$0(W,"email",J.message,X);break;case"format:idn-email":$0(W,"idn-email",J.message,X);break;case"pattern:zod":l(W,e.email,J.message,X);break}break;case"url":$0(W,"uri",J.message,X);break;case"uuid":$0(W,"uuid",J.message,X);break;case"regex":l(W,J.regex,J.message,X);break;case"cuid":l(W,e.cuid,J.message,X);break;case"cuid2":l(W,e.cuid2,J.message,X);break;case"startsWith":l(W,RegExp(`^${i1(J.value,X)}`),J.message,X);break;case"endsWith":l(W,RegExp(`${i1(J.value,X)}$`),J.message,X);break;case"datetime":$0(W,"date-time",J.message,X);break;case"date":$0(W,"date",J.message,X);break;case"time":$0(W,"time",J.message,X);break;case"duration":$0(W,"duration",J.message,X);break;case"length":L(W,"minLength",typeof W.minLength==="number"?Math.max(W.minLength,J.value):J.value,J.message,X),L(W,"maxLength",typeof W.maxLength==="number"?Math.min(W.maxLength,J.value):J.value,J.message,X);break;case"includes":{l(W,RegExp(i1(J.value,X)),J.message,X);break}case"ip":{if(J.version!=="v6")$0(W,"ipv4",J.message,X);if(J.version!=="v4")$0(W,"ipv6",J.message,X);break}case"base64url":l(W,e.base64url,J.message,X);break;case"jwt":l(W,e.jwt,J.message,X);break;case"cidr":{if(J.version!=="v6")l(W,e.ipv4Cidr,J.message,X);if(J.version!=="v4")l(W,e.ipv6Cidr,J.message,X);break}case"emoji":l(W,e.emoji(),J.message,X);break;case"ulid":{l(W,e.ulid,J.message,X);break}case"base64":{switch(X.base64Strategy){case"format:binary":{$0(W,"binary",J.message,X);break}case"contentEncoding:base64":{L(W,"contentEncoding","base64",J.message,X);break}case"pattern:zod":{l(W,e.base64,J.message,X);break}}break}case"nanoid":l(W,e.nanoid,J.message,X);case"toLowerCase":case"toUpperCase":case"trim":break;default:((Y)=>{})(J)}return W}function i1($,X){return X.patternStrategy==="escape"?u$($):$}var n$=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function u$($){let X="";for(let W=0;W<$.length;W++){if(!n$.has($[W]))X+="\\";X+=$[W]}return X}function $0($,X,W,J){if($.format||$.anyOf?.some((Y)=>Y.format)){if(!$.anyOf)$.anyOf=[];if($.format){if($.anyOf.push({format:$.format,...$.errorMessage&&J.errorMessages&&{errorMessage:{format:$.errorMessage.format}}}),delete $.format,$.errorMessage){if(delete $.errorMessage.format,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.anyOf.push({format:X,...W&&J.errorMessages&&{errorMessage:{format:W}}})}else L($,"format",X,W,J)}function l($,X,W,J){if($.pattern||$.allOf?.some((Y)=>Y.pattern)){if(!$.allOf)$.allOf=[];if($.pattern){if($.allOf.push({pattern:$.pattern,...$.errorMessage&&J.errorMessages&&{errorMessage:{pattern:$.errorMessage.pattern}}}),delete $.pattern,$.errorMessage){if(delete $.errorMessage.pattern,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.allOf.push({pattern:i2(X,J),...W&&J.errorMessages&&{errorMessage:{pattern:W}}})}else L($,"pattern",i2(X,J),W,J)}function i2($,X){if(!X.applyRegexFlags||!$.flags)return $.source;let W={i:$.flags.includes("i"),m:$.flags.includes("m"),s:$.flags.includes("s")},J=W.i?$.source.toLowerCase():$.source,Y="",G=!1,H=!1,w=!1;for(let B=0;B<J.length;B++){if(G){Y+=J[B],G=!1;continue}if(W.i){if(H){if(J[B].match(/[a-z]/)){if(w)Y+=J[B],Y+=`${J[B-2]}-${J[B]}`.toUpperCase(),w=!1;else if(J[B+1]==="-"&&J[B+2]?.match(/[a-z]/))Y+=J[B],w=!0;else Y+=`${J[B]}${J[B].toUpperCase()}`;continue}}else if(J[B].match(/[a-z]/)){Y+=`[${J[B]}${J[B].toUpperCase()}]`;continue}}if(W.m){if(J[B]==="^"){Y+=`(^|(?<=[\r
5
- ]))`;continue}else if(J[B]==="$"){Y+=`($|(?=[\r
6
- ]))`;continue}}if(W.s&&J[B]==="."){Y+=H?`${J[B]}\r
7
- `:`[${J[B]}\r
8
- ]`;continue}if(Y+=J[B],J[B]==="\\")G=!0;else if(H&&J[B]==="]")H=!1;else if(!H&&J[B]==="[")H=!0}try{new RegExp(Y)}catch{return console.warn(`Could not convert regex pattern at ${X.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),$.source}return Y}function E1($,X){if(X.target==="openAi")console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");if(X.target==="openApi3"&&$.keyType?._def.typeName===V.ZodEnum)return{type:"object",required:$.keyType._def.values,properties:$.keyType._def.values.reduce((J,Y)=>({...J,[Y]:F($.valueType._def,{...X,currentPath:[...X.currentPath,"properties",Y]})??{}}),{}),additionalProperties:X.rejectedAdditionalProperties};let W={type:"object",additionalProperties:F($.valueType._def,{...X,currentPath:[...X.currentPath,"additionalProperties"]})??X.allowedAdditionalProperties};if(X.target==="openApi3")return W;if($.keyType?._def.typeName===V.ZodString&&$.keyType._def.checks?.length){let{type:J,...Y}=_1($.keyType._def,X);return{...W,propertyNames:Y}}else if($.keyType?._def.typeName===V.ZodEnum)return{...W,propertyNames:{enum:$.keyType._def.values}};else if($.keyType?._def.typeName===V.ZodBranded&&$.keyType._def.type._def.typeName===V.ZodString&&$.keyType._def.type._def.checks?.length){let{type:J,...Y}=L1($.keyType._def,X);return{...W,propertyNames:Y}}return W}function d2($,X){if(X.mapStrategy==="record")return E1($,X);let W=F($.keyType._def,{...X,currentPath:[...X.currentPath,"items","items","0"]})||{},J=F($.valueType._def,{...X,currentPath:[...X.currentPath,"items","items","1"]})||{};return{type:"array",maxItems:125,items:{type:"array",items:[W,J],minItems:2,maxItems:2}}}function o2($){let X=$.values,J=Object.keys($.values).filter((G)=>{return typeof X[X[G]]!=="number"}).map((G)=>X[G]),Y=Array.from(new Set(J.map((G)=>typeof G)));return{type:Y.length===1?Y[0]==="string"?"string":"number":["string","number"],enum:J}}function r2(){return{not:{}}}function a2($){return $.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var d0={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function s2($,X){if(X.target==="openApi3")return t2($,X);let W=$.options instanceof Map?Array.from($.options.values()):$.options;if(W.every((J)=>(J._def.typeName in d0)&&(!J._def.checks||!J._def.checks.length))){let J=W.reduce((Y,G)=>{let H=d0[G._def.typeName];return H&&!Y.includes(H)?[...Y,H]:Y},[]);return{type:J.length>1?J:J[0]}}else if(W.every((J)=>J._def.typeName==="ZodLiteral"&&!J.description)){let J=W.reduce((Y,G)=>{let H=typeof G._def.value;switch(H){case"string":case"number":case"boolean":return[...Y,H];case"bigint":return[...Y,"integer"];case"object":if(G._def.value===null)return[...Y,"null"];case"symbol":case"undefined":case"function":default:return Y}},[]);if(J.length===W.length){let Y=J.filter((G,H,w)=>w.indexOf(G)===H);return{type:Y.length>1?Y:Y[0],enum:W.reduce((G,H)=>{return G.includes(H._def.value)?G:[...G,H._def.value]},[])}}}else if(W.every((J)=>J._def.typeName==="ZodEnum"))return{type:"string",enum:W.reduce((J,Y)=>[...J,...Y._def.values.filter((G)=>!J.includes(G))],[])};return t2($,X)}var t2=($,X)=>{let W=($.options instanceof Map?Array.from($.options.values()):$.options).map((J,Y)=>F(J._def,{...X,currentPath:[...X.currentPath,"anyOf",`${Y}`]})).filter((J)=>!!J&&(!X.strictUnions||typeof J==="object"&&Object.keys(J).length>0));return W.length?{anyOf:W}:void 0};function e2($,X){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes($.innerType._def.typeName)&&(!$.innerType._def.checks||!$.innerType._def.checks.length)){if(X.target==="openApi3")return{type:d0[$.innerType._def.typeName],nullable:!0};return{type:[d0[$.innerType._def.typeName],"null"]}}if(X.target==="openApi3"){let J=F($.innerType._def,{...X,currentPath:[...X.currentPath]});if(J&&"$ref"in J)return{allOf:[J],nullable:!0};return J&&{...J,nullable:!0}}let W=F($.innerType._def,{...X,currentPath:[...X.currentPath,"anyOf","0"]});return W&&{anyOf:[W,{type:"null"}]}}function $4($,X){let W={type:"number"};if(!$.checks)return W;for(let J of $.checks)switch(J.kind){case"int":W.type="integer",u1(W,"type",J.message,X);break;case"min":if(X.target==="jsonSchema7")if(J.inclusive)L(W,"minimum",J.value,J.message,X);else L(W,"exclusiveMinimum",J.value,J.message,X);else{if(!J.inclusive)W.exclusiveMinimum=!0;L(W,"minimum",J.value,J.message,X)}break;case"max":if(X.target==="jsonSchema7")if(J.inclusive)L(W,"maximum",J.value,J.message,X);else L(W,"exclusiveMaximum",J.value,J.message,X);else{if(!J.inclusive)W.exclusiveMaximum=!0;L(W,"maximum",J.value,J.message,X)}break;case"multipleOf":L(W,"multipleOf",J.value,J.message,X);break}return W}function X4($,X){let W=X.target==="openAi",J={type:"object",properties:{}},Y=[],G=$.shape();for(let w in G){let B=G[w];if(B===void 0||B._def===void 0)continue;let D=p$(B);if(D&&W){if(B instanceof u)B=B._def.innerType;if(!B.isNullable())B=B.nullable();D=!1}let j=F(B._def,{...X,currentPath:[...X.currentPath,"properties",w],propertyPath:[...X.currentPath,"properties",w]});if(j===void 0)continue;if(J.properties[w]=j,!D)Y.push(w)}if(Y.length)J.required=Y;let H=c$($,X);if(H!==void 0)J.additionalProperties=H;return J}function c$($,X){if($.catchall._def.typeName!=="ZodNever")return F($.catchall._def,{...X,currentPath:[...X.currentPath,"additionalProperties"]});switch($.unknownKeys){case"passthrough":return X.allowedAdditionalProperties;case"strict":return X.rejectedAdditionalProperties;case"strip":return X.removeAdditionalStrategy==="strict"?X.allowedAdditionalProperties:X.rejectedAdditionalProperties}}function p$($){try{return $.isOptional()}catch{return!0}}var W4=($,X)=>{if(X.currentPath.toString()===X.propertyPath?.toString())return F($.innerType._def,X);let W=F($.innerType._def,{...X,currentPath:[...X.currentPath,"anyOf","1"]});return W?{anyOf:[{not:{}},W]}:{}};var J4=($,X)=>{if(X.pipeStrategy==="input")return F($.in._def,X);else if(X.pipeStrategy==="output")return F($.out._def,X);let W=F($.in._def,{...X,currentPath:[...X.currentPath,"allOf","0"]}),J=F($.out._def,{...X,currentPath:[...X.currentPath,"allOf",W?"1":"0"]});return{allOf:[W,J].filter((Y)=>Y!==void 0)}};function Y4($,X){return F($.type._def,X)}function G4($,X){let J={type:"array",uniqueItems:!0,items:F($.valueType._def,{...X,currentPath:[...X.currentPath,"items"]})};if($.minSize)L(J,"minItems",$.minSize.value,$.minSize.message,X);if($.maxSize)L(J,"maxItems",$.maxSize.value,$.maxSize.message,X);return J}function Q4($,X){if($.rest)return{type:"array",minItems:$.items.length,items:$.items.map((W,J)=>F(W._def,{...X,currentPath:[...X.currentPath,"items",`${J}`]})).reduce((W,J)=>J===void 0?W:[...W,J],[]),additionalItems:F($.rest._def,{...X,currentPath:[...X.currentPath,"additionalItems"]})};else return{type:"array",minItems:$.items.length,maxItems:$.items.length,items:$.items.map((W,J)=>F(W._def,{...X,currentPath:[...X.currentPath,"items",`${J}`]})).reduce((W,J)=>J===void 0?W:[...W,J],[])}}function H4(){return{not:{}}}function w4(){return{}}var B4=($,X)=>{return F($.innerType._def,X)};var D4=($,X,W)=>{switch(X){case V.ZodString:return _1($,W);case V.ZodNumber:return $4($,W);case V.ZodObject:return X4($,W);case V.ZodBigInt:return y2($,W);case V.ZodBoolean:return Z2();case V.ZodDate:return c1($,W);case V.ZodUndefined:return H4();case V.ZodNull:return a2(W);case V.ZodArray:return g2($,W);case V.ZodUnion:case V.ZodDiscriminatedUnion:return s2($,W);case V.ZodIntersection:return c2($,W);case V.ZodTuple:return Q4($,W);case V.ZodRecord:return E1($,W);case V.ZodLiteral:return p2($,W);case V.ZodEnum:return u2($);case V.ZodNativeEnum:return o2($);case V.ZodNullable:return e2($,W);case V.ZodOptional:return W4($,W);case V.ZodMap:return d2($,W);case V.ZodSet:return G4($,W);case V.ZodLazy:return()=>$.getter()._def;case V.ZodPromise:return Y4($,W);case V.ZodNaN:case V.ZodNever:return r2();case V.ZodEffects:return n2($,W);case V.ZodAny:return h2();case V.ZodUnknown:return w4();case V.ZodDefault:return l2($,W);case V.ZodBranded:return L1($,W);case V.ZodReadonly:return B4($,W);case V.ZodCatch:return m2($,W);case V.ZodPipeline:return J4($,W);case V.ZodFunction:case V.ZodVoid:case V.ZodSymbol:return;default:return((J)=>{return})(X)}};function F($,X,W=!1){let J=X.seen.get($);if(X.override){let w=X.override?.($,X,J,W);if(w!==T2)return w}if(J&&!W){let w=i$(J,X);if(w!==void 0)return w}let Y={def:$,path:X.currentPath,jsonSchema:void 0};X.seen.set($,Y);let G=D4($,$.typeName,X),H=typeof G==="function"?F(G(),X):G;if(H)o$($,X,H);if(X.postProcess){let w=X.postProcess(H,$,X);return Y.jsonSchema=H,w}return Y.jsonSchema=H,H}var i$=($,X)=>{switch(X.$refStrategy){case"root":return{$ref:$.path.join("/")};case"relative":return{$ref:d$(X.currentPath,$.path)};case"none":case"seen":{if($.path.length<X.currentPath.length&&$.path.every((W,J)=>X.currentPath[J]===W))return console.warn(`Recursive reference detected at ${X.currentPath.join("/")}! Defaulting to any`),{};return X.$refStrategy==="seen"?{}:void 0}}},d$=($,X)=>{let W=0;for(;W<$.length&&W<X.length;W++)if($[W]!==X[W])break;return[($.length-W).toString(),...X.slice(W)].join("/")},o$=($,X,W)=>{if($.description){if(W.description=$.description,X.markdownDescription)W.markdownDescription=$.description}return W};var d1=($,X)=>{let W=x2(X),J=typeof X==="object"&&X.definitions?Object.entries(X.definitions).reduce((B,[D,j])=>({...B,[D]:F(j._def,{...W,currentPath:[...W.basePath,W.definitionPath,D]},!0)??{}}),{}):void 0,Y=typeof X==="string"?X:X?.nameStrategy==="title"?void 0:X?.name,G=F($._def,Y===void 0?W:{...W,currentPath:[...W.basePath,W.definitionPath,Y]},!1)??{},H=typeof X==="object"&&X.name!==void 0&&X.nameStrategy==="title"?X.name:void 0;if(H!==void 0)G.title=H;let w=Y===void 0?J?{...G,[W.definitionPath]:J}:G:{$ref:[...W.$refStrategy==="relative"?[]:W.basePath,W.definitionPath,Y].join("/"),[W.definitionPath]:{...J,[Y]:G}};if(W.target==="jsonSchema7")w.$schema="http://json-schema.org/draft-07/schema#";else if(W.target==="jsonSchema2019-09"||W.target==="openAi")w.$schema="https://json-schema.org/draft/2019-09/schema#";if(W.target==="openAi"&&(("anyOf"in w)||("oneOf"in w)||("allOf"in w)||("type"in w)&&Array.isArray(w.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return w};var o1;(function($){$.Completable="McpCompletable"})(o1||(o1={}));class o0 extends N{_parse($){let{ctx:X}=this._processInputParams($),W=X.data;return this._def.type._parse({data:W,path:X.path,parent:X})}unwrap(){return this._def.type}}o0.create=($,X)=>{return new o0({type:$,typeName:o1.Completable,complete:X.complete,...r$(X)})};function r$($){if(!$)return{};let{errorMap:X,invalid_type_error:W,required_error:J,description:Y}=$;if(X&&(W||J))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(X)return{errorMap:X,description:Y};return{errorMap:(H,w)=>{var B,D;let{message:j}=$;if(H.code==="invalid_enum_value")return{message:j!==null&&j!==void 0?j:w.defaultError};if(typeof w.data==="undefined")return{message:(B=j!==null&&j!==void 0?j:J)!==null&&B!==void 0?B:w.defaultError};if(H.code!=="invalid_type")return{message:w.defaultError};return{message:(D=j!==null&&j!==void 0?j:W)!==null&&D!==void 0?D:w.defaultError}},description:Y}}class w0{static isTemplate($){return/\{[^}\s]+\}/.test($)}static validateLength($,X,W){if($.length>X)throw new Error(`${W} exceeds maximum length of ${X} characters (got ${$.length})`)}constructor($){w0.validateLength($,1e6,"Template"),this.template=$,this.parts=this.parse($)}toString(){return this.template}parse($){let X=[],W="",J=0,Y=0;while(J<$.length)if($[J]==="{"){if(W)X.push(W),W="";let G=$.indexOf("}",J);if(G===-1)throw new Error("Unclosed template expression");if(Y++,Y>1e4)throw new Error("Template contains too many expressions (max 10000)");let H=$.slice(J+1,G),w=this.getOperator(H),B=H.includes("*"),D=this.getNames(H),j=D[0];for(let R of D)w0.validateLength(R,1e6,"Variable name");X.push({name:j,operator:w,names:D,exploded:B}),J=G+1}else W+=$[J],J++;if(W)X.push(W);return X}getOperator($){return["+","#",".","/","?","&"].find((W)=>$.startsWith(W))||""}getNames($){let X=this.getOperator($);return $.slice(X.length).split(",").map((W)=>W.replace("*","").trim()).filter((W)=>W.length>0)}encodeValue($,X){if(w0.validateLength($,1e6,"Variable value"),X==="+"||X==="#")return encodeURI($);return encodeURIComponent($)}expandPart($,X){if($.operator==="?"||$.operator==="&"){let G=$.names.map((w)=>{let B=X[w];if(B===void 0)return"";let D=Array.isArray(B)?B.map((j)=>this.encodeValue(j,$.operator)).join(","):this.encodeValue(B.toString(),$.operator);return`${w}=${D}`}).filter((w)=>w.length>0);if(G.length===0)return"";return($.operator==="?"?"?":"&")+G.join("&")}if($.names.length>1){let G=$.names.map((H)=>X[H]).filter((H)=>H!==void 0);if(G.length===0)return"";return G.map((H)=>Array.isArray(H)?H[0]:H).join(",")}let W=X[$.name];if(W===void 0)return"";let Y=(Array.isArray(W)?W:[W]).map((G)=>this.encodeValue(G,$.operator));switch($.operator){case"":return Y.join(",");case"+":return Y.join(",");case"#":return"#"+Y.join(",");case".":return"."+Y.join(".");case"/":return"/"+Y.join("/");default:return Y.join(",")}}expand($){let X="",W=!1;for(let J of this.parts){if(typeof J==="string"){X+=J;continue}let Y=this.expandPart(J,$);if(!Y)continue;if((J.operator==="?"||J.operator==="&")&&W)X+=Y.replace("?","&");else X+=Y;if(J.operator==="?"||J.operator==="&")W=!0}return X}escapeRegExp($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}partToRegExp($){let X=[];for(let Y of $.names)w0.validateLength(Y,1e6,"Variable name");if($.operator==="?"||$.operator==="&"){for(let Y=0;Y<$.names.length;Y++){let G=$.names[Y],H=Y===0?"\\"+$.operator:"&";X.push({pattern:H+this.escapeRegExp(G)+"=([^&]+)",name:G})}return X}let W,J=$.name;switch($.operator){case"":W=$.exploded?"([^/]+(?:,[^/]+)*)":"([^/,]+)";break;case"+":case"#":W="(.+)";break;case".":W="\\.([^/,]+)";break;case"/":W="/"+($.exploded?"([^/]+(?:,[^/]+)*)":"([^/,]+)");break;default:W="([^/]+)"}return X.push({pattern:W,name:J}),X}match($){w0.validateLength($,1e6,"URI");let X="^",W=[];for(let H of this.parts)if(typeof H==="string")X+=this.escapeRegExp(H);else{let w=this.partToRegExp(H);for(let{pattern:B,name:D}of w)X+=B,W.push({name:D,exploded:H.exploded})}X+="$",w0.validateLength(X,1e6,"Generated regex pattern");let J=new RegExp(X),Y=$.match(J);if(!Y)return null;let G={};for(let H=0;H<W.length;H++){let{name:w,exploded:B}=W[H],D=Y[H+1],j=w.replace("*","");if(B&&D.includes(","))G[j]=D.split(",");else G[j]=D}return G}}class r1{constructor($,X){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new n1($,X)}async connect($){return await this.server.connect($)}async close(){await this.server.close()}setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler(N1.shape.method.value),this.server.assertCanSetRequestHandler(q1.shape.method.value),this.server.registerCapabilities({tools:{}}),this.server.setRequestHandler(N1,()=>({tools:Object.entries(this._registeredTools).map(([$,X])=>{return{name:$,description:X.description,inputSchema:X.inputSchema?d1(X.inputSchema,{strictUnions:!0}):a$}})})),this.server.setRequestHandler(q1,async($,X)=>{let W=this._registeredTools[$.params.name];if(!W)throw new m(h.InvalidParams,`Tool ${$.params.name} not found`);if(W.inputSchema){let J=await W.inputSchema.safeParseAsync($.params.arguments);if(!J.success)throw new m(h.InvalidParams,`Invalid arguments for tool ${$.params.name}: ${J.error.message}`);let Y=J.data,G=W.callback;try{return await Promise.resolve(G(Y,X))}catch(H){return{content:[{type:"text",text:H instanceof Error?H.message:String(H)}],isError:!0}}}else{let J=W.callback;try{return await Promise.resolve(J(X))}catch(Y){return{content:[{type:"text",text:Y instanceof Error?Y.message:String(Y)}],isError:!0}}}}),this._toolHandlersInitialized=!0}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(R1.shape.method.value),this.server.setRequestHandler(R1,async($)=>{switch($.params.ref.type){case"ref/prompt":return this.handlePromptCompletion($,$.params.ref);case"ref/resource":return this.handleResourceCompletion($,$.params.ref);default:throw new m(h.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,X){let W=this._registeredPrompts[X.name];if(!W)throw new m(h.InvalidParams,`Prompt ${$.params.ref.name} not found`);if(!W.argsSchema)return f1;let J=W.argsSchema.shape[$.params.argument.name];if(!(J instanceof o0))return f1;let G=await J._def.complete($.params.argument.value);return M4(G)}async handleResourceCompletion($,X){let W=Object.values(this._registeredResourceTemplates).find((G)=>G.resourceTemplate.uriTemplate.toString()===X.uri);if(!W){if(this._registeredResources[X.uri])return f1;throw new m(h.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let J=W.resourceTemplate.completeCallback($.params.argument.name);if(!J)return f1;let Y=await J($.params.argument.value);return M4(Y)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(O1.shape.method.value),this.server.assertCanSetRequestHandler(A1.shape.method.value),this.server.assertCanSetRequestHandler(z1.shape.method.value),this.server.registerCapabilities({resources:{}}),this.server.setRequestHandler(O1,async($,X)=>{let W=Object.entries(this._registeredResources).map(([Y,G])=>({uri:Y,name:G.name,...G.metadata})),J=[];for(let Y of Object.values(this._registeredResourceTemplates)){if(!Y.resourceTemplate.listCallback)continue;let G=await Y.resourceTemplate.listCallback(X);for(let H of G.resources)J.push({...H,...Y.metadata})}return{resources:[...W,...J]}}),this.server.setRequestHandler(A1,async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([X,W])=>({name:X,uriTemplate:W.resourceTemplate.uriTemplate.toString(),...W.metadata}))}}),this.server.setRequestHandler(z1,async($,X)=>{let W=new URL($.params.uri),J=this._registeredResources[W.toString()];if(J)return J.readCallback(W,X);for(let Y of Object.values(this._registeredResourceTemplates)){let G=Y.resourceTemplate.uriTemplate.match(W.toString());if(G)return Y.readCallback(W,G,X)}throw new m(h.InvalidParams,`Resource ${W} not found`)}),this.setCompletionRequestHandler(),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(U1.shape.method.value),this.server.assertCanSetRequestHandler(K1.shape.method.value),this.server.registerCapabilities({prompts:{}}),this.server.setRequestHandler(U1,()=>({prompts:Object.entries(this._registeredPrompts).map(([$,X])=>{return{name:$,description:X.description,arguments:X.argsSchema?t$(X.argsSchema):void 0}})})),this.server.setRequestHandler(K1,async($,X)=>{let W=this._registeredPrompts[$.params.name];if(!W)throw new m(h.InvalidParams,`Prompt ${$.params.name} not found`);if(W.argsSchema){let J=await W.argsSchema.safeParseAsync($.params.arguments);if(!J.success)throw new m(h.InvalidParams,`Invalid arguments for prompt ${$.params.name}: ${J.error.message}`);let Y=J.data,G=W.callback;return await Promise.resolve(G(Y,X))}else{let J=W.callback;return await Promise.resolve(J(X))}}),this.setCompletionRequestHandler(),this._promptHandlersInitialized=!0}resource($,X,...W){let J;if(typeof W[0]==="object")J=W.shift();let Y=W[0];if(typeof X==="string"){if(this._registeredResources[X])throw new Error(`Resource ${X} is already registered`);this._registeredResources[X]={name:$,metadata:J,readCallback:Y}}else{if(this._registeredResourceTemplates[$])throw new Error(`Resource template ${$} is already registered`);this._registeredResourceTemplates[$]={resourceTemplate:X,metadata:J,readCallback:Y}}this.setResourceRequestHandlers()}tool($,...X){if(this._registeredTools[$])throw new Error(`Tool ${$} is already registered`);let W;if(typeof X[0]==="string")W=X.shift();let J;if(X.length>1)J=X.shift();let Y=X[0];this._registeredTools[$]={description:W,inputSchema:J===void 0?void 0:Q.object(J),callback:Y},this.setToolRequestHandlers()}prompt($,...X){if(this._registeredPrompts[$])throw new Error(`Prompt ${$} is already registered`);let W;if(typeof X[0]==="string")W=X.shift();let J;if(X.length>1)J=X.shift();let Y=X[0];this._registeredPrompts[$]={description:W,argsSchema:J===void 0?void 0:Q.object(J),callback:Y},this.setPromptRequestHandlers()}}class S0{constructor($,X){this._callbacks=X,this._uriTemplate=typeof $==="string"?new w0($):$}get uriTemplate(){return this._uriTemplate}get listCallback(){return this._callbacks.list}completeCallback($){var X;return(X=this._callbacks.complete)===null||X===void 0?void 0:X[$]}}var a$={type:"object"};function t$($){return Object.entries($.shape).map(([X,W])=>({name:X,description:W.description,required:!W.isOptional()}))}function M4($){return{completion:{values:$.slice(0,100),total:$.length,hasMore:$.length>100}}}var f1={completion:{values:[],hasMore:!1}};import j4 from"node:process";class a1{append($){this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){if(!this._buffer)return null;let $=this._buffer.indexOf(`
9
- `);if($===-1)return null;let X=this._buffer.toString("utf8",0,$);return this._buffer=this._buffer.subarray($+1),s$(X)}clear(){this._buffer=void 0}}function s$($){return R2.parse(JSON.parse($))}function V4($){return JSON.stringify($)+`
10
- `}class t1{constructor($=j4.stdin,X=j4.stdout){this._stdin=$,this._stdout=X,this._readBuffer=new a1,this._started=!1,this._ondata=(W)=>{this._readBuffer.append(W),this.processReadBuffer()},this._onerror=(W)=>{var J;(J=this.onerror)===null||J===void 0||J.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 $,X;while(!0)try{let W=this._readBuffer.readMessage();if(W===null)break;($=this.onmessage)===null||$===void 0||$.call(this,W)}catch(W){(X=this.onerror)===null||X===void 0||X.call(this,W)}}async close(){var $;if(this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),($=this.onclose)===null||$===void 0||$.call(this)}send($){return new Promise((X)=>{let W=V4($);if(this._stdout.write(W))X();else this._stdout.once("drain",X)})}}var F4=p4(K4(),1);F4.default.config();var N3=process.env.LOGSEQ_PORT||"12315",q3=process.env.LOGSEQ_HOST||"127.0.0.1",X2=process.env.LOGSEQ_TOKEN||"",S4=`http://${q3}:${N3}/api`;if(!X2&&process.env.TEST_TYPE!=="unit"&&process.env.MOCK_LOGSEQ_API!=="true")console.error("Error: LOGSEQ_TOKEN is required. Set it in a .env file or as an environment variable."),process.exit(1);var C=(...$)=>console.error(...$);var R3=process.env.MOCK_LOGSEQ_API==="true",I={pages:[{name:"MCP-Test-Page",uuid:"mock-page-1",properties:{"test-property":"test-value"}},{name:"Current-Test-Page",uuid:"mock-page-2",properties:{}},{name:"Reference-Test-Page",uuid:"mock-page-3",properties:{}},{name:"Recipe Page",uuid:"mock-page-4",properties:{tags:["recipe"]}},{name:"Tasks-Page",uuid:"mock-page-5",properties:{}}],blocks:[{uuid:"mock-block-uuid",content:"This is a test block created by MCP integration test",page:{id:"MCP-Test-Page"},parent:null},{uuid:"task-todo",content:"TODO This is a todo task",page:{id:"Tasks-Page"},parent:null},{uuid:"task-doing",content:"DOING This is a doing task",page:{id:"Tasks-Page"},parent:null},{uuid:"task-done",content:"DONE This is a done task",page:{id:"Tasks-Page"},parent:null},{uuid:"recipe-block",content:"This is a recipe block",page:{id:"Recipe Page"},properties:{tags:["recipe"]},parent:null}],currentPage:{name:"Current-Test-Page",uuid:"mock-page-2"}};async function K($,X=[]){if(R3)return L3($,X);try{C(`Calling Logseq API: ${$} with args:`,JSON.stringify(X));let W=await fetch(S4,{method:"POST",headers:{Authorization:`Bearer ${X2}`,"Content-Type":"application/json"},body:JSON.stringify({method:$,args:X})});if(!W.ok)throw new Error(`Logseq API error: ${W.status} ${W.statusText}`);let J;try{let Y=await W.text();if(!Y||Y.trim()==="")return C(`Empty response from Logseq API (${$})`),null;J=JSON.parse(Y)}catch(Y){if(C(`JSON parse error for ${$}:`,Y),$.includes("getBlockProperty")||$.includes("getProperty")||$.includes("removeBlockProperty"))return null;throw new Error(`Failed to parse JSON response: ${Y.message}`)}return C("Logseq API response:",JSON.stringify(J).substring(0,200)+"..."),J}catch(W){throw console.error(`Error calling Logseq API (${$}):`,W),W}}function L3($,X=[]){switch(C(`[MOCK] Calling Logseq API: ${$} with args:`,JSON.stringify(X)),$){case"logseq.Editor.createPage":let[W,J,Y]=X,G={name:W,uuid:`page-${Date.now()}`,properties:J||{}};if(I.pages.push(G),Y?.redirect)I.currentPage={name:W,uuid:G.uuid||"mock-page-2"};return{name:W,uuid:G.uuid||"mock-page-2",properties:J||{},id:Date.now()};case"logseq.Editor.getPage":let H=X[0],w=I.pages.find((z)=>z.name.toLowerCase()===H.toLowerCase());if(!w)return null;return{name:w.name.toLowerCase().replace(/\s/g,"-"),originalName:w.name,uuid:w.uuid||"mock-page-2",properties:w.properties,id:Date.now()};case"logseq.Editor.getCurrentPage":return{name:I.currentPage.name.toLowerCase().replace(/\s/g,"-"),originalName:I.currentPage.name,uuid:I.currentPage.uuid||"mock-page-2",id:Date.now()};case"logseq.Editor.getAllPages":return I.pages.map((z)=>({name:z.name.toLowerCase().replace(/\s/g,"-"),originalName:z.name,uuid:z.uuid||"mock-page-2",id:Date.now(),journal:!1}));case"logseq.Editor.getPageBlocksTree":let B=X[0];return I.blocks.filter((z)=>z.page.id.toLowerCase()===B.toLowerCase()||z.page.id.toLowerCase().replace(/\s/g,"-")===B.toLowerCase());case"logseq.Editor.getPageLinkedReferences":return[{from:{name:"Another-Page",uuid:"mock-page-ref"},to:{name:X[0],uuid:"mock-page-target"},content:"Reference content"}];case"logseq.Editor.createBlock":let[D,j,R]=X,f={uuid:`mock-block-${Date.now()}`,content:j,page:{id:D},properties:R?.properties||{},parent:null};return I.blocks.push(f),f;case"logseq.Editor.insertBlock":let[b,v,T]=X,E={uuid:`mock-block-${Date.now()}`,content:v,page:{id:typeof b==="string"&&!b.includes("-")?b:"MCP-Test-Page"},properties:T?.properties||{},parent:typeof b==="string"&&b.includes("-")?b:null};return I.blocks.push(E),E;case"logseq.Editor.getBlock":let[d,Y0]=X,N0=I.blocks.find((z)=>z.uuid===d);if(!N0)return null;if(Y0?.includeChildren)return{...N0,children:I.blocks.filter((z)=>z.parent===d)};return N0;case"logseq.Editor.updateBlock":let[O0,a0,W2]=X,t0=I.blocks.find((z)=>z.uuid===O0);if(t0){if(t0.content=a0,W2?.properties)t0.properties={...t0.properties,...W2.properties}}return null;case"logseq.Editor.removeBlock":let[h4]=X,J2=I.blocks.findIndex((z)=>z.uuid===h4);if(J2>=0)I.blocks.splice(J2,1);return null;case"logseq.Editor.getBlockProperty":let[g4,y4]=X,I1=I.blocks.find((z)=>z.uuid===g4);if(!I1||!I1.properties)return null;return I1.properties[y4]||null;case"logseq.Editor.getBlockProperties":let[Z4]=X,Y2=I.blocks.find((z)=>z.uuid===Z4);if(!Y2)return null;return Y2.properties||{};case"logseq.DB.datascriptQuery":let[p]=X;if(p&&typeof p==="string"&&p.includes(":block/marker")){let z=p&&typeof p==="string"&&p.includes("TODO")?["TODO"]:p&&typeof p==="string"&&p.includes("DOING")?["DOING"]:p&&typeof p==="string"&&p.includes("DONE")?["DONE"]:["TODO","DOING","DONE"];return I.blocks.filter((b1)=>{let m4=b1.content.split(" ")[0]||"";return z.includes(m4)}).map((b1)=>[b1])}return[[{uuid:"mock-query-result",content:"Mock query result",properties:{}}]];case"logseq.DB.q":let[s0]=X;if(s0&&typeof s0==="string"){let z=I.blocks.filter((e0)=>e0.content.includes(s0)).map((e0)=>[e0]);return z.length>0?z:[[{uuid:"search-result",content:`Content matching ${s0}`,page:{id:"MCP-Test-Page"}}]]}return[[{uuid:"search-result",content:"Default search result",page:{id:"MCP-Test-Page"}}]];case"logseq.Datascript.q":let[x]=X;if(x&&typeof x==="string"&&x.includes("block/marker"))return I.blocks.filter((z)=>z.content.startsWith("TODO")||z.content.startsWith("DOING")||z.content.startsWith("DONE")).map((z)=>[z.uuid,z.content.split(" ")[0]]);else if(x&&typeof x==="string"&&x.includes(":block/content"))return I.blocks.map((z)=>[[{uuid:z.uuid,content:z.content,":block/content":z.content,page:z.page}]]);else if(x&&typeof x==="string"&&x.includes(":block/_refs"))return[["mock-reference-uuid"]];else if(x&&typeof x==="string"&&x.includes(":block/properties")&&x.includes("recipe"))return I.blocks.filter((z)=>z.properties&&z.properties.tags&&z.properties.tags.includes("recipe")).map((z)=>[z.uuid]);else if(x&&typeof x==="string"&&x.includes(":page/properties")&&x.includes("recipe"))return I.pages.filter((z)=>z.properties&&z.properties.tags&&z.properties.tags.includes("recipe")).map((z)=>[z.name]);return I.blocks.map((z)=>[[{uuid:z.uuid,content:z.content}]]);case"logseq.Datascript.qUpsert":return{blocks:I.blocks.filter((z)=>z.properties&&z.properties.tags&&z.properties.tags.includes("recipe")).map((z)=>({uuid:z.uuid,content:z.content})),pages:I.pages.filter((z)=>z.properties&&z.properties.tags&&z.properties.tags.includes("recipe")).map((z)=>({name:z.name}))};default:return C(`[MOCK] Unhandled method: ${$}`),null}}function N4($){$.tool("query",`Search and query the Logseq graph using Datalog queries or text search. This is the most powerful way to retrieve specific information.
2
+ import{createRequire as qN}from"node:module";var KN=Object.create;var{getPrototypeOf:BN,defineProperty:NW,getOwnPropertyNames:AN}=Object;var SN=Object.prototype.hasOwnProperty;var IW=($,v,U)=>{U=$!=null?KN(BN($)):{};let X=v||!$||!$.__esModule?NW(U,"default",{value:$,enumerable:!0}):U;for(let J of AN($))if(!SN.call(X,J))NW(X,J,{get:()=>$[J],enumerable:!0});return X};var k=($,v)=>()=>(v||$((v={exports:{}}).exports,v),v.exports);var H4=($,v)=>{for(var U in v)NW($,U,{get:v[U],enumerable:!0,configurable:!0,set:(X)=>v[U]=()=>X})};var q0=qN(import.meta.url);var pv=k((s7)=>{Object.defineProperty(s7,"__esModule",{value:!0});s7.regexpCode=s7.getEsmExportName=s7.getProperty=s7.safeStringify=s7.stringify=s7.strConcat=s7.addCodeArg=s7.str=s7._=s7.nil=s7._Code=s7.Name=s7.IDENTIFIER=s7._CodeOrName=void 0;class AX{}s7._CodeOrName=AX;s7.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class w1 extends AX{constructor($){super();if(!s7.IDENTIFIER.test($))throw Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}s7.Name=w1;class Q6 extends AX{constructor($){super();this._items=typeof $==="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((v,U)=>`${v}${U}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((v,U)=>{if(U instanceof w1)v[U.str]=(v[U.str]||0)+1;return v},{})}}s7._Code=Q6;s7.nil=new Q6("");function a7($,...v){let U=[$[0]],X=0;while(X<v.length)aY(U,v[X]),U.push($[++X]);return new Q6(U)}s7._=a7;var tY=new Q6("+");function e7($,...v){let U=[ov($[0])],X=0;while(X<v.length)U.push(tY),aY(U,v[X]),U.push(tY,ov($[++X]));return wK(U),new Q6(U)}s7.str=e7;function aY($,v){if(v instanceof Q6)$.push(...v._items);else if(v instanceof w1)$.push(v);else $.push(IK(v))}s7.addCodeArg=aY;function wK($){let v=1;while(v<$.length-1){if($[v]===tY){let U=HK($[v-1],$[v+1]);if(U!==void 0){$.splice(v-1,3,U);continue}$[v++]="+"}v++}}function HK($,v){if(v==='""')return $;if($==='""')return v;if(typeof $=="string"){if(v instanceof w1||$[$.length-1]!=='"')return;if(typeof v!="string")return`${$.slice(0,-1)}${v}"`;if(v[0]==='"')return $.slice(0,-1)+v.slice(1);return}if(typeof v=="string"&&v[0]==='"'&&!($ instanceof w1))return`"${$}${v.slice(1)}`;return}function NK($,v){return v.emptyStr()?$:$.emptyStr()?v:e7`${$}${v}`}s7.strConcat=NK;function IK($){return typeof $=="number"||typeof $=="boolean"||$===null?$:ov(Array.isArray($)?$.join(","):$)}function OK($){return new Q6(ov($))}s7.stringify=OK;function ov($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}s7.safeStringify=ov;function DK($){return typeof $=="string"&&s7.IDENTIFIER.test($)?new Q6(`.${$}`):a7`[${$}]`}s7.getProperty=DK;function bK($){if(typeof $=="string"&&s7.IDENTIFIER.test($))return new Q6(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}s7.getEsmExportName=bK;function VK($){return new Q6($.toString())}s7.regexpCode=VK});var vz=k((J5)=>{Object.defineProperty(J5,"__esModule",{value:!0});J5.ValueScope=J5.ValueScopeName=J5.Scope=J5.varKinds=J5.UsedValueState=void 0;var m$=pv();class v5 extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var qX;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(qX||(J5.UsedValueState=qX={}));J5.varKinds={const:new m$.Name("const"),let:new m$.Name("let"),var:new m$.Name("var")};class sY{constructor({prefixes:$,parent:v}={}){this._names={},this._prefixes=$,this._parent=v}toName($){return $ instanceof m$.Name?$:this.name($)}name($){return new m$.Name(this._newName($))}_newName($){let v=this._names[$]||this._nameGroup($);return`${$}${v.index++}`}_nameGroup($){var v,U;if(((U=(v=this._parent)===null||v===void 0?void 0:v._prefixes)===null||U===void 0?void 0:U.has($))||this._prefixes&&!this._prefixes.has($))throw Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}J5.Scope=sY;class $z extends m$.Name{constructor($,v){super(v);this.prefix=$}setValue($,{property:v,itemIndex:U}){this.value=$,this.scopePath=m$._`.${new m$.Name(v)}[${U}]`}}J5.ValueScopeName=$z;var CK=m$._`\n`;class U5 extends sY{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?CK:m$.nil}}get(){return this._scope}name($){return new $z($,this._newName($))}value($,v){var U;if(v.ref===void 0)throw Error("CodeGen: ref must be passed in value");let X=this.toName($),{prefix:J}=X,W=(U=v.key)!==null&&U!==void 0?U:v.ref,Y=this._values[J];if(Y){let Q=Y.get(W);if(Q)return Q}else Y=this._values[J]=new Map;Y.set(W,X);let z=this._scope[J]||(this._scope[J]=[]),G=z.length;return z[G]=v.ref,X.setValue(v,{property:J,itemIndex:G}),X}getValue($,v){let U=this._values[$];if(!U)return;return U.get(v)}scopeRefs($,v=this._values){return this._reduceValues(v,(U)=>{if(U.scopePath===void 0)throw Error(`CodeGen: name "${U}" has no value`);return m$._`${$}${U.scopePath}`})}scopeCode($=this._values,v,U){return this._reduceValues($,(X)=>{if(X.value===void 0)throw Error(`CodeGen: name "${X}" has no value`);return X.value.code},v,U)}_reduceValues($,v,U={},X){let J=m$.nil;for(let W in $){let Y=$[W];if(!Y)continue;let z=U[W]=U[W]||new Map;Y.forEach((G)=>{if(z.has(G))return;z.set(G,qX.Started);let Q=v(G);if(Q){let j=this.opts.es5?J5.varKinds.var:J5.varKinds.const;J=m$._`${J}${j} ${G} = ${Q};${this.opts._n}`}else if(Q=X===null||X===void 0?void 0:X(G))J=m$._`${J}${Q}${this.opts._n}`;else throw new v5(G);z.set(G,qX.Completed)})}return J}}J5.ValueScope=U5});var p=k((n$)=>{Object.defineProperty(n$,"__esModule",{value:!0});n$.or=n$.and=n$.not=n$.CodeGen=n$.operators=n$.varKinds=n$.ValueScopeName=n$.ValueScope=n$.Scope=n$.Name=n$.regexpCode=n$.stringify=n$.getProperty=n$.nil=n$.strConcat=n$.str=n$._=void 0;var $$=pv(),j6=vz(),U4=pv();Object.defineProperty(n$,"_",{enumerable:!0,get:function(){return U4._}});Object.defineProperty(n$,"str",{enumerable:!0,get:function(){return U4.str}});Object.defineProperty(n$,"strConcat",{enumerable:!0,get:function(){return U4.strConcat}});Object.defineProperty(n$,"nil",{enumerable:!0,get:function(){return U4.nil}});Object.defineProperty(n$,"getProperty",{enumerable:!0,get:function(){return U4.getProperty}});Object.defineProperty(n$,"stringify",{enumerable:!0,get:function(){return U4.stringify}});Object.defineProperty(n$,"regexpCode",{enumerable:!0,get:function(){return U4.regexpCode}});Object.defineProperty(n$,"Name",{enumerable:!0,get:function(){return U4.Name}});var RX=vz();Object.defineProperty(n$,"Scope",{enumerable:!0,get:function(){return RX.Scope}});Object.defineProperty(n$,"ValueScope",{enumerable:!0,get:function(){return RX.ValueScope}});Object.defineProperty(n$,"ValueScopeName",{enumerable:!0,get:function(){return RX.ValueScopeName}});Object.defineProperty(n$,"varKinds",{enumerable:!0,get:function(){return RX.varKinds}});n$.operators={GT:new $$._Code(">"),GTE:new $$._Code(">="),LT:new $$._Code("<"),LTE:new $$._Code("<="),EQ:new $$._Code("==="),NEQ:new $$._Code("!=="),NOT:new $$._Code("!"),OR:new $$._Code("||"),AND:new $$._Code("&&"),ADD:new $$._Code("+")};class J4{optimizeNodes(){return this}optimizeNames($,v){return this}}class W5 extends J4{constructor($,v,U){super();this.varKind=$,this.name=v,this.rhs=U}render({es5:$,_n:v}){let U=$?j6.varKinds.var:this.varKind,X=this.rhs===void 0?"":` = ${this.rhs}`;return`${U} ${this.name}${X};`+v}optimizeNames($,v){if(!$[this.name.str])return;if(this.rhs)this.rhs=N1(this.rhs,$,v);return this}get names(){return this.rhs instanceof $$._CodeOrName?this.rhs.names:{}}}class Xz extends J4{constructor($,v,U){super();this.lhs=$,this.rhs=v,this.sideEffects=U}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,v){if(this.lhs instanceof $$.Name&&!$[this.lhs.str]&&!this.sideEffects)return;return this.rhs=N1(this.rhs,$,v),this}get names(){let $=this.lhs instanceof $$.Name?{}:{...this.lhs.names};return PX($,this.rhs)}}class Y5 extends Xz{constructor($,v,U,X){super($,U,X);this.op=v}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class z5 extends J4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class G5 extends J4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class Q5 extends J4{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class j5 extends J4{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,v){return this.code=N1(this.code,$,v),this}get names(){return this.code instanceof $$._CodeOrName?this.code.names:{}}}class kX extends J4{constructor($=[]){super();this.nodes=$}render($){return this.nodes.reduce((v,U)=>v+U.render($),"")}optimizeNodes(){let{nodes:$}=this,v=$.length;while(v--){let U=$[v].optimizeNodes();if(Array.isArray(U))$.splice(v,1,...U);else if(U)$[v]=U;else $.splice(v,1)}return $.length>0?this:void 0}optimizeNames($,v){let{nodes:U}=this,X=U.length;while(X--){let J=U[X];if(J.optimizeNames($,v))continue;xK($,J.names),U.splice(X,1)}return U.length>0?this:void 0}get names(){return this.nodes.reduce(($,v)=>L4($,v.names),{})}}class X4 extends kX{render($){return"{"+$._n+super.render($)+"}"+$._n}}class w5 extends kX{}class dv extends X4{}dv.kind="else";class f6 extends X4{constructor($,v){super(v);this.condition=$}render($){let v=`if(${this.condition})`+super.render($);if(this.else)v+="else "+this.else.render($);return v}optimizeNodes(){super.optimizeNodes();let $=this.condition;if($===!0)return this.nodes;let v=this.else;if(v){let U=v.optimizeNodes();v=this.else=Array.isArray(U)?new dv(U):U}if(v){if($===!1)return v instanceof f6?v:v.nodes;if(this.nodes.length)return this;return new f6(D5($),v instanceof f6?[v]:v.nodes)}if($===!1||!this.nodes.length)return;return this}optimizeNames($,v){var U;if(this.else=(U=this.else)===null||U===void 0?void 0:U.optimizeNames($,v),!(super.optimizeNames($,v)||this.else))return;return this.condition=N1(this.condition,$,v),this}get names(){let $=super.names;if(PX($,this.condition),this.else)L4($,this.else.names);return $}}f6.kind="if";class H1 extends X4{}H1.kind="for";class H5 extends H1{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,v){if(!super.optimizeNames($,v))return;return this.iteration=N1(this.iteration,$,v),this}get names(){return L4(super.names,this.iteration.names)}}class N5 extends H1{constructor($,v,U,X){super();this.varKind=$,this.name=v,this.from=U,this.to=X}render($){let v=$.es5?j6.varKinds.var:this.varKind,{name:U,from:X,to:J}=this;return`for(${v} ${U}=${X}; ${U}<${J}; ${U}++)`+super.render($)}get names(){let $=PX(super.names,this.from);return PX($,this.to)}}class Uz extends H1{constructor($,v,U,X){super();this.loop=$,this.varKind=v,this.name=U,this.iterable=X}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,v){if(!super.optimizeNames($,v))return;return this.iterable=N1(this.iterable,$,v),this}get names(){return L4(super.names,this.iterable.names)}}class LX extends X4{constructor($,v,U){super();this.name=$,this.args=v,this.async=U}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}LX.kind="func";class FX extends kX{render($){return"return "+super.render($)}}FX.kind="return";class I5 extends X4{render($){let v="try"+super.render($);if(this.catch)v+=this.catch.render($);if(this.finally)v+=this.finally.render($);return v}optimizeNodes(){var $,v;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(v=this.finally)===null||v===void 0||v.optimizeNodes(),this}optimizeNames($,v){var U,X;return super.optimizeNames($,v),(U=this.catch)===null||U===void 0||U.optimizeNames($,v),(X=this.finally)===null||X===void 0||X.optimizeNames($,v),this}get names(){let $=super.names;if(this.catch)L4($,this.catch.names);if(this.finally)L4($,this.finally.names);return $}}class EX extends X4{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}EX.kind="catch";class MX extends X4{render($){return"finally"+super.render($)}}MX.kind="finally";class O5{constructor($,v={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...v,_n:v.lines?`
3
+ `:""},this._extScope=$,this._scope=new j6.Scope({parent:$}),this._nodes=[new w5]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,v){let U=this._extScope.value($,v);return(this._values[U.prefix]||(this._values[U.prefix]=new Set)).add(U),U}getScopeValue($,v){return this._extScope.getValue($,v)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,v,U,X){let J=this._scope.toName(v);if(U!==void 0&&X)this._constants[J.str]=U;return this._leafNode(new W5($,J,U)),J}const($,v,U){return this._def(j6.varKinds.const,$,v,U)}let($,v,U){return this._def(j6.varKinds.let,$,v,U)}var($,v,U){return this._def(j6.varKinds.var,$,v,U)}assign($,v,U){return this._leafNode(new Xz($,v,U))}add($,v){return this._leafNode(new Y5($,n$.operators.ADD,v))}code($){if(typeof $=="function")$();else if($!==$$.nil)this._leafNode(new j5($));return this}object(...$){let v=["{"];for(let[U,X]of $){if(v.length>1)v.push(",");if(v.push(U),U!==X||this.opts.es5)v.push(":"),(0,$$.addCodeArg)(v,X)}return v.push("}"),new $$._Code(v)}if($,v,U){if(this._blockNode(new f6($)),v&&U)this.code(v).else().code(U).endIf();else if(v)this.code(v).endIf();else if(U)throw Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new f6($))}else(){return this._elseNode(new dv)}endIf(){return this._endBlockNode(f6,dv)}_for($,v){if(this._blockNode($),v)this.code(v).endFor();return this}for($,v){return this._for(new H5($),v)}forRange($,v,U,X,J=this.opts.es5?j6.varKinds.var:j6.varKinds.let){let W=this._scope.toName($);return this._for(new N5(J,W,v,U),()=>X(W))}forOf($,v,U,X=j6.varKinds.const){let J=this._scope.toName($);if(this.opts.es5){let W=v instanceof $$.Name?v:this.var("_arr",v);return this.forRange("_i",0,$$._`${W}.length`,(Y)=>{this.var(J,$$._`${W}[${Y}]`),U(J)})}return this._for(new Uz("of",X,J,v),()=>U(J))}forIn($,v,U,X=this.opts.es5?j6.varKinds.var:j6.varKinds.const){if(this.opts.ownProperties)return this.forOf($,$$._`Object.keys(${v})`,U);let J=this._scope.toName($);return this._for(new Uz("in",X,J,v),()=>U(J))}endFor(){return this._endBlockNode(H1)}label($){return this._leafNode(new z5($))}break($){return this._leafNode(new G5($))}return($){let v=new FX;if(this._blockNode(v),this.code($),v.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(FX)}try($,v,U){if(!v&&!U)throw Error('CodeGen: "try" without "catch" and "finally"');let X=new I5;if(this._blockNode(X),this.code($),v){let J=this.name("e");this._currNode=X.catch=new EX(J),v(J)}if(U)this._currNode=X.finally=new MX,this.code(U);return this._endBlockNode(EX,MX)}throw($){return this._leafNode(new Q5($))}block($,v){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(v);return this}endBlock($){let v=this._blockStarts.pop();if(v===void 0)throw Error("CodeGen: not in self-balancing block");let U=this._nodes.length-v;if(U<0||$!==void 0&&U!==$)throw Error(`CodeGen: wrong number of nodes: ${U} vs ${$} expected`);return this._nodes.length=v,this}func($,v=$$.nil,U,X){if(this._blockNode(new LX($,v,U)),X)this.code(X).endFunc();return this}endFunc(){return this._endBlockNode(LX)}optimize($=1){while($-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,v){let U=this._currNode;if(U instanceof $||v&&U instanceof v)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${v?`${$.kind}/${v.kind}`:$.kind}"`)}_elseNode($){let v=this._currNode;if(!(v instanceof f6))throw Error('CodeGen: "else" without "if"');return this._currNode=v.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let v=this._nodes;v[v.length-1]=$}}n$.CodeGen=O5;function L4($,v){for(let U in v)$[U]=($[U]||0)+(v[U]||0);return $}function PX($,v){return v instanceof $$._CodeOrName?L4($,v.names):$}function N1($,v,U){if($ instanceof $$.Name)return X($);if(!J($))return $;return new $$._Code($._items.reduce((W,Y)=>{if(Y instanceof $$.Name)Y=X(Y);if(Y instanceof $$._Code)W.push(...Y._items);else W.push(Y);return W},[]));function X(W){let Y=U[W.str];if(Y===void 0||v[W.str]!==1)return W;return delete v[W.str],Y}function J(W){return W instanceof $$._Code&&W._items.some((Y)=>Y instanceof $$.Name&&v[Y.str]===1&&U[Y.str]!==void 0)}}function xK($,v){for(let U in v)$[U]=($[U]||0)-(v[U]||0)}function D5($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:$$._`!${Jz($)}`}n$.not=D5;var gK=b5(n$.operators.AND);function fK(...$){return $.reduce(gK)}n$.and=fK;var yK=b5(n$.operators.OR);function uK(...$){return $.reduce(yK)}n$.or=uK;function b5($){return(v,U)=>v===$$.nil?U:U===$$.nil?v:$$._`${Jz(v)} ${$} ${Jz(U)}`}function Jz($){return $ instanceof $$.Name?$:$$._`(${$})`}});var J$=k((E5)=>{Object.defineProperty(E5,"__esModule",{value:!0});E5.checkStrictMode=E5.getErrorPath=E5.Type=E5.useFunc=E5.setEvaluated=E5.evaluatedPropsToName=E5.mergeEvaluated=E5.eachItem=E5.unescapeJsonPointer=E5.escapeJsonPointer=E5.escapeFragment=E5.unescapeFragment=E5.schemaRefOrVal=E5.schemaHasRulesButRef=E5.schemaHasRules=E5.checkUnknownRules=E5.alwaysValidSchema=E5.toHash=void 0;var j$=p(),nK=pv();function cK($){let v={};for(let U of $)v[U]=!0;return v}E5.toHash=cK;function iK($,v){if(typeof v=="boolean")return v;if(Object.keys(v).length===0)return!0;return A5($,v),!S5(v,$.self.RULES.all)}E5.alwaysValidSchema=iK;function A5($,v=$.schema){let{opts:U,self:X}=$;if(!U.strictSchema)return;if(typeof v==="boolean")return;let J=X.RULES.keywords;for(let W in v)if(!J[W])F5($,`unknown keyword: "${W}"`)}E5.checkUnknownRules=A5;function S5($,v){if(typeof $=="boolean")return!$;for(let U in $)if(v[U])return!0;return!1}E5.schemaHasRules=S5;function rK($,v){if(typeof $=="boolean")return!$;for(let U in $)if(U!=="$ref"&&v.all[U])return!0;return!1}E5.schemaHasRulesButRef=rK;function oK({topSchemaRef:$,schemaPath:v},U,X,J){if(!J){if(typeof U=="number"||typeof U=="boolean")return U;if(typeof U=="string")return j$._`${U}`}return j$._`${$}${v}${(0,j$.getProperty)(X)}`}E5.schemaRefOrVal=oK;function pK($){return q5(decodeURIComponent($))}E5.unescapeFragment=pK;function dK($){return encodeURIComponent(Yz($))}E5.escapeFragment=dK;function Yz($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}E5.escapeJsonPointer=Yz;function q5($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}E5.unescapeJsonPointer=q5;function tK($,v){if(Array.isArray($))for(let U of $)v(U);else v($)}E5.eachItem=tK;function K5({mergeNames:$,mergeToName:v,mergeValues:U,resultToName:X}){return(J,W,Y,z)=>{let G=Y===void 0?W:Y instanceof j$.Name?(W instanceof j$.Name?$(J,W,Y):v(J,W,Y),Y):W instanceof j$.Name?(v(J,Y,W),W):U(W,Y);return z===j$.Name&&!(G instanceof j$.Name)?X(J,G):G}}E5.mergeEvaluated={props:K5({mergeNames:($,v,U)=>$.if(j$._`${U} !== true && ${v} !== undefined`,()=>{$.if(j$._`${v} === true`,()=>$.assign(U,!0),()=>$.assign(U,j$._`${U} || {}`).code(j$._`Object.assign(${U}, ${v})`))}),mergeToName:($,v,U)=>$.if(j$._`${U} !== true`,()=>{if(v===!0)$.assign(U,!0);else $.assign(U,j$._`${U} || {}`),zz($,U,v)}),mergeValues:($,v)=>$===!0?!0:{...$,...v},resultToName:L5}),items:K5({mergeNames:($,v,U)=>$.if(j$._`${U} !== true && ${v} !== undefined`,()=>$.assign(U,j$._`${v} === true ? true : ${U} > ${v} ? ${U} : ${v}`)),mergeToName:($,v,U)=>$.if(j$._`${U} !== true`,()=>$.assign(U,v===!0?!0:j$._`${U} > ${v} ? ${U} : ${v}`)),mergeValues:($,v)=>$===!0?!0:Math.max($,v),resultToName:($,v)=>$.var("items",v)})};function L5($,v){if(v===!0)return $.var("props",!0);let U=$.var("props",j$._`{}`);if(v!==void 0)zz($,U,v);return U}E5.evaluatedPropsToName=L5;function zz($,v,U){Object.keys(U).forEach((X)=>$.assign(j$._`${v}${(0,j$.getProperty)(X)}`,!0))}E5.setEvaluated=zz;var B5={};function aK($,v){return $.scopeValue("func",{ref:v,code:B5[v.code]||(B5[v.code]=new nK._Code(v.code))})}E5.useFunc=aK;var Wz;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(Wz||(E5.Type=Wz={}));function eK($,v,U){if($ instanceof j$.Name){let X=v===Wz.Num;return U?X?j$._`"[" + ${$} + "]"`:j$._`"['" + ${$} + "']"`:X?j$._`"/" + ${$}`:j$._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return U?(0,j$.getProperty)($).toString():"/"+Yz($)}E5.getErrorPath=eK;function F5($,v,U=$.opts.strictSchema){if(!U)return;if(v=`strict mode: ${v}`,U===!0)throw Error(v);$.self.logger.warn(v)}E5.checkStrictMode=F5});var y6=k((P5)=>{Object.defineProperty(P5,"__esModule",{value:!0});var R$=p(),DB={data:new R$.Name("data"),valCxt:new R$.Name("valCxt"),instancePath:new R$.Name("instancePath"),parentData:new R$.Name("parentData"),parentDataProperty:new R$.Name("parentDataProperty"),rootData:new R$.Name("rootData"),dynamicAnchors:new R$.Name("dynamicAnchors"),vErrors:new R$.Name("vErrors"),errors:new R$.Name("errors"),this:new R$.Name("this"),self:new R$.Name("self"),scope:new R$.Name("scope"),json:new R$.Name("json"),jsonPos:new R$.Name("jsonPos"),jsonLen:new R$.Name("jsonLen"),jsonPart:new R$.Name("jsonPart")};P5.default=DB});var tv=k((_5)=>{Object.defineProperty(_5,"__esModule",{value:!0});_5.extendErrors=_5.resetErrorsCount=_5.reportExtraError=_5.reportError=_5.keyword$DataError=_5.keywordError=void 0;var v$=p(),_X=J$(),T$=y6();_5.keywordError={message:({keyword:$})=>v$.str`must pass "${$}" keyword validation`};_5.keyword$DataError={message:({keyword:$,schemaType:v})=>v?v$.str`"${$}" keyword must be ${v} ($data)`:v$.str`"${$}" keyword is invalid ($data)`};function VB($,v=_5.keywordError,U,X){let{it:J}=$,{gen:W,compositeRule:Y,allErrors:z}=J,G=C5($,v,U);if(X!==null&&X!==void 0?X:Y||z)R5(W,G);else k5(J,v$._`[${G}]`)}_5.reportError=VB;function KB($,v=_5.keywordError,U){let{it:X}=$,{gen:J,compositeRule:W,allErrors:Y}=X,z=C5($,v,U);if(R5(J,z),!(W||Y))k5(X,T$.default.vErrors)}_5.reportExtraError=KB;function BB($,v){$.assign(T$.default.errors,v),$.if(v$._`${T$.default.vErrors} !== null`,()=>$.if(v,()=>$.assign(v$._`${T$.default.vErrors}.length`,v),()=>$.assign(T$.default.vErrors,null)))}_5.resetErrorsCount=BB;function AB({gen:$,keyword:v,schemaValue:U,data:X,errsCount:J,it:W}){if(J===void 0)throw Error("ajv implementation error");let Y=$.name("err");$.forRange("i",J,T$.default.errors,(z)=>{if($.const(Y,v$._`${T$.default.vErrors}[${z}]`),$.if(v$._`${Y}.instancePath === undefined`,()=>$.assign(v$._`${Y}.instancePath`,(0,v$.strConcat)(T$.default.instancePath,W.errorPath))),$.assign(v$._`${Y}.schemaPath`,v$.str`${W.errSchemaPath}/${v}`),W.opts.verbose)$.assign(v$._`${Y}.schema`,U),$.assign(v$._`${Y}.data`,X)})}_5.extendErrors=AB;function R5($,v){let U=$.const("err",v);$.if(v$._`${T$.default.vErrors} === null`,()=>$.assign(T$.default.vErrors,v$._`[${U}]`),v$._`${T$.default.vErrors}.push(${U})`),$.code(v$._`${T$.default.errors}++`)}function k5($,v){let{gen:U,validateName:X,schemaEnv:J}=$;if(J.$async)U.throw(v$._`new ${$.ValidationError}(${v})`);else U.assign(v$._`${X}.errors`,v),U.return(!1)}var F4={keyword:new v$.Name("keyword"),schemaPath:new v$.Name("schemaPath"),params:new v$.Name("params"),propertyName:new v$.Name("propertyName"),message:new v$.Name("message"),schema:new v$.Name("schema"),parentSchema:new v$.Name("parentSchema")};function C5($,v,U){let{createErrors:X}=$.it;if(X===!1)return v$._`{}`;return SB($,v,U)}function SB($,v,U={}){let{gen:X,it:J}=$,W=[qB(J,U),LB($,U)];return FB($,v,W),X.object(...W)}function qB({errorPath:$},{instancePath:v}){let U=v?v$.str`${$}${(0,_X.getErrorPath)(v,_X.Type.Str)}`:$;return[T$.default.instancePath,(0,v$.strConcat)(T$.default.instancePath,U)]}function LB({keyword:$,it:{errSchemaPath:v}},{schemaPath:U,parentSchema:X}){let J=X?v:v$.str`${v}/${$}`;if(U)J=v$.str`${J}${(0,_X.getErrorPath)(U,_X.Type.Str)}`;return[F4.schemaPath,J]}function FB($,{params:v,message:U},X){let{keyword:J,data:W,schemaValue:Y,it:z}=$,{opts:G,propertyName:Q,topSchemaRef:j,schemaPath:H}=z;if(X.push([F4.keyword,J],[F4.params,typeof v=="function"?v($):v||v$._`{}`]),G.messages)X.push([F4.message,typeof U=="function"?U($):U]);if(G.verbose)X.push([F4.schema,Y],[F4.parentSchema,v$._`${j}${H}`],[T$.default.data,W]);if(Q)X.push([F4.propertyName,Q])}});var f5=k((x5)=>{Object.defineProperty(x5,"__esModule",{value:!0});x5.boolOrEmptySchema=x5.topBoolOrEmptySchema=void 0;var kB=tv(),CB=p(),_B=y6(),ZB={message:"boolean schema is false"};function TB($){let{gen:v,schema:U,validateName:X}=$;if(U===!1)T5($,!1);else if(typeof U=="object"&&U.$async===!0)v.return(_B.default.data);else v.assign(CB._`${X}.errors`,null),v.return(!0)}x5.topBoolOrEmptySchema=TB;function xB($,v){let{gen:U,schema:X}=$;if(X===!1)U.var(v,!1),T5($);else U.var(v,!0)}x5.boolOrEmptySchema=xB;function T5($,v){let{gen:U,data:X}=$,J={gen:U,keyword:"false schema",data:X,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};(0,kB.reportError)(J,ZB,void 0,v)}});var Qz=k((y5)=>{Object.defineProperty(y5,"__esModule",{value:!0});y5.getRules=y5.isJSONType=void 0;var fB=["string","number","integer","boolean","null","object","array"],yB=new Set(fB);function uB($){return typeof $=="string"&&yB.has($)}y5.isJSONType=uB;function hB(){let $={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...$,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},$.number,$.string,$.array,$.object],post:{rules:[]},all:{},keywords:{}}}y5.getRules=hB});var jz=k((m5)=>{Object.defineProperty(m5,"__esModule",{value:!0});m5.shouldUseRule=m5.shouldUseGroup=m5.schemaHasRulesForType=void 0;function mB({schema:$,self:v},U){let X=v.RULES.types[U];return X&&X!==!0&&h5($,X)}m5.schemaHasRulesForType=mB;function h5($,v){return v.rules.some((U)=>l5($,U))}m5.shouldUseGroup=h5;function l5($,v){var U;return $[v.keyword]!==void 0||((U=v.definition.implements)===null||U===void 0?void 0:U.some((X)=>$[X]!==void 0))}m5.shouldUseRule=l5});var av=k((o5)=>{Object.defineProperty(o5,"__esModule",{value:!0});o5.reportTypeError=o5.checkDataTypes=o5.checkDataType=o5.coerceAndCheckDataType=o5.getJSONTypes=o5.getSchemaTypes=o5.DataType=void 0;var iB=Qz(),rB=jz(),oB=tv(),i=p(),c5=J$(),I1;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(I1||(o5.DataType=I1={}));function pB($){let v=i5($.type);if(v.includes("null")){if($.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!v.length&&$.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if($.nullable===!0)v.push("null")}return v}o5.getSchemaTypes=pB;function i5($){let v=Array.isArray($)?$:$?[$]:[];if(v.every(iB.isJSONType))return v;throw Error("type must be JSONType or JSONType[]: "+v.join(","))}o5.getJSONTypes=i5;function dB($,v){let{gen:U,data:X,opts:J}=$,W=tB(v,J.coerceTypes),Y=v.length>0&&!(W.length===0&&v.length===1&&(0,rB.schemaHasRulesForType)($,v[0]));if(Y){let z=Hz(v,X,J.strictNumbers,I1.Wrong);U.if(z,()=>{if(W.length)aB($,v,W);else Nz($)})}return Y}o5.coerceAndCheckDataType=dB;var r5=new Set(["string","number","integer","boolean","null"]);function tB($,v){return v?$.filter((U)=>r5.has(U)||v==="array"&&U==="array"):[]}function aB($,v,U){let{gen:X,data:J,opts:W}=$,Y=X.let("dataType",i._`typeof ${J}`),z=X.let("coerced",i._`undefined`);if(W.coerceTypes==="array")X.if(i._`${Y} == 'object' && Array.isArray(${J}) && ${J}.length == 1`,()=>X.assign(J,i._`${J}[0]`).assign(Y,i._`typeof ${J}`).if(Hz(v,J,W.strictNumbers),()=>X.assign(z,J)));X.if(i._`${z} !== undefined`);for(let Q of U)if(r5.has(Q)||Q==="array"&&W.coerceTypes==="array")G(Q);X.else(),Nz($),X.endIf(),X.if(i._`${z} !== undefined`,()=>{X.assign(J,z),eB($,z)});function G(Q){switch(Q){case"string":X.elseIf(i._`${Y} == "number" || ${Y} == "boolean"`).assign(z,i._`"" + ${J}`).elseIf(i._`${J} === null`).assign(z,i._`""`);return;case"number":X.elseIf(i._`${Y} == "boolean" || ${J} === null
4
+ || (${Y} == "string" && ${J} && ${J} == +${J})`).assign(z,i._`+${J}`);return;case"integer":X.elseIf(i._`${Y} === "boolean" || ${J} === null
5
+ || (${Y} === "string" && ${J} && ${J} == +${J} && !(${J} % 1))`).assign(z,i._`+${J}`);return;case"boolean":X.elseIf(i._`${J} === "false" || ${J} === 0 || ${J} === null`).assign(z,!1).elseIf(i._`${J} === "true" || ${J} === 1`).assign(z,!0);return;case"null":X.elseIf(i._`${J} === "" || ${J} === 0 || ${J} === false`),X.assign(z,null);return;case"array":X.elseIf(i._`${Y} === "string" || ${Y} === "number"
6
+ || ${Y} === "boolean" || ${J} === null`).assign(z,i._`[${J}]`)}}}function eB({gen:$,parentData:v,parentDataProperty:U},X){$.if(i._`${v} !== undefined`,()=>$.assign(i._`${v}[${U}]`,X))}function wz($,v,U,X=I1.Correct){let J=X===I1.Correct?i.operators.EQ:i.operators.NEQ,W;switch($){case"null":return i._`${v} ${J} null`;case"array":W=i._`Array.isArray(${v})`;break;case"object":W=i._`${v} && typeof ${v} == "object" && !Array.isArray(${v})`;break;case"integer":W=Y(i._`!(${v} % 1) && !isNaN(${v})`);break;case"number":W=Y();break;default:return i._`typeof ${v} ${J} ${$}`}return X===I1.Correct?W:(0,i.not)(W);function Y(z=i.nil){return(0,i.and)(i._`typeof ${v} == "number"`,z,U?i._`isFinite(${v})`:i.nil)}}o5.checkDataType=wz;function Hz($,v,U,X){if($.length===1)return wz($[0],v,U,X);let J,W=(0,c5.toHash)($);if(W.array&&W.object){let Y=i._`typeof ${v} != "object"`;J=W.null?Y:i._`!${v} || ${Y}`,delete W.null,delete W.array,delete W.object}else J=i.nil;if(W.number)delete W.integer;for(let Y in W)J=(0,i.and)(J,wz(Y,v,U,X));return J}o5.checkDataTypes=Hz;var sB={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:v})=>typeof $=="string"?i._`{type: ${$}}`:i._`{type: ${v}}`};function Nz($){let v=$A($);(0,oB.reportError)(v,sB)}o5.reportTypeError=Nz;function $A($){let{gen:v,data:U,schema:X}=$,J=(0,c5.schemaRefOrVal)($,X,"type");return{gen:v,keyword:"type",data:U,schema:X.type,schemaCode:J,schemaValue:J,parentSchema:X,params:{},it:$}}});var e5=k((t5)=>{Object.defineProperty(t5,"__esModule",{value:!0});t5.assignDefaults=void 0;var O1=p(),zA=J$();function GA($,v){let{properties:U,items:X}=$.schema;if(v==="object"&&U)for(let J in U)d5($,J,U[J].default);else if(v==="array"&&Array.isArray(X))X.forEach((J,W)=>d5($,W,J.default))}t5.assignDefaults=GA;function d5($,v,U){let{gen:X,compositeRule:J,data:W,opts:Y}=$;if(U===void 0)return;let z=O1._`${W}${(0,O1.getProperty)(v)}`;if(J){(0,zA.checkStrictMode)($,`default is ignored for: ${z}`);return}let G=O1._`${z} === undefined`;if(Y.useDefaults==="empty")G=O1._`${G} || ${z} === null || ${z} === ""`;X.if(G,O1._`${z} = ${(0,O1.stringify)(U)}`)}});var $6=k((vj)=>{Object.defineProperty(vj,"__esModule",{value:!0});vj.validateUnion=vj.validateArray=vj.usePattern=vj.callValidateCode=vj.schemaProperties=vj.allSchemaProperties=vj.noPropertyInData=vj.propertyInData=vj.isOwnProperty=vj.hasPropFunc=vj.reportMissingProp=vj.checkMissingProp=vj.checkReportMissingProp=void 0;var N$=p(),Iz=J$(),W4=y6(),QA=J$();function jA($,v){let{gen:U,data:X,it:J}=$;U.if(Dz(U,X,v,J.opts.ownProperties),()=>{$.setParams({missingProperty:N$._`${v}`},!0),$.error()})}vj.checkReportMissingProp=jA;function wA({gen:$,data:v,it:{opts:U}},X,J){return(0,N$.or)(...X.map((W)=>(0,N$.and)(Dz($,v,W,U.ownProperties),N$._`${J} = ${W}`)))}vj.checkMissingProp=wA;function HA($,v){$.setParams({missingProperty:v},!0),$.error()}vj.reportMissingProp=HA;function s5($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:N$._`Object.prototype.hasOwnProperty`})}vj.hasPropFunc=s5;function Oz($,v,U){return N$._`${s5($)}.call(${v}, ${U})`}vj.isOwnProperty=Oz;function NA($,v,U,X){let J=N$._`${v}${(0,N$.getProperty)(U)} !== undefined`;return X?N$._`${J} && ${Oz($,v,U)}`:J}vj.propertyInData=NA;function Dz($,v,U,X){let J=N$._`${v}${(0,N$.getProperty)(U)} === undefined`;return X?(0,N$.or)(J,(0,N$.not)(Oz($,v,U))):J}vj.noPropertyInData=Dz;function $j($){return $?Object.keys($).filter((v)=>v!=="__proto__"):[]}vj.allSchemaProperties=$j;function IA($,v){return $j(v).filter((U)=>!(0,Iz.alwaysValidSchema)($,v[U]))}vj.schemaProperties=IA;function OA({schemaCode:$,data:v,it:{gen:U,topSchemaRef:X,schemaPath:J,errorPath:W},it:Y},z,G,Q){let j=Q?N$._`${$}, ${v}, ${X}${J}`:v,H=[[W4.default.instancePath,(0,N$.strConcat)(W4.default.instancePath,W)],[W4.default.parentData,Y.parentData],[W4.default.parentDataProperty,Y.parentDataProperty],[W4.default.rootData,W4.default.rootData]];if(Y.opts.dynamicRef)H.push([W4.default.dynamicAnchors,W4.default.dynamicAnchors]);let N=N$._`${j}, ${U.object(...H)}`;return G!==N$.nil?N$._`${z}.call(${G}, ${N})`:N$._`${z}(${N})`}vj.callValidateCode=OA;var DA=N$._`new RegExp`;function bA({gen:$,it:{opts:v}},U){let X=v.unicodeRegExp?"u":"",{regExp:J}=v.code,W=J(U,X);return $.scopeValue("pattern",{key:W.toString(),ref:W,code:N$._`${J.code==="new RegExp"?DA:(0,QA.useFunc)($,J)}(${U}, ${X})`})}vj.usePattern=bA;function VA($){let{gen:v,data:U,keyword:X,it:J}=$,W=v.name("valid");if(J.allErrors){let z=v.let("valid",!0);return Y(()=>v.assign(z,!1)),z}return v.var(W,!0),Y(()=>v.break()),W;function Y(z){let G=v.const("len",N$._`${U}.length`);v.forRange("i",0,G,(Q)=>{$.subschema({keyword:X,dataProp:Q,dataPropType:Iz.Type.Num},W),v.if((0,N$.not)(W),z)})}}vj.validateArray=VA;function KA($){let{gen:v,schema:U,keyword:X,it:J}=$;if(!Array.isArray(U))throw Error("ajv implementation error");if(U.some((G)=>(0,Iz.alwaysValidSchema)(J,G))&&!J.opts.unevaluated)return;let Y=v.let("valid",!1),z=v.name("_valid");v.block(()=>U.forEach((G,Q)=>{let j=$.subschema({keyword:X,schemaProp:Q,compositeRule:!0},z);if(v.assign(Y,N$._`${Y} || ${z}`),!$.mergeValidEvaluated(j,z))v.if((0,N$.not)(Y))})),$.result(Y,()=>$.reset(),()=>$.error(!0))}vj.validateUnion=KA});var zj=k((Wj)=>{Object.defineProperty(Wj,"__esModule",{value:!0});Wj.validateKeywordUsage=Wj.validSchemaType=Wj.funcKeywordCode=Wj.macroKeywordCode=void 0;var x$=p(),E4=y6(),_A=$6(),ZA=tv();function TA($,v){let{gen:U,keyword:X,schema:J,parentSchema:W,it:Y}=$,z=v.macro.call(Y.self,J,W,Y),G=Xj(U,X,z);if(Y.opts.validateSchema!==!1)Y.self.validateSchema(z,!0);let Q=U.name("valid");$.subschema({schema:z,schemaPath:x$.nil,errSchemaPath:`${Y.errSchemaPath}/${X}`,topSchemaRef:G,compositeRule:!0},Q),$.pass(Q,()=>$.error(!0))}Wj.macroKeywordCode=TA;function xA($,v){var U;let{gen:X,keyword:J,schema:W,parentSchema:Y,$data:z,it:G}=$;fA(G,v);let Q=!z&&v.compile?v.compile.call(G.self,W,Y,G):v.validate,j=Xj(X,J,Q),H=X.let("valid");$.block$data(H,N),$.ok((U=v.valid)!==null&&U!==void 0?U:H);function N(){if(v.errors===!1){if(D(),v.modifying)Jj($);K(()=>$.error())}else{let B=v.async?w():I();if(v.modifying)Jj($);K(()=>gA($,B))}}function w(){let B=X.let("ruleErrs",null);return X.try(()=>D(x$._`await `),(x)=>X.assign(H,!1).if(x$._`${x} instanceof ${G.ValidationError}`,()=>X.assign(B,x$._`${x}.errors`),()=>X.throw(x))),B}function I(){let B=x$._`${j}.errors`;return X.assign(B,null),D(x$.nil),B}function D(B=v.async?x$._`await `:x$.nil){let x=G.opts.passContext?E4.default.this:E4.default.self,R=!(("compile"in v)&&!z||v.schema===!1);X.assign(H,x$._`${B}${(0,_A.callValidateCode)($,j,x,R)}`,v.modifying)}function K(B){var x;X.if((0,x$.not)((x=v.valid)!==null&&x!==void 0?x:H),B)}}Wj.funcKeywordCode=xA;function Jj($){let{gen:v,data:U,it:X}=$;v.if(X.parentData,()=>v.assign(U,x$._`${X.parentData}[${X.parentDataProperty}]`))}function gA($,v){let{gen:U}=$;U.if(x$._`Array.isArray(${v})`,()=>{U.assign(E4.default.vErrors,x$._`${E4.default.vErrors} === null ? ${v} : ${E4.default.vErrors}.concat(${v})`).assign(E4.default.errors,x$._`${E4.default.vErrors}.length`),(0,ZA.extendErrors)($)},()=>$.error())}function fA({schemaEnv:$},v){if(v.async&&!$.$async)throw Error("async keyword in sync schema")}function Xj($,v,U){if(U===void 0)throw Error(`keyword "${v}" failed to compile`);return $.scopeValue("keyword",typeof U=="function"?{ref:U}:{ref:U,code:(0,x$.stringify)(U)})}function yA($,v,U=!1){return!v.length||v.some((X)=>X==="array"?Array.isArray($):X==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==X||U&&typeof $>"u")}Wj.validSchemaType=yA;function uA({schema:$,opts:v,self:U,errSchemaPath:X},J,W){if(Array.isArray(J.keyword)?!J.keyword.includes(W):J.keyword!==W)throw Error("ajv implementation error");let Y=J.dependencies;if(Y===null||Y===void 0?void 0:Y.some((z)=>!Object.prototype.hasOwnProperty.call($,z)))throw Error(`parent schema must have dependencies of ${W}: ${Y.join(",")}`);if(J.validateSchema){if(!J.validateSchema($[W])){let G=`keyword "${W}" value is invalid at path "${X}": `+U.errorsText(J.validateSchema.errors);if(v.validateSchema==="log")U.logger.error(G);else throw Error(G)}}}Wj.validateKeywordUsage=uA});var wj=k((Qj)=>{Object.defineProperty(Qj,"__esModule",{value:!0});Qj.extendSubschemaMode=Qj.extendSubschemaData=Qj.getSubschema=void 0;var q6=p(),Gj=J$();function nA($,{keyword:v,schemaProp:U,schema:X,schemaPath:J,errSchemaPath:W,topSchemaRef:Y}){if(v!==void 0&&X!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(v!==void 0){let z=$.schema[v];return U===void 0?{schema:z,schemaPath:q6._`${$.schemaPath}${(0,q6.getProperty)(v)}`,errSchemaPath:`${$.errSchemaPath}/${v}`}:{schema:z[U],schemaPath:q6._`${$.schemaPath}${(0,q6.getProperty)(v)}${(0,q6.getProperty)(U)}`,errSchemaPath:`${$.errSchemaPath}/${v}/${(0,Gj.escapeFragment)(U)}`}}if(X!==void 0){if(J===void 0||W===void 0||Y===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:X,schemaPath:J,topSchemaRef:Y,errSchemaPath:W}}throw Error('either "keyword" or "schema" must be passed')}Qj.getSubschema=nA;function cA($,v,{dataProp:U,dataPropType:X,data:J,dataTypes:W,propertyName:Y}){if(J!==void 0&&U!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:z}=v;if(U!==void 0){let{errorPath:Q,dataPathArr:j,opts:H}=v,N=z.let("data",q6._`${v.data}${(0,q6.getProperty)(U)}`,!0);G(N),$.errorPath=q6.str`${Q}${(0,Gj.getErrorPath)(U,X,H.jsPropertySyntax)}`,$.parentDataProperty=q6._`${U}`,$.dataPathArr=[...j,$.parentDataProperty]}if(J!==void 0){let Q=J instanceof q6.Name?J:z.let("data",J,!0);if(G(Q),Y!==void 0)$.propertyName=Y}if(W)$.dataTypes=W;function G(Q){$.data=Q,$.dataLevel=v.dataLevel+1,$.dataTypes=[],v.definedProperties=new Set,$.parentData=v.data,$.dataNames=[...v.dataNames,Q]}}Qj.extendSubschemaData=cA;function iA($,{jtdDiscriminator:v,jtdMetadata:U,compositeRule:X,createErrors:J,allErrors:W}){if(X!==void 0)$.compositeRule=X;if(J!==void 0)$.createErrors=J;if(W!==void 0)$.allErrors=W;$.jtdDiscriminator=v,$.jtdMetadata=U}Qj.extendSubschemaMode=iA});var bz=k((Yf,Hj)=>{Hj.exports=function $(v,U){if(v===U)return!0;if(v&&U&&typeof v=="object"&&typeof U=="object"){if(v.constructor!==U.constructor)return!1;var X,J,W;if(Array.isArray(v)){if(X=v.length,X!=U.length)return!1;for(J=X;J--!==0;)if(!$(v[J],U[J]))return!1;return!0}if(v.constructor===RegExp)return v.source===U.source&&v.flags===U.flags;if(v.valueOf!==Object.prototype.valueOf)return v.valueOf()===U.valueOf();if(v.toString!==Object.prototype.toString)return v.toString()===U.toString();if(W=Object.keys(v),X=W.length,X!==Object.keys(U).length)return!1;for(J=X;J--!==0;)if(!Object.prototype.hasOwnProperty.call(U,W[J]))return!1;for(J=X;J--!==0;){var Y=W[J];if(!$(v[Y],U[Y]))return!1}return!0}return v!==v&&U!==U}});var Ij=k((zf,Nj)=>{var Y4=Nj.exports=function($,v,U){if(typeof v=="function")U=v,v={};U=v.cb||U;var X=typeof U=="function"?U:U.pre||function(){},J=U.post||function(){};ZX(v,X,J,$,"",$)};Y4.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Y4.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Y4.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Y4.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 ZX($,v,U,X,J,W,Y,z,G,Q){if(X&&typeof X=="object"&&!Array.isArray(X)){v(X,J,W,Y,z,G,Q);for(var j in X){var H=X[j];if(Array.isArray(H)){if(j in Y4.arrayKeywords)for(var N=0;N<H.length;N++)ZX($,v,U,H[N],J+"/"+j+"/"+N,W,J,j,X,N)}else if(j in Y4.propsKeywords){if(H&&typeof H=="object")for(var w in H)ZX($,v,U,H[w],J+"/"+j+"/"+pA(w),W,J,j,X,w)}else if(j in Y4.keywords||$.allKeys&&!(j in Y4.skipKeywords))ZX($,v,U,H,J+"/"+j,W,J,j,X)}U(X,J,W,Y,z,G,Q)}}function pA($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var ev=k((Vj)=>{Object.defineProperty(Vj,"__esModule",{value:!0});Vj.getSchemaRefs=Vj.resolveUrl=Vj.normalizeId=Vj._getFullPath=Vj.getFullPath=Vj.inlineRef=void 0;var dA=J$(),tA=bz(),aA=Ij(),eA=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function sA($,v=!0){if(typeof $=="boolean")return!0;if(v===!0)return!Vz($);if(!v)return!1;return Oj($)<=v}Vj.inlineRef=sA;var $S=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Vz($){for(let v in $){if($S.has(v))return!0;let U=$[v];if(Array.isArray(U)&&U.some(Vz))return!0;if(typeof U=="object"&&Vz(U))return!0}return!1}function Oj($){let v=0;for(let U in $){if(U==="$ref")return 1/0;if(v++,eA.has(U))continue;if(typeof $[U]=="object")(0,dA.eachItem)($[U],(X)=>v+=Oj(X));if(v===1/0)return 1/0}return v}function Dj($,v="",U){if(U!==!1)v=D1(v);let X=$.parse(v);return bj($,X)}Vj.getFullPath=Dj;function bj($,v){return $.serialize(v).split("#")[0]+"#"}Vj._getFullPath=bj;var vS=/#\/?$/;function D1($){return $?$.replace(vS,""):""}Vj.normalizeId=D1;function US($,v,U){return U=D1(U),$.resolve(v,U)}Vj.resolveUrl=US;var JS=/^[a-z_][-a-z0-9._]*$/i;function XS($,v){if(typeof $=="boolean")return{};let{schemaId:U,uriResolver:X}=this.opts,J=D1($[U]||v),W={"":J},Y=Dj(X,J,!1),z={},G=new Set;return aA($,{allKeys:!0},(H,N,w,I)=>{if(I===void 0)return;let D=Y+N,K=W[I];if(typeof H[U]=="string")K=B.call(this,H[U]);x.call(this,H.$anchor),x.call(this,H.$dynamicAnchor),W[N]=K;function B(R){let y=this.opts.uriResolver.resolve;if(R=D1(K?y(K,R):R),G.has(R))throw j(R);G.add(R);let T=this.refs[R];if(typeof T=="string")T=this.refs[T];if(typeof T=="object")Q(H,T.schema,R);else if(R!==D1(D))if(R[0]==="#")Q(H,z[R],R),z[R]=H;else this.refs[R]=D;return R}function x(R){if(typeof R=="string"){if(!JS.test(R))throw Error(`invalid anchor "${R}"`);B.call(this,`#${R}`)}}}),z;function Q(H,N,w){if(N!==void 0&&!tA(H,N))throw j(w)}function j(H){return Error(`reference "${H}" resolves to more than one schema`)}}Vj.getSchemaRefs=XS});var v0=k((Tj)=>{Object.defineProperty(Tj,"__esModule",{value:!0});Tj.getData=Tj.KeywordCxt=Tj.validateFunctionCode=void 0;var Lj=f5(),Bj=av(),Bz=jz(),TX=av(),jS=e5(),$0=zj(),Kz=wj(),g=p(),m=y6(),wS=ev(),u6=J$(),sv=tv();function HS($){if(Mj($)){if(Pj($),Ej($)){OS($);return}}Fj($,()=>(0,Lj.topBoolOrEmptySchema)($))}Tj.validateFunctionCode=HS;function Fj({gen:$,validateName:v,schema:U,schemaEnv:X,opts:J},W){if(J.code.es5)$.func(v,g._`${m.default.data}, ${m.default.valCxt}`,X.$async,()=>{$.code(g._`"use strict"; ${Aj(U,J)}`),IS($,J),$.code(W)});else $.func(v,g._`${m.default.data}, ${NS(J)}`,X.$async,()=>$.code(Aj(U,J)).code(W))}function NS($){return g._`{${m.default.instancePath}="", ${m.default.parentData}, ${m.default.parentDataProperty}, ${m.default.rootData}=${m.default.data}${$.dynamicRef?g._`, ${m.default.dynamicAnchors}={}`:g.nil}}={}`}function IS($,v){$.if(m.default.valCxt,()=>{if($.var(m.default.instancePath,g._`${m.default.valCxt}.${m.default.instancePath}`),$.var(m.default.parentData,g._`${m.default.valCxt}.${m.default.parentData}`),$.var(m.default.parentDataProperty,g._`${m.default.valCxt}.${m.default.parentDataProperty}`),$.var(m.default.rootData,g._`${m.default.valCxt}.${m.default.rootData}`),v.dynamicRef)$.var(m.default.dynamicAnchors,g._`${m.default.valCxt}.${m.default.dynamicAnchors}`)},()=>{if($.var(m.default.instancePath,g._`""`),$.var(m.default.parentData,g._`undefined`),$.var(m.default.parentDataProperty,g._`undefined`),$.var(m.default.rootData,m.default.data),v.dynamicRef)$.var(m.default.dynamicAnchors,g._`{}`)})}function OS($){let{schema:v,opts:U,gen:X}=$;Fj($,()=>{if(U.$comment&&v.$comment)kj($);if(BS($),X.let(m.default.vErrors,null),X.let(m.default.errors,0),U.unevaluated)DS($);Rj($),qS($)});return}function DS($){let{gen:v,validateName:U}=$;$.evaluated=v.const("evaluated",g._`${U}.evaluated`),v.if(g._`${$.evaluated}.dynamicProps`,()=>v.assign(g._`${$.evaluated}.props`,g._`undefined`)),v.if(g._`${$.evaluated}.dynamicItems`,()=>v.assign(g._`${$.evaluated}.items`,g._`undefined`))}function Aj($,v){let U=typeof $=="object"&&$[v.schemaId];return U&&(v.code.source||v.code.process)?g._`/*# sourceURL=${U} */`:g.nil}function bS($,v){if(Mj($)){if(Pj($),Ej($)){VS($,v);return}}(0,Lj.boolOrEmptySchema)($,v)}function Ej({schema:$,self:v}){if(typeof $=="boolean")return!$;for(let U in $)if(v.RULES.all[U])return!0;return!1}function Mj($){return typeof $.schema!="boolean"}function VS($,v){let{schema:U,gen:X,opts:J}=$;if(J.$comment&&U.$comment)kj($);AS($),SS($);let W=X.const("_errs",m.default.errors);Rj($,W),X.var(v,g._`${W} === ${m.default.errors}`)}function Pj($){(0,u6.checkUnknownRules)($),KS($)}function Rj($,v){if($.opts.jtd)return Sj($,[],!1,v);let U=(0,Bj.getSchemaTypes)($.schema),X=(0,Bj.coerceAndCheckDataType)($,U);Sj($,U,!X,v)}function KS($){let{schema:v,errSchemaPath:U,opts:X,self:J}=$;if(v.$ref&&X.ignoreKeywordsWithRef&&(0,u6.schemaHasRulesButRef)(v,J.RULES))J.logger.warn(`$ref: keywords ignored in schema at path "${U}"`)}function BS($){let{schema:v,opts:U}=$;if(v.default!==void 0&&U.useDefaults&&U.strictSchema)(0,u6.checkStrictMode)($,"default is ignored in the schema root")}function AS($){let v=$.schema[$.opts.schemaId];if(v)$.baseId=(0,wS.resolveUrl)($.opts.uriResolver,$.baseId,v)}function SS($){if($.schema.$async&&!$.schemaEnv.$async)throw Error("async schema in sync schema")}function kj({gen:$,schemaEnv:v,schema:U,errSchemaPath:X,opts:J}){let W=U.$comment;if(J.$comment===!0)$.code(g._`${m.default.self}.logger.log(${W})`);else if(typeof J.$comment=="function"){let Y=g.str`${X}/$comment`,z=$.scopeValue("root",{ref:v.root});$.code(g._`${m.default.self}.opts.$comment(${W}, ${Y}, ${z}.schema)`)}}function qS($){let{gen:v,schemaEnv:U,validateName:X,ValidationError:J,opts:W}=$;if(U.$async)v.if(g._`${m.default.errors} === 0`,()=>v.return(m.default.data),()=>v.throw(g._`new ${J}(${m.default.vErrors})`));else{if(v.assign(g._`${X}.errors`,m.default.vErrors),W.unevaluated)LS($);v.return(g._`${m.default.errors} === 0`)}}function LS({gen:$,evaluated:v,props:U,items:X}){if(U instanceof g.Name)$.assign(g._`${v}.props`,U);if(X instanceof g.Name)$.assign(g._`${v}.items`,X)}function Sj($,v,U,X){let{gen:J,schema:W,data:Y,allErrors:z,opts:G,self:Q}=$,{RULES:j}=Q;if(W.$ref&&(G.ignoreKeywordsWithRef||!(0,u6.schemaHasRulesButRef)(W,j))){J.block(()=>_j($,"$ref",j.all.$ref.definition));return}if(!G.jtd)FS($,v);J.block(()=>{for(let N of j.rules)H(N);H(j.post)});function H(N){if(!(0,Bz.shouldUseGroup)(W,N))return;if(N.type){if(J.if((0,TX.checkDataType)(N.type,Y,G.strictNumbers)),qj($,N),v.length===1&&v[0]===N.type&&U)J.else(),(0,TX.reportTypeError)($);J.endIf()}else qj($,N);if(!z)J.if(g._`${m.default.errors} === ${X||0}`)}}function qj($,v){let{gen:U,schema:X,opts:{useDefaults:J}}=$;if(J)(0,jS.assignDefaults)($,v.type);U.block(()=>{for(let W of v.rules)if((0,Bz.shouldUseRule)(X,W))_j($,W.keyword,W.definition,v.type)})}function FS($,v){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(ES($,v),!$.opts.allowUnionTypes)MS($,v);PS($,$.dataTypes)}function ES($,v){if(!v.length)return;if(!$.dataTypes.length){$.dataTypes=v;return}v.forEach((U)=>{if(!Cj($.dataTypes,U))Az($,`type "${U}" not allowed by context "${$.dataTypes.join(",")}"`)}),kS($,v)}function MS($,v){if(v.length>1&&!(v.length===2&&v.includes("null")))Az($,"use allowUnionTypes to allow union type keyword")}function PS($,v){let U=$.self.RULES.all;for(let X in U){let J=U[X];if(typeof J=="object"&&(0,Bz.shouldUseRule)($.schema,J)){let{type:W}=J.definition;if(W.length&&!W.some((Y)=>RS(v,Y)))Az($,`missing type "${W.join(",")}" for keyword "${X}"`)}}}function RS($,v){return $.includes(v)||v==="number"&&$.includes("integer")}function Cj($,v){return $.includes(v)||v==="integer"&&$.includes("number")}function kS($,v){let U=[];for(let X of $.dataTypes)if(Cj(v,X))U.push(X);else if(v.includes("integer")&&X==="number")U.push("integer");$.dataTypes=U}function Az($,v){let U=$.schemaEnv.baseId+$.errSchemaPath;v+=` at "${U}" (strictTypes)`,(0,u6.checkStrictMode)($,v,$.opts.strictTypes)}class Sz{constructor($,v,U){if((0,$0.validateKeywordUsage)($,v,U),this.gen=$.gen,this.allErrors=$.allErrors,this.keyword=U,this.data=$.data,this.schema=$.schema[U],this.$data=v.$data&&$.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,u6.schemaRefOrVal)($,this.schema,U,this.$data),this.schemaType=v.schemaType,this.parentSchema=$.schema,this.params={},this.it=$,this.def=v,this.$data)this.schemaCode=$.gen.const("vSchema",Zj(this.$data,$));else if(this.schemaCode=this.schemaValue,!(0,$0.validSchemaType)(this.schema,v.schemaType,v.allowUndefined))throw Error(`${U} value must be ${JSON.stringify(v.schemaType)}`);if("code"in v?v.trackErrors:v.errors!==!1)this.errsCount=$.gen.const("_errs",m.default.errors)}result($,v,U){this.failResult((0,g.not)($),v,U)}failResult($,v,U){if(this.gen.if($),U)U();else this.error();if(v){if(this.gen.else(),v(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass($,v){this.failResult((0,g.not)($),void 0,v)}fail($){if($===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if($),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data($){if(!this.$data)return this.fail($);let{schemaCode:v}=this;this.fail(g._`${v} !== undefined && (${(0,g.or)(this.invalid$data(),$)})`)}error($,v,U){if(v){this.setParams(v),this._error($,U),this.setParams({});return}this._error($,U)}_error($,v){($?sv.reportExtraError:sv.reportError)(this,this.def.error,v)}$dataError(){(0,sv.reportError)(this,this.def.$dataError||sv.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,sv.resetErrorsCount)(this.gen,this.errsCount)}ok($){if(!this.allErrors)this.gen.if($)}setParams($,v){if(v)Object.assign(this.params,$);else this.params=$}block$data($,v,U=g.nil){this.gen.block(()=>{this.check$data($,U),v()})}check$data($=g.nil,v=g.nil){if(!this.$data)return;let{gen:U,schemaCode:X,schemaType:J,def:W}=this;if(U.if((0,g.or)(g._`${X} === undefined`,v)),$!==g.nil)U.assign($,!0);if(J.length||W.validateSchema){if(U.elseIf(this.invalid$data()),this.$dataError(),$!==g.nil)U.assign($,!1)}U.else()}invalid$data(){let{gen:$,schemaCode:v,schemaType:U,def:X,it:J}=this;return(0,g.or)(W(),Y());function W(){if(U.length){if(!(v instanceof g.Name))throw Error("ajv implementation error");let z=Array.isArray(U)?U:[U];return g._`${(0,TX.checkDataTypes)(z,v,J.opts.strictNumbers,TX.DataType.Wrong)}`}return g.nil}function Y(){if(X.validateSchema){let z=$.scopeValue("validate$data",{ref:X.validateSchema});return g._`!${z}(${v})`}return g.nil}}subschema($,v){let U=(0,Kz.getSubschema)(this.it,$);(0,Kz.extendSubschemaData)(U,this.it,$),(0,Kz.extendSubschemaMode)(U,$);let X={...this.it,...U,items:void 0,props:void 0};return bS(X,v),X}mergeEvaluated($,v){let{it:U,gen:X}=this;if(!U.opts.unevaluated)return;if(U.props!==!0&&$.props!==void 0)U.props=u6.mergeEvaluated.props(X,$.props,U.props,v);if(U.items!==!0&&$.items!==void 0)U.items=u6.mergeEvaluated.items(X,$.items,U.items,v)}mergeValidEvaluated($,v){let{it:U,gen:X}=this;if(U.opts.unevaluated&&(U.props!==!0||U.items!==!0))return X.if(v,()=>this.mergeEvaluated($,g.Name)),!0}}Tj.KeywordCxt=Sz;function _j($,v,U,X){let J=new Sz($,U,v);if("code"in U)U.code(J,X);else if(J.$data&&U.validate)(0,$0.funcKeywordCode)(J,U);else if("macro"in U)(0,$0.macroKeywordCode)(J,U);else if(U.compile||U.validate)(0,$0.funcKeywordCode)(J,U)}var CS=/^\/(?:[^~]|~0|~1)*$/,_S=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Zj($,{dataLevel:v,dataNames:U,dataPathArr:X}){let J,W;if($==="")return m.default.rootData;if($[0]==="/"){if(!CS.test($))throw Error(`Invalid JSON-pointer: ${$}`);J=$,W=m.default.rootData}else{let Q=_S.exec($);if(!Q)throw Error(`Invalid JSON-pointer: ${$}`);let j=+Q[1];if(J=Q[2],J==="#"){if(j>=v)throw Error(G("property/index",j));return X[v-j]}if(j>v)throw Error(G("data",j));if(W=U[v-j],!J)return W}let Y=W,z=J.split("/");for(let Q of z)if(Q)W=g._`${W}${(0,g.getProperty)((0,u6.unescapeJsonPointer)(Q))}`,Y=g._`${Y} && ${W}`;return Y;function G(Q,j){return`Cannot access ${Q} ${j} levels up, current level is ${v}`}}Tj.getData=Zj});var xX=k((fj)=>{Object.defineProperty(fj,"__esModule",{value:!0});class gj extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}fj.default=gj});var U0=k((uj)=>{Object.defineProperty(uj,"__esModule",{value:!0});var qz=ev();class yj extends Error{constructor($,v,U,X){super(X||`can't resolve reference ${U} from id ${v}`);this.missingRef=(0,qz.resolveUrl)($,v,U),this.missingSchema=(0,qz.normalizeId)((0,qz.getFullPath)($,this.missingRef))}}uj.default=yj});var fX=k((mj)=>{Object.defineProperty(mj,"__esModule",{value:!0});mj.resolveSchema=mj.getCompilingSchema=mj.resolveRef=mj.compileSchema=mj.SchemaEnv=void 0;var w6=p(),fS=xX(),M4=y6(),H6=ev(),hj=J$(),yS=v0();class J0{constructor($){var v;this.refs={},this.dynamicAnchors={};let U;if(typeof $.schema=="object")U=$.schema;this.schema=$.schema,this.schemaId=$.schemaId,this.root=$.root||this,this.baseId=(v=$.baseId)!==null&&v!==void 0?v:(0,H6.normalizeId)(U===null||U===void 0?void 0:U[$.schemaId||"$id"]),this.schemaPath=$.schemaPath,this.localRefs=$.localRefs,this.meta=$.meta,this.$async=U===null||U===void 0?void 0:U.$async,this.refs={}}}mj.SchemaEnv=J0;function Fz($){let v=lj.call(this,$);if(v)return v;let U=(0,H6.getFullPath)(this.opts.uriResolver,$.root.baseId),{es5:X,lines:J}=this.opts.code,{ownProperties:W}=this.opts,Y=new w6.CodeGen(this.scope,{es5:X,lines:J,ownProperties:W}),z;if($.$async)z=Y.scopeValue("Error",{ref:fS.default,code:w6._`require("ajv/dist/runtime/validation_error").default`});let G=Y.scopeName("validate");$.validateName=G;let Q={gen:Y,allErrors:this.opts.allErrors,data:M4.default.data,parentData:M4.default.parentData,parentDataProperty:M4.default.parentDataProperty,dataNames:[M4.default.data],dataPathArr:[w6.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:Y.scopeValue("schema",this.opts.code.source===!0?{ref:$.schema,code:(0,w6.stringify)($.schema)}:{ref:$.schema}),validateName:G,ValidationError:z,schema:$.schema,schemaEnv:$,rootId:U,baseId:$.baseId||U,schemaPath:w6.nil,errSchemaPath:$.schemaPath||(this.opts.jtd?"":"#"),errorPath:w6._`""`,opts:this.opts,self:this},j;try{this._compilations.add($),(0,yS.validateFunctionCode)(Q),Y.optimize(this.opts.code.optimize);let H=Y.toString();if(j=`${Y.scopeRefs(M4.default.scope)}return ${H}`,this.opts.code.process)j=this.opts.code.process(j,$);let w=Function(`${M4.default.self}`,`${M4.default.scope}`,j)(this,this.scope.get());if(this.scope.value(G,{ref:w}),w.errors=null,w.schema=$.schema,w.schemaEnv=$,$.$async)w.$async=!0;if(this.opts.code.source===!0)w.source={validateName:G,validateCode:H,scopeValues:Y._values};if(this.opts.unevaluated){let{props:I,items:D}=Q;if(w.evaluated={props:I instanceof w6.Name?void 0:I,items:D instanceof w6.Name?void 0:D,dynamicProps:I instanceof w6.Name,dynamicItems:D instanceof w6.Name},w.source)w.source.evaluated=(0,w6.stringify)(w.evaluated)}return $.validate=w,$}catch(H){if(delete $.validate,delete $.validateName,j)this.logger.error("Error compiling schema, function code:",j);throw H}finally{this._compilations.delete($)}}mj.compileSchema=Fz;function uS($,v,U){var X;U=(0,H6.resolveUrl)(this.opts.uriResolver,v,U);let J=$.refs[U];if(J)return J;let W=mS.call(this,$,U);if(W===void 0){let Y=(X=$.localRefs)===null||X===void 0?void 0:X[U],{schemaId:z}=this.opts;if(Y)W=new J0({schema:Y,schemaId:z,root:$,baseId:v})}if(W===void 0)return;return $.refs[U]=hS.call(this,W)}mj.resolveRef=uS;function hS($){if((0,H6.inlineRef)($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:Fz.call(this,$)}function lj($){for(let v of this._compilations)if(lS(v,$))return v}mj.getCompilingSchema=lj;function lS($,v){return $.schema===v.schema&&$.root===v.root&&$.baseId===v.baseId}function mS($,v){let U;while(typeof(U=this.refs[v])=="string")v=U;return U||this.schemas[v]||gX.call(this,$,v)}function gX($,v){let U=this.opts.uriResolver.parse(v),X=(0,H6._getFullPath)(this.opts.uriResolver,U),J=(0,H6.getFullPath)(this.opts.uriResolver,$.baseId,void 0);if(Object.keys($.schema).length>0&&X===J)return Lz.call(this,U,$);let W=(0,H6.normalizeId)(X),Y=this.refs[W]||this.schemas[W];if(typeof Y=="string"){let z=gX.call(this,$,Y);if(typeof(z===null||z===void 0?void 0:z.schema)!=="object")return;return Lz.call(this,U,z)}if(typeof(Y===null||Y===void 0?void 0:Y.schema)!=="object")return;if(!Y.validate)Fz.call(this,Y);if(W===(0,H6.normalizeId)(v)){let{schema:z}=Y,{schemaId:G}=this.opts,Q=z[G];if(Q)J=(0,H6.resolveUrl)(this.opts.uriResolver,J,Q);return new J0({schema:z,schemaId:G,root:$,baseId:J})}return Lz.call(this,U,Y)}mj.resolveSchema=gX;var nS=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Lz($,{baseId:v,schema:U,root:X}){var J;if(((J=$.fragment)===null||J===void 0?void 0:J[0])!=="/")return;for(let z of $.fragment.slice(1).split("/")){if(typeof U==="boolean")return;let G=U[(0,hj.unescapeFragment)(z)];if(G===void 0)return;U=G;let Q=typeof U==="object"&&U[this.opts.schemaId];if(!nS.has(z)&&Q)v=(0,H6.resolveUrl)(this.opts.uriResolver,v,Q)}let W;if(typeof U!="boolean"&&U.$ref&&!(0,hj.schemaHasRulesButRef)(U,this.RULES)){let z=(0,H6.resolveUrl)(this.opts.uriResolver,v,U.$ref);W=gX.call(this,X,z)}let{schemaId:Y}=this.opts;if(W=W||new J0({schema:U,schemaId:Y,root:X,baseId:v}),W.schema!==W.root.schema)return W;return}});var cj=k((Nf,pS)=>{pS.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Mz=k((If,pj)=>{var dS=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),rj=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function Ez($){let v="",U=0,X=0;for(X=0;X<$.length;X++){if(U=$[X].charCodeAt(0),U===48)continue;if(!(U>=48&&U<=57||U>=65&&U<=70||U>=97&&U<=102))return"";v+=$[X];break}for(X+=1;X<$.length;X++){if(U=$[X].charCodeAt(0),!(U>=48&&U<=57||U>=65&&U<=70||U>=97&&U<=102))return"";v+=$[X]}return v}var tS=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function ij($){return $.length=0,!0}function aS($,v,U){if($.length){let X=Ez($);if(X!=="")v.push(X);else return U.error=!0,!1;$.length=0}return!0}function eS($){let v=0,U={error:!1,address:"",zone:""},X=[],J=[],W=!1,Y=!1,z=aS;for(let G=0;G<$.length;G++){let Q=$[G];if(Q==="["||Q==="]")continue;if(Q===":"){if(W===!0)Y=!0;if(!z(J,X,U))break;if(++v>7){U.error=!0;break}if(G>0&&$[G-1]===":")W=!0;X.push(":");continue}else if(Q==="%"){if(!z(J,X,U))break;z=ij}else{J.push(Q);continue}}if(J.length)if(z===ij)U.zone=J.join("");else if(Y)X.push(J.join(""));else X.push(Ez(J));return U.address=X.join(""),U}function oj($){if(sS($,":")<2)return{host:$,isIPV6:!1};let v=eS($);if(!v.error){let{address:U,address:X}=v;if(v.zone)U+="%"+v.zone,X+="%25"+v.zone;return{host:U,isIPV6:!0,escapedHost:X}}else return{host:$,isIPV6:!1}}function sS($,v){let U=0;for(let X=0;X<$.length;X++)if($[X]===v)U++;return U}function $q($){let v=$,U=[],X=-1,J=0;while(J=v.length){if(J===1)if(v===".")break;else if(v==="/"){U.push("/");break}else{U.push(v);break}else if(J===2){if(v[0]==="."){if(v[1]===".")break;else if(v[1]==="/"){v=v.slice(2);continue}}else if(v[0]==="/"){if(v[1]==="."||v[1]==="/"){U.push("/");break}}}else if(J===3){if(v==="/.."){if(U.length!==0)U.pop();U.push("/");break}}if(v[0]==="."){if(v[1]==="."){if(v[2]==="/"){v=v.slice(3);continue}}else if(v[1]==="/"){v=v.slice(2);continue}}else if(v[0]==="/"){if(v[1]==="."){if(v[2]==="/"){v=v.slice(2);continue}else if(v[2]==="."){if(v[3]==="/"){if(v=v.slice(3),U.length!==0)U.pop();continue}}}}if((X=v.indexOf("/",1))===-1){U.push(v);break}else U.push(v.slice(0,X)),v=v.slice(X)}return U.join("")}function vq($,v){let U=v!==!0?escape:unescape;if($.scheme!==void 0)$.scheme=U($.scheme);if($.userinfo!==void 0)$.userinfo=U($.userinfo);if($.host!==void 0)$.host=U($.host);if($.path!==void 0)$.path=U($.path);if($.query!==void 0)$.query=U($.query);if($.fragment!==void 0)$.fragment=U($.fragment);return $}function Uq($){let v=[];if($.userinfo!==void 0)v.push($.userinfo),v.push("@");if($.host!==void 0){let U=unescape($.host);if(!rj(U)){let X=oj(U);if(X.isIPV6===!0)U=`[${X.escapedHost}]`;else U=$.host}v.push(U)}if(typeof $.port==="number"||typeof $.port==="string")v.push(":"),v.push(String($.port));return v.length?v.join(""):void 0}pj.exports={nonSimpleDomain:tS,recomposeAuthority:Uq,normalizeComponentEncoding:vq,removeDotSegments:$q,isIPv4:rj,isUUID:dS,normalizeIPv6:oj,stringArrayToHexStripped:Ez}});var sj=k((Of,ej)=>{var{isUUID:Jq}=Mz(),Xq=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Wq=["http","https","ws","wss","urn","urn:uuid"];function Yq($){return Wq.indexOf($)!==-1}function Pz($){if($.secure===!0)return!0;else if($.secure===!1)return!1;else if($.scheme)return $.scheme.length===3&&($.scheme[0]==="w"||$.scheme[0]==="W")&&($.scheme[1]==="s"||$.scheme[1]==="S")&&($.scheme[2]==="s"||$.scheme[2]==="S");else return!1}function dj($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function tj($){let v=String($.scheme).toLowerCase()==="https";if($.port===(v?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function zq($){return $.secure=Pz($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function Gq($){if($.port===(Pz($)?443:80)||$.port==="")$.port=void 0;if(typeof $.secure==="boolean")$.scheme=$.secure?"wss":"ws",$.secure=void 0;if($.resourceName){let[v,U]=$.resourceName.split("?");$.path=v&&v!=="/"?v:void 0,$.query=U,$.resourceName=void 0}return $.fragment=void 0,$}function Qq($,v){if(!$.path)return $.error="URN can not be parsed",$;let U=$.path.match(Xq);if(U){let X=v.scheme||$.scheme||"urn";$.nid=U[1].toLowerCase(),$.nss=U[2];let J=`${X}:${v.nid||$.nid}`,W=Rz(J);if($.path=void 0,W)$=W.parse($,v)}else $.error=$.error||"URN can not be parsed.";return $}function jq($,v){if($.nid===void 0)throw Error("URN without nid cannot be serialized");let U=v.scheme||$.scheme||"urn",X=$.nid.toLowerCase(),J=`${U}:${v.nid||X}`,W=Rz(J);if(W)$=W.serialize($,v);let Y=$,z=$.nss;return Y.path=`${X||v.nid}:${z}`,v.skipEscape=!0,Y}function wq($,v){let U=$;if(U.uuid=U.nss,U.nss=void 0,!v.tolerant&&(!U.uuid||!Jq(U.uuid)))U.error=U.error||"UUID is not valid.";return U}function Hq($){let v=$;return v.nss=($.uuid||"").toLowerCase(),v}var aj={scheme:"http",domainHost:!0,parse:dj,serialize:tj},Nq={scheme:"https",domainHost:aj.domainHost,parse:dj,serialize:tj},yX={scheme:"ws",domainHost:!0,parse:zq,serialize:Gq},Iq={scheme:"wss",domainHost:yX.domainHost,parse:yX.parse,serialize:yX.serialize},Oq={scheme:"urn",parse:Qq,serialize:jq,skipNormalize:!0},Dq={scheme:"urn:uuid",parse:wq,serialize:Hq,skipNormalize:!0},uX={http:aj,https:Nq,ws:yX,wss:Iq,urn:Oq,"urn:uuid":Dq};Object.setPrototypeOf(uX,null);function Rz($){return $&&(uX[$]||uX[$.toLowerCase()])||void 0}ej.exports={wsIsSecure:Pz,SCHEMES:uX,isValidSchemeName:Yq,getSchemeHandler:Rz}});var Uw=k((Df,lX)=>{var{normalizeIPv6:bq,removeDotSegments:X0,recomposeAuthority:Vq,normalizeComponentEncoding:hX,isIPv4:Kq,nonSimpleDomain:Bq}=Mz(),{SCHEMES:Aq,getSchemeHandler:$w}=sj();function Sq($,v){if(typeof $==="string")$=L6(h6($,v),v);else if(typeof $==="object")$=h6(L6($,v),v);return $}function qq($,v,U){let X=U?Object.assign({scheme:"null"},U):{scheme:"null"},J=vw(h6($,X),h6(v,X),X,!0);return X.skipEscape=!0,L6(J,X)}function vw($,v,U,X){let J={};if(!X)$=h6(L6($,U),U),v=h6(L6(v,U),U);if(U=U||{},!U.tolerant&&v.scheme)J.scheme=v.scheme,J.userinfo=v.userinfo,J.host=v.host,J.port=v.port,J.path=X0(v.path||""),J.query=v.query;else{if(v.userinfo!==void 0||v.host!==void 0||v.port!==void 0)J.userinfo=v.userinfo,J.host=v.host,J.port=v.port,J.path=X0(v.path||""),J.query=v.query;else{if(!v.path)if(J.path=$.path,v.query!==void 0)J.query=v.query;else J.query=$.query;else{if(v.path[0]==="/")J.path=X0(v.path);else{if(($.userinfo!==void 0||$.host!==void 0||$.port!==void 0)&&!$.path)J.path="/"+v.path;else if(!$.path)J.path=v.path;else J.path=$.path.slice(0,$.path.lastIndexOf("/")+1)+v.path;J.path=X0(J.path)}J.query=v.query}J.userinfo=$.userinfo,J.host=$.host,J.port=$.port}J.scheme=$.scheme}return J.fragment=v.fragment,J}function Lq($,v,U){if(typeof $==="string")$=unescape($),$=L6(hX(h6($,U),!0),{...U,skipEscape:!0});else if(typeof $==="object")$=L6(hX($,!0),{...U,skipEscape:!0});if(typeof v==="string")v=unescape(v),v=L6(hX(h6(v,U),!0),{...U,skipEscape:!0});else if(typeof v==="object")v=L6(hX(v,!0),{...U,skipEscape:!0});return $.toLowerCase()===v.toLowerCase()}function L6($,v){let U={host:$.host,scheme:$.scheme,userinfo:$.userinfo,port:$.port,path:$.path,query:$.query,nid:$.nid,nss:$.nss,uuid:$.uuid,fragment:$.fragment,reference:$.reference,resourceName:$.resourceName,secure:$.secure,error:""},X=Object.assign({},v),J=[],W=$w(X.scheme||U.scheme);if(W&&W.serialize)W.serialize(U,X);if(U.path!==void 0)if(!X.skipEscape){if(U.path=escape(U.path),U.scheme!==void 0)U.path=U.path.split("%3A").join(":")}else U.path=unescape(U.path);if(X.reference!=="suffix"&&U.scheme)J.push(U.scheme,":");let Y=Vq(U);if(Y!==void 0){if(X.reference!=="suffix")J.push("//");if(J.push(Y),U.path&&U.path[0]!=="/")J.push("/")}if(U.path!==void 0){let z=U.path;if(!X.absolutePath&&(!W||!W.absolutePath))z=X0(z);if(Y===void 0&&z[0]==="/"&&z[1]==="/")z="/%2F"+z.slice(2);J.push(z)}if(U.query!==void 0)J.push("?",U.query);if(U.fragment!==void 0)J.push("#",U.fragment);return J.join("")}var Fq=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function h6($,v){let U=Object.assign({},v),X={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},J=!1;if(U.reference==="suffix")if(U.scheme)$=U.scheme+":"+$;else $="//"+$;let W=$.match(Fq);if(W){if(X.scheme=W[1],X.userinfo=W[3],X.host=W[4],X.port=parseInt(W[5],10),X.path=W[6]||"",X.query=W[7],X.fragment=W[8],isNaN(X.port))X.port=W[5];if(X.host)if(Kq(X.host)===!1){let G=bq(X.host);X.host=G.host.toLowerCase(),J=G.isIPV6}else J=!0;if(X.scheme===void 0&&X.userinfo===void 0&&X.host===void 0&&X.port===void 0&&X.query===void 0&&!X.path)X.reference="same-document";else if(X.scheme===void 0)X.reference="relative";else if(X.fragment===void 0)X.reference="absolute";else X.reference="uri";if(U.reference&&U.reference!=="suffix"&&U.reference!==X.reference)X.error=X.error||"URI is not a "+U.reference+" reference.";let Y=$w(U.scheme||X.scheme);if(!U.unicodeSupport&&(!Y||!Y.unicodeSupport)){if(X.host&&(U.domainHost||Y&&Y.domainHost)&&J===!1&&Bq(X.host))try{X.host=URL.domainToASCII(X.host.toLowerCase())}catch(z){X.error=X.error||"Host's domain name can not be converted to ASCII: "+z}}if(!Y||Y&&!Y.skipNormalize){if($.indexOf("%")!==-1){if(X.scheme!==void 0)X.scheme=unescape(X.scheme);if(X.host!==void 0)X.host=unescape(X.host)}if(X.path)X.path=escape(unescape(X.path));if(X.fragment)X.fragment=encodeURI(decodeURIComponent(X.fragment))}if(Y&&Y.parse)Y.parse(X,U)}else X.error=X.error||"URI can not be parsed.";return X}var kz={SCHEMES:Aq,normalize:Sq,resolve:qq,resolveComponent:vw,equal:Lq,serialize:L6,parse:h6};lX.exports=kz;lX.exports.default=kz;lX.exports.fastUri=kz});var Ww=k((Xw)=>{Object.defineProperty(Xw,"__esModule",{value:!0});var Jw=Uw();Jw.code='require("ajv/dist/runtime/uri").default';Xw.default=Jw});var Nw=k((l6)=>{Object.defineProperty(l6,"__esModule",{value:!0});l6.CodeGen=l6.Name=l6.nil=l6.stringify=l6.str=l6._=l6.KeywordCxt=void 0;var Mq=v0();Object.defineProperty(l6,"KeywordCxt",{enumerable:!0,get:function(){return Mq.KeywordCxt}});var b1=p();Object.defineProperty(l6,"_",{enumerable:!0,get:function(){return b1._}});Object.defineProperty(l6,"str",{enumerable:!0,get:function(){return b1.str}});Object.defineProperty(l6,"stringify",{enumerable:!0,get:function(){return b1.stringify}});Object.defineProperty(l6,"nil",{enumerable:!0,get:function(){return b1.nil}});Object.defineProperty(l6,"Name",{enumerable:!0,get:function(){return b1.Name}});Object.defineProperty(l6,"CodeGen",{enumerable:!0,get:function(){return b1.CodeGen}});var Pq=xX(),jw=U0(),Rq=Qz(),W0=fX(),kq=p(),Y0=ev(),mX=av(),_z=J$(),Yw=cj(),Cq=Ww(),ww=($,v)=>new RegExp($,v);ww.code="new RegExp";var _q=["removeAdditional","useDefaults","coerceTypes"],Zq=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Tq={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},xq={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},zw=200;function gq($){var v,U,X,J,W,Y,z,G,Q,j,H,N,w,I,D,K,B,x,R,y,T,O6,P6,jW,wW;let S1=$.strict,HW=(v=$.code)===null||v===void 0?void 0:v.optimize,wG=HW===!0||HW===void 0?1:HW||0,HG=(X=(U=$.code)===null||U===void 0?void 0:U.regExp)!==null&&X!==void 0?X:ww,VN=(J=$.uriResolver)!==null&&J!==void 0?J:Cq.default;return{strictSchema:(Y=(W=$.strictSchema)!==null&&W!==void 0?W:S1)!==null&&Y!==void 0?Y:!0,strictNumbers:(G=(z=$.strictNumbers)!==null&&z!==void 0?z:S1)!==null&&G!==void 0?G:!0,strictTypes:(j=(Q=$.strictTypes)!==null&&Q!==void 0?Q:S1)!==null&&j!==void 0?j:"log",strictTuples:(N=(H=$.strictTuples)!==null&&H!==void 0?H:S1)!==null&&N!==void 0?N:"log",strictRequired:(I=(w=$.strictRequired)!==null&&w!==void 0?w:S1)!==null&&I!==void 0?I:!1,code:$.code?{...$.code,optimize:wG,regExp:HG}:{optimize:wG,regExp:HG},loopRequired:(D=$.loopRequired)!==null&&D!==void 0?D:zw,loopEnum:(K=$.loopEnum)!==null&&K!==void 0?K:zw,meta:(B=$.meta)!==null&&B!==void 0?B:!0,messages:(x=$.messages)!==null&&x!==void 0?x:!0,inlineRefs:(R=$.inlineRefs)!==null&&R!==void 0?R:!0,schemaId:(y=$.schemaId)!==null&&y!==void 0?y:"$id",addUsedSchema:(T=$.addUsedSchema)!==null&&T!==void 0?T:!0,validateSchema:(O6=$.validateSchema)!==null&&O6!==void 0?O6:!0,validateFormats:(P6=$.validateFormats)!==null&&P6!==void 0?P6:!0,unicodeRegExp:(jW=$.unicodeRegExp)!==null&&jW!==void 0?jW:!0,int32range:(wW=$.int32range)!==null&&wW!==void 0?wW:!0,uriResolver:VN}}class nX{constructor($={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...gq($)};let{es5:v,lines:U}=this.opts.code;this.scope=new kq.ValueScope({scope:{},prefixes:Zq,es5:v,lines:U}),this.logger=mq($.logger);let X=$.validateFormats;if($.validateFormats=!1,this.RULES=(0,Rq.getRules)(),Gw.call(this,Tq,$,"NOT SUPPORTED"),Gw.call(this,xq,$,"DEPRECATED","warn"),this._metaOpts=hq.call(this),$.formats)yq.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)uq.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);fq.call(this),$.validateFormats=X}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:v,schemaId:U}=this.opts,X=Yw;if(U==="id")X={...Yw},X.id=X.$id,delete X.$id;if(v&&$)this.addMetaSchema(X,X[U],!1)}defaultMeta(){let{meta:$,schemaId:v}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[v]||$:void 0}validate($,v){let U;if(typeof $=="string"){if(U=this.getSchema($),!U)throw Error(`no schema with key or ref "${$}"`)}else U=this.compile($);let X=U(v);if(!("$async"in U))this.errors=U.errors;return X}compile($,v){let U=this._addSchema($,v);return U.validate||this._compileSchemaEnv(U)}compileAsync($,v){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:U}=this.opts;return X.call(this,$,v);async function X(Q,j){await J.call(this,Q.$schema);let H=this._addSchema(Q,j);return H.validate||W.call(this,H)}async function J(Q){if(Q&&!this.getSchema(Q))await X.call(this,{$ref:Q},!0)}async function W(Q){try{return this._compileSchemaEnv(Q)}catch(j){if(!(j instanceof jw.default))throw j;return Y.call(this,j),await z.call(this,j.missingSchema),W.call(this,Q)}}function Y({missingSchema:Q,missingRef:j}){if(this.refs[Q])throw Error(`AnySchema ${Q} is loaded but ${j} cannot be resolved`)}async function z(Q){let j=await G.call(this,Q);if(!this.refs[Q])await J.call(this,j.$schema);if(!this.refs[Q])this.addSchema(j,Q,v)}async function G(Q){let j=this._loading[Q];if(j)return j;try{return await(this._loading[Q]=U(Q))}finally{delete this._loading[Q]}}}addSchema($,v,U,X=this.opts.validateSchema){if(Array.isArray($)){for(let W of $)this.addSchema(W,void 0,U,X);return this}let J;if(typeof $==="object"){let{schemaId:W}=this.opts;if(J=$[W],J!==void 0&&typeof J!="string")throw Error(`schema ${W} must be string`)}return v=(0,Y0.normalizeId)(v||J),this._checkUnique(v),this.schemas[v]=this._addSchema($,U,v,X,!0),this}addMetaSchema($,v,U=this.opts.validateSchema){return this.addSchema($,v,!0,U),this}validateSchema($,v){if(typeof $=="boolean")return!0;let U;if(U=$.$schema,U!==void 0&&typeof U!="string")throw Error("$schema must be a string");if(U=U||this.opts.defaultMeta||this.defaultMeta(),!U)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let X=this.validate(U,$);if(!X&&v){let J="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(J);else throw Error(J)}return X}getSchema($){let v;while(typeof(v=Qw.call(this,$))=="string")$=v;if(v===void 0){let{schemaId:U}=this.opts,X=new W0.SchemaEnv({schema:{},schemaId:U});if(v=W0.resolveSchema.call(this,X,$),!v)return;this.refs[$]=v}return v.validate||this._compileSchemaEnv(v)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let v=Qw.call(this,$);if(typeof v=="object")this._cache.delete(v.schema);return delete this.schemas[$],delete this.refs[$],this}case"object":{let v=$;this._cache.delete(v);let U=$[this.opts.schemaId];if(U)U=(0,Y0.normalizeId)(U),delete this.schemas[U],delete this.refs[U];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(let v of $)this.addKeyword(v);return this}addKeyword($,v){let U;if(typeof $=="string"){if(U=$,typeof v=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),v.keyword=U}else if(typeof $=="object"&&v===void 0){if(v=$,U=v.keyword,Array.isArray(U)&&!U.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(cq.call(this,U,v),!v)return(0,_z.eachItem)(U,(J)=>Cz.call(this,J)),this;rq.call(this,v);let X={...v,type:(0,mX.getJSONTypes)(v.type),schemaType:(0,mX.getJSONTypes)(v.schemaType)};return(0,_z.eachItem)(U,X.type.length===0?(J)=>Cz.call(this,J,X):(J)=>X.type.forEach((W)=>Cz.call(this,J,X,W))),this}getKeyword($){let v=this.RULES.all[$];return typeof v=="object"?v.definition:!!v}removeKeyword($){let{RULES:v}=this;delete v.keywords[$],delete v.all[$];for(let U of v.rules){let X=U.rules.findIndex((J)=>J.keyword===$);if(X>=0)U.rules.splice(X,1)}return this}addFormat($,v){if(typeof v=="string")v=new RegExp(v);return this.formats[$]=v,this}errorsText($=this.errors,{separator:v=", ",dataVar:U="data"}={}){if(!$||$.length===0)return"No errors";return $.map((X)=>`${U}${X.instancePath} ${X.message}`).reduce((X,J)=>X+v+J)}$dataMetaSchema($,v){let U=this.RULES.all;$=JSON.parse(JSON.stringify($));for(let X of v){let J=X.split("/").slice(1),W=$;for(let Y of J)W=W[Y];for(let Y in U){let z=U[Y];if(typeof z!="object")continue;let{$data:G}=z.definition,Q=W[Y];if(G&&Q)W[Y]=Hw(Q)}}return $}_removeAllSchemas($,v){for(let U in $){let X=$[U];if(!v||v.test(U)){if(typeof X=="string")delete $[U];else if(X&&!X.meta)this._cache.delete(X.schema),delete $[U]}}}_addSchema($,v,U,X=this.opts.validateSchema,J=this.opts.addUsedSchema){let W,{schemaId:Y}=this.opts;if(typeof $=="object")W=$[Y];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof $!="boolean")throw Error("schema must be object or boolean");let z=this._cache.get($);if(z!==void 0)return z;U=(0,Y0.normalizeId)(W||U);let G=Y0.getSchemaRefs.call(this,$,U);if(z=new W0.SchemaEnv({schema:$,schemaId:Y,meta:v,baseId:U,localRefs:G}),this._cache.set(z.schema,z),J&&!U.startsWith("#")){if(U)this._checkUnique(U);this.refs[U]=z}if(X)this.validateSchema($,!0);return z}_checkUnique($){if(this.schemas[$]||this.refs[$])throw Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta)this._compileMetaSchema($);else W0.compileSchema.call(this,$);if(!$.validate)throw Error("ajv implementation error");return $.validate}_compileMetaSchema($){let v=this.opts;this.opts=this._metaOpts;try{W0.compileSchema.call(this,$)}finally{this.opts=v}}}nX.ValidationError=Pq.default;nX.MissingRefError=jw.default;l6.default=nX;function Gw($,v,U,X="error"){for(let J in $){let W=J;if(W in v)this.logger[X](`${U}: option ${J}. ${$[W]}`)}}function Qw($){return $=(0,Y0.normalizeId)($),this.schemas[$]||this.refs[$]}function fq(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let v in $)this.addSchema($[v],v)}function yq(){for(let $ in this.opts.formats){let v=this.opts.formats[$];if(v)this.addFormat($,v)}}function uq($){if(Array.isArray($)){this.addVocabulary($);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let v in $){let U=$[v];if(!U.keyword)U.keyword=v;this.addKeyword(U)}}function hq(){let $={...this.opts};for(let v of _q)delete $[v];return $}var lq={log(){},warn(){},error(){}};function mq($){if($===!1)return lq;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw Error("logger must implement log, warn and error methods")}var nq=/^[a-z_$][a-z0-9_$:-]*$/i;function cq($,v){let{RULES:U}=this;if((0,_z.eachItem)($,(X)=>{if(U.keywords[X])throw Error(`Keyword ${X} is already defined`);if(!nq.test(X))throw Error(`Keyword ${X} has invalid name`)}),!v)return;if(v.$data&&!(("code"in v)||("validate"in v)))throw Error('$data keyword must have "code" or "validate" function')}function Cz($,v,U){var X;let J=v===null||v===void 0?void 0:v.post;if(U&&J)throw Error('keyword with "post" flag cannot have "type"');let{RULES:W}=this,Y=J?W.post:W.rules.find(({type:G})=>G===U);if(!Y)Y={type:U,rules:[]},W.rules.push(Y);if(W.keywords[$]=!0,!v)return;let z={keyword:$,definition:{...v,type:(0,mX.getJSONTypes)(v.type),schemaType:(0,mX.getJSONTypes)(v.schemaType)}};if(v.before)iq.call(this,Y,z,v.before);else Y.rules.push(z);W.all[$]=z,(X=v.implements)===null||X===void 0||X.forEach((G)=>this.addKeyword(G))}function iq($,v,U){let X=$.rules.findIndex((J)=>J.keyword===U);if(X>=0)$.rules.splice(X,0,v);else $.rules.push(v),this.logger.warn(`rule ${U} is not defined`)}function rq($){let{metaSchema:v}=$;if(v===void 0)return;if($.$data&&this.opts.$data)v=Hw(v);$.validateSchema=this.compile(v,!0)}var oq={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Hw($){return{anyOf:[$,oq]}}});var Ow=k((Iw)=>{Object.defineProperty(Iw,"__esModule",{value:!0});var tq={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Iw.default=tq});var Aw=k((Kw)=>{Object.defineProperty(Kw,"__esModule",{value:!0});Kw.callRef=Kw.getValidate=void 0;var eq=U0(),Dw=$6(),c$=p(),V1=y6(),bw=fX(),cX=J$(),sq={keyword:"$ref",schemaType:"string",code($){let{gen:v,schema:U,it:X}=$,{baseId:J,schemaEnv:W,validateName:Y,opts:z,self:G}=X,{root:Q}=W;if((U==="#"||U==="#/")&&J===Q.baseId)return H();let j=bw.resolveRef.call(G,Q,J,U);if(j===void 0)throw new eq.default(X.opts.uriResolver,J,U);if(j instanceof bw.SchemaEnv)return N(j);return w(j);function H(){if(W===Q)return iX($,Y,W,W.$async);let I=v.scopeValue("root",{ref:Q});return iX($,c$._`${I}.validate`,Q,Q.$async)}function N(I){let D=Vw($,I);iX($,D,I,I.$async)}function w(I){let D=v.scopeValue("schema",z.code.source===!0?{ref:I,code:(0,c$.stringify)(I)}:{ref:I}),K=v.name("valid"),B=$.subschema({schema:I,dataTypes:[],schemaPath:c$.nil,topSchemaRef:D,errSchemaPath:U},K);$.mergeEvaluated(B),$.ok(K)}}};function Vw($,v){let{gen:U}=$;return v.validate?U.scopeValue("validate",{ref:v.validate}):c$._`${U.scopeValue("wrapper",{ref:v})}.validate`}Kw.getValidate=Vw;function iX($,v,U,X){let{gen:J,it:W}=$,{allErrors:Y,schemaEnv:z,opts:G}=W,Q=G.passContext?V1.default.this:c$.nil;if(X)j();else H();function j(){if(!z.$async)throw Error("async schema referenced by sync schema");let I=J.let("valid");J.try(()=>{if(J.code(c$._`await ${(0,Dw.callValidateCode)($,v,Q)}`),w(v),!Y)J.assign(I,!0)},(D)=>{if(J.if(c$._`!(${D} instanceof ${W.ValidationError})`,()=>J.throw(D)),N(D),!Y)J.assign(I,!1)}),$.ok(I)}function H(){$.result((0,Dw.callValidateCode)($,v,Q),()=>w(v),()=>N(v))}function N(I){let D=c$._`${I}.errors`;J.assign(V1.default.vErrors,c$._`${V1.default.vErrors} === null ? ${D} : ${V1.default.vErrors}.concat(${D})`),J.assign(V1.default.errors,c$._`${V1.default.vErrors}.length`)}function w(I){var D;if(!W.opts.unevaluated)return;let K=(D=U===null||U===void 0?void 0:U.validate)===null||D===void 0?void 0:D.evaluated;if(W.props!==!0)if(K&&!K.dynamicProps){if(K.props!==void 0)W.props=cX.mergeEvaluated.props(J,K.props,W.props)}else{let B=J.var("props",c$._`${I}.evaluated.props`);W.props=cX.mergeEvaluated.props(J,B,W.props,c$.Name)}if(W.items!==!0)if(K&&!K.dynamicItems){if(K.items!==void 0)W.items=cX.mergeEvaluated.items(J,K.items,W.items)}else{let B=J.var("items",c$._`${I}.evaluated.items`);W.items=cX.mergeEvaluated.items(J,B,W.items,c$.Name)}}}Kw.callRef=iX;Kw.default=sq});var qw=k((Sw)=>{Object.defineProperty(Sw,"__esModule",{value:!0});var UL=Ow(),JL=Aw(),XL=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",UL.default,JL.default];Sw.default=XL});var Fw=k((Lw)=>{Object.defineProperty(Lw,"__esModule",{value:!0});var rX=p(),z4=rX.operators,oX={maximum:{okStr:"<=",ok:z4.LTE,fail:z4.GT},minimum:{okStr:">=",ok:z4.GTE,fail:z4.LT},exclusiveMaximum:{okStr:"<",ok:z4.LT,fail:z4.GTE},exclusiveMinimum:{okStr:">",ok:z4.GT,fail:z4.LTE}},YL={message:({keyword:$,schemaCode:v})=>rX.str`must be ${oX[$].okStr} ${v}`,params:({keyword:$,schemaCode:v})=>rX._`{comparison: ${oX[$].okStr}, limit: ${v}}`},zL={keyword:Object.keys(oX),type:"number",schemaType:"number",$data:!0,error:YL,code($){let{keyword:v,data:U,schemaCode:X}=$;$.fail$data(rX._`${U} ${oX[v].fail} ${X} || isNaN(${U})`)}};Lw.default=zL});var Mw=k((Ew)=>{Object.defineProperty(Ew,"__esModule",{value:!0});var z0=p(),QL={message:({schemaCode:$})=>z0.str`must be multiple of ${$}`,params:({schemaCode:$})=>z0._`{multipleOf: ${$}}`},jL={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:QL,code($){let{gen:v,data:U,schemaCode:X,it:J}=$,W=J.opts.multipleOfPrecision,Y=v.let("res"),z=W?z0._`Math.abs(Math.round(${Y}) - ${Y}) > 1e-${W}`:z0._`${Y} !== parseInt(${Y})`;$.fail$data(z0._`(${X} === 0 || (${Y} = ${U}/${X}, ${z}))`)}};Ew.default=jL});var kw=k((Rw)=>{Object.defineProperty(Rw,"__esModule",{value:!0});function Pw($){let v=$.length,U=0,X=0,J;while(X<v)if(U++,J=$.charCodeAt(X++),J>=55296&&J<=56319&&X<v){if(J=$.charCodeAt(X),(J&64512)===56320)X++}return U}Rw.default=Pw;Pw.code='require("ajv/dist/runtime/ucs2length").default'});var _w=k((Cw)=>{Object.defineProperty(Cw,"__esModule",{value:!0});var P4=p(),NL=J$(),IL=kw(),OL={message({keyword:$,schemaCode:v}){let U=$==="maxLength"?"more":"fewer";return P4.str`must NOT have ${U} than ${v} characters`},params:({schemaCode:$})=>P4._`{limit: ${$}}`},DL={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:OL,code($){let{keyword:v,data:U,schemaCode:X,it:J}=$,W=v==="maxLength"?P4.operators.GT:P4.operators.LT,Y=J.opts.unicode===!1?P4._`${U}.length`:P4._`${(0,NL.useFunc)($.gen,IL.default)}(${U})`;$.fail$data(P4._`${Y} ${W} ${X}`)}};Cw.default=DL});var Tw=k((Zw)=>{Object.defineProperty(Zw,"__esModule",{value:!0});var VL=$6(),pX=p(),KL={message:({schemaCode:$})=>pX.str`must match pattern "${$}"`,params:({schemaCode:$})=>pX._`{pattern: ${$}}`},BL={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:KL,code($){let{data:v,$data:U,schema:X,schemaCode:J,it:W}=$,Y=W.opts.unicodeRegExp?"u":"",z=U?pX._`(new RegExp(${J}, ${Y}))`:(0,VL.usePattern)($,X);$.fail$data(pX._`!${z}.test(${v})`)}};Zw.default=BL});var gw=k((xw)=>{Object.defineProperty(xw,"__esModule",{value:!0});var G0=p(),SL={message({keyword:$,schemaCode:v}){let U=$==="maxProperties"?"more":"fewer";return G0.str`must NOT have ${U} than ${v} properties`},params:({schemaCode:$})=>G0._`{limit: ${$}}`},qL={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:SL,code($){let{keyword:v,data:U,schemaCode:X}=$,J=v==="maxProperties"?G0.operators.GT:G0.operators.LT;$.fail$data(G0._`Object.keys(${U}).length ${J} ${X}`)}};xw.default=qL});var yw=k((fw)=>{Object.defineProperty(fw,"__esModule",{value:!0});var Q0=$6(),j0=p(),FL=J$(),EL={message:({params:{missingProperty:$}})=>j0.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>j0._`{missingProperty: ${$}}`},ML={keyword:"required",type:"object",schemaType:"array",$data:!0,error:EL,code($){let{gen:v,schema:U,schemaCode:X,data:J,$data:W,it:Y}=$,{opts:z}=Y;if(!W&&U.length===0)return;let G=U.length>=z.loopRequired;if(Y.allErrors)Q();else j();if(z.strictRequired){let w=$.parentSchema.properties,{definedProperties:I}=$.it;for(let D of U)if((w===null||w===void 0?void 0:w[D])===void 0&&!I.has(D)){let K=Y.schemaEnv.baseId+Y.errSchemaPath,B=`required property "${D}" is not defined at "${K}" (strictRequired)`;(0,FL.checkStrictMode)(Y,B,Y.opts.strictRequired)}}function Q(){if(G||W)$.block$data(j0.nil,H);else for(let w of U)(0,Q0.checkReportMissingProp)($,w)}function j(){let w=v.let("missing");if(G||W){let I=v.let("valid",!0);$.block$data(I,()=>N(w,I)),$.ok(I)}else v.if((0,Q0.checkMissingProp)($,U,w)),(0,Q0.reportMissingProp)($,w),v.else()}function H(){v.forOf("prop",X,(w)=>{$.setParams({missingProperty:w}),v.if((0,Q0.noPropertyInData)(v,J,w,z.ownProperties),()=>$.error())})}function N(w,I){$.setParams({missingProperty:w}),v.forOf(w,X,()=>{v.assign(I,(0,Q0.propertyInData)(v,J,w,z.ownProperties)),v.if((0,j0.not)(I),()=>{$.error(),v.break()})},j0.nil)}}};fw.default=ML});var hw=k((uw)=>{Object.defineProperty(uw,"__esModule",{value:!0});var w0=p(),RL={message({keyword:$,schemaCode:v}){let U=$==="maxItems"?"more":"fewer";return w0.str`must NOT have ${U} than ${v} items`},params:({schemaCode:$})=>w0._`{limit: ${$}}`},kL={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:RL,code($){let{keyword:v,data:U,schemaCode:X}=$,J=v==="maxItems"?w0.operators.GT:w0.operators.LT;$.fail$data(w0._`${U}.length ${J} ${X}`)}};uw.default=kL});var dX=k((mw)=>{Object.defineProperty(mw,"__esModule",{value:!0});var lw=bz();lw.code='require("ajv/dist/runtime/equal").default';mw.default=lw});var cw=k((nw)=>{Object.defineProperty(nw,"__esModule",{value:!0});var Zz=av(),E$=p(),ZL=J$(),TL=dX(),xL={message:({params:{i:$,j:v}})=>E$.str`must NOT have duplicate items (items ## ${v} and ${$} are identical)`,params:({params:{i:$,j:v}})=>E$._`{i: ${$}, j: ${v}}`},gL={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:xL,code($){let{gen:v,data:U,$data:X,schema:J,parentSchema:W,schemaCode:Y,it:z}=$;if(!X&&!J)return;let G=v.let("valid"),Q=W.items?(0,Zz.getSchemaTypes)(W.items):[];$.block$data(G,j,E$._`${Y} === false`),$.ok(G);function j(){let I=v.let("i",E$._`${U}.length`),D=v.let("j");$.setParams({i:I,j:D}),v.assign(G,!0),v.if(E$._`${I} > 1`,()=>(H()?N:w)(I,D))}function H(){return Q.length>0&&!Q.some((I)=>I==="object"||I==="array")}function N(I,D){let K=v.name("item"),B=(0,Zz.checkDataTypes)(Q,K,z.opts.strictNumbers,Zz.DataType.Wrong),x=v.const("indices",E$._`{}`);v.for(E$._`;${I}--;`,()=>{if(v.let(K,E$._`${U}[${I}]`),v.if(B,E$._`continue`),Q.length>1)v.if(E$._`typeof ${K} == "string"`,E$._`${K} += "_"`);v.if(E$._`typeof ${x}[${K}] == "number"`,()=>{v.assign(D,E$._`${x}[${K}]`),$.error(),v.assign(G,!1).break()}).code(E$._`${x}[${K}] = ${I}`)})}function w(I,D){let K=(0,ZL.useFunc)(v,TL.default),B=v.name("outer");v.label(B).for(E$._`;${I}--;`,()=>v.for(E$._`${D} = ${I}; ${D}--;`,()=>v.if(E$._`${K}(${U}[${I}], ${U}[${D}])`,()=>{$.error(),v.assign(G,!1).break(B)})))}}};nw.default=gL});var rw=k((iw)=>{Object.defineProperty(iw,"__esModule",{value:!0});var Tz=p(),yL=J$(),uL=dX(),hL={message:"must be equal to constant",params:({schemaCode:$})=>Tz._`{allowedValue: ${$}}`},lL={keyword:"const",$data:!0,error:hL,code($){let{gen:v,data:U,$data:X,schemaCode:J,schema:W}=$;if(X||W&&typeof W=="object")$.fail$data(Tz._`!${(0,yL.useFunc)(v,uL.default)}(${U}, ${J})`);else $.fail(Tz._`${W} !== ${U}`)}};iw.default=lL});var pw=k((ow)=>{Object.defineProperty(ow,"__esModule",{value:!0});var H0=p(),nL=J$(),cL=dX(),iL={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>H0._`{allowedValues: ${$}}`},rL={keyword:"enum",schemaType:"array",$data:!0,error:iL,code($){let{gen:v,data:U,$data:X,schema:J,schemaCode:W,it:Y}=$;if(!X&&J.length===0)throw Error("enum must have non-empty array");let z=J.length>=Y.opts.loopEnum,G,Q=()=>G!==null&&G!==void 0?G:G=(0,nL.useFunc)(v,cL.default),j;if(z||X)j=v.let("valid"),$.block$data(j,H);else{if(!Array.isArray(J))throw Error("ajv implementation error");let w=v.const("vSchema",W);j=(0,H0.or)(...J.map((I,D)=>N(w,D)))}$.pass(j);function H(){v.assign(j,!1),v.forOf("v",W,(w)=>v.if(H0._`${Q()}(${U}, ${w})`,()=>v.assign(j,!0).break()))}function N(w,I){let D=J[I];return typeof D==="object"&&D!==null?H0._`${Q()}(${U}, ${w}[${I}])`:H0._`${U} === ${D}`}}};ow.default=rL});var tw=k((dw)=>{Object.defineProperty(dw,"__esModule",{value:!0});var pL=Fw(),dL=Mw(),tL=_w(),aL=Tw(),eL=gw(),sL=yw(),$F=hw(),vF=cw(),UF=rw(),JF=pw(),XF=[pL.default,dL.default,tL.default,aL.default,eL.default,sL.default,$F.default,vF.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},UF.default,JF.default];dw.default=XF});var gz=k((ew)=>{Object.defineProperty(ew,"__esModule",{value:!0});ew.validateAdditionalItems=void 0;var R4=p(),xz=J$(),YF={message:({params:{len:$}})=>R4.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>R4._`{limit: ${$}}`},zF={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:YF,code($){let{parentSchema:v,it:U}=$,{items:X}=v;if(!Array.isArray(X)){(0,xz.checkStrictMode)(U,'"additionalItems" is ignored when "items" is not an array of schemas');return}aw($,X)}};function aw($,v){let{gen:U,schema:X,data:J,keyword:W,it:Y}=$;Y.items=!0;let z=U.const("len",R4._`${J}.length`);if(X===!1)$.setParams({len:v.length}),$.pass(R4._`${z} <= ${v.length}`);else if(typeof X=="object"&&!(0,xz.alwaysValidSchema)(Y,X)){let Q=U.var("valid",R4._`${z} <= ${v.length}`);U.if((0,R4.not)(Q),()=>G(Q)),$.ok(Q)}function G(Q){U.forRange("i",v.length,z,(j)=>{if($.subschema({keyword:W,dataProp:j,dataPropType:xz.Type.Num},Q),!Y.allErrors)U.if((0,R4.not)(Q),()=>U.break())})}}ew.validateAdditionalItems=aw;ew.default=zF});var fz=k((U3)=>{Object.defineProperty(U3,"__esModule",{value:!0});U3.validateTuple=void 0;var $3=p(),tX=J$(),QF=$6(),jF={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:v,it:U}=$;if(Array.isArray(v))return v3($,"additionalItems",v);if(U.items=!0,(0,tX.alwaysValidSchema)(U,v))return;$.ok((0,QF.validateArray)($))}};function v3($,v,U=$.schema){let{gen:X,parentSchema:J,data:W,keyword:Y,it:z}=$;if(j(J),z.opts.unevaluated&&U.length&&z.items!==!0)z.items=tX.mergeEvaluated.items(X,U.length,z.items);let G=X.name("valid"),Q=X.const("len",$3._`${W}.length`);U.forEach((H,N)=>{if((0,tX.alwaysValidSchema)(z,H))return;X.if($3._`${Q} > ${N}`,()=>$.subschema({keyword:Y,schemaProp:N,dataProp:N},G)),$.ok(G)});function j(H){let{opts:N,errSchemaPath:w}=z,I=U.length,D=I===H.minItems&&(I===H.maxItems||H[v]===!1);if(N.strictTuples&&!D){let K=`"${Y}" is ${I}-tuple, but minItems or maxItems/${v} are not specified or different at path "${w}"`;(0,tX.checkStrictMode)(z,K,N.strictTuples)}}}U3.validateTuple=v3;U3.default=jF});var W3=k((X3)=>{Object.defineProperty(X3,"__esModule",{value:!0});var HF=fz(),NF={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>(0,HF.validateTuple)($,"items")};X3.default=NF});var G3=k((z3)=>{Object.defineProperty(z3,"__esModule",{value:!0});var Y3=p(),OF=J$(),DF=$6(),bF=gz(),VF={message:({params:{len:$}})=>Y3.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>Y3._`{limit: ${$}}`},KF={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:VF,code($){let{schema:v,parentSchema:U,it:X}=$,{prefixItems:J}=U;if(X.items=!0,(0,OF.alwaysValidSchema)(X,v))return;if(J)(0,bF.validateAdditionalItems)($,J);else $.ok((0,DF.validateArray)($))}};z3.default=KF});var j3=k((Q3)=>{Object.defineProperty(Q3,"__esModule",{value:!0});var v6=p(),aX=J$(),AF={message:({params:{min:$,max:v}})=>v===void 0?v6.str`must contain at least ${$} valid item(s)`:v6.str`must contain at least ${$} and no more than ${v} valid item(s)`,params:({params:{min:$,max:v}})=>v===void 0?v6._`{minContains: ${$}}`:v6._`{minContains: ${$}, maxContains: ${v}}`},SF={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:AF,code($){let{gen:v,schema:U,parentSchema:X,data:J,it:W}=$,Y,z,{minContains:G,maxContains:Q}=X;if(W.opts.next)Y=G===void 0?1:G,z=Q;else Y=1;let j=v.const("len",v6._`${J}.length`);if($.setParams({min:Y,max:z}),z===void 0&&Y===0){(0,aX.checkStrictMode)(W,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(z!==void 0&&Y>z){(0,aX.checkStrictMode)(W,'"minContains" > "maxContains" is always invalid'),$.fail();return}if((0,aX.alwaysValidSchema)(W,U)){let D=v6._`${j} >= ${Y}`;if(z!==void 0)D=v6._`${D} && ${j} <= ${z}`;$.pass(D);return}W.items=!0;let H=v.name("valid");if(z===void 0&&Y===1)w(H,()=>v.if(H,()=>v.break()));else if(Y===0){if(v.let(H,!0),z!==void 0)v.if(v6._`${J}.length > 0`,N)}else v.let(H,!1),N();$.result(H,()=>$.reset());function N(){let D=v.name("_valid"),K=v.let("count",0);w(D,()=>v.if(D,()=>I(K)))}function w(D,K){v.forRange("i",0,j,(B)=>{$.subschema({keyword:"contains",dataProp:B,dataPropType:aX.Type.Num,compositeRule:!0},D),K()})}function I(D){if(v.code(v6._`${D}++`),z===void 0)v.if(v6._`${D} >= ${Y}`,()=>v.assign(H,!0).break());else if(v.if(v6._`${D} > ${z}`,()=>v.assign(H,!1).break()),Y===1)v.assign(H,!0);else v.if(v6._`${D} >= ${Y}`,()=>v.assign(H,!0))}}};Q3.default=SF});var D3=k((N3)=>{Object.defineProperty(N3,"__esModule",{value:!0});N3.validateSchemaDeps=N3.validatePropertyDeps=N3.error=void 0;var yz=p(),LF=J$(),N0=$6();N3.error={message:({params:{property:$,depsCount:v,deps:U}})=>{let X=v===1?"property":"properties";return yz.str`must have ${X} ${U} when property ${$} is present`},params:({params:{property:$,depsCount:v,deps:U,missingProperty:X}})=>yz._`{property: ${$},
7
+ missingProperty: ${X},
8
+ depsCount: ${v},
9
+ deps: ${U}}`};var FF={keyword:"dependencies",type:"object",schemaType:"object",error:N3.error,code($){let[v,U]=EF($);w3($,v),H3($,U)}};function EF({schema:$}){let v={},U={};for(let X in $){if(X==="__proto__")continue;let J=Array.isArray($[X])?v:U;J[X]=$[X]}return[v,U]}function w3($,v=$.schema){let{gen:U,data:X,it:J}=$;if(Object.keys(v).length===0)return;let W=U.let("missing");for(let Y in v){let z=v[Y];if(z.length===0)continue;let G=(0,N0.propertyInData)(U,X,Y,J.opts.ownProperties);if($.setParams({property:Y,depsCount:z.length,deps:z.join(", ")}),J.allErrors)U.if(G,()=>{for(let Q of z)(0,N0.checkReportMissingProp)($,Q)});else U.if(yz._`${G} && (${(0,N0.checkMissingProp)($,z,W)})`),(0,N0.reportMissingProp)($,W),U.else()}}N3.validatePropertyDeps=w3;function H3($,v=$.schema){let{gen:U,data:X,keyword:J,it:W}=$,Y=U.name("valid");for(let z in v){if((0,LF.alwaysValidSchema)(W,v[z]))continue;U.if((0,N0.propertyInData)(U,X,z,W.opts.ownProperties),()=>{let G=$.subschema({keyword:J,schemaProp:z},Y);$.mergeValidEvaluated(G,Y)},()=>U.var(Y,!0)),$.ok(Y)}}N3.validateSchemaDeps=H3;N3.default=FF});var K3=k((V3)=>{Object.defineProperty(V3,"__esModule",{value:!0});var b3=p(),RF=J$(),kF={message:"property name must be valid",params:({params:$})=>b3._`{propertyName: ${$.propertyName}}`},CF={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:kF,code($){let{gen:v,schema:U,data:X,it:J}=$;if((0,RF.alwaysValidSchema)(J,U))return;let W=v.name("valid");v.forIn("key",X,(Y)=>{$.setParams({propertyName:Y}),$.subschema({keyword:"propertyNames",data:Y,dataTypes:["string"],propertyName:Y,compositeRule:!0},W),v.if((0,b3.not)(W),()=>{if($.error(!0),!J.allErrors)v.break()})}),$.ok(W)}};V3.default=CF});var uz=k((B3)=>{Object.defineProperty(B3,"__esModule",{value:!0});var eX=$6(),N6=p(),ZF=y6(),sX=J$(),TF={message:"must NOT have additional properties",params:({params:$})=>N6._`{additionalProperty: ${$.additionalProperty}}`},xF={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:TF,code($){let{gen:v,schema:U,parentSchema:X,data:J,errsCount:W,it:Y}=$;if(!W)throw Error("ajv implementation error");let{allErrors:z,opts:G}=Y;if(Y.props=!0,G.removeAdditional!=="all"&&(0,sX.alwaysValidSchema)(Y,U))return;let Q=(0,eX.allSchemaProperties)(X.properties),j=(0,eX.allSchemaProperties)(X.patternProperties);H(),$.ok(N6._`${W} === ${ZF.default.errors}`);function H(){v.forIn("key",J,(K)=>{if(!Q.length&&!j.length)I(K);else v.if(N(K),()=>I(K))})}function N(K){let B;if(Q.length>8){let x=(0,sX.schemaRefOrVal)(Y,X.properties,"properties");B=(0,eX.isOwnProperty)(v,x,K)}else if(Q.length)B=(0,N6.or)(...Q.map((x)=>N6._`${K} === ${x}`));else B=N6.nil;if(j.length)B=(0,N6.or)(B,...j.map((x)=>N6._`${(0,eX.usePattern)($,x)}.test(${K})`));return(0,N6.not)(B)}function w(K){v.code(N6._`delete ${J}[${K}]`)}function I(K){if(G.removeAdditional==="all"||G.removeAdditional&&U===!1){w(K);return}if(U===!1){if($.setParams({additionalProperty:K}),$.error(),!z)v.break();return}if(typeof U=="object"&&!(0,sX.alwaysValidSchema)(Y,U)){let B=v.name("valid");if(G.removeAdditional==="failing")D(K,B,!1),v.if((0,N6.not)(B),()=>{$.reset(),w(K)});else if(D(K,B),!z)v.if((0,N6.not)(B),()=>v.break())}}function D(K,B,x){let R={keyword:"additionalProperties",dataProp:K,dataPropType:sX.Type.Str};if(x===!1)Object.assign(R,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(R,B)}}};B3.default=xF});var L3=k((q3)=>{Object.defineProperty(q3,"__esModule",{value:!0});var fF=v0(),A3=$6(),hz=J$(),S3=uz(),yF={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:v,schema:U,parentSchema:X,data:J,it:W}=$;if(W.opts.removeAdditional==="all"&&X.additionalProperties===void 0)S3.default.code(new fF.KeywordCxt(W,S3.default,"additionalProperties"));let Y=(0,A3.allSchemaProperties)(U);for(let H of Y)W.definedProperties.add(H);if(W.opts.unevaluated&&Y.length&&W.props!==!0)W.props=hz.mergeEvaluated.props(v,(0,hz.toHash)(Y),W.props);let z=Y.filter((H)=>!(0,hz.alwaysValidSchema)(W,U[H]));if(z.length===0)return;let G=v.name("valid");for(let H of z){if(Q(H))j(H);else{if(v.if((0,A3.propertyInData)(v,J,H,W.opts.ownProperties)),j(H),!W.allErrors)v.else().var(G,!0);v.endIf()}$.it.definedProperties.add(H),$.ok(G)}function Q(H){return W.opts.useDefaults&&!W.compositeRule&&U[H].default!==void 0}function j(H){$.subschema({keyword:"properties",schemaProp:H,dataProp:H},G)}}};q3.default=yF});var R3=k((P3)=>{Object.defineProperty(P3,"__esModule",{value:!0});var F3=$6(),$W=p(),E3=J$(),M3=J$(),hF={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:v,schema:U,data:X,parentSchema:J,it:W}=$,{opts:Y}=W,z=(0,F3.allSchemaProperties)(U),G=z.filter((D)=>(0,E3.alwaysValidSchema)(W,U[D]));if(z.length===0||G.length===z.length&&(!W.opts.unevaluated||W.props===!0))return;let Q=Y.strictSchema&&!Y.allowMatchingProperties&&J.properties,j=v.name("valid");if(W.props!==!0&&!(W.props instanceof $W.Name))W.props=(0,M3.evaluatedPropsToName)(v,W.props);let{props:H}=W;N();function N(){for(let D of z){if(Q)w(D);if(W.allErrors)I(D);else v.var(j,!0),I(D),v.if(j)}}function w(D){for(let K in Q)if(new RegExp(D).test(K))(0,E3.checkStrictMode)(W,`property ${K} matches pattern ${D} (use allowMatchingProperties)`)}function I(D){v.forIn("key",X,(K)=>{v.if($W._`${(0,F3.usePattern)($,D)}.test(${K})`,()=>{let B=G.includes(D);if(!B)$.subschema({keyword:"patternProperties",schemaProp:D,dataProp:K,dataPropType:M3.Type.Str},j);if(W.opts.unevaluated&&H!==!0)v.assign($W._`${H}[${K}]`,!0);else if(!B&&!W.allErrors)v.if((0,$W.not)(j),()=>v.break())})})}}};P3.default=hF});var C3=k((k3)=>{Object.defineProperty(k3,"__esModule",{value:!0});var mF=J$(),nF={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:v,schema:U,it:X}=$;if((0,mF.alwaysValidSchema)(X,U)){$.fail();return}let J=v.name("valid");$.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},J),$.failResult(J,()=>$.reset(),()=>$.error())},error:{message:"must NOT be valid"}};k3.default=nF});var Z3=k((_3)=>{Object.defineProperty(_3,"__esModule",{value:!0});var iF=$6(),rF={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:iF.validateUnion,error:{message:"must match a schema in anyOf"}};_3.default=rF});var x3=k((T3)=>{Object.defineProperty(T3,"__esModule",{value:!0});var vW=p(),pF=J$(),dF={message:"must match exactly one schema in oneOf",params:({params:$})=>vW._`{passingSchemas: ${$.passing}}`},tF={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:dF,code($){let{gen:v,schema:U,parentSchema:X,it:J}=$;if(!Array.isArray(U))throw Error("ajv implementation error");if(J.opts.discriminator&&X.discriminator)return;let W=U,Y=v.let("valid",!1),z=v.let("passing",null),G=v.name("_valid");$.setParams({passing:z}),v.block(Q),$.result(Y,()=>$.reset(),()=>$.error(!0));function Q(){W.forEach((j,H)=>{let N;if((0,pF.alwaysValidSchema)(J,j))v.var(G,!0);else N=$.subschema({keyword:"oneOf",schemaProp:H,compositeRule:!0},G);if(H>0)v.if(vW._`${G} && ${Y}`).assign(Y,!1).assign(z,vW._`[${z}, ${H}]`).else();v.if(G,()=>{if(v.assign(Y,!0),v.assign(z,H),N)$.mergeEvaluated(N,vW.Name)})})}}};T3.default=tF});var f3=k((g3)=>{Object.defineProperty(g3,"__esModule",{value:!0});var eF=J$(),sF={keyword:"allOf",schemaType:"array",code($){let{gen:v,schema:U,it:X}=$;if(!Array.isArray(U))throw Error("ajv implementation error");let J=v.name("valid");U.forEach((W,Y)=>{if((0,eF.alwaysValidSchema)(X,W))return;let z=$.subschema({keyword:"allOf",schemaProp:Y},J);$.ok(J),$.mergeEvaluated(z)})}};g3.default=sF});var l3=k((h3)=>{Object.defineProperty(h3,"__esModule",{value:!0});var UW=p(),u3=J$(),vE={message:({params:$})=>UW.str`must match "${$.ifClause}" schema`,params:({params:$})=>UW._`{failingKeyword: ${$.ifClause}}`},UE={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:vE,code($){let{gen:v,parentSchema:U,it:X}=$;if(U.then===void 0&&U.else===void 0)(0,u3.checkStrictMode)(X,'"if" without "then" and "else" is ignored');let J=y3(X,"then"),W=y3(X,"else");if(!J&&!W)return;let Y=v.let("valid",!0),z=v.name("_valid");if(G(),$.reset(),J&&W){let j=v.let("ifClause");$.setParams({ifClause:j}),v.if(z,Q("then",j),Q("else",j))}else if(J)v.if(z,Q("then"));else v.if((0,UW.not)(z),Q("else"));$.pass(Y,()=>$.error(!0));function G(){let j=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},z);$.mergeEvaluated(j)}function Q(j,H){return()=>{let N=$.subschema({keyword:j},z);if(v.assign(Y,z),$.mergeValidEvaluated(N,Y),H)v.assign(H,UW._`${j}`);else $.setParams({ifClause:j})}}}};function y3($,v){let U=$.schema[v];return U!==void 0&&!(0,u3.alwaysValidSchema)($,U)}h3.default=UE});var n3=k((m3)=>{Object.defineProperty(m3,"__esModule",{value:!0});var XE=J$(),WE={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:v,it:U}){if(v.if===void 0)(0,XE.checkStrictMode)(U,`"${$}" without "if" is ignored`)}};m3.default=WE});var i3=k((c3)=>{Object.defineProperty(c3,"__esModule",{value:!0});var zE=gz(),GE=W3(),QE=fz(),jE=G3(),wE=j3(),HE=D3(),NE=K3(),IE=uz(),OE=L3(),DE=R3(),bE=C3(),VE=Z3(),KE=x3(),BE=f3(),AE=l3(),SE=n3();function qE($=!1){let v=[bE.default,VE.default,KE.default,BE.default,AE.default,SE.default,NE.default,IE.default,HE.default,OE.default,DE.default];if($)v.push(GE.default,jE.default);else v.push(zE.default,QE.default);return v.push(wE.default),v}c3.default=qE});var o3=k((r3)=>{Object.defineProperty(r3,"__esModule",{value:!0});var A$=p(),FE={message:({schemaCode:$})=>A$.str`must match format "${$}"`,params:({schemaCode:$})=>A$._`{format: ${$}}`},EE={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:FE,code($,v){let{gen:U,data:X,$data:J,schema:W,schemaCode:Y,it:z}=$,{opts:G,errSchemaPath:Q,schemaEnv:j,self:H}=z;if(!G.validateFormats)return;if(J)N();else w();function N(){let I=U.scopeValue("formats",{ref:H.formats,code:G.code.formats}),D=U.const("fDef",A$._`${I}[${Y}]`),K=U.let("fType"),B=U.let("format");U.if(A$._`typeof ${D} == "object" && !(${D} instanceof RegExp)`,()=>U.assign(K,A$._`${D}.type || "string"`).assign(B,A$._`${D}.validate`),()=>U.assign(K,A$._`"string"`).assign(B,D)),$.fail$data((0,A$.or)(x(),R()));function x(){if(G.strictSchema===!1)return A$.nil;return A$._`${Y} && !${B}`}function R(){let y=j.$async?A$._`(${D}.async ? await ${B}(${X}) : ${B}(${X}))`:A$._`${B}(${X})`,T=A$._`(typeof ${B} == "function" ? ${y} : ${B}.test(${X}))`;return A$._`${B} && ${B} !== true && ${K} === ${v} && !${T}`}}function w(){let I=H.formats[W];if(!I){x();return}if(I===!0)return;let[D,K,B]=R(I);if(D===v)$.pass(y());function x(){if(G.strictSchema===!1){H.logger.warn(T());return}throw Error(T());function T(){return`unknown format "${W}" ignored in schema at path "${Q}"`}}function R(T){let O6=T instanceof RegExp?(0,A$.regexpCode)(T):G.code.formats?A$._`${G.code.formats}${(0,A$.getProperty)(W)}`:void 0,P6=U.scopeValue("formats",{key:W,ref:T,code:O6});if(typeof T=="object"&&!(T instanceof RegExp))return[T.type||"string",T.validate,A$._`${P6}.validate`];return["string",T,P6]}function y(){if(typeof I=="object"&&!(I instanceof RegExp)&&I.async){if(!j.$async)throw Error("async format in sync schema");return A$._`await ${B}(${X})`}return typeof K=="function"?A$._`${B}(${X})`:A$._`${B}.test(${X})`}}}};r3.default=EE});var d3=k((p3)=>{Object.defineProperty(p3,"__esModule",{value:!0});var PE=o3(),RE=[PE.default];p3.default=RE});var e3=k((t3)=>{Object.defineProperty(t3,"__esModule",{value:!0});t3.contentVocabulary=t3.metadataVocabulary=void 0;t3.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];t3.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var vH=k(($H)=>{Object.defineProperty($H,"__esModule",{value:!0});var _E=qw(),ZE=tw(),TE=i3(),xE=d3(),s3=e3(),gE=[_E.default,ZE.default,(0,TE.default)(),xE.default,s3.metadataVocabulary,s3.contentVocabulary];$H.default=gE});var WH=k((JH)=>{Object.defineProperty(JH,"__esModule",{value:!0});JH.DiscrError=void 0;var UH;(function($){$.Tag="tag",$.Mapping="mapping"})(UH||(JH.DiscrError=UH={}))});var GH=k((zH)=>{Object.defineProperty(zH,"__esModule",{value:!0});var K1=p(),lz=WH(),YH=fX(),yE=U0(),uE=J$(),hE={message:({params:{discrError:$,tagName:v}})=>$===lz.DiscrError.Tag?`tag "${v}" must be string`:`value of tag "${v}" must be in oneOf`,params:({params:{discrError:$,tag:v,tagName:U}})=>K1._`{error: ${$}, tag: ${U}, tagValue: ${v}}`},lE={keyword:"discriminator",type:"object",schemaType:"object",error:hE,code($){let{gen:v,data:U,schema:X,parentSchema:J,it:W}=$,{oneOf:Y}=J;if(!W.opts.discriminator)throw Error("discriminator: requires discriminator option");let z=X.propertyName;if(typeof z!="string")throw Error("discriminator: requires propertyName");if(X.mapping)throw Error("discriminator: mapping is not supported");if(!Y)throw Error("discriminator: requires oneOf keyword");let G=v.let("valid",!1),Q=v.const("tag",K1._`${U}${(0,K1.getProperty)(z)}`);v.if(K1._`typeof ${Q} == "string"`,()=>j(),()=>$.error(!1,{discrError:lz.DiscrError.Tag,tag:Q,tagName:z})),$.ok(G);function j(){let w=N();v.if(!1);for(let I in w)v.elseIf(K1._`${Q} === ${I}`),v.assign(G,H(w[I]));v.else(),$.error(!1,{discrError:lz.DiscrError.Mapping,tag:Q,tagName:z}),v.endIf()}function H(w){let I=v.name("valid"),D=$.subschema({keyword:"oneOf",schemaProp:w},I);return $.mergeEvaluated(D,K1.Name),I}function N(){var w;let I={},D=B(J),K=!0;for(let y=0;y<Y.length;y++){let T=Y[y];if((T===null||T===void 0?void 0:T.$ref)&&!(0,uE.schemaHasRulesButRef)(T,W.self.RULES)){let P6=T.$ref;if(T=YH.resolveRef.call(W.self,W.schemaEnv.root,W.baseId,P6),T instanceof YH.SchemaEnv)T=T.schema;if(T===void 0)throw new yE.default(W.opts.uriResolver,W.baseId,P6)}let O6=(w=T===null||T===void 0?void 0:T.properties)===null||w===void 0?void 0:w[z];if(typeof O6!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${z}"`);K=K&&(D||B(T)),x(O6,y)}if(!K)throw Error(`discriminator: "${z}" must be required`);return I;function B({required:y}){return Array.isArray(y)&&y.includes(z)}function x(y,T){if(y.const)R(y.const,T);else if(y.enum)for(let O6 of y.enum)R(O6,T);else throw Error(`discriminator: "properties/${z}" must have "const" or "enum"`)}function R(y,T){if(typeof y!="string"||y in I)throw Error(`discriminator: "${z}" values must be unique strings`);I[y]=T}}}};zH.default=lE});var QH=k((wy,nE)=>{nE.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 nz=k((i$,mz)=>{Object.defineProperty(i$,"__esModule",{value:!0});i$.MissingRefError=i$.ValidationError=i$.CodeGen=i$.Name=i$.nil=i$.stringify=i$.str=i$._=i$.KeywordCxt=i$.Ajv=void 0;var cE=Nw(),iE=vH(),rE=GH(),jH=QH(),oE=["/properties"],JW="http://json-schema.org/draft-07/schema";class I0 extends cE.default{_addVocabularies(){if(super._addVocabularies(),iE.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(rE.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(jH,oE):jH;this.addMetaSchema($,JW,!1),this.refs["http://json-schema.org/schema"]=JW}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(JW)?JW:void 0)}}i$.Ajv=I0;mz.exports=i$=I0;mz.exports.Ajv=I0;Object.defineProperty(i$,"__esModule",{value:!0});i$.default=I0;var pE=v0();Object.defineProperty(i$,"KeywordCxt",{enumerable:!0,get:function(){return pE.KeywordCxt}});var B1=p();Object.defineProperty(i$,"_",{enumerable:!0,get:function(){return B1._}});Object.defineProperty(i$,"str",{enumerable:!0,get:function(){return B1.str}});Object.defineProperty(i$,"stringify",{enumerable:!0,get:function(){return B1.stringify}});Object.defineProperty(i$,"nil",{enumerable:!0,get:function(){return B1.nil}});Object.defineProperty(i$,"Name",{enumerable:!0,get:function(){return B1.Name}});Object.defineProperty(i$,"CodeGen",{enumerable:!0,get:function(){return B1.CodeGen}});var dE=xX();Object.defineProperty(i$,"ValidationError",{enumerable:!0,get:function(){return dE.default}});var tE=U0();Object.defineProperty(i$,"MissingRefError",{enumerable:!0,get:function(){return tE.default}})});var BH=k((VH)=>{Object.defineProperty(VH,"__esModule",{value:!0});VH.formatNames=VH.fastFormats=VH.fullFormats=void 0;function F6($,v){return{validate:$,compare:v}}VH.fullFormats={date:F6(IH,oz),time:F6(iz(!0),pz),"date-time":F6(wH(!0),DH),"iso-time":F6(iz(),OH),"iso-date-time":F6(wH(),bH),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:XM,"uri-reference":/^(?:[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,"uri-template":/^(?:(?:[^\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,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,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:/^(?=.{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,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([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}))|:)))$/i,regex:wM,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:WM,int32:{type:"number",validate:GM},int64:{type:"number",validate:QM},float:{type:"number",validate:NH},double:{type:"number",validate:NH},password:!0,binary:!0};VH.fastFormats={...VH.fullFormats,date:F6(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,oz),time:F6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,pz),"date-time":F6(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,DH),"iso-time":F6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,OH),"iso-date-time":F6(/^\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,bH),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,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};VH.formatNames=Object.keys(VH.fullFormats);function sE($){return $%4===0&&($%100!==0||$%400===0)}var $M=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,vM=[0,31,28,31,30,31,30,31,31,30,31,30,31];function IH($){let v=$M.exec($);if(!v)return!1;let U=+v[1],X=+v[2],J=+v[3];return X>=1&&X<=12&&J>=1&&J<=(X===2&&sE(U)?29:vM[X])}function oz($,v){if(!($&&v))return;if($>v)return 1;if($<v)return-1;return 0}var cz=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function iz($){return function(U){let X=cz.exec(U);if(!X)return!1;let J=+X[1],W=+X[2],Y=+X[3],z=X[4],G=X[5]==="-"?-1:1,Q=+(X[6]||0),j=+(X[7]||0);if(Q>23||j>59||$&&!z)return!1;if(J<=23&&W<=59&&Y<60)return!0;let H=W-j*G,N=J-Q*G-(H<0?1:0);return(N===23||N===-1)&&(H===59||H===-1)&&Y<61}}function pz($,v){if(!($&&v))return;let U=new Date("2020-01-01T"+$).valueOf(),X=new Date("2020-01-01T"+v).valueOf();if(!(U&&X))return;return U-X}function OH($,v){if(!($&&v))return;let U=cz.exec($),X=cz.exec(v);if(!(U&&X))return;if($=U[1]+U[2]+U[3],v=X[1]+X[2]+X[3],$>v)return 1;if($<v)return-1;return 0}var rz=/t|\s/i;function wH($){let v=iz($);return function(X){let J=X.split(rz);return J.length===2&&IH(J[0])&&v(J[1])}}function DH($,v){if(!($&&v))return;let U=new Date($).valueOf(),X=new Date(v).valueOf();if(!(U&&X))return;return U-X}function bH($,v){if(!($&&v))return;let[U,X]=$.split(rz),[J,W]=v.split(rz),Y=oz(U,J);if(Y===void 0)return;return Y||pz(X,W)}var UM=/\/|:/,JM=/^(?:[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;function XM($){return UM.test($)&&JM.test($)}var HH=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function WM($){return HH.lastIndex=0,HH.test($)}var YM=-2147483648,zM=2147483647;function GM($){return Number.isInteger($)&&$<=zM&&$>=YM}function QM($){return Number.isInteger($)}function NH(){return!0}var jM=/[^\\]\\Z/;function wM($){if(jM.test($))return!1;try{return new RegExp($),!0}catch(v){return!1}}});var SH=k((AH)=>{Object.defineProperty(AH,"__esModule",{value:!0});AH.formatLimitDefinition=void 0;var NM=nz(),I6=p(),G4=I6.operators,XW={formatMaximum:{okStr:"<=",ok:G4.LTE,fail:G4.GT},formatMinimum:{okStr:">=",ok:G4.GTE,fail:G4.LT},formatExclusiveMaximum:{okStr:"<",ok:G4.LT,fail:G4.GTE},formatExclusiveMinimum:{okStr:">",ok:G4.GT,fail:G4.LTE}},IM={message:({keyword:$,schemaCode:v})=>I6.str`should be ${XW[$].okStr} ${v}`,params:({keyword:$,schemaCode:v})=>I6._`{comparison: ${XW[$].okStr}, limit: ${v}}`};AH.formatLimitDefinition={keyword:Object.keys(XW),type:"string",schemaType:"string",$data:!0,error:IM,code($){let{gen:v,data:U,schemaCode:X,keyword:J,it:W}=$,{opts:Y,self:z}=W;if(!Y.validateFormats)return;let G=new NM.KeywordCxt(W,z.RULES.all.format.definition,"format");if(G.$data)Q();else j();function Q(){let N=v.scopeValue("formats",{ref:z.formats,code:Y.code.formats}),w=v.const("fmt",I6._`${N}[${G.schemaCode}]`);$.fail$data((0,I6.or)(I6._`typeof ${w} != "object"`,I6._`${w} instanceof RegExp`,I6._`typeof ${w}.compare != "function"`,H(w)))}function j(){let N=G.schema,w=z.formats[N];if(!w||w===!0)return;if(typeof w!="object"||w instanceof RegExp||typeof w.compare!="function")throw Error(`"${J}": format "${N}" does not define "compare" function`);let I=v.scopeValue("formats",{key:N,ref:w,code:Y.code.formats?I6._`${Y.code.formats}${(0,I6.getProperty)(N)}`:void 0});$.fail$data(H(I))}function H(N){return I6._`${N}.compare(${U}, ${X}) ${XW[J].fail} 0`}},dependencies:["format"]};var OM=($)=>{return $.addKeyword(AH.formatLimitDefinition),$};AH.default=OM});var EH=k((O0,FH)=>{Object.defineProperty(O0,"__esModule",{value:!0});var A1=BH(),bM=SH(),az=p(),qH=new az.Name("fullFormats"),VM=new az.Name("fastFormats"),ez=($,v={keywords:!0})=>{if(Array.isArray(v))return LH($,v,A1.fullFormats,qH),$;let[U,X]=v.mode==="fast"?[A1.fastFormats,VM]:[A1.fullFormats,qH],J=v.formats||A1.formatNames;if(LH($,J,U,X),v.keywords)(0,bM.default)($);return $};ez.get=($,v="full")=>{let X=(v==="fast"?A1.fastFormats:A1.fullFormats)[$];if(!X)throw Error(`Unknown format "${$}"`);return X};function LH($,v,U,X){var J,W;(J=(W=$.opts.code).formats)!==null&&J!==void 0||(W.formats=az._`require("ajv-formats/dist/formats").${X}`);for(let Y of v)$.addFormat(Y,U[Y])}FH.exports=O0=ez;Object.defineProperty(O0,"__esModule",{value:!0});O0.default=ez});var fH=k((ny,MM)=>{MM.exports={name:"dotenv",version:"16.6.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var mH=k((cy,n6)=>{var YG=q0("fs"),WW=q0("path"),PM=q0("os"),RM=q0("crypto"),kM=fH(),zG=kM.version,CM=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function _M($){let v={},U=$.toString();U=U.replace(/\r\n?/mg,`
10
+ `);let X;while((X=CM.exec(U))!=null){let J=X[1],W=X[2]||"";W=W.trim();let Y=W[0];if(W=W.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),Y==='"')W=W.replace(/\\n/g,`
11
+ `),W=W.replace(/\\r/g,"\r");v[J]=W}return v}function ZM($){$=$||{};let v=lH($);$.path=v;let U=L$.configDotenv($);if(!U.parsed){let Y=Error(`MISSING_DATA: Cannot parse ${v} for an unknown reason`);throw Y.code="MISSING_DATA",Y}let X=hH($).split(","),J=X.length,W;for(let Y=0;Y<J;Y++)try{let z=X[Y].trim(),G=xM(U,z);W=L$.decrypt(G.ciphertext,G.key);break}catch(z){if(Y+1>=J)throw z}return L$.parse(W)}function TM($){console.log(`[dotenv@${zG}][WARN] ${$}`)}function b0($){console.log(`[dotenv@${zG}][DEBUG] ${$}`)}function uH($){console.log(`[dotenv@${zG}] ${$}`)}function hH($){if($&&$.DOTENV_KEY&&$.DOTENV_KEY.length>0)return $.DOTENV_KEY;if(process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0)return process.env.DOTENV_KEY;return""}function xM($,v){let U;try{U=new URL(v)}catch(z){if(z.code==="ERR_INVALID_URL"){let G=Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw G.code="INVALID_DOTENV_KEY",G}throw z}let X=U.password;if(!X){let z=Error("INVALID_DOTENV_KEY: Missing key part");throw z.code="INVALID_DOTENV_KEY",z}let J=U.searchParams.get("environment");if(!J){let z=Error("INVALID_DOTENV_KEY: Missing environment part");throw z.code="INVALID_DOTENV_KEY",z}let W=`DOTENV_VAULT_${J.toUpperCase()}`,Y=$.parsed[W];if(!Y){let z=Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${W} in your .env.vault file.`);throw z.code="NOT_FOUND_DOTENV_ENVIRONMENT",z}return{ciphertext:Y,key:X}}function lH($){let v=null;if($&&$.path&&$.path.length>0)if(Array.isArray($.path)){for(let U of $.path)if(YG.existsSync(U))v=U.endsWith(".vault")?U:`${U}.vault`}else v=$.path.endsWith(".vault")?$.path:`${$.path}.vault`;else v=WW.resolve(process.cwd(),".env.vault");if(YG.existsSync(v))return v;return null}function yH($){return $[0]==="~"?WW.join(PM.homedir(),$.slice(1)):$}function gM($){let v=Boolean($&&$.debug),U=$&&"quiet"in $?$.quiet:!0;if(v||!U)uH("Loading env from encrypted .env.vault");let X=L$._parseVault($),J=process.env;if($&&$.processEnv!=null)J=$.processEnv;return L$.populate(J,X,$),{parsed:X}}function fM($){let v=WW.resolve(process.cwd(),".env"),U="utf8",X=Boolean($&&$.debug),J=$&&"quiet"in $?$.quiet:!0;if($&&$.encoding)U=$.encoding;else if(X)b0("No encoding is specified. UTF-8 is used by default");let W=[v];if($&&$.path)if(!Array.isArray($.path))W=[yH($.path)];else{W=[];for(let Q of $.path)W.push(yH(Q))}let Y,z={};for(let Q of W)try{let j=L$.parse(YG.readFileSync(Q,{encoding:U}));L$.populate(z,j,$)}catch(j){if(X)b0(`Failed to load ${Q} ${j.message}`);Y=j}let G=process.env;if($&&$.processEnv!=null)G=$.processEnv;if(L$.populate(G,z,$),X||!J){let Q=Object.keys(z).length,j=[];for(let H of W)try{let N=WW.relative(process.cwd(),H);j.push(N)}catch(N){if(X)b0(`Failed to load ${H} ${N.message}`);Y=N}uH(`injecting env (${Q}) from ${j.join(",")}`)}if(Y)return{parsed:z,error:Y};else return{parsed:z}}function yM($){if(hH($).length===0)return L$.configDotenv($);let v=lH($);if(!v)return TM(`You set DOTENV_KEY but you are missing a .env.vault file at ${v}. Did you forget to build it?`),L$.configDotenv($);return L$._configVault($)}function uM($,v){let U=Buffer.from(v.slice(-64),"hex"),X=Buffer.from($,"base64"),J=X.subarray(0,12),W=X.subarray(-16);X=X.subarray(12,-16);try{let Y=RM.createDecipheriv("aes-256-gcm",U,J);return Y.setAuthTag(W),`${Y.update(X)}${Y.final()}`}catch(Y){let z=Y instanceof RangeError,G=Y.message==="Invalid key length",Q=Y.message==="Unsupported state or unable to authenticate data";if(z||G){let j=Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw j.code="INVALID_DOTENV_KEY",j}else if(Q){let j=Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw j.code="DECRYPTION_FAILED",j}else throw Y}}function hM($,v,U={}){let X=Boolean(U&&U.debug),J=Boolean(U&&U.override);if(typeof v!=="object"){let W=Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw W.code="OBJECT_REQUIRED",W}for(let W of Object.keys(v))if(Object.prototype.hasOwnProperty.call($,W)){if(J===!0)$[W]=v[W];if(X)if(J===!0)b0(`"${W}" is already defined and WAS overwritten`);else b0(`"${W}" is already defined and was NOT overwritten`)}else $[W]=v[W]}var L$={configDotenv:fM,_configVault:gM,_parseVault:ZM,config:yM,decrypt:uM,parse:_M,populate:hM};cy.configDotenv=L$.configDotenv;cy._configVault=L$._configVault;cy._parseVault=L$._parseVault;cy.config=L$.config;cy.decrypt=L$.decrypt;cy.parse=L$.parse;cy.populate=L$.populate;n6.exports=L$});import bN from"node:process";import c6 from"node:process";var a;(function($){$.assertEqual=(J)=>{};function v(J){}$.assertIs=v;function U(J){throw Error()}$.assertNever=U,$.arrayToEnum=(J)=>{let W={};for(let Y of J)W[Y]=Y;return W},$.getValidEnumValues=(J)=>{let W=$.objectKeys(J).filter((z)=>typeof J[J[z]]!=="number"),Y={};for(let z of W)Y[z]=J[z];return $.objectValues(Y)},$.objectValues=(J)=>{return $.objectKeys(J).map(function(W){return J[W]})},$.objectKeys=typeof Object.keys==="function"?(J)=>Object.keys(J):(J)=>{let W=[];for(let Y in J)if(Object.prototype.hasOwnProperty.call(J,Y))W.push(Y);return W},$.find=(J,W)=>{for(let Y of J)if(W(Y))return Y;return},$.isInteger=typeof Number.isInteger==="function"?(J)=>Number.isInteger(J):(J)=>typeof J==="number"&&Number.isFinite(J)&&Math.floor(J)===J;function X(J,W=" | "){return J.map((Y)=>typeof Y==="string"?`'${Y}'`:Y).join(W)}$.joinValues=X,$.jsonStringifyReplacer=(J,W)=>{if(typeof W==="bigint")return W.toString();return W}})(a||(a={}));var NG;(function($){$.mergeShapes=(v,U)=>{return{...v,...U}}})(NG||(NG={}));var M=a.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),R6=($)=>{switch(typeof $){case"undefined":return M.undefined;case"string":return M.string;case"number":return Number.isNaN($)?M.nan:M.number;case"boolean":return M.boolean;case"function":return M.function;case"bigint":return M.bigint;case"symbol":return M.symbol;case"object":if(Array.isArray($))return M.array;if($===null)return M.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return M.promise;if(typeof Map<"u"&&$ instanceof Map)return M.map;if(typeof Set<"u"&&$ instanceof Set)return M.set;if(typeof Date<"u"&&$ instanceof Date)return M.date;return M.object;default:return M.unknown}};var S=a.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"]);class r$ extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(U)=>{this.issues=[...this.issues,U]},this.addIssues=(U=[])=>{this.issues=[...this.issues,...U]};let v=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,v);else this.__proto__=v;this.name="ZodError",this.issues=$}format($){let v=$||function(J){return J.message},U={_errors:[]},X=(J)=>{for(let W of J.issues)if(W.code==="invalid_union")W.unionErrors.map(X);else if(W.code==="invalid_return_type")X(W.returnTypeError);else if(W.code==="invalid_arguments")X(W.argumentsError);else if(W.path.length===0)U._errors.push(v(W));else{let Y=U,z=0;while(z<W.path.length){let G=W.path[z];if(z!==W.path.length-1)Y[G]=Y[G]||{_errors:[]};else Y[G]=Y[G]||{_errors:[]},Y[G]._errors.push(v(W));Y=Y[G],z++}}};return X(this),U}static assert($){if(!($ instanceof r$))throw Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,a.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(v)=>v.message){let v=Object.create(null),U=[];for(let X of this.issues)if(X.path.length>0){let J=X.path[0];v[J]=v[J]||[],v[J].push($(X))}else U.push($(X));return{formErrors:U,fieldErrors:v}}get formErrors(){return this.flatten()}}r$.create=($)=>{return new r$($)};var LN=($,v)=>{let U;switch($.code){case S.invalid_type:if($.received===M.undefined)U="Required";else U=`Expected ${$.expected}, received ${$.received}`;break;case S.invalid_literal:U=`Invalid literal value, expected ${JSON.stringify($.expected,a.jsonStringifyReplacer)}`;break;case S.unrecognized_keys:U=`Unrecognized key(s) in object: ${a.joinValues($.keys,", ")}`;break;case S.invalid_union:U="Invalid input";break;case S.invalid_union_discriminator:U=`Invalid discriminator value. Expected ${a.joinValues($.options)}`;break;case S.invalid_enum_value:U=`Invalid enum value. Expected ${a.joinValues($.options)}, received '${$.received}'`;break;case S.invalid_arguments:U="Invalid function arguments";break;case S.invalid_return_type:U="Invalid function return type";break;case S.invalid_date:U="Invalid date";break;case S.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(U=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")U=`${U} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)U=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)U=`Invalid input: must end with "${$.validation.endsWith}"`;else a.assertNever($.validation);else if($.validation!=="regex")U=`Invalid ${$.validation}`;else U="Invalid";break;case S.too_small:if($.type==="array")U=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")U=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")U=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="bigint")U=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")U=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else U="Invalid input";break;case S.too_big:if($.type==="array")U=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")U=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")U=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")U=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")U=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else U="Invalid input";break;case S.custom:U="Invalid input";break;case S.invalid_intersection_types:U="Intersection results could not be merged";break;case S.not_multiple_of:U=`Number must be a multiple of ${$.multipleOf}`;break;case S.not_finite:U="Number must be finite";break;default:U=v.defaultError,a.assertNever($)}return{message:U}},i6=LN;var FN=i6;function q1(){return FN}var L0=($)=>{let{data:v,path:U,errorMaps:X,issueData:J}=$,W=[...U,...J.path||[]],Y={...J,path:W};if(J.message!==void 0)return{...J,path:W,message:J.message};let z="",G=X.filter((Q)=>!!Q).slice().reverse();for(let Q of G)z=Q(Y,{data:v,defaultError:z}).message;return{...J,path:W,message:z}};function P($,v){let U=q1(),X=L0({issueData:v,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,U,U===i6?void 0:i6].filter((J)=>!!J)});$.common.issues.push(X)}class M${constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,v){let U=[];for(let X of v){if(X.status==="aborted")return u;if(X.status==="dirty")$.dirty();U.push(X.value)}return{status:$.value,value:U}}static async mergeObjectAsync($,v){let U=[];for(let X of v){let J=await X.key,W=await X.value;U.push({key:J,value:W})}return M$.mergeObjectSync($,U)}static mergeObjectSync($,v){let U={};for(let X of v){let{key:J,value:W}=X;if(J.status==="aborted")return u;if(W.status==="aborted")return u;if(J.status==="dirty")$.dirty();if(W.status==="dirty")$.dirty();if(J.value!=="__proto__"&&(typeof W.value<"u"||X.alwaysSet))U[J.value]=W.value}return{status:$.value,value:U}}}var u=Object.freeze({status:"aborted"}),T4=($)=>({status:"dirty",value:$}),C$=($)=>({status:"valid",value:$}),OW=($)=>$.status==="aborted",DW=($)=>$.status==="dirty",N4=($)=>$.status==="valid",L1=($)=>typeof Promise<"u"&&$ instanceof Promise;var Z;(function($){$.errToObj=(v)=>typeof v==="string"?{message:v}:v||{},$.toString=(v)=>typeof v==="string"?v:v?.message})(Z||(Z={}));class U6{constructor($,v,U,X){this._cachedPath=[],this.parent=$,this.data=v,this._path=U,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}}var IG=($,v)=>{if(N4(v))return{success:!0,data:v.value};else{if(!$.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let U=new r$($.common.issues);return this._error=U,this._error}}}};function n($){if(!$)return{};let{errorMap:v,invalid_type_error:U,required_error:X,description:J}=$;if(v&&(U||X))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(v)return{errorMap:v,description:J};return{errorMap:(Y,z)=>{let{message:G}=$;if(Y.code==="invalid_enum_value")return{message:G??z.defaultError};if(typeof z.data>"u")return{message:G??X??z.defaultError};if(Y.code!=="invalid_type")return{message:z.defaultError};return{message:G??U??z.defaultError}},description:J}}class d{get description(){return this._def.description}_getType($){return R6($.data)}_getOrReturnCtx($,v){return v||{common:$.parent.common,data:$.data,parsedType:R6($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new M$,ctx:{common:$.parent.common,data:$.data,parsedType:R6($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let v=this._parse($);if(L1(v))throw Error("Synchronous parse encountered promise.");return v}_parseAsync($){let v=this._parse($);return Promise.resolve(v)}parse($,v){let U=this.safeParse($,v);if(U.success)return U.data;throw U.error}safeParse($,v){let U={common:{issues:[],async:v?.async??!1,contextualErrorMap:v?.errorMap},path:v?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:R6($)},X=this._parseSync({data:$,path:U.path,parent:U});return IG(U,X)}"~validate"($){let v={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:R6($)};if(!this["~standard"].async)try{let U=this._parseSync({data:$,path:[],parent:v});return N4(U)?{value:U.value}:{issues:v.common.issues}}catch(U){if(U?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;v.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:v}).then((U)=>N4(U)?{value:U.value}:{issues:v.common.issues})}async parseAsync($,v){let U=await this.safeParseAsync($,v);if(U.success)return U.data;throw U.error}async safeParseAsync($,v){let U={common:{issues:[],contextualErrorMap:v?.errorMap,async:!0},path:v?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:R6($)},X=this._parse({data:$,path:U.path,parent:U}),J=await(L1(X)?X:Promise.resolve(X));return IG(U,J)}refine($,v){let U=(X)=>{if(typeof v==="string"||typeof v>"u")return{message:v};else if(typeof v==="function")return v(X);else return v};return this._refinement((X,J)=>{let W=$(X),Y=()=>J.addIssue({code:S.custom,...U(X)});if(typeof Promise<"u"&&W instanceof Promise)return W.then((z)=>{if(!z)return Y(),!1;else return!0});if(!W)return Y(),!1;else return!0})}refinement($,v){return this._refinement((U,X)=>{if(!$(U))return X.addIssue(typeof v==="function"?v(U,X):v),!1;else return!0})}_refinement($){return new V6({schema:this,typeName:L.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,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 b6.create(this,this._def)}nullable(){return r6.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return D6.create(this)}promise(){return u4.create(this,this._def)}or($){return R1.create([this,$],this._def)}and($){return k1.create(this,$,this._def)}transform($){return new V6({...n(this._def),schema:this,typeName:L.ZodEffects,effect:{type:"transform",transform:$}})}default($){let v=typeof $==="function"?$:()=>$;return new T1({...n(this._def),innerType:this,defaultValue:v,typeName:L.ZodDefault})}brand(){return new BW({typeName:L.ZodBranded,type:this,...n(this._def)})}catch($){let v=typeof $==="function"?$:()=>$;return new x1({...n(this._def),innerType:this,catchValue:v,typeName:L.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return _0.create(this,$)}readonly(){return g1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var EN=/^c[^\s-]{8,}$/i,MN=/^[0-9a-z]+$/,PN=/^[0-9A-HJKMNP-TV-Z]{26}$/i,RN=/^[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,kN=/^[a-z0-9_-]{21}$/i,CN=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,_N=/^[-+]?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)?)??$/,ZN=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,TN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",bW,xN=/^(?:(?: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])$/,gN=/^(?:(?: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])$/,fN=/^(([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]))$/,yN=/^(([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])$/,uN=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,hN=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,OG="((\\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])))",lN=new RegExp(`^${OG}$`);function DG($){let v="[0-5]\\d";if($.precision)v=`${v}\\.\\d{${$.precision}}`;else if($.precision==null)v=`${v}(\\.\\d+)?`;let U=$.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${v})${U}`}function mN($){return new RegExp(`^${DG($)}$`)}function nN($){let v=`${OG}T${DG($)}`,U=[];if(U.push($.local?"Z?":"Z"),$.offset)U.push("([+-]\\d{2}:?\\d{2})");return v=`${v}(${U.join("|")})`,new RegExp(`^${v}$`)}function cN($,v){if((v==="v4"||!v)&&xN.test($))return!0;if((v==="v6"||!v)&&fN.test($))return!0;return!1}function iN($,v){if(!CN.test($))return!1;try{let[U]=$.split(".");if(!U)return!1;let X=U.replace(/-/g,"+").replace(/_/g,"/").padEnd(U.length+(4-U.length%4)%4,"="),J=JSON.parse(atob(X));if(typeof J!=="object"||J===null)return!1;if("typ"in J&&J?.typ!=="JWT")return!1;if(!J.alg)return!1;if(v&&J.alg!==v)return!1;return!0}catch{return!1}}function rN($,v){if((v==="v4"||!v)&&gN.test($))return!0;if((v==="v6"||!v)&&yN.test($))return!0;return!1}class C6 extends d{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==M.string){let J=this._getOrReturnCtx($);return P(J,{code:S.invalid_type,expected:M.string,received:J.parsedType}),u}let U=new M$,X=void 0;for(let J of this._def.checks)if(J.kind==="min"){if($.data.length<J.value)X=this._getOrReturnCtx($,X),P(X,{code:S.too_small,minimum:J.value,type:"string",inclusive:!0,exact:!1,message:J.message}),U.dirty()}else if(J.kind==="max"){if($.data.length>J.value)X=this._getOrReturnCtx($,X),P(X,{code:S.too_big,maximum:J.value,type:"string",inclusive:!0,exact:!1,message:J.message}),U.dirty()}else if(J.kind==="length"){let W=$.data.length>J.value,Y=$.data.length<J.value;if(W||Y){if(X=this._getOrReturnCtx($,X),W)P(X,{code:S.too_big,maximum:J.value,type:"string",inclusive:!0,exact:!0,message:J.message});else if(Y)P(X,{code:S.too_small,minimum:J.value,type:"string",inclusive:!0,exact:!0,message:J.message});U.dirty()}}else if(J.kind==="email"){if(!ZN.test($.data))X=this._getOrReturnCtx($,X),P(X,{validation:"email",code:S.invalid_string,message:J.message}),U.dirty()}else if(J.kind==="emoji"){if(!bW)bW=new RegExp(TN,"u");if(!bW.test($.data))X=this._getOrReturnCtx($,X),P(X,{validation:"emoji",code:S.invalid_string,message:J.message}),U.dirty()}else if(J.kind==="uuid"){if(!RN.test($.data))X=this._getOrReturnCtx($,X),P(X,{validation:"uuid",code:S.invalid_string,message:J.message}),U.dirty()}else if(J.kind==="nanoid"){if(!kN.test($.data))X=this._getOrReturnCtx($,X),P(X,{validation:"nanoid",code:S.invalid_string,message:J.message}),U.dirty()}else if(J.kind==="cuid"){if(!EN.test($.data))X=this._getOrReturnCtx($,X),P(X,{validation:"cuid",code:S.invalid_string,message:J.message}),U.dirty()}else if(J.kind==="cuid2"){if(!MN.test($.data))X=this._getOrReturnCtx($,X),P(X,{validation:"cuid2",code:S.invalid_string,message:J.message}),U.dirty()}else if(J.kind==="ulid"){if(!PN.test($.data))X=this._getOrReturnCtx($,X),P(X,{validation:"ulid",code:S.invalid_string,message:J.message}),U.dirty()}else if(J.kind==="url")try{new URL($.data)}catch{X=this._getOrReturnCtx($,X),P(X,{validation:"url",code:S.invalid_string,message:J.message}),U.dirty()}else if(J.kind==="regex"){if(J.regex.lastIndex=0,!J.regex.test($.data))X=this._getOrReturnCtx($,X),P(X,{validation:"regex",code:S.invalid_string,message:J.message}),U.dirty()}else if(J.kind==="trim")$.data=$.data.trim();else if(J.kind==="includes"){if(!$.data.includes(J.value,J.position))X=this._getOrReturnCtx($,X),P(X,{code:S.invalid_string,validation:{includes:J.value,position:J.position},message:J.message}),U.dirty()}else if(J.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(J.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(J.kind==="startsWith"){if(!$.data.startsWith(J.value))X=this._getOrReturnCtx($,X),P(X,{code:S.invalid_string,validation:{startsWith:J.value},message:J.message}),U.dirty()}else if(J.kind==="endsWith"){if(!$.data.endsWith(J.value))X=this._getOrReturnCtx($,X),P(X,{code:S.invalid_string,validation:{endsWith:J.value},message:J.message}),U.dirty()}else if(J.kind==="datetime"){if(!nN(J).test($.data))X=this._getOrReturnCtx($,X),P(X,{code:S.invalid_string,validation:"datetime",message:J.message}),U.dirty()}else if(J.kind==="date"){if(!lN.test($.data))X=this._getOrReturnCtx($,X),P(X,{code:S.invalid_string,validation:"date",message:J.message}),U.dirty()}else if(J.kind==="time"){if(!mN(J).test($.data))X=this._getOrReturnCtx($,X),P(X,{code:S.invalid_string,validation:"time",message:J.message}),U.dirty()}else if(J.kind==="duration"){if(!_N.test($.data))X=this._getOrReturnCtx($,X),P(X,{validation:"duration",code:S.invalid_string,message:J.message}),U.dirty()}else if(J.kind==="ip"){if(!cN($.data,J.version))X=this._getOrReturnCtx($,X),P(X,{validation:"ip",code:S.invalid_string,message:J.message}),U.dirty()}else if(J.kind==="jwt"){if(!iN($.data,J.alg))X=this._getOrReturnCtx($,X),P(X,{validation:"jwt",code:S.invalid_string,message:J.message}),U.dirty()}else if(J.kind==="cidr"){if(!rN($.data,J.version))X=this._getOrReturnCtx($,X),P(X,{validation:"cidr",code:S.invalid_string,message:J.message}),U.dirty()}else if(J.kind==="base64"){if(!uN.test($.data))X=this._getOrReturnCtx($,X),P(X,{validation:"base64",code:S.invalid_string,message:J.message}),U.dirty()}else if(J.kind==="base64url"){if(!hN.test($.data))X=this._getOrReturnCtx($,X),P(X,{validation:"base64url",code:S.invalid_string,message:J.message}),U.dirty()}else a.assertNever(J);return{status:U.value,value:$.data}}_regex($,v,U){return this.refinement((X)=>$.test(X),{validation:v,code:S.invalid_string,...Z.errToObj(U)})}_addCheck($){return new C6({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...Z.errToObj($)})}url($){return this._addCheck({kind:"url",...Z.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...Z.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...Z.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...Z.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...Z.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...Z.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...Z.errToObj($)})}base64($){return this._addCheck({kind:"base64",...Z.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...Z.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...Z.errToObj($)})}ip($){return this._addCheck({kind:"ip",...Z.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...Z.errToObj($)})}datetime($){if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof $?.precision>"u"?null:$?.precision,offset:$?.offset??!1,local:$?.local??!1,...Z.errToObj($?.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof $?.precision>"u"?null:$?.precision,...Z.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...Z.errToObj($)})}regex($,v){return this._addCheck({kind:"regex",regex:$,...Z.errToObj(v)})}includes($,v){return this._addCheck({kind:"includes",value:$,position:v?.position,...Z.errToObj(v?.message)})}startsWith($,v){return this._addCheck({kind:"startsWith",value:$,...Z.errToObj(v)})}endsWith($,v){return this._addCheck({kind:"endsWith",value:$,...Z.errToObj(v)})}min($,v){return this._addCheck({kind:"min",value:$,...Z.errToObj(v)})}max($,v){return this._addCheck({kind:"max",value:$,...Z.errToObj(v)})}length($,v){return this._addCheck({kind:"length",value:$,...Z.errToObj(v)})}nonempty($){return this.min(1,Z.errToObj($))}trim(){return new C6({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new C6({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new C6({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let v of this._def.checks)if(v.kind==="min"){if($===null||v.value>$)$=v.value}return $}get maxLength(){let $=null;for(let v of this._def.checks)if(v.kind==="max"){if($===null||v.value<$)$=v.value}return $}}C6.create=($)=>{return new C6({checks:[],typeName:L.ZodString,coerce:$?.coerce??!1,...n($)})};function oN($,v){let U=($.toString().split(".")[1]||"").length,X=(v.toString().split(".")[1]||"").length,J=U>X?U:X,W=Number.parseInt($.toFixed(J).replace(".","")),Y=Number.parseInt(v.toFixed(J).replace(".",""));return W%Y/10**J}class g4 extends d{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==M.number){let J=this._getOrReturnCtx($);return P(J,{code:S.invalid_type,expected:M.number,received:J.parsedType}),u}let U=void 0,X=new M$;for(let J of this._def.checks)if(J.kind==="int"){if(!a.isInteger($.data))U=this._getOrReturnCtx($,U),P(U,{code:S.invalid_type,expected:"integer",received:"float",message:J.message}),X.dirty()}else if(J.kind==="min"){if(J.inclusive?$.data<J.value:$.data<=J.value)U=this._getOrReturnCtx($,U),P(U,{code:S.too_small,minimum:J.value,type:"number",inclusive:J.inclusive,exact:!1,message:J.message}),X.dirty()}else if(J.kind==="max"){if(J.inclusive?$.data>J.value:$.data>=J.value)U=this._getOrReturnCtx($,U),P(U,{code:S.too_big,maximum:J.value,type:"number",inclusive:J.inclusive,exact:!1,message:J.message}),X.dirty()}else if(J.kind==="multipleOf"){if(oN($.data,J.value)!==0)U=this._getOrReturnCtx($,U),P(U,{code:S.not_multiple_of,multipleOf:J.value,message:J.message}),X.dirty()}else if(J.kind==="finite"){if(!Number.isFinite($.data))U=this._getOrReturnCtx($,U),P(U,{code:S.not_finite,message:J.message}),X.dirty()}else a.assertNever(J);return{status:X.value,value:$.data}}gte($,v){return this.setLimit("min",$,!0,Z.toString(v))}gt($,v){return this.setLimit("min",$,!1,Z.toString(v))}lte($,v){return this.setLimit("max",$,!0,Z.toString(v))}lt($,v){return this.setLimit("max",$,!1,Z.toString(v))}setLimit($,v,U,X){return new g4({...this._def,checks:[...this._def.checks,{kind:$,value:v,inclusive:U,message:Z.toString(X)}]})}_addCheck($){return new g4({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:Z.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Z.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Z.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Z.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Z.toString($)})}multipleOf($,v){return this._addCheck({kind:"multipleOf",value:$,message:Z.toString(v)})}finite($){return this._addCheck({kind:"finite",message:Z.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Z.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Z.toString($)})}get minValue(){let $=null;for(let v of this._def.checks)if(v.kind==="min"){if($===null||v.value>$)$=v.value}return $}get maxValue(){let $=null;for(let v of this._def.checks)if(v.kind==="max"){if($===null||v.value<$)$=v.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&a.isInteger($.value))}get isFinite(){let $=null,v=null;for(let U of this._def.checks)if(U.kind==="finite"||U.kind==="int"||U.kind==="multipleOf")return!0;else if(U.kind==="min"){if(v===null||U.value>v)v=U.value}else if(U.kind==="max"){if($===null||U.value<$)$=U.value}return Number.isFinite(v)&&Number.isFinite($)}}g4.create=($)=>{return new g4({checks:[],typeName:L.ZodNumber,coerce:$?.coerce||!1,...n($)})};class f4 extends d{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch{return this._getInvalidInput($)}if(this._getType($)!==M.bigint)return this._getInvalidInput($);let U=void 0,X=new M$;for(let J of this._def.checks)if(J.kind==="min"){if(J.inclusive?$.data<J.value:$.data<=J.value)U=this._getOrReturnCtx($,U),P(U,{code:S.too_small,type:"bigint",minimum:J.value,inclusive:J.inclusive,message:J.message}),X.dirty()}else if(J.kind==="max"){if(J.inclusive?$.data>J.value:$.data>=J.value)U=this._getOrReturnCtx($,U),P(U,{code:S.too_big,type:"bigint",maximum:J.value,inclusive:J.inclusive,message:J.message}),X.dirty()}else if(J.kind==="multipleOf"){if($.data%J.value!==BigInt(0))U=this._getOrReturnCtx($,U),P(U,{code:S.not_multiple_of,multipleOf:J.value,message:J.message}),X.dirty()}else a.assertNever(J);return{status:X.value,value:$.data}}_getInvalidInput($){let v=this._getOrReturnCtx($);return P(v,{code:S.invalid_type,expected:M.bigint,received:v.parsedType}),u}gte($,v){return this.setLimit("min",$,!0,Z.toString(v))}gt($,v){return this.setLimit("min",$,!1,Z.toString(v))}lte($,v){return this.setLimit("max",$,!0,Z.toString(v))}lt($,v){return this.setLimit("max",$,!1,Z.toString(v))}setLimit($,v,U,X){return new f4({...this._def,checks:[...this._def.checks,{kind:$,value:v,inclusive:U,message:Z.toString(X)}]})}_addCheck($){return new f4({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Z.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Z.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Z.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Z.toString($)})}multipleOf($,v){return this._addCheck({kind:"multipleOf",value:$,message:Z.toString(v)})}get minValue(){let $=null;for(let v of this._def.checks)if(v.kind==="min"){if($===null||v.value>$)$=v.value}return $}get maxValue(){let $=null;for(let v of this._def.checks)if(v.kind==="max"){if($===null||v.value<$)$=v.value}return $}}f4.create=($)=>{return new f4({checks:[],typeName:L.ZodBigInt,coerce:$?.coerce??!1,...n($)})};class F0 extends d{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==M.boolean){let U=this._getOrReturnCtx($);return P(U,{code:S.invalid_type,expected:M.boolean,received:U.parsedType}),u}return C$($.data)}}F0.create=($)=>{return new F0({typeName:L.ZodBoolean,coerce:$?.coerce||!1,...n($)})};class E1 extends d{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==M.date){let J=this._getOrReturnCtx($);return P(J,{code:S.invalid_type,expected:M.date,received:J.parsedType}),u}if(Number.isNaN($.data.getTime())){let J=this._getOrReturnCtx($);return P(J,{code:S.invalid_date}),u}let U=new M$,X=void 0;for(let J of this._def.checks)if(J.kind==="min"){if($.data.getTime()<J.value)X=this._getOrReturnCtx($,X),P(X,{code:S.too_small,message:J.message,inclusive:!0,exact:!1,minimum:J.value,type:"date"}),U.dirty()}else if(J.kind==="max"){if($.data.getTime()>J.value)X=this._getOrReturnCtx($,X),P(X,{code:S.too_big,message:J.message,inclusive:!0,exact:!1,maximum:J.value,type:"date"}),U.dirty()}else a.assertNever(J);return{status:U.value,value:new Date($.data.getTime())}}_addCheck($){return new E1({...this._def,checks:[...this._def.checks,$]})}min($,v){return this._addCheck({kind:"min",value:$.getTime(),message:Z.toString(v)})}max($,v){return this._addCheck({kind:"max",value:$.getTime(),message:Z.toString(v)})}get minDate(){let $=null;for(let v of this._def.checks)if(v.kind==="min"){if($===null||v.value>$)$=v.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let v of this._def.checks)if(v.kind==="max"){if($===null||v.value<$)$=v.value}return $!=null?new Date($):null}}E1.create=($)=>{return new E1({checks:[],coerce:$?.coerce||!1,typeName:L.ZodDate,...n($)})};class E0 extends d{_parse($){if(this._getType($)!==M.symbol){let U=this._getOrReturnCtx($);return P(U,{code:S.invalid_type,expected:M.symbol,received:U.parsedType}),u}return C$($.data)}}E0.create=($)=>{return new E0({typeName:L.ZodSymbol,...n($)})};class M1 extends d{_parse($){if(this._getType($)!==M.undefined){let U=this._getOrReturnCtx($);return P(U,{code:S.invalid_type,expected:M.undefined,received:U.parsedType}),u}return C$($.data)}}M1.create=($)=>{return new M1({typeName:L.ZodUndefined,...n($)})};class P1 extends d{_parse($){if(this._getType($)!==M.null){let U=this._getOrReturnCtx($);return P(U,{code:S.invalid_type,expected:M.null,received:U.parsedType}),u}return C$($.data)}}P1.create=($)=>{return new P1({typeName:L.ZodNull,...n($)})};class M0 extends d{constructor(){super(...arguments);this._any=!0}_parse($){return C$($.data)}}M0.create=($)=>{return new M0({typeName:L.ZodAny,...n($)})};class I4 extends d{constructor(){super(...arguments);this._unknown=!0}_parse($){return C$($.data)}}I4.create=($)=>{return new I4({typeName:L.ZodUnknown,...n($)})};class _6 extends d{_parse($){let v=this._getOrReturnCtx($);return P(v,{code:S.invalid_type,expected:M.never,received:v.parsedType}),u}}_6.create=($)=>{return new _6({typeName:L.ZodNever,...n($)})};class P0 extends d{_parse($){if(this._getType($)!==M.undefined){let U=this._getOrReturnCtx($);return P(U,{code:S.invalid_type,expected:M.void,received:U.parsedType}),u}return C$($.data)}}P0.create=($)=>{return new P0({typeName:L.ZodVoid,...n($)})};class D6 extends d{_parse($){let{ctx:v,status:U}=this._processInputParams($),X=this._def;if(v.parsedType!==M.array)return P(v,{code:S.invalid_type,expected:M.array,received:v.parsedType}),u;if(X.exactLength!==null){let W=v.data.length>X.exactLength.value,Y=v.data.length<X.exactLength.value;if(W||Y)P(v,{code:W?S.too_big:S.too_small,minimum:Y?X.exactLength.value:void 0,maximum:W?X.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:X.exactLength.message}),U.dirty()}if(X.minLength!==null){if(v.data.length<X.minLength.value)P(v,{code:S.too_small,minimum:X.minLength.value,type:"array",inclusive:!0,exact:!1,message:X.minLength.message}),U.dirty()}if(X.maxLength!==null){if(v.data.length>X.maxLength.value)P(v,{code:S.too_big,maximum:X.maxLength.value,type:"array",inclusive:!0,exact:!1,message:X.maxLength.message}),U.dirty()}if(v.common.async)return Promise.all([...v.data].map((W,Y)=>{return X.type._parseAsync(new U6(v,W,v.path,Y))})).then((W)=>{return M$.mergeArray(U,W)});let J=[...v.data].map((W,Y)=>{return X.type._parseSync(new U6(v,W,v.path,Y))});return M$.mergeArray(U,J)}get element(){return this._def.type}min($,v){return new D6({...this._def,minLength:{value:$,message:Z.toString(v)}})}max($,v){return new D6({...this._def,maxLength:{value:$,message:Z.toString(v)}})}length($,v){return new D6({...this._def,exactLength:{value:$,message:Z.toString(v)}})}nonempty($){return this.min(1,$)}}D6.create=($,v)=>{return new D6({type:$,minLength:null,maxLength:null,exactLength:null,typeName:L.ZodArray,...n(v)})};function x4($){if($ instanceof b$){let v={};for(let U in $.shape){let X=$.shape[U];v[U]=b6.create(x4(X))}return new b$({...$._def,shape:()=>v})}else if($ instanceof D6)return new D6({...$._def,type:x4($.element)});else if($ instanceof b6)return b6.create(x4($.unwrap()));else if($ instanceof r6)return r6.create(x4($.unwrap()));else if($ instanceof Z6)return Z6.create($.items.map((v)=>x4(v)));else return $}class b$ extends d{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),v=a.objectKeys($);return this._cached={shape:$,keys:v},this._cached}_parse($){if(this._getType($)!==M.object){let G=this._getOrReturnCtx($);return P(G,{code:S.invalid_type,expected:M.object,received:G.parsedType}),u}let{status:U,ctx:X}=this._processInputParams($),{shape:J,keys:W}=this._getCached(),Y=[];if(!(this._def.catchall instanceof _6&&this._def.unknownKeys==="strip")){for(let G in X.data)if(!W.includes(G))Y.push(G)}let z=[];for(let G of W){let Q=J[G],j=X.data[G];z.push({key:{status:"valid",value:G},value:Q._parse(new U6(X,j,X.path,G)),alwaysSet:G in X.data})}if(this._def.catchall instanceof _6){let G=this._def.unknownKeys;if(G==="passthrough")for(let Q of Y)z.push({key:{status:"valid",value:Q},value:{status:"valid",value:X.data[Q]}});else if(G==="strict"){if(Y.length>0)P(X,{code:S.unrecognized_keys,keys:Y}),U.dirty()}else if(G==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let G=this._def.catchall;for(let Q of Y){let j=X.data[Q];z.push({key:{status:"valid",value:Q},value:G._parse(new U6(X,j,X.path,Q)),alwaysSet:Q in X.data})}}if(X.common.async)return Promise.resolve().then(async()=>{let G=[];for(let Q of z){let j=await Q.key,H=await Q.value;G.push({key:j,value:H,alwaysSet:Q.alwaysSet})}return G}).then((G)=>{return M$.mergeObjectSync(U,G)});else return M$.mergeObjectSync(U,z)}get shape(){return this._def.shape()}strict($){return Z.errToObj,new b$({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(v,U)=>{let X=this._def.errorMap?.(v,U).message??U.defaultError;if(v.code==="unrecognized_keys")return{message:Z.errToObj($).message??X};return{message:X}}}:{}})}strip(){return new b$({...this._def,unknownKeys:"strip"})}passthrough(){return new b$({...this._def,unknownKeys:"passthrough"})}extend($){return new b$({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new b$({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:L.ZodObject})}setKey($,v){return this.augment({[$]:v})}catchall($){return new b$({...this._def,catchall:$})}pick($){let v={};for(let U of a.objectKeys($))if($[U]&&this.shape[U])v[U]=this.shape[U];return new b$({...this._def,shape:()=>v})}omit($){let v={};for(let U of a.objectKeys(this.shape))if(!$[U])v[U]=this.shape[U];return new b$({...this._def,shape:()=>v})}deepPartial(){return x4(this)}partial($){let v={};for(let U of a.objectKeys(this.shape)){let X=this.shape[U];if($&&!$[U])v[U]=X;else v[U]=X.optional()}return new b$({...this._def,shape:()=>v})}required($){let v={};for(let U of a.objectKeys(this.shape))if($&&!$[U])v[U]=this.shape[U];else{let J=this.shape[U];while(J instanceof b6)J=J._def.innerType;v[U]=J}return new b$({...this._def,shape:()=>v})}keyof(){return bG(a.objectKeys(this.shape))}}b$.create=($,v)=>{return new b$({shape:()=>$,unknownKeys:"strip",catchall:_6.create(),typeName:L.ZodObject,...n(v)})};b$.strictCreate=($,v)=>{return new b$({shape:()=>$,unknownKeys:"strict",catchall:_6.create(),typeName:L.ZodObject,...n(v)})};b$.lazycreate=($,v)=>{return new b$({shape:$,unknownKeys:"strip",catchall:_6.create(),typeName:L.ZodObject,...n(v)})};class R1 extends d{_parse($){let{ctx:v}=this._processInputParams($),U=this._def.options;function X(J){for(let Y of J)if(Y.result.status==="valid")return Y.result;for(let Y of J)if(Y.result.status==="dirty")return v.common.issues.push(...Y.ctx.common.issues),Y.result;let W=J.map((Y)=>new r$(Y.ctx.common.issues));return P(v,{code:S.invalid_union,unionErrors:W}),u}if(v.common.async)return Promise.all(U.map(async(J)=>{let W={...v,common:{...v.common,issues:[]},parent:null};return{result:await J._parseAsync({data:v.data,path:v.path,parent:W}),ctx:W}})).then(X);else{let J=void 0,W=[];for(let z of U){let G={...v,common:{...v.common,issues:[]},parent:null},Q=z._parseSync({data:v.data,path:v.path,parent:G});if(Q.status==="valid")return Q;else if(Q.status==="dirty"&&!J)J={result:Q,ctx:G};if(G.common.issues.length)W.push(G.common.issues)}if(J)return v.common.issues.push(...J.ctx.common.issues),J.result;let Y=W.map((z)=>new r$(z));return P(v,{code:S.invalid_union,unionErrors:Y}),u}}get options(){return this._def.options}}R1.create=($,v)=>{return new R1({options:$,typeName:L.ZodUnion,...n(v)})};var k6=($)=>{if($ instanceof C1)return k6($.schema);else if($ instanceof V6)return k6($.innerType());else if($ instanceof _1)return[$.value];else if($ instanceof O4)return $.options;else if($ instanceof Z1)return a.objectValues($.enum);else if($ instanceof T1)return k6($._def.innerType);else if($ instanceof M1)return[void 0];else if($ instanceof P1)return[null];else if($ instanceof b6)return[void 0,...k6($.unwrap())];else if($ instanceof r6)return[null,...k6($.unwrap())];else if($ instanceof BW)return k6($.unwrap());else if($ instanceof g1)return k6($.unwrap());else if($ instanceof x1)return k6($._def.innerType);else return[]};class KW extends d{_parse($){let{ctx:v}=this._processInputParams($);if(v.parsedType!==M.object)return P(v,{code:S.invalid_type,expected:M.object,received:v.parsedType}),u;let U=this.discriminator,X=v.data[U],J=this.optionsMap.get(X);if(!J)return P(v,{code:S.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[U]}),u;if(v.common.async)return J._parseAsync({data:v.data,path:v.path,parent:v});else return J._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($,v,U){let X=new Map;for(let J of v){let W=k6(J.shape[$]);if(!W.length)throw Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let Y of W){if(X.has(Y))throw Error(`Discriminator property ${String($)} has duplicate value ${String(Y)}`);X.set(Y,J)}}return new KW({typeName:L.ZodDiscriminatedUnion,discriminator:$,options:v,optionsMap:X,...n(U)})}}function VW($,v){let U=R6($),X=R6(v);if($===v)return{valid:!0,data:$};else if(U===M.object&&X===M.object){let J=a.objectKeys(v),W=a.objectKeys($).filter((z)=>J.indexOf(z)!==-1),Y={...$,...v};for(let z of W){let G=VW($[z],v[z]);if(!G.valid)return{valid:!1};Y[z]=G.data}return{valid:!0,data:Y}}else if(U===M.array&&X===M.array){if($.length!==v.length)return{valid:!1};let J=[];for(let W=0;W<$.length;W++){let Y=$[W],z=v[W],G=VW(Y,z);if(!G.valid)return{valid:!1};J.push(G.data)}return{valid:!0,data:J}}else if(U===M.date&&X===M.date&&+$===+v)return{valid:!0,data:$};else return{valid:!1}}class k1 extends d{_parse($){let{status:v,ctx:U}=this._processInputParams($),X=(J,W)=>{if(OW(J)||OW(W))return u;let Y=VW(J.value,W.value);if(!Y.valid)return P(U,{code:S.invalid_intersection_types}),u;if(DW(J)||DW(W))v.dirty();return{status:v.value,value:Y.data}};if(U.common.async)return Promise.all([this._def.left._parseAsync({data:U.data,path:U.path,parent:U}),this._def.right._parseAsync({data:U.data,path:U.path,parent:U})]).then(([J,W])=>X(J,W));else return X(this._def.left._parseSync({data:U.data,path:U.path,parent:U}),this._def.right._parseSync({data:U.data,path:U.path,parent:U}))}}k1.create=($,v,U)=>{return new k1({left:$,right:v,typeName:L.ZodIntersection,...n(U)})};class Z6 extends d{_parse($){let{status:v,ctx:U}=this._processInputParams($);if(U.parsedType!==M.array)return P(U,{code:S.invalid_type,expected:M.array,received:U.parsedType}),u;if(U.data.length<this._def.items.length)return P(U,{code:S.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),u;if(!this._def.rest&&U.data.length>this._def.items.length)P(U,{code:S.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),v.dirty();let J=[...U.data].map((W,Y)=>{let z=this._def.items[Y]||this._def.rest;if(!z)return null;return z._parse(new U6(U,W,U.path,Y))}).filter((W)=>!!W);if(U.common.async)return Promise.all(J).then((W)=>{return M$.mergeArray(v,W)});else return M$.mergeArray(v,J)}get items(){return this._def.items}rest($){return new Z6({...this._def,rest:$})}}Z6.create=($,v)=>{if(!Array.isArray($))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Z6({items:$,typeName:L.ZodTuple,rest:null,...n(v)})};class R0 extends d{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:v,ctx:U}=this._processInputParams($);if(U.parsedType!==M.object)return P(U,{code:S.invalid_type,expected:M.object,received:U.parsedType}),u;let X=[],J=this._def.keyType,W=this._def.valueType;for(let Y in U.data)X.push({key:J._parse(new U6(U,Y,U.path,Y)),value:W._parse(new U6(U,U.data[Y],U.path,Y)),alwaysSet:Y in U.data});if(U.common.async)return M$.mergeObjectAsync(v,X);else return M$.mergeObjectSync(v,X)}get element(){return this._def.valueType}static create($,v,U){if(v instanceof d)return new R0({keyType:$,valueType:v,typeName:L.ZodRecord,...n(U)});return new R0({keyType:C6.create(),valueType:$,typeName:L.ZodRecord,...n(v)})}}class k0 extends d{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:v,ctx:U}=this._processInputParams($);if(U.parsedType!==M.map)return P(U,{code:S.invalid_type,expected:M.map,received:U.parsedType}),u;let X=this._def.keyType,J=this._def.valueType,W=[...U.data.entries()].map(([Y,z],G)=>{return{key:X._parse(new U6(U,Y,U.path,[G,"key"])),value:J._parse(new U6(U,z,U.path,[G,"value"]))}});if(U.common.async){let Y=new Map;return Promise.resolve().then(async()=>{for(let z of W){let G=await z.key,Q=await z.value;if(G.status==="aborted"||Q.status==="aborted")return u;if(G.status==="dirty"||Q.status==="dirty")v.dirty();Y.set(G.value,Q.value)}return{status:v.value,value:Y}})}else{let Y=new Map;for(let z of W){let{key:G,value:Q}=z;if(G.status==="aborted"||Q.status==="aborted")return u;if(G.status==="dirty"||Q.status==="dirty")v.dirty();Y.set(G.value,Q.value)}return{status:v.value,value:Y}}}}k0.create=($,v,U)=>{return new k0({valueType:v,keyType:$,typeName:L.ZodMap,...n(U)})};class y4 extends d{_parse($){let{status:v,ctx:U}=this._processInputParams($);if(U.parsedType!==M.set)return P(U,{code:S.invalid_type,expected:M.set,received:U.parsedType}),u;let X=this._def;if(X.minSize!==null){if(U.data.size<X.minSize.value)P(U,{code:S.too_small,minimum:X.minSize.value,type:"set",inclusive:!0,exact:!1,message:X.minSize.message}),v.dirty()}if(X.maxSize!==null){if(U.data.size>X.maxSize.value)P(U,{code:S.too_big,maximum:X.maxSize.value,type:"set",inclusive:!0,exact:!1,message:X.maxSize.message}),v.dirty()}let J=this._def.valueType;function W(z){let G=new Set;for(let Q of z){if(Q.status==="aborted")return u;if(Q.status==="dirty")v.dirty();G.add(Q.value)}return{status:v.value,value:G}}let Y=[...U.data.values()].map((z,G)=>J._parse(new U6(U,z,U.path,G)));if(U.common.async)return Promise.all(Y).then((z)=>W(z));else return W(Y)}min($,v){return new y4({...this._def,minSize:{value:$,message:Z.toString(v)}})}max($,v){return new y4({...this._def,maxSize:{value:$,message:Z.toString(v)}})}size($,v){return this.min($,v).max($,v)}nonempty($){return this.min(1,$)}}y4.create=($,v)=>{return new y4({valueType:$,minSize:null,maxSize:null,typeName:L.ZodSet,...n(v)})};class F1 extends d{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:v}=this._processInputParams($);if(v.parsedType!==M.function)return P(v,{code:S.invalid_type,expected:M.function,received:v.parsedType}),u;function U(Y,z){return L0({data:Y,path:v.path,errorMaps:[v.common.contextualErrorMap,v.schemaErrorMap,q1(),i6].filter((G)=>!!G),issueData:{code:S.invalid_arguments,argumentsError:z}})}function X(Y,z){return L0({data:Y,path:v.path,errorMaps:[v.common.contextualErrorMap,v.schemaErrorMap,q1(),i6].filter((G)=>!!G),issueData:{code:S.invalid_return_type,returnTypeError:z}})}let J={errorMap:v.common.contextualErrorMap},W=v.data;if(this._def.returns instanceof u4){let Y=this;return C$(async function(...z){let G=new r$([]),Q=await Y._def.args.parseAsync(z,J).catch((N)=>{throw G.addIssue(U(z,N)),G}),j=await Reflect.apply(W,this,Q);return await Y._def.returns._def.type.parseAsync(j,J).catch((N)=>{throw G.addIssue(X(j,N)),G})})}else{let Y=this;return C$(function(...z){let G=Y._def.args.safeParse(z,J);if(!G.success)throw new r$([U(z,G.error)]);let Q=Reflect.apply(W,this,G.data),j=Y._def.returns.safeParse(Q,J);if(!j.success)throw new r$([X(Q,j.error)]);return j.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new F1({...this._def,args:Z6.create($).rest(I4.create())})}returns($){return new F1({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,v,U){return new F1({args:$?$:Z6.create([]).rest(I4.create()),returns:v||I4.create(),typeName:L.ZodFunction,...n(U)})}}class C1 extends d{get schema(){return this._def.getter()}_parse($){let{ctx:v}=this._processInputParams($);return this._def.getter()._parse({data:v.data,path:v.path,parent:v})}}C1.create=($,v)=>{return new C1({getter:$,typeName:L.ZodLazy,...n(v)})};class _1 extends d{_parse($){if($.data!==this._def.value){let v=this._getOrReturnCtx($);return P(v,{received:v.data,code:S.invalid_literal,expected:this._def.value}),u}return{status:"valid",value:$.data}}get value(){return this._def.value}}_1.create=($,v)=>{return new _1({value:$,typeName:L.ZodLiteral,...n(v)})};function bG($,v){return new O4({values:$,typeName:L.ZodEnum,...n(v)})}class O4 extends d{_parse($){if(typeof $.data!=="string"){let v=this._getOrReturnCtx($),U=this._def.values;return P(v,{expected:a.joinValues(U),received:v.parsedType,code:S.invalid_type}),u}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let v=this._getOrReturnCtx($),U=this._def.values;return P(v,{received:v.data,code:S.invalid_enum_value,options:U}),u}return C$($.data)}get options(){return this._def.values}get enum(){let $={};for(let v of this._def.values)$[v]=v;return $}get Values(){let $={};for(let v of this._def.values)$[v]=v;return $}get Enum(){let $={};for(let v of this._def.values)$[v]=v;return $}extract($,v=this._def){return O4.create($,{...this._def,...v})}exclude($,v=this._def){return O4.create(this.options.filter((U)=>!$.includes(U)),{...this._def,...v})}}O4.create=bG;class Z1 extends d{_parse($){let v=a.getValidEnumValues(this._def.values),U=this._getOrReturnCtx($);if(U.parsedType!==M.string&&U.parsedType!==M.number){let X=a.objectValues(v);return P(U,{expected:a.joinValues(X),received:U.parsedType,code:S.invalid_type}),u}if(!this._cache)this._cache=new Set(a.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let X=a.objectValues(v);return P(U,{received:U.data,code:S.invalid_enum_value,options:X}),u}return C$($.data)}get enum(){return this._def.values}}Z1.create=($,v)=>{return new Z1({values:$,typeName:L.ZodNativeEnum,...n(v)})};class u4 extends d{unwrap(){return this._def.type}_parse($){let{ctx:v}=this._processInputParams($);if(v.parsedType!==M.promise&&v.common.async===!1)return P(v,{code:S.invalid_type,expected:M.promise,received:v.parsedType}),u;let U=v.parsedType===M.promise?v.data:Promise.resolve(v.data);return C$(U.then((X)=>{return this._def.type.parseAsync(X,{path:v.path,errorMap:v.common.contextualErrorMap})}))}}u4.create=($,v)=>{return new u4({type:$,typeName:L.ZodPromise,...n(v)})};class V6 extends d{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===L.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:v,ctx:U}=this._processInputParams($),X=this._def.effect||null,J={addIssue:(W)=>{if(P(U,W),W.fatal)v.abort();else v.dirty()},get path(){return U.path}};if(J.addIssue=J.addIssue.bind(J),X.type==="preprocess"){let W=X.transform(U.data,J);if(U.common.async)return Promise.resolve(W).then(async(Y)=>{if(v.value==="aborted")return u;let z=await this._def.schema._parseAsync({data:Y,path:U.path,parent:U});if(z.status==="aborted")return u;if(z.status==="dirty")return T4(z.value);if(v.value==="dirty")return T4(z.value);return z});else{if(v.value==="aborted")return u;let Y=this._def.schema._parseSync({data:W,path:U.path,parent:U});if(Y.status==="aborted")return u;if(Y.status==="dirty")return T4(Y.value);if(v.value==="dirty")return T4(Y.value);return Y}}if(X.type==="refinement"){let W=(Y)=>{let z=X.refinement(Y,J);if(U.common.async)return Promise.resolve(z);if(z instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return Y};if(U.common.async===!1){let Y=this._def.schema._parseSync({data:U.data,path:U.path,parent:U});if(Y.status==="aborted")return u;if(Y.status==="dirty")v.dirty();return W(Y.value),{status:v.value,value:Y.value}}else return this._def.schema._parseAsync({data:U.data,path:U.path,parent:U}).then((Y)=>{if(Y.status==="aborted")return u;if(Y.status==="dirty")v.dirty();return W(Y.value).then(()=>{return{status:v.value,value:Y.value}})})}if(X.type==="transform")if(U.common.async===!1){let W=this._def.schema._parseSync({data:U.data,path:U.path,parent:U});if(!N4(W))return u;let Y=X.transform(W.value,J);if(Y instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:v.value,value:Y}}else return this._def.schema._parseAsync({data:U.data,path:U.path,parent:U}).then((W)=>{if(!N4(W))return u;return Promise.resolve(X.transform(W.value,J)).then((Y)=>({status:v.value,value:Y}))});a.assertNever(X)}}V6.create=($,v,U)=>{return new V6({schema:$,typeName:L.ZodEffects,effect:v,...n(U)})};V6.createWithPreprocess=($,v,U)=>{return new V6({schema:v,effect:{type:"preprocess",transform:$},typeName:L.ZodEffects,...n(U)})};class b6 extends d{_parse($){if(this._getType($)===M.undefined)return C$(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}b6.create=($,v)=>{return new b6({innerType:$,typeName:L.ZodOptional,...n(v)})};class r6 extends d{_parse($){if(this._getType($)===M.null)return C$(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}r6.create=($,v)=>{return new r6({innerType:$,typeName:L.ZodNullable,...n(v)})};class T1 extends d{_parse($){let{ctx:v}=this._processInputParams($),U=v.data;if(v.parsedType===M.undefined)U=this._def.defaultValue();return this._def.innerType._parse({data:U,path:v.path,parent:v})}removeDefault(){return this._def.innerType}}T1.create=($,v)=>{return new T1({innerType:$,typeName:L.ZodDefault,defaultValue:typeof v.default==="function"?v.default:()=>v.default,...n(v)})};class x1 extends d{_parse($){let{ctx:v}=this._processInputParams($),U={...v,common:{...v.common,issues:[]}},X=this._def.innerType._parse({data:U.data,path:U.path,parent:{...U}});if(L1(X))return X.then((J)=>{return{status:"valid",value:J.status==="valid"?J.value:this._def.catchValue({get error(){return new r$(U.common.issues)},input:U.data})}});else return{status:"valid",value:X.status==="valid"?X.value:this._def.catchValue({get error(){return new r$(U.common.issues)},input:U.data})}}removeCatch(){return this._def.innerType}}x1.create=($,v)=>{return new x1({innerType:$,typeName:L.ZodCatch,catchValue:typeof v.catch==="function"?v.catch:()=>v.catch,...n(v)})};class C0 extends d{_parse($){if(this._getType($)!==M.nan){let U=this._getOrReturnCtx($);return P(U,{code:S.invalid_type,expected:M.nan,received:U.parsedType}),u}return{status:"valid",value:$.data}}}C0.create=($)=>{return new C0({typeName:L.ZodNaN,...n($)})};var Gk=Symbol("zod_brand");class BW extends d{_parse($){let{ctx:v}=this._processInputParams($),U=v.data;return this._def.type._parse({data:U,path:v.path,parent:v})}unwrap(){return this._def.type}}class _0 extends d{_parse($){let{status:v,ctx:U}=this._processInputParams($);if(U.common.async)return(async()=>{let J=await this._def.in._parseAsync({data:U.data,path:U.path,parent:U});if(J.status==="aborted")return u;if(J.status==="dirty")return v.dirty(),T4(J.value);else return this._def.out._parseAsync({data:J.value,path:U.path,parent:U})})();else{let X=this._def.in._parseSync({data:U.data,path:U.path,parent:U});if(X.status==="aborted")return u;if(X.status==="dirty")return v.dirty(),{status:"dirty",value:X.value};else return this._def.out._parseSync({data:X.value,path:U.path,parent:U})}}static create($,v){return new _0({in:$,out:v,typeName:L.ZodPipeline})}}class g1 extends d{_parse($){let v=this._def.innerType._parse($),U=(X)=>{if(N4(X))X.value=Object.freeze(X.value);return X};return L1(v)?v.then((X)=>U(X)):U(v)}unwrap(){return this._def.innerType}}g1.create=($,v)=>{return new g1({innerType:$,typeName:L.ZodReadonly,...n(v)})};var Qk={object:b$.lazycreate},L;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(L||(L={}));var jk=C6.create,wk=g4.create,Hk=C0.create,Nk=f4.create,Ik=F0.create,Ok=E1.create,Dk=E0.create,bk=M1.create,Vk=P1.create,Kk=M0.create,Bk=I4.create,Ak=_6.create,Sk=P0.create,qk=D6.create,VG=b$.create,Lk=b$.strictCreate,Fk=R1.create,Ek=KW.create,Mk=k1.create,Pk=Z6.create,Rk=R0.create,kk=k0.create,Ck=y4.create,_k=F1.create,Zk=C1.create,Tk=_1.create,xk=O4.create,gk=Z1.create,fk=u4.create,yk=V6.create,uk=b6.create,hk=r6.create,lk=V6.createWithPreprocess,mk=_0.create;var J6={};H4(J6,{version:()=>q9,util:()=>q,treeifyError:()=>f0,toJSONSchema:()=>X1,toDotPath:()=>LG,safeParseAsync:()=>s6,safeParse:()=>e6,safeEncodeAsync:()=>CG,safeEncode:()=>RG,safeDecodeAsync:()=>_G,safeDecode:()=>kG,registry:()=>Jv,regexes:()=>f$,prettifyError:()=>y0,parseAsync:()=>K4,parse:()=>V4,meta:()=>TJ,locales:()=>e4,isValidJWT:()=>tG,isValidBase64URL:()=>dG,isValidBase64:()=>R9,globalRegistry:()=>P$,globalConfig:()=>f1,formatError:()=>c4,flattenError:()=>n4,encodeAsync:()=>MG,encode:()=>FG,describe:()=>ZJ,decodeAsync:()=>PG,decode:()=>EG,config:()=>B$,clone:()=>F$,_xid:()=>Iv,_void:()=>EJ,_uuidv7:()=>Gv,_uuidv6:()=>zv,_uuidv4:()=>Yv,_uuid:()=>Wv,_url:()=>$1,_uppercase:()=>Mv,_unknown:()=>LJ,_union:()=>oO,_undefined:()=>AJ,_ulid:()=>Nv,_uint64:()=>KJ,_uint32:()=>OJ,_tuple:()=>tO,_trim:()=>Zv,_transform:()=>JD,_toUpperCase:()=>xv,_toLowerCase:()=>Tv,_templateLiteral:()=>HD,_symbol:()=>BJ,_superRefine:()=>_J,_success:()=>GD,_stringbool:()=>xJ,_stringFormat:()=>q4,_string:()=>zJ,_startsWith:()=>Rv,_slugify:()=>gv,_size:()=>Lv,_set:()=>sO,_safeParseAsync:()=>p4,_safeParse:()=>o4,_safeEncodeAsync:()=>i0,_safeEncode:()=>n0,_safeDecodeAsync:()=>r0,_safeDecode:()=>c0,_regex:()=>Fv,_refine:()=>CJ,_record:()=>aO,_readonly:()=>wD,_property:()=>T8,_promise:()=>ID,_positive:()=>k8,_pipe:()=>jD,_parseAsync:()=>r4,_parse:()=>i4,_overwrite:()=>B6,_optional:()=>XD,_number:()=>jJ,_nullable:()=>WD,_null:()=>SJ,_normalize:()=>_v,_nonpositive:()=>_8,_nonoptional:()=>zD,_nonnegative:()=>Z8,_never:()=>FJ,_negative:()=>C8,_nativeEnum:()=>vD,_nanoid:()=>jv,_nan:()=>PJ,_multipleOf:()=>A4,_minSize:()=>S4,_minLength:()=>v4,_min:()=>y$,_mime:()=>Cv,_maxSize:()=>v1,_maxLength:()=>U1,_max:()=>e$,_map:()=>eO,_mac:()=>GJ,_lte:()=>e$,_lt:()=>T6,_lowercase:()=>Ev,_literal:()=>UD,_length:()=>J1,_lazy:()=>ND,_ksuid:()=>Ov,_jwt:()=>qv,_isoTime:()=>L8,_isoDuration:()=>F8,_isoDateTime:()=>S8,_isoDate:()=>q8,_ipv6:()=>bv,_ipv4:()=>Dv,_intersection:()=>dO,_int64:()=>VJ,_int32:()=>IJ,_int:()=>wJ,_includes:()=>Pv,_guid:()=>s4,_gte:()=>y$,_gt:()=>x6,_float64:()=>NJ,_float32:()=>HJ,_file:()=>RJ,_enum:()=>$D,_endsWith:()=>kv,_encodeAsync:()=>l0,_encode:()=>u0,_emoji:()=>Qv,_email:()=>Xv,_e164:()=>Sv,_discriminatedUnion:()=>pO,_default:()=>YD,_decodeAsync:()=>m0,_decode:()=>h0,_date:()=>MJ,_custom:()=>kJ,_cuid2:()=>Hv,_cuid:()=>wv,_coercedString:()=>A8,_coercedNumber:()=>E8,_coercedDate:()=>R8,_coercedBoolean:()=>M8,_coercedBigint:()=>P8,_cidrv6:()=>Kv,_cidrv4:()=>Vv,_check:()=>JQ,_catch:()=>QD,_boolean:()=>DJ,_bigint:()=>bJ,_base64url:()=>Av,_base64:()=>Bv,_array:()=>x8,_any:()=>qJ,TimePrecision:()=>QJ,NEVER:()=>Z0,JSONSchemaGenerator:()=>gJ,JSONSchema:()=>XQ,Doc:()=>t0,$output:()=>WJ,$input:()=>YJ,$constructor:()=>O,$brand:()=>T0,$ZodXID:()=>wU,$ZodVoid:()=>CU,$ZodUnknown:()=>RU,$ZodUnion:()=>d1,$ZodUndefined:()=>EU,$ZodUUID:()=>JU,$ZodURL:()=>WU,$ZodULID:()=>jU,$ZodType:()=>l,$ZodTuple:()=>t1,$ZodTransform:()=>nU,$ZodTemplateLiteral:()=>$J,$ZodSymbol:()=>FU,$ZodSuccess:()=>dU,$ZodStringFormat:()=>W$,$ZodString:()=>$4,$ZodSet:()=>uU,$ZodRegistry:()=>Uv,$ZodRecord:()=>fU,$ZodRealError:()=>g$,$ZodReadonly:()=>sU,$ZodPromise:()=>UJ,$ZodPrefault:()=>oU,$ZodPipe:()=>eU,$ZodOptional:()=>cU,$ZodObjectJIT:()=>k9,$ZodObject:()=>TU,$ZodNumberFormat:()=>qU,$ZodNumber:()=>o1,$ZodNullable:()=>iU,$ZodNull:()=>MU,$ZodNonOptional:()=>pU,$ZodNever:()=>kU,$ZodNanoID:()=>zU,$ZodNaN:()=>aU,$ZodMap:()=>yU,$ZodMAC:()=>OU,$ZodLiteral:()=>lU,$ZodLazy:()=>JJ,$ZodKSUID:()=>HU,$ZodJWT:()=>AU,$ZodIntersection:()=>gU,$ZodISOTime:()=>M9,$ZodISODuration:()=>P9,$ZodISODateTime:()=>F9,$ZodISODate:()=>E9,$ZodIPv6:()=>IU,$ZodIPv4:()=>NU,$ZodGUID:()=>UU,$ZodFunction:()=>vJ,$ZodFile:()=>mU,$ZodError:()=>c1,$ZodEnum:()=>hU,$ZodEncodeError:()=>D4,$ZodEmoji:()=>YU,$ZodEmail:()=>XU,$ZodE164:()=>BU,$ZodDiscriminatedUnion:()=>xU,$ZodDefault:()=>rU,$ZodDate:()=>_U,$ZodCustomStringFormat:()=>SU,$ZodCustom:()=>XJ,$ZodCodec:()=>a4,$ZodCheckUpperCase:()=>D9,$ZodCheckStringFormat:()=>d4,$ZodCheckStartsWith:()=>V9,$ZodCheckSizeEquals:()=>j9,$ZodCheckRegex:()=>I9,$ZodCheckProperty:()=>B9,$ZodCheckOverwrite:()=>S9,$ZodCheckNumberFormat:()=>Y9,$ZodCheckMultipleOf:()=>W9,$ZodCheckMinSize:()=>Q9,$ZodCheckMinLength:()=>H9,$ZodCheckMimeType:()=>A9,$ZodCheckMaxSize:()=>G9,$ZodCheckMaxLength:()=>w9,$ZodCheckLowerCase:()=>O9,$ZodCheckLessThan:()=>p0,$ZodCheckLengthEquals:()=>N9,$ZodCheckIncludes:()=>b9,$ZodCheckGreaterThan:()=>d0,$ZodCheckEndsWith:()=>K9,$ZodCheckBigIntFormat:()=>z9,$ZodCheck:()=>z$,$ZodCatch:()=>tU,$ZodCUID2:()=>QU,$ZodCUID:()=>GU,$ZodCIDRv6:()=>bU,$ZodCIDRv4:()=>DU,$ZodBoolean:()=>t4,$ZodBigIntFormat:()=>LU,$ZodBigInt:()=>p1,$ZodBase64URL:()=>KU,$ZodBase64:()=>VU,$ZodAsyncError:()=>K6,$ZodArray:()=>ZU,$ZodAny:()=>PU});var Z0=Object.freeze({status:"aborted"});function O($,v,U){function X(z,G){if(!z._zod)Object.defineProperty(z,"_zod",{value:{def:G,constr:Y,traits:new Set},enumerable:!1});if(z._zod.traits.has($))return;z._zod.traits.add($),v(z,G);let Q=Y.prototype,j=Object.keys(Q);for(let H=0;H<j.length;H++){let N=j[H];if(!(N in z))z[N]=Q[N].bind(z)}}let J=U?.Parent??Object;class W extends J{}Object.defineProperty(W,"name",{value:$});function Y(z){var G;let Q=U?.Parent?new W:this;X(Q,z),(G=Q._zod).deferred??(G.deferred=[]);for(let j of Q._zod.deferred)j();return Q}return Object.defineProperty(Y,"init",{value:X}),Object.defineProperty(Y,Symbol.hasInstance,{value:(z)=>{if(U?.Parent&&z instanceof U.Parent)return!0;return z?._zod?.traits?.has($)}}),Object.defineProperty(Y,"name",{value:$}),Y}var T0=Symbol("zod_brand");class K6 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class D4 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var f1={};function B$($){if($)Object.assign(f1,$);return f1}var q={};H4(q,{unwrapMessage:()=>y1,uint8ArrayToHex:()=>VI,uint8ArrayToBase64url:()=>DI,uint8ArrayToBase64:()=>AG,stringifyPrimitive:()=>F,slugify:()=>qW,shallowClone:()=>FW,safeExtend:()=>jI,required:()=>NI,randomString:()=>JI,propertyKeyTypes:()=>l1,promiseAllObject:()=>UI,primitiveTypes:()=>EW,prefixIssues:()=>o$,pick:()=>zI,partial:()=>HI,optionalKeys:()=>MW,omit:()=>GI,objectClone:()=>sN,numKeys:()=>XI,nullish:()=>o6,normalizeParams:()=>E,mergeDefs:()=>d6,merge:()=>wI,jsonStringifyReplacer:()=>h4,joinValues:()=>b,issue:()=>m4,isPlainObject:()=>t6,isObject:()=>b4,hexToUint8Array:()=>bI,getSizableOrigin:()=>m1,getParsedType:()=>WI,getLengthableOrigin:()=>n1,getEnumValues:()=>u1,getElementAtPath:()=>vI,floatSafeRemainder:()=>SW,finalizeIssue:()=>p$,extend:()=>QI,escapeRegex:()=>a$,esc:()=>x0,defineLazy:()=>t,createTransparentProxy:()=>YI,cloneDef:()=>$I,clone:()=>F$,cleanRegex:()=>h1,cleanEnum:()=>II,captureStackTrace:()=>g0,cached:()=>l4,base64urlToUint8Array:()=>OI,base64ToUint8Array:()=>BG,assignProp:()=>p6,assertNotEqual:()=>dN,assertNever:()=>aN,assertIs:()=>tN,assertEqual:()=>pN,assert:()=>eN,allowsEval:()=>LW,aborted:()=>a6,NUMBER_FORMAT_RANGES:()=>PW,Class:()=>SG,BIGINT_FORMAT_RANGES:()=>RW});function pN($){return $}function dN($){return $}function tN($){}function aN($){throw Error()}function eN($){}function u1($){let v=Object.values($).filter((X)=>typeof X==="number");return Object.entries($).filter(([X,J])=>v.indexOf(+X)===-1).map(([X,J])=>J)}function b($,v="|"){return $.map((U)=>F(U)).join(v)}function h4($,v){if(typeof v==="bigint")return v.toString();return v}function l4($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw Error("cached value already set")}}}function o6($){return $===null||$===void 0}function h1($){let v=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(v,U)}function SW($,v){let U=($.toString().split(".")[1]||"").length,X=v.toString(),J=(X.split(".")[1]||"").length;if(J===0&&/\d?e-\d?/.test(X)){let G=X.match(/\d?e-(\d?)/);if(G?.[1])J=Number.parseInt(G[1])}let W=U>J?U:J,Y=Number.parseInt($.toFixed(W).replace(".","")),z=Number.parseInt(v.toFixed(W).replace(".",""));return Y%z/10**W}var KG=Symbol("evaluating");function t($,v,U){let X=void 0;Object.defineProperty($,v,{get(){if(X===KG)return;if(X===void 0)X=KG,X=U();return X},set(J){Object.defineProperty($,v,{value:J})},configurable:!0})}function sN($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function p6($,v,U){Object.defineProperty($,v,{value:U,writable:!0,enumerable:!0,configurable:!0})}function d6(...$){let v={};for(let U of $){let X=Object.getOwnPropertyDescriptors(U);Object.assign(v,X)}return Object.defineProperties({},v)}function $I($){return d6($._zod.def)}function vI($,v){if(!v)return $;return v.reduce((U,X)=>U?.[X],$)}function UI($){let v=Object.keys($),U=v.map((X)=>$[X]);return Promise.all(U).then((X)=>{let J={};for(let W=0;W<v.length;W++)J[v[W]]=X[W];return J})}function JI($=10){let U="";for(let X=0;X<$;X++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function x0($){return JSON.stringify($)}function qW($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var g0="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function b4($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var LW=l4(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function t6($){if(b4($)===!1)return!1;let v=$.constructor;if(v===void 0)return!0;if(typeof v!=="function")return!0;let U=v.prototype;if(b4(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function FW($){if(t6($))return{...$};if(Array.isArray($))return[...$];return $}function XI($){let v=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))v++;return v}var WI=($)=>{let v=typeof $;switch(v){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${v}`)}},l1=new Set(["string","number","symbol"]),EW=new Set(["string","number","bigint","boolean","symbol","undefined"]);function a$($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F$($,v,U){let X=new $._zod.constr(v??$._zod.def);if(!v||U?.parent)X._zod.parent=$;return X}function E($){let v=$;if(!v)return{};if(typeof v==="string")return{error:()=>v};if(v?.message!==void 0){if(v?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");v.error=v.message}if(delete v.message,typeof v.error==="string")return{...v,error:()=>v.error};return v}function YI($){let v;return new Proxy({},{get(U,X,J){return v??(v=$()),Reflect.get(v,X,J)},set(U,X,J,W){return v??(v=$()),Reflect.set(v,X,J,W)},has(U,X){return v??(v=$()),Reflect.has(v,X)},deleteProperty(U,X){return v??(v=$()),Reflect.deleteProperty(v,X)},ownKeys(U){return v??(v=$()),Reflect.ownKeys(v)},getOwnPropertyDescriptor(U,X){return v??(v=$()),Reflect.getOwnPropertyDescriptor(v,X)},defineProperty(U,X,J){return v??(v=$()),Reflect.defineProperty(v,X,J)}})}function F($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function MW($){return Object.keys($).filter((v)=>{return $[v]._zod.optin==="optional"&&$[v]._zod.optout==="optional"})}var PW={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},RW={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function zI($,v){let U=$._zod.def,X=d6($._zod.def,{get shape(){let J={};for(let W in v){if(!(W in U.shape))throw Error(`Unrecognized key: "${W}"`);if(!v[W])continue;J[W]=U.shape[W]}return p6(this,"shape",J),J},checks:[]});return F$($,X)}function GI($,v){let U=$._zod.def,X=d6($._zod.def,{get shape(){let J={...$._zod.def.shape};for(let W in v){if(!(W in U.shape))throw Error(`Unrecognized key: "${W}"`);if(!v[W])continue;delete J[W]}return p6(this,"shape",J),J},checks:[]});return F$($,X)}function QI($,v){if(!t6(v))throw Error("Invalid input to extend: expected a plain object");let U=$._zod.def.checks;if(U&&U.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let J=d6($._zod.def,{get shape(){let W={...$._zod.def.shape,...v};return p6(this,"shape",W),W},checks:[]});return F$($,J)}function jI($,v){if(!t6(v))throw Error("Invalid input to safeExtend: expected a plain object");let U={...$._zod.def,get shape(){let X={...$._zod.def.shape,...v};return p6(this,"shape",X),X},checks:$._zod.def.checks};return F$($,U)}function wI($,v){let U=d6($._zod.def,{get shape(){let X={...$._zod.def.shape,...v._zod.def.shape};return p6(this,"shape",X),X},get catchall(){return v._zod.def.catchall},checks:[]});return F$($,U)}function HI($,v,U){let X=d6(v._zod.def,{get shape(){let J=v._zod.def.shape,W={...J};if(U)for(let Y in U){if(!(Y in J))throw Error(`Unrecognized key: "${Y}"`);if(!U[Y])continue;W[Y]=$?new $({type:"optional",innerType:J[Y]}):J[Y]}else for(let Y in J)W[Y]=$?new $({type:"optional",innerType:J[Y]}):J[Y];return p6(this,"shape",W),W},checks:[]});return F$(v,X)}function NI($,v,U){let X=d6(v._zod.def,{get shape(){let J=v._zod.def.shape,W={...J};if(U)for(let Y in U){if(!(Y in W))throw Error(`Unrecognized key: "${Y}"`);if(!U[Y])continue;W[Y]=new $({type:"nonoptional",innerType:J[Y]})}else for(let Y in J)W[Y]=new $({type:"nonoptional",innerType:J[Y]});return p6(this,"shape",W),W},checks:[]});return F$(v,X)}function a6($,v=0){if($.aborted===!0)return!0;for(let U=v;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function o$($,v){return v.map((U)=>{var X;return(X=U).path??(X.path=[]),U.path.unshift($),U})}function y1($){return typeof $==="string"?$:$?.message}function p$($,v,U){let X={...$,path:$.path??[]};if(!$.message){let J=y1($.inst?._zod.def?.error?.($))??y1(v?.error?.($))??y1(U.customError?.($))??y1(U.localeError?.($))??"Invalid input";X.message=J}if(delete X.inst,delete X.continue,!v?.reportInput)delete X.input;return X}function m1($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function n1($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function m4(...$){let[v,U,X]=$;if(typeof v==="string")return{message:v,code:"custom",input:U,inst:X};return{...v}}function II($){return Object.entries($).filter(([v,U])=>{return Number.isNaN(Number.parseInt(v,10))}).map((v)=>v[1])}function BG($){let v=atob($),U=new Uint8Array(v.length);for(let X=0;X<v.length;X++)U[X]=v.charCodeAt(X);return U}function AG($){let v="";for(let U=0;U<$.length;U++)v+=String.fromCharCode($[U]);return btoa(v)}function OI($){let v=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-v.length%4)%4);return BG(v+U)}function DI($){return AG($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function bI($){let v=$.replace(/^0x/,"");if(v.length%2!==0)throw Error("Invalid hex string length");let U=new Uint8Array(v.length/2);for(let X=0;X<v.length;X+=2)U[X/2]=Number.parseInt(v.slice(X,X+2),16);return U}function VI($){return Array.from($).map((v)=>v.toString(16).padStart(2,"0")).join("")}class SG{constructor(...$){}}var qG=($,v)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:v,enumerable:!1}),$.message=JSON.stringify(v,h4,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},c1=O("$ZodError",qG),g$=O("$ZodError",qG,{Parent:Error});function n4($,v=(U)=>U.message){let U={},X=[];for(let J of $.issues)if(J.path.length>0)U[J.path[0]]=U[J.path[0]]||[],U[J.path[0]].push(v(J));else X.push(v(J));return{formErrors:X,fieldErrors:U}}function c4($,v=(U)=>U.message){let U={_errors:[]},X=(J)=>{for(let W of J.issues)if(W.code==="invalid_union"&&W.errors.length)W.errors.map((Y)=>X({issues:Y}));else if(W.code==="invalid_key")X({issues:W.issues});else if(W.code==="invalid_element")X({issues:W.issues});else if(W.path.length===0)U._errors.push(v(W));else{let Y=U,z=0;while(z<W.path.length){let G=W.path[z];if(z!==W.path.length-1)Y[G]=Y[G]||{_errors:[]};else Y[G]=Y[G]||{_errors:[]},Y[G]._errors.push(v(W));Y=Y[G],z++}}};return X($),U}function f0($,v=(U)=>U.message){let U={errors:[]},X=(J,W=[])=>{var Y,z;for(let G of J.issues)if(G.code==="invalid_union"&&G.errors.length)G.errors.map((Q)=>X({issues:Q},G.path));else if(G.code==="invalid_key")X({issues:G.issues},G.path);else if(G.code==="invalid_element")X({issues:G.issues},G.path);else{let Q=[...W,...G.path];if(Q.length===0){U.errors.push(v(G));continue}let j=U,H=0;while(H<Q.length){let N=Q[H],w=H===Q.length-1;if(typeof N==="string")j.properties??(j.properties={}),(Y=j.properties)[N]??(Y[N]={errors:[]}),j=j.properties[N];else j.items??(j.items=[]),(z=j.items)[N]??(z[N]={errors:[]}),j=j.items[N];if(w)j.errors.push(v(G));H++}}};return X($),U}function LG($){let v=[],U=$.map((X)=>typeof X==="object"?X.key:X);for(let X of U)if(typeof X==="number")v.push(`[${X}]`);else if(typeof X==="symbol")v.push(`[${JSON.stringify(String(X))}]`);else if(/[^\w$]/.test(X))v.push(`[${JSON.stringify(X)}]`);else{if(v.length)v.push(".");v.push(X)}return v.join("")}function y0($){let v=[],U=[...$.issues].sort((X,J)=>(X.path??[]).length-(J.path??[]).length);for(let X of U)if(v.push(`✖ ${X.message}`),X.path?.length)v.push(` → at ${LG(X.path)}`);return v.join(`
12
+ `)}var i4=($)=>(v,U,X,J)=>{let W=X?Object.assign(X,{async:!1}):{async:!1},Y=v._zod.run({value:U,issues:[]},W);if(Y instanceof Promise)throw new K6;if(Y.issues.length){let z=new(J?.Err??$)(Y.issues.map((G)=>p$(G,W,B$())));throw g0(z,J?.callee),z}return Y.value},V4=i4(g$),r4=($)=>async(v,U,X,J)=>{let W=X?Object.assign(X,{async:!0}):{async:!0},Y=v._zod.run({value:U,issues:[]},W);if(Y instanceof Promise)Y=await Y;if(Y.issues.length){let z=new(J?.Err??$)(Y.issues.map((G)=>p$(G,W,B$())));throw g0(z,J?.callee),z}return Y.value},K4=r4(g$),o4=($)=>(v,U,X)=>{let J=X?{...X,async:!1}:{async:!1},W=v._zod.run({value:U,issues:[]},J);if(W instanceof Promise)throw new K6;return W.issues.length?{success:!1,error:new($??c1)(W.issues.map((Y)=>p$(Y,J,B$())))}:{success:!0,data:W.value}},e6=o4(g$),p4=($)=>async(v,U,X)=>{let J=X?Object.assign(X,{async:!0}):{async:!0},W=v._zod.run({value:U,issues:[]},J);if(W instanceof Promise)W=await W;return W.issues.length?{success:!1,error:new $(W.issues.map((Y)=>p$(Y,J,B$())))}:{success:!0,data:W.value}},s6=p4(g$),u0=($)=>(v,U,X)=>{let J=X?Object.assign(X,{direction:"backward"}):{direction:"backward"};return i4($)(v,U,J)},FG=u0(g$),h0=($)=>(v,U,X)=>{return i4($)(v,U,X)},EG=h0(g$),l0=($)=>async(v,U,X)=>{let J=X?Object.assign(X,{direction:"backward"}):{direction:"backward"};return r4($)(v,U,J)},MG=l0(g$),m0=($)=>async(v,U,X)=>{return r4($)(v,U,X)},PG=m0(g$),n0=($)=>(v,U,X)=>{let J=X?Object.assign(X,{direction:"backward"}):{direction:"backward"};return o4($)(v,U,J)},RG=n0(g$),c0=($)=>(v,U,X)=>{return o4($)(v,U,X)},kG=c0(g$),i0=($)=>async(v,U,X)=>{let J=X?Object.assign(X,{direction:"backward"}):{direction:"backward"};return p4($)(v,U,J)},CG=i0(g$),r0=($)=>async(v,U,X)=>{return p4($)(v,U,X)},_G=r0(g$);var f$={};H4(f$,{xid:()=>ZW,uuid7:()=>qI,uuid6:()=>SI,uuid4:()=>AI,uuid:()=>B4,uppercase:()=>X9,unicodeEmail:()=>ZG,undefined:()=>U9,ulid:()=>_W,time:()=>pW,string:()=>tW,sha512_hex:()=>cI,sha512_base64url:()=>rI,sha512_base64:()=>iI,sha384_hex:()=>lI,sha384_base64url:()=>nI,sha384_base64:()=>mI,sha256_hex:()=>yI,sha256_base64url:()=>hI,sha256_base64:()=>uI,sha1_hex:()=>xI,sha1_base64url:()=>fI,sha1_base64:()=>gI,rfc5322Email:()=>FI,number:()=>sW,null:()=>v9,nanoid:()=>xW,md5_hex:()=>_I,md5_base64url:()=>TI,md5_base64:()=>ZI,mac:()=>mW,lowercase:()=>J9,ksuid:()=>TW,ipv6:()=>lW,ipv4:()=>hW,integer:()=>eW,idnEmail:()=>EI,html5Email:()=>LI,hostname:()=>RI,hex:()=>CI,guid:()=>fW,extendedDuration:()=>BI,emoji:()=>uW,email:()=>yW,e164:()=>rW,duration:()=>gW,domain:()=>kI,datetime:()=>dW,date:()=>oW,cuid2:()=>CW,cuid:()=>kW,cidrv6:()=>cW,cidrv4:()=>nW,browserEmail:()=>MI,boolean:()=>$9,bigint:()=>aW,base64url:()=>o0,base64:()=>iW});var kW=/^[cC][^\s-]{8,}$/,CW=/^[0-9a-z]+$/,_W=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ZW=/^[0-9a-vA-V]{20}$/,TW=/^[A-Za-z0-9]{27}$/,xW=/^[a-zA-Z0-9_-]{21}$/,gW=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,BI=/^[-+]?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)?)??$/,fW=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,B4=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},AI=B4(4),SI=B4(6),qI=B4(7),yW=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,LI=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,FI=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,ZG=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,EI=ZG,MI=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,PI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function uW(){return new RegExp(PI,"u")}var hW=/^(?:(?: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])$/,lW=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,mW=($)=>{let v=a$($??":");return new RegExp(`^(?:[0-9A-F]{2}${v}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${v}){5}[0-9a-f]{2}$`)},nW=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,cW=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,iW=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,o0=/^[A-Za-z0-9_-]*$/,RI=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,kI=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,rW=/^\+(?:[0-9]){6,14}[0-9]$/,TG="(?:(?:\\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])))",oW=new RegExp(`^${TG}$`);function xG($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function pW($){return new RegExp(`^${xG($)}$`)}function dW($){let v=xG({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let X=`${v}(?:${U.join("|")})`;return new RegExp(`^${TG}T(?:${X})$`)}var tW=($)=>{let v=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${v}$`)},aW=/^-?\d+n?$/,eW=/^-?\d+$/,sW=/^-?\d+(?:\.\d+)?/,$9=/^(?:true|false)$/i,v9=/^null$/i;var U9=/^undefined$/i;var J9=/^[^A-Z]*$/,X9=/^[^a-z]*$/,CI=/^[0-9a-fA-F]*$/;function i1($,v){return new RegExp(`^[A-Za-z0-9+/]{${$}}${v}$`)}function r1($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var _I=/^[0-9a-fA-F]{32}$/,ZI=i1(22,"=="),TI=r1(22),xI=/^[0-9a-fA-F]{40}$/,gI=i1(27,"="),fI=r1(27),yI=/^[0-9a-fA-F]{64}$/,uI=i1(43,"="),hI=r1(43),lI=/^[0-9a-fA-F]{96}$/,mI=i1(64,""),nI=r1(64),cI=/^[0-9a-fA-F]{128}$/,iI=i1(86,"=="),rI=r1(86);var z$=O("$ZodCheck",($,v)=>{var U;$._zod??($._zod={}),$._zod.def=v,(U=$._zod).onattach??(U.onattach=[])}),fG={number:"number",bigint:"bigint",object:"date"},p0=O("$ZodCheckLessThan",($,v)=>{z$.init($,v);let U=fG[typeof v.value];$._zod.onattach.push((X)=>{let J=X._zod.bag,W=(v.inclusive?J.maximum:J.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(v.value<W)if(v.inclusive)J.maximum=v.value;else J.exclusiveMaximum=v.value}),$._zod.check=(X)=>{if(v.inclusive?X.value<=v.value:X.value<v.value)return;X.issues.push({origin:U,code:"too_big",maximum:v.value,input:X.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),d0=O("$ZodCheckGreaterThan",($,v)=>{z$.init($,v);let U=fG[typeof v.value];$._zod.onattach.push((X)=>{let J=X._zod.bag,W=(v.inclusive?J.minimum:J.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(v.value>W)if(v.inclusive)J.minimum=v.value;else J.exclusiveMinimum=v.value}),$._zod.check=(X)=>{if(v.inclusive?X.value>=v.value:X.value>v.value)return;X.issues.push({origin:U,code:"too_small",minimum:v.value,input:X.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),W9=O("$ZodCheckMultipleOf",($,v)=>{z$.init($,v),$._zod.onattach.push((U)=>{var X;(X=U._zod.bag).multipleOf??(X.multipleOf=v.value)}),$._zod.check=(U)=>{if(typeof U.value!==typeof v.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof U.value==="bigint"?U.value%v.value===BigInt(0):SW(U.value,v.value)===0)return;U.issues.push({origin:typeof U.value,code:"not_multiple_of",divisor:v.value,input:U.value,inst:$,continue:!v.abort})}}),Y9=O("$ZodCheckNumberFormat",($,v)=>{z$.init($,v),v.format=v.format||"float64";let U=v.format?.includes("int"),X=U?"int":"number",[J,W]=PW[v.format];$._zod.onattach.push((Y)=>{let z=Y._zod.bag;if(z.format=v.format,z.minimum=J,z.maximum=W,U)z.pattern=eW}),$._zod.check=(Y)=>{let z=Y.value;if(U){if(!Number.isInteger(z)){Y.issues.push({expected:X,format:v.format,code:"invalid_type",continue:!1,input:z,inst:$});return}if(!Number.isSafeInteger(z)){if(z>0)Y.issues.push({input:z,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:X,continue:!v.abort});else Y.issues.push({input:z,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:X,continue:!v.abort});return}}if(z<J)Y.issues.push({origin:"number",input:z,code:"too_small",minimum:J,inclusive:!0,inst:$,continue:!v.abort});if(z>W)Y.issues.push({origin:"number",input:z,code:"too_big",maximum:W,inst:$})}}),z9=O("$ZodCheckBigIntFormat",($,v)=>{z$.init($,v);let[U,X]=RW[v.format];$._zod.onattach.push((J)=>{let W=J._zod.bag;W.format=v.format,W.minimum=U,W.maximum=X}),$._zod.check=(J)=>{let W=J.value;if(W<U)J.issues.push({origin:"bigint",input:W,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!v.abort});if(W>X)J.issues.push({origin:"bigint",input:W,code:"too_big",maximum:X,inst:$})}}),G9=O("$ZodCheckMaxSize",($,v)=>{var U;z$.init($,v),(U=$._zod.def).when??(U.when=(X)=>{let J=X.value;return!o6(J)&&J.size!==void 0}),$._zod.onattach.push((X)=>{let J=X._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<J)X._zod.bag.maximum=v.maximum}),$._zod.check=(X)=>{let J=X.value;if(J.size<=v.maximum)return;X.issues.push({origin:m1(J),code:"too_big",maximum:v.maximum,inclusive:!0,input:J,inst:$,continue:!v.abort})}}),Q9=O("$ZodCheckMinSize",($,v)=>{var U;z$.init($,v),(U=$._zod.def).when??(U.when=(X)=>{let J=X.value;return!o6(J)&&J.size!==void 0}),$._zod.onattach.push((X)=>{let J=X._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>J)X._zod.bag.minimum=v.minimum}),$._zod.check=(X)=>{let J=X.value;if(J.size>=v.minimum)return;X.issues.push({origin:m1(J),code:"too_small",minimum:v.minimum,inclusive:!0,input:J,inst:$,continue:!v.abort})}}),j9=O("$ZodCheckSizeEquals",($,v)=>{var U;z$.init($,v),(U=$._zod.def).when??(U.when=(X)=>{let J=X.value;return!o6(J)&&J.size!==void 0}),$._zod.onattach.push((X)=>{let J=X._zod.bag;J.minimum=v.size,J.maximum=v.size,J.size=v.size}),$._zod.check=(X)=>{let J=X.value,W=J.size;if(W===v.size)return;let Y=W>v.size;X.issues.push({origin:m1(J),...Y?{code:"too_big",maximum:v.size}:{code:"too_small",minimum:v.size},inclusive:!0,exact:!0,input:X.value,inst:$,continue:!v.abort})}}),w9=O("$ZodCheckMaxLength",($,v)=>{var U;z$.init($,v),(U=$._zod.def).when??(U.when=(X)=>{let J=X.value;return!o6(J)&&J.length!==void 0}),$._zod.onattach.push((X)=>{let J=X._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<J)X._zod.bag.maximum=v.maximum}),$._zod.check=(X)=>{let J=X.value;if(J.length<=v.maximum)return;let Y=n1(J);X.issues.push({origin:Y,code:"too_big",maximum:v.maximum,inclusive:!0,input:J,inst:$,continue:!v.abort})}}),H9=O("$ZodCheckMinLength",($,v)=>{var U;z$.init($,v),(U=$._zod.def).when??(U.when=(X)=>{let J=X.value;return!o6(J)&&J.length!==void 0}),$._zod.onattach.push((X)=>{let J=X._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>J)X._zod.bag.minimum=v.minimum}),$._zod.check=(X)=>{let J=X.value;if(J.length>=v.minimum)return;let Y=n1(J);X.issues.push({origin:Y,code:"too_small",minimum:v.minimum,inclusive:!0,input:J,inst:$,continue:!v.abort})}}),N9=O("$ZodCheckLengthEquals",($,v)=>{var U;z$.init($,v),(U=$._zod.def).when??(U.when=(X)=>{let J=X.value;return!o6(J)&&J.length!==void 0}),$._zod.onattach.push((X)=>{let J=X._zod.bag;J.minimum=v.length,J.maximum=v.length,J.length=v.length}),$._zod.check=(X)=>{let J=X.value,W=J.length;if(W===v.length)return;let Y=n1(J),z=W>v.length;X.issues.push({origin:Y,...z?{code:"too_big",maximum:v.length}:{code:"too_small",minimum:v.length},inclusive:!0,exact:!0,input:X.value,inst:$,continue:!v.abort})}}),d4=O("$ZodCheckStringFormat",($,v)=>{var U,X;if(z$.init($,v),$._zod.onattach.push((J)=>{let W=J._zod.bag;if(W.format=v.format,v.pattern)W.patterns??(W.patterns=new Set),W.patterns.add(v.pattern)}),v.pattern)(U=$._zod).check??(U.check=(J)=>{if(v.pattern.lastIndex=0,v.pattern.test(J.value))return;J.issues.push({origin:"string",code:"invalid_format",format:v.format,input:J.value,...v.pattern?{pattern:v.pattern.toString()}:{},inst:$,continue:!v.abort})});else(X=$._zod).check??(X.check=()=>{})}),I9=O("$ZodCheckRegex",($,v)=>{d4.init($,v),$._zod.check=(U)=>{if(v.pattern.lastIndex=0,v.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:"regex",input:U.value,pattern:v.pattern.toString(),inst:$,continue:!v.abort})}}),O9=O("$ZodCheckLowerCase",($,v)=>{v.pattern??(v.pattern=J9),d4.init($,v)}),D9=O("$ZodCheckUpperCase",($,v)=>{v.pattern??(v.pattern=X9),d4.init($,v)}),b9=O("$ZodCheckIncludes",($,v)=>{z$.init($,v);let U=a$(v.includes),X=new RegExp(typeof v.position==="number"?`^.{${v.position}}${U}`:U);v.pattern=X,$._zod.onattach.push((J)=>{let W=J._zod.bag;W.patterns??(W.patterns=new Set),W.patterns.add(X)}),$._zod.check=(J)=>{if(J.value.includes(v.includes,v.position))return;J.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:v.includes,input:J.value,inst:$,continue:!v.abort})}}),V9=O("$ZodCheckStartsWith",($,v)=>{z$.init($,v);let U=new RegExp(`^${a$(v.prefix)}.*`);v.pattern??(v.pattern=U),$._zod.onattach.push((X)=>{let J=X._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(U)}),$._zod.check=(X)=>{if(X.value.startsWith(v.prefix))return;X.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:v.prefix,input:X.value,inst:$,continue:!v.abort})}}),K9=O("$ZodCheckEndsWith",($,v)=>{z$.init($,v);let U=new RegExp(`.*${a$(v.suffix)}$`);v.pattern??(v.pattern=U),$._zod.onattach.push((X)=>{let J=X._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(U)}),$._zod.check=(X)=>{if(X.value.endsWith(v.suffix))return;X.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:v.suffix,input:X.value,inst:$,continue:!v.abort})}});function gG($,v,U){if($.issues.length)v.issues.push(...o$(U,$.issues))}var B9=O("$ZodCheckProperty",($,v)=>{z$.init($,v),$._zod.check=(U)=>{let X=v.schema._zod.run({value:U.value[v.property],issues:[]},{});if(X instanceof Promise)return X.then((J)=>gG(J,U,v.property));gG(X,U,v.property);return}}),A9=O("$ZodCheckMimeType",($,v)=>{z$.init($,v);let U=new Set(v.mime);$._zod.onattach.push((X)=>{X._zod.bag.mime=v.mime}),$._zod.check=(X)=>{if(U.has(X.value.type))return;X.issues.push({code:"invalid_value",values:v.mime,input:X.value.type,inst:$,continue:!v.abort})}}),S9=O("$ZodCheckOverwrite",($,v)=>{z$.init($,v),$._zod.check=(U)=>{U.value=v.tx(U.value)}});class t0{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let U=$.split(`
13
+ `).filter((W)=>W),X=Math.min(...U.map((W)=>W.length-W.trimStart().length)),J=U.map((W)=>W.slice(X)).map((W)=>" ".repeat(this.indent*2)+W);for(let W of J)this.content.push(W)}compile(){let $=Function,v=this?.args,X=[...(this?.content??[""]).map((J)=>` ${J}`)];return new $(...v,X.join(`
14
+ `))}}var q9={major:4,minor:1,patch:13};var l=O("$ZodType",($,v)=>{var U;$??($={}),$._zod.def=v,$._zod.bag=$._zod.bag||{},$._zod.version=q9;let X=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))X.unshift($);for(let J of X)for(let W of J._zod.onattach)W($);if(X.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let J=(Y,z,G)=>{let Q=a6(Y),j;for(let H of z){if(H._zod.def.when){if(!H._zod.def.when(Y))continue}else if(Q)continue;let N=Y.issues.length,w=H._zod.check(Y);if(w instanceof Promise&&G?.async===!1)throw new K6;if(j||w instanceof Promise)j=(j??Promise.resolve()).then(async()=>{if(await w,Y.issues.length===N)return;if(!Q)Q=a6(Y,N)});else{if(Y.issues.length===N)continue;if(!Q)Q=a6(Y,N)}}if(j)return j.then(()=>{return Y});return Y},W=(Y,z,G)=>{if(a6(Y))return Y.aborted=!0,Y;let Q=J(z,X,G);if(Q instanceof Promise){if(G.async===!1)throw new K6;return Q.then((j)=>$._zod.parse(j,G))}return $._zod.parse(Q,G)};$._zod.run=(Y,z)=>{if(z.skipChecks)return $._zod.parse(Y,z);if(z.direction==="backward"){let Q=$._zod.parse({value:Y.value,issues:[]},{...z,skipChecks:!0});if(Q instanceof Promise)return Q.then((j)=>{return W(j,Y,z)});return W(Q,Y,z)}let G=$._zod.parse(Y,z);if(G instanceof Promise){if(z.async===!1)throw new K6;return G.then((Q)=>J(Q,X,z))}return J(G,X,z)}}$["~standard"]={validate:(J)=>{try{let W=e6($,J);return W.success?{value:W.data}:{issues:W.error?.issues}}catch(W){return s6($,J).then((Y)=>Y.success?{value:Y.data}:{issues:Y.error?.issues})}},vendor:"zod",version:1}}),$4=O("$ZodString",($,v)=>{l.init($,v),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??tW($._zod.bag),$._zod.parse=(U,X)=>{if(v.coerce)try{U.value=String(U.value)}catch(J){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),W$=O("$ZodStringFormat",($,v)=>{d4.init($,v),$4.init($,v)}),UU=O("$ZodGUID",($,v)=>{v.pattern??(v.pattern=fW),W$.init($,v)}),JU=O("$ZodUUID",($,v)=>{if(v.version){let X={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[v.version];if(X===void 0)throw Error(`Invalid UUID version: "${v.version}"`);v.pattern??(v.pattern=B4(X))}else v.pattern??(v.pattern=B4());W$.init($,v)}),XU=O("$ZodEmail",($,v)=>{v.pattern??(v.pattern=yW),W$.init($,v)}),WU=O("$ZodURL",($,v)=>{W$.init($,v),$._zod.check=(U)=>{try{let X=U.value.trim(),J=new URL(X);if(v.hostname){if(v.hostname.lastIndex=0,!v.hostname.test(J.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:v.hostname.source,input:U.value,inst:$,continue:!v.abort})}if(v.protocol){if(v.protocol.lastIndex=0,!v.protocol.test(J.protocol.endsWith(":")?J.protocol.slice(0,-1):J.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:v.protocol.source,input:U.value,inst:$,continue:!v.abort})}if(v.normalize)U.value=J.href;else U.value=X;return}catch(X){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!v.abort})}}}),YU=O("$ZodEmoji",($,v)=>{v.pattern??(v.pattern=uW()),W$.init($,v)}),zU=O("$ZodNanoID",($,v)=>{v.pattern??(v.pattern=xW),W$.init($,v)}),GU=O("$ZodCUID",($,v)=>{v.pattern??(v.pattern=kW),W$.init($,v)}),QU=O("$ZodCUID2",($,v)=>{v.pattern??(v.pattern=CW),W$.init($,v)}),jU=O("$ZodULID",($,v)=>{v.pattern??(v.pattern=_W),W$.init($,v)}),wU=O("$ZodXID",($,v)=>{v.pattern??(v.pattern=ZW),W$.init($,v)}),HU=O("$ZodKSUID",($,v)=>{v.pattern??(v.pattern=TW),W$.init($,v)}),F9=O("$ZodISODateTime",($,v)=>{v.pattern??(v.pattern=dW(v)),W$.init($,v)}),E9=O("$ZodISODate",($,v)=>{v.pattern??(v.pattern=oW),W$.init($,v)}),M9=O("$ZodISOTime",($,v)=>{v.pattern??(v.pattern=pW(v)),W$.init($,v)}),P9=O("$ZodISODuration",($,v)=>{v.pattern??(v.pattern=gW),W$.init($,v)}),NU=O("$ZodIPv4",($,v)=>{v.pattern??(v.pattern=hW),W$.init($,v),$._zod.bag.format="ipv4"}),IU=O("$ZodIPv6",($,v)=>{v.pattern??(v.pattern=lW),W$.init($,v),$._zod.bag.format="ipv6",$._zod.check=(U)=>{try{new URL(`http://[${U.value}]`)}catch{U.issues.push({code:"invalid_format",format:"ipv6",input:U.value,inst:$,continue:!v.abort})}}}),OU=O("$ZodMAC",($,v)=>{v.pattern??(v.pattern=mW(v.delimiter)),W$.init($,v),$._zod.bag.format="mac"}),DU=O("$ZodCIDRv4",($,v)=>{v.pattern??(v.pattern=nW),W$.init($,v)}),bU=O("$ZodCIDRv6",($,v)=>{v.pattern??(v.pattern=cW),W$.init($,v),$._zod.check=(U)=>{let X=U.value.split("/");try{if(X.length!==2)throw Error();let[J,W]=X;if(!W)throw Error();let Y=Number(W);if(`${Y}`!==W)throw Error();if(Y<0||Y>128)throw Error();new URL(`http://[${J}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!v.abort})}}});function R9($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var VU=O("$ZodBase64",($,v)=>{v.pattern??(v.pattern=iW),W$.init($,v),$._zod.bag.contentEncoding="base64",$._zod.check=(U)=>{if(R9(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!v.abort})}});function dG($){if(!o0.test($))return!1;let v=$.replace(/[-_]/g,(X)=>X==="-"?"+":"/"),U=v.padEnd(Math.ceil(v.length/4)*4,"=");return R9(U)}var KU=O("$ZodBase64URL",($,v)=>{v.pattern??(v.pattern=o0),W$.init($,v),$._zod.bag.contentEncoding="base64url",$._zod.check=(U)=>{if(dG(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!v.abort})}}),BU=O("$ZodE164",($,v)=>{v.pattern??(v.pattern=rW),W$.init($,v)});function tG($,v=null){try{let U=$.split(".");if(U.length!==3)return!1;let[X]=U;if(!X)return!1;let J=JSON.parse(atob(X));if("typ"in J&&J?.typ!=="JWT")return!1;if(!J.alg)return!1;if(v&&(!("alg"in J)||J.alg!==v))return!1;return!0}catch{return!1}}var AU=O("$ZodJWT",($,v)=>{W$.init($,v),$._zod.check=(U)=>{if(tG(U.value,v.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!v.abort})}}),SU=O("$ZodCustomStringFormat",($,v)=>{W$.init($,v),$._zod.check=(U)=>{if(v.fn(U.value))return;U.issues.push({code:"invalid_format",format:v.format,input:U.value,inst:$,continue:!v.abort})}}),o1=O("$ZodNumber",($,v)=>{l.init($,v),$._zod.pattern=$._zod.bag.pattern??sW,$._zod.parse=(U,X)=>{if(v.coerce)try{U.value=Number(U.value)}catch(Y){}let J=U.value;if(typeof J==="number"&&!Number.isNaN(J)&&Number.isFinite(J))return U;let W=typeof J==="number"?Number.isNaN(J)?"NaN":!Number.isFinite(J)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:J,inst:$,...W?{received:W}:{}}),U}}),qU=O("$ZodNumberFormat",($,v)=>{Y9.init($,v),o1.init($,v)}),t4=O("$ZodBoolean",($,v)=>{l.init($,v),$._zod.pattern=$9,$._zod.parse=(U,X)=>{if(v.coerce)try{U.value=Boolean(U.value)}catch(W){}let J=U.value;if(typeof J==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:J,inst:$}),U}}),p1=O("$ZodBigInt",($,v)=>{l.init($,v),$._zod.pattern=aW,$._zod.parse=(U,X)=>{if(v.coerce)try{U.value=BigInt(U.value)}catch(J){}if(typeof U.value==="bigint")return U;return U.issues.push({expected:"bigint",code:"invalid_type",input:U.value,inst:$}),U}}),LU=O("$ZodBigIntFormat",($,v)=>{z9.init($,v),p1.init($,v)}),FU=O("$ZodSymbol",($,v)=>{l.init($,v),$._zod.parse=(U,X)=>{let J=U.value;if(typeof J==="symbol")return U;return U.issues.push({expected:"symbol",code:"invalid_type",input:J,inst:$}),U}}),EU=O("$ZodUndefined",($,v)=>{l.init($,v),$._zod.pattern=U9,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(U,X)=>{let J=U.value;if(typeof J>"u")return U;return U.issues.push({expected:"undefined",code:"invalid_type",input:J,inst:$}),U}}),MU=O("$ZodNull",($,v)=>{l.init($,v),$._zod.pattern=v9,$._zod.values=new Set([null]),$._zod.parse=(U,X)=>{let J=U.value;if(J===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:J,inst:$}),U}}),PU=O("$ZodAny",($,v)=>{l.init($,v),$._zod.parse=(U)=>U}),RU=O("$ZodUnknown",($,v)=>{l.init($,v),$._zod.parse=(U)=>U}),kU=O("$ZodNever",($,v)=>{l.init($,v),$._zod.parse=(U,X)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}}),CU=O("$ZodVoid",($,v)=>{l.init($,v),$._zod.parse=(U,X)=>{let J=U.value;if(typeof J>"u")return U;return U.issues.push({expected:"void",code:"invalid_type",input:J,inst:$}),U}}),_U=O("$ZodDate",($,v)=>{l.init($,v),$._zod.parse=(U,X)=>{if(v.coerce)try{U.value=new Date(U.value)}catch(z){}let J=U.value,W=J instanceof Date;if(W&&!Number.isNaN(J.getTime()))return U;return U.issues.push({expected:"date",code:"invalid_type",input:J,...W?{received:"Invalid Date"}:{},inst:$}),U}});function uG($,v,U){if($.issues.length)v.issues.push(...o$(U,$.issues));v.value[U]=$.value}var ZU=O("$ZodArray",($,v)=>{l.init($,v),$._zod.parse=(U,X)=>{let J=U.value;if(!Array.isArray(J))return U.issues.push({expected:"array",code:"invalid_type",input:J,inst:$}),U;U.value=Array(J.length);let W=[];for(let Y=0;Y<J.length;Y++){let z=J[Y],G=v.element._zod.run({value:z,issues:[]},X);if(G instanceof Promise)W.push(G.then((Q)=>uG(Q,U,Y)));else uG(G,U,Y)}if(W.length)return Promise.all(W).then(()=>U);return U}});function vU($,v,U,X){if($.issues.length)v.issues.push(...o$(U,$.issues));if($.value===void 0){if(U in X)v.value[U]=void 0}else v.value[U]=$.value}function aG($){let v=Object.keys($.shape);for(let X of v)if(!$.shape?.[X]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${X}": expected a Zod schema`);let U=MW($.shape);return{...$,keys:v,keySet:new Set(v),numKeys:v.length,optionalKeys:new Set(U)}}function eG($,v,U,X,J,W){let Y=[],z=J.keySet,G=J.catchall._zod,Q=G.def.type;for(let j in v){if(z.has(j))continue;if(Q==="never"){Y.push(j);continue}let H=G.run({value:v[j],issues:[]},X);if(H instanceof Promise)$.push(H.then((N)=>vU(N,U,j,v)));else vU(H,U,j,v)}if(Y.length)U.issues.push({code:"unrecognized_keys",keys:Y,input:v,inst:W});if(!$.length)return U;return Promise.all($).then(()=>{return U})}var TU=O("$ZodObject",($,v)=>{if(l.init($,v),!Object.getOwnPropertyDescriptor(v,"shape")?.get){let z=v.shape;Object.defineProperty(v,"shape",{get:()=>{let G={...z};return Object.defineProperty(v,"shape",{value:G}),G}})}let X=l4(()=>aG(v));t($._zod,"propValues",()=>{let z=v.shape,G={};for(let Q in z){let j=z[Q]._zod;if(j.values){G[Q]??(G[Q]=new Set);for(let H of j.values)G[Q].add(H)}}return G});let J=b4,W=v.catchall,Y;$._zod.parse=(z,G)=>{Y??(Y=X.value);let Q=z.value;if(!J(Q))return z.issues.push({expected:"object",code:"invalid_type",input:Q,inst:$}),z;z.value={};let j=[],H=Y.shape;for(let N of Y.keys){let I=H[N]._zod.run({value:Q[N],issues:[]},G);if(I instanceof Promise)j.push(I.then((D)=>vU(D,z,N,Q)));else vU(I,z,N,Q)}if(!W)return j.length?Promise.all(j).then(()=>z):z;return eG(j,Q,z,G,X.value,$)}}),k9=O("$ZodObjectJIT",($,v)=>{TU.init($,v);let U=$._zod.parse,X=l4(()=>aG(v)),J=(N)=>{let w=new t0(["shape","payload","ctx"]),I=X.value,D=(R)=>{let y=x0(R);return`shape[${y}]._zod.run({ value: input[${y}], issues: [] }, ctx)`};w.write("const input = payload.value;");let K=Object.create(null),B=0;for(let R of I.keys)K[R]=`key_${B++}`;w.write("const newResult = {};");for(let R of I.keys){let y=K[R],T=x0(R);w.write(`const ${y} = ${D(R)};`),w.write(`
15
+ if (${y}.issues.length) {
16
+ payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
17
+ ...iss,
18
+ path: iss.path ? [${T}, ...iss.path] : [${T}]
19
+ })));
20
+ }
21
+
22
+
23
+ if (${y}.value === undefined) {
24
+ if (${T} in input) {
25
+ newResult[${T}] = undefined;
26
+ }
27
+ } else {
28
+ newResult[${T}] = ${y}.value;
29
+ }
30
+
31
+ `)}w.write("payload.value = newResult;"),w.write("return payload;");let x=w.compile();return(R,y)=>x(N,R,y)},W,Y=b4,z=!f1.jitless,Q=z&&LW.value,j=v.catchall,H;$._zod.parse=(N,w)=>{H??(H=X.value);let I=N.value;if(!Y(I))return N.issues.push({expected:"object",code:"invalid_type",input:I,inst:$}),N;if(z&&Q&&w?.async===!1&&w.jitless!==!0){if(!W)W=J(v.shape);if(N=W(N,w),!j)return N;return eG([],I,N,w,H,$)}return U(N,w)}});function hG($,v,U,X){for(let W of $)if(W.issues.length===0)return v.value=W.value,v;let J=$.filter((W)=>!a6(W));if(J.length===1)return v.value=J[0].value,J[0];return v.issues.push({code:"invalid_union",input:v.value,inst:U,errors:$.map((W)=>W.issues.map((Y)=>p$(Y,X,B$())))}),v}var d1=O("$ZodUnion",($,v)=>{l.init($,v),t($._zod,"optin",()=>v.options.some((J)=>J._zod.optin==="optional")?"optional":void 0),t($._zod,"optout",()=>v.options.some((J)=>J._zod.optout==="optional")?"optional":void 0),t($._zod,"values",()=>{if(v.options.every((J)=>J._zod.values))return new Set(v.options.flatMap((J)=>Array.from(J._zod.values)));return}),t($._zod,"pattern",()=>{if(v.options.every((J)=>J._zod.pattern)){let J=v.options.map((W)=>W._zod.pattern);return new RegExp(`^(${J.map((W)=>h1(W.source)).join("|")})$`)}return});let U=v.options.length===1,X=v.options[0]._zod.run;$._zod.parse=(J,W)=>{if(U)return X(J,W);let Y=!1,z=[];for(let G of v.options){let Q=G._zod.run({value:J.value,issues:[]},W);if(Q instanceof Promise)z.push(Q),Y=!0;else{if(Q.issues.length===0)return Q;z.push(Q)}}if(!Y)return hG(z,J,$,W);return Promise.all(z).then((G)=>{return hG(G,J,$,W)})}}),xU=O("$ZodDiscriminatedUnion",($,v)=>{d1.init($,v);let U=$._zod.parse;t($._zod,"propValues",()=>{let J={};for(let W of v.options){let Y=W._zod.propValues;if(!Y||Object.keys(Y).length===0)throw Error(`Invalid discriminated union option at index "${v.options.indexOf(W)}"`);for(let[z,G]of Object.entries(Y)){if(!J[z])J[z]=new Set;for(let Q of G)J[z].add(Q)}}return J});let X=l4(()=>{let J=v.options,W=new Map;for(let Y of J){let z=Y._zod.propValues?.[v.discriminator];if(!z||z.size===0)throw Error(`Invalid discriminated union option at index "${v.options.indexOf(Y)}"`);for(let G of z){if(W.has(G))throw Error(`Duplicate discriminator value "${String(G)}"`);W.set(G,Y)}}return W});$._zod.parse=(J,W)=>{let Y=J.value;if(!b4(Y))return J.issues.push({code:"invalid_type",expected:"object",input:Y,inst:$}),J;let z=X.value.get(Y?.[v.discriminator]);if(z)return z._zod.run(J,W);if(v.unionFallback)return U(J,W);return J.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:v.discriminator,input:Y,path:[v.discriminator],inst:$}),J}}),gU=O("$ZodIntersection",($,v)=>{l.init($,v),$._zod.parse=(U,X)=>{let J=U.value,W=v.left._zod.run({value:J,issues:[]},X),Y=v.right._zod.run({value:J,issues:[]},X);if(W instanceof Promise||Y instanceof Promise)return Promise.all([W,Y]).then(([G,Q])=>{return lG(U,G,Q)});return lG(U,W,Y)}});function L9($,v){if($===v)return{valid:!0,data:$};if($ instanceof Date&&v instanceof Date&&+$===+v)return{valid:!0,data:$};if(t6($)&&t6(v)){let U=Object.keys(v),X=Object.keys($).filter((W)=>U.indexOf(W)!==-1),J={...$,...v};for(let W of X){let Y=L9($[W],v[W]);if(!Y.valid)return{valid:!1,mergeErrorPath:[W,...Y.mergeErrorPath]};J[W]=Y.data}return{valid:!0,data:J}}if(Array.isArray($)&&Array.isArray(v)){if($.length!==v.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let X=0;X<$.length;X++){let J=$[X],W=v[X],Y=L9(J,W);if(!Y.valid)return{valid:!1,mergeErrorPath:[X,...Y.mergeErrorPath]};U.push(Y.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function lG($,v,U){if(v.issues.length)$.issues.push(...v.issues);if(U.issues.length)$.issues.push(...U.issues);if(a6($))return $;let X=L9(v.value,U.value);if(!X.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(X.mergeErrorPath)}`);return $.value=X.data,$}var t1=O("$ZodTuple",($,v)=>{l.init($,v);let U=v.items;$._zod.parse=(X,J)=>{let W=X.value;if(!Array.isArray(W))return X.issues.push({input:W,inst:$,expected:"tuple",code:"invalid_type"}),X;X.value=[];let Y=[],z=[...U].reverse().findIndex((j)=>j._zod.optin!=="optional"),G=z===-1?0:U.length-z;if(!v.rest){let j=W.length>U.length,H=W.length<G-1;if(j||H)return X.issues.push({...j?{code:"too_big",maximum:U.length}:{code:"too_small",minimum:U.length},input:W,inst:$,origin:"array"}),X}let Q=-1;for(let j of U){if(Q++,Q>=W.length){if(Q>=G)continue}let H=j._zod.run({value:W[Q],issues:[]},J);if(H instanceof Promise)Y.push(H.then((N)=>a0(N,X,Q)));else a0(H,X,Q)}if(v.rest){let j=W.slice(U.length);for(let H of j){Q++;let N=v.rest._zod.run({value:H,issues:[]},J);if(N instanceof Promise)Y.push(N.then((w)=>a0(w,X,Q)));else a0(N,X,Q)}}if(Y.length)return Promise.all(Y).then(()=>X);return X}});function a0($,v,U){if($.issues.length)v.issues.push(...o$(U,$.issues));v.value[U]=$.value}var fU=O("$ZodRecord",($,v)=>{l.init($,v),$._zod.parse=(U,X)=>{let J=U.value;if(!t6(J))return U.issues.push({expected:"record",code:"invalid_type",input:J,inst:$}),U;let W=[],Y=v.keyType._zod.values;if(Y){U.value={};let z=new Set;for(let Q of Y)if(typeof Q==="string"||typeof Q==="number"||typeof Q==="symbol"){z.add(typeof Q==="number"?Q.toString():Q);let j=v.valueType._zod.run({value:J[Q],issues:[]},X);if(j instanceof Promise)W.push(j.then((H)=>{if(H.issues.length)U.issues.push(...o$(Q,H.issues));U.value[Q]=H.value}));else{if(j.issues.length)U.issues.push(...o$(Q,j.issues));U.value[Q]=j.value}}let G;for(let Q in J)if(!z.has(Q))G=G??[],G.push(Q);if(G&&G.length>0)U.issues.push({code:"unrecognized_keys",input:J,inst:$,keys:G})}else{U.value={};for(let z of Reflect.ownKeys(J)){if(z==="__proto__")continue;let G=v.keyType._zod.run({value:z,issues:[]},X);if(G instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(G.issues.length){U.issues.push({code:"invalid_key",origin:"record",issues:G.issues.map((j)=>p$(j,X,B$())),input:z,path:[z],inst:$}),U.value[G.value]=G.value;continue}let Q=v.valueType._zod.run({value:J[z],issues:[]},X);if(Q instanceof Promise)W.push(Q.then((j)=>{if(j.issues.length)U.issues.push(...o$(z,j.issues));U.value[G.value]=j.value}));else{if(Q.issues.length)U.issues.push(...o$(z,Q.issues));U.value[G.value]=Q.value}}}if(W.length)return Promise.all(W).then(()=>U);return U}}),yU=O("$ZodMap",($,v)=>{l.init($,v),$._zod.parse=(U,X)=>{let J=U.value;if(!(J instanceof Map))return U.issues.push({expected:"map",code:"invalid_type",input:J,inst:$}),U;let W=[];U.value=new Map;for(let[Y,z]of J){let G=v.keyType._zod.run({value:Y,issues:[]},X),Q=v.valueType._zod.run({value:z,issues:[]},X);if(G instanceof Promise||Q instanceof Promise)W.push(Promise.all([G,Q]).then(([j,H])=>{mG(j,H,U,Y,J,$,X)}));else mG(G,Q,U,Y,J,$,X)}if(W.length)return Promise.all(W).then(()=>U);return U}});function mG($,v,U,X,J,W,Y){if($.issues.length)if(l1.has(typeof X))U.issues.push(...o$(X,$.issues));else U.issues.push({code:"invalid_key",origin:"map",input:J,inst:W,issues:$.issues.map((z)=>p$(z,Y,B$()))});if(v.issues.length)if(l1.has(typeof X))U.issues.push(...o$(X,v.issues));else U.issues.push({origin:"map",code:"invalid_element",input:J,inst:W,key:X,issues:v.issues.map((z)=>p$(z,Y,B$()))});U.value.set($.value,v.value)}var uU=O("$ZodSet",($,v)=>{l.init($,v),$._zod.parse=(U,X)=>{let J=U.value;if(!(J instanceof Set))return U.issues.push({input:J,inst:$,expected:"set",code:"invalid_type"}),U;let W=[];U.value=new Set;for(let Y of J){let z=v.valueType._zod.run({value:Y,issues:[]},X);if(z instanceof Promise)W.push(z.then((G)=>nG(G,U)));else nG(z,U)}if(W.length)return Promise.all(W).then(()=>U);return U}});function nG($,v){if($.issues.length)v.issues.push(...$.issues);v.value.add($.value)}var hU=O("$ZodEnum",($,v)=>{l.init($,v);let U=u1(v.entries),X=new Set(U);$._zod.values=X,$._zod.pattern=new RegExp(`^(${U.filter((J)=>l1.has(typeof J)).map((J)=>typeof J==="string"?a$(J):J.toString()).join("|")})$`),$._zod.parse=(J,W)=>{let Y=J.value;if(X.has(Y))return J;return J.issues.push({code:"invalid_value",values:U,input:Y,inst:$}),J}}),lU=O("$ZodLiteral",($,v)=>{if(l.init($,v),v.values.length===0)throw Error("Cannot create literal schema with no valid values");let U=new Set(v.values);$._zod.values=U,$._zod.pattern=new RegExp(`^(${v.values.map((X)=>typeof X==="string"?a$(X):X?a$(X.toString()):String(X)).join("|")})$`),$._zod.parse=(X,J)=>{let W=X.value;if(U.has(W))return X;return X.issues.push({code:"invalid_value",values:v.values,input:W,inst:$}),X}}),mU=O("$ZodFile",($,v)=>{l.init($,v),$._zod.parse=(U,X)=>{let J=U.value;if(J instanceof File)return U;return U.issues.push({expected:"file",code:"invalid_type",input:J,inst:$}),U}}),nU=O("$ZodTransform",($,v)=>{l.init($,v),$._zod.parse=(U,X)=>{if(X.direction==="backward")throw new D4($.constructor.name);let J=v.transform(U.value,U);if(X.async)return(J instanceof Promise?J:Promise.resolve(J)).then((Y)=>{return U.value=Y,U});if(J instanceof Promise)throw new K6;return U.value=J,U}});function cG($,v){if($.issues.length&&v===void 0)return{issues:[],value:void 0};return $}var cU=O("$ZodOptional",($,v)=>{l.init($,v),$._zod.optin="optional",$._zod.optout="optional",t($._zod,"values",()=>{return v.innerType._zod.values?new Set([...v.innerType._zod.values,void 0]):void 0}),t($._zod,"pattern",()=>{let U=v.innerType._zod.pattern;return U?new RegExp(`^(${h1(U.source)})?$`):void 0}),$._zod.parse=(U,X)=>{if(v.innerType._zod.optin==="optional"){let J=v.innerType._zod.run(U,X);if(J instanceof Promise)return J.then((W)=>cG(W,U.value));return cG(J,U.value)}if(U.value===void 0)return U;return v.innerType._zod.run(U,X)}}),iU=O("$ZodNullable",($,v)=>{l.init($,v),t($._zod,"optin",()=>v.innerType._zod.optin),t($._zod,"optout",()=>v.innerType._zod.optout),t($._zod,"pattern",()=>{let U=v.innerType._zod.pattern;return U?new RegExp(`^(${h1(U.source)}|null)$`):void 0}),t($._zod,"values",()=>{return v.innerType._zod.values?new Set([...v.innerType._zod.values,null]):void 0}),$._zod.parse=(U,X)=>{if(U.value===null)return U;return v.innerType._zod.run(U,X)}}),rU=O("$ZodDefault",($,v)=>{l.init($,v),$._zod.optin="optional",t($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(U,X)=>{if(X.direction==="backward")return v.innerType._zod.run(U,X);if(U.value===void 0)return U.value=v.defaultValue,U;let J=v.innerType._zod.run(U,X);if(J instanceof Promise)return J.then((W)=>iG(W,v));return iG(J,v)}});function iG($,v){if($.value===void 0)$.value=v.defaultValue;return $}var oU=O("$ZodPrefault",($,v)=>{l.init($,v),$._zod.optin="optional",t($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(U,X)=>{if(X.direction==="backward")return v.innerType._zod.run(U,X);if(U.value===void 0)U.value=v.defaultValue;return v.innerType._zod.run(U,X)}}),pU=O("$ZodNonOptional",($,v)=>{l.init($,v),t($._zod,"values",()=>{let U=v.innerType._zod.values;return U?new Set([...U].filter((X)=>X!==void 0)):void 0}),$._zod.parse=(U,X)=>{let J=v.innerType._zod.run(U,X);if(J instanceof Promise)return J.then((W)=>rG(W,$));return rG(J,$)}});function rG($,v){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:v});return $}var dU=O("$ZodSuccess",($,v)=>{l.init($,v),$._zod.parse=(U,X)=>{if(X.direction==="backward")throw new D4("ZodSuccess");let J=v.innerType._zod.run(U,X);if(J instanceof Promise)return J.then((W)=>{return U.value=W.issues.length===0,U});return U.value=J.issues.length===0,U}}),tU=O("$ZodCatch",($,v)=>{l.init($,v),t($._zod,"optin",()=>v.innerType._zod.optin),t($._zod,"optout",()=>v.innerType._zod.optout),t($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(U,X)=>{if(X.direction==="backward")return v.innerType._zod.run(U,X);let J=v.innerType._zod.run(U,X);if(J instanceof Promise)return J.then((W)=>{if(U.value=W.value,W.issues.length)U.value=v.catchValue({...U,error:{issues:W.issues.map((Y)=>p$(Y,X,B$()))},input:U.value}),U.issues=[];return U});if(U.value=J.value,J.issues.length)U.value=v.catchValue({...U,error:{issues:J.issues.map((W)=>p$(W,X,B$()))},input:U.value}),U.issues=[];return U}}),aU=O("$ZodNaN",($,v)=>{l.init($,v),$._zod.parse=(U,X)=>{if(typeof U.value!=="number"||!Number.isNaN(U.value))return U.issues.push({input:U.value,inst:$,expected:"nan",code:"invalid_type"}),U;return U}}),eU=O("$ZodPipe",($,v)=>{l.init($,v),t($._zod,"values",()=>v.in._zod.values),t($._zod,"optin",()=>v.in._zod.optin),t($._zod,"optout",()=>v.out._zod.optout),t($._zod,"propValues",()=>v.in._zod.propValues),$._zod.parse=(U,X)=>{if(X.direction==="backward"){let W=v.out._zod.run(U,X);if(W instanceof Promise)return W.then((Y)=>e0(Y,v.in,X));return e0(W,v.in,X)}let J=v.in._zod.run(U,X);if(J instanceof Promise)return J.then((W)=>e0(W,v.out,X));return e0(J,v.out,X)}});function e0($,v,U){if($.issues.length)return $.aborted=!0,$;return v._zod.run({value:$.value,issues:$.issues},U)}var a4=O("$ZodCodec",($,v)=>{l.init($,v),t($._zod,"values",()=>v.in._zod.values),t($._zod,"optin",()=>v.in._zod.optin),t($._zod,"optout",()=>v.out._zod.optout),t($._zod,"propValues",()=>v.in._zod.propValues),$._zod.parse=(U,X)=>{if((X.direction||"forward")==="forward"){let W=v.in._zod.run(U,X);if(W instanceof Promise)return W.then((Y)=>s0(Y,v,X));return s0(W,v,X)}else{let W=v.out._zod.run(U,X);if(W instanceof Promise)return W.then((Y)=>s0(Y,v,X));return s0(W,v,X)}}});function s0($,v,U){if($.issues.length)return $.aborted=!0,$;if((U.direction||"forward")==="forward"){let J=v.transform($.value,$);if(J instanceof Promise)return J.then((W)=>$U($,W,v.out,U));return $U($,J,v.out,U)}else{let J=v.reverseTransform($.value,$);if(J instanceof Promise)return J.then((W)=>$U($,W,v.in,U));return $U($,J,v.in,U)}}function $U($,v,U,X){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:v,issues:$.issues},X)}var sU=O("$ZodReadonly",($,v)=>{l.init($,v),t($._zod,"propValues",()=>v.innerType._zod.propValues),t($._zod,"values",()=>v.innerType._zod.values),t($._zod,"optin",()=>v.innerType?._zod?.optin),t($._zod,"optout",()=>v.innerType?._zod?.optout),$._zod.parse=(U,X)=>{if(X.direction==="backward")return v.innerType._zod.run(U,X);let J=v.innerType._zod.run(U,X);if(J instanceof Promise)return J.then(oG);return oG(J)}});function oG($){return $.value=Object.freeze($.value),$}var $J=O("$ZodTemplateLiteral",($,v)=>{l.init($,v);let U=[];for(let X of v.parts)if(typeof X==="object"&&X!==null){if(!X._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...X._zod.traits].shift()}`);let J=X._zod.pattern instanceof RegExp?X._zod.pattern.source:X._zod.pattern;if(!J)throw Error(`Invalid template literal part: ${X._zod.traits}`);let W=J.startsWith("^")?1:0,Y=J.endsWith("$")?J.length-1:J.length;U.push(J.slice(W,Y))}else if(X===null||EW.has(typeof X))U.push(a$(`${X}`));else throw Error(`Invalid template literal part: ${X}`);$._zod.pattern=new RegExp(`^${U.join("")}$`),$._zod.parse=(X,J)=>{if(typeof X.value!=="string")return X.issues.push({input:X.value,inst:$,expected:"template_literal",code:"invalid_type"}),X;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(X.value))return X.issues.push({input:X.value,inst:$,code:"invalid_format",format:v.format??"template_literal",pattern:$._zod.pattern.source}),X;return X}}),vJ=O("$ZodFunction",($,v)=>{return l.init($,v),$._def=v,$._zod.def=v,$.implement=(U)=>{if(typeof U!=="function")throw Error("implement() must be called with a function");return function(...X){let J=$._def.input?V4($._def.input,X):X,W=Reflect.apply(U,this,J);if($._def.output)return V4($._def.output,W);return W}},$.implementAsync=(U)=>{if(typeof U!=="function")throw Error("implementAsync() must be called with a function");return async function(...X){let J=$._def.input?await K4($._def.input,X):X,W=await Reflect.apply(U,this,J);if($._def.output)return await K4($._def.output,W);return W}},$._zod.parse=(U,X)=>{if(typeof U.value!=="function")return U.issues.push({code:"invalid_type",expected:"function",input:U.value,inst:$}),U;if($._def.output&&$._def.output._zod.def.type==="promise")U.value=$.implementAsync(U.value);else U.value=$.implement(U.value);return U},$.input=(...U)=>{let X=$.constructor;if(Array.isArray(U[0]))return new X({type:"function",input:new t1({type:"tuple",items:U[0],rest:U[1]}),output:$._def.output});return new X({type:"function",input:U[0],output:$._def.output})},$.output=(U)=>{return new $.constructor({type:"function",input:$._def.input,output:U})},$}),UJ=O("$ZodPromise",($,v)=>{l.init($,v),$._zod.parse=(U,X)=>{return Promise.resolve(U.value).then((J)=>v.innerType._zod.run({value:J,issues:[]},X))}}),JJ=O("$ZodLazy",($,v)=>{l.init($,v),t($._zod,"innerType",()=>v.getter()),t($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),t($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),t($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),t($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(U,X)=>{return $._zod.innerType._zod.run(U,X)}}),XJ=O("$ZodCustom",($,v)=>{z$.init($,v),l.init($,v),$._zod.parse=(U,X)=>{return U},$._zod.check=(U)=>{let X=U.value,J=v.fn(X);if(J instanceof Promise)return J.then((W)=>pG(W,U,X,$));pG(J,U,X,$);return}});function pG($,v,U,X){if(!$){let J={code:"custom",input:U,inst:X,path:[...X._zod.def.path??[]],continue:!X._zod.def.abort};if(X._zod.def.params)J.params=X._zod.def.params;v.issues.push(m4(J))}}var e4={};H4(e4,{zhTW:()=>K8,zhCN:()=>V8,yo:()=>B8,vi:()=>b8,ur:()=>D8,uk:()=>vv,ua:()=>O8,tr:()=>I8,th:()=>N8,ta:()=>H8,sv:()=>w8,sl:()=>j8,ru:()=>Q8,pt:()=>G8,ps:()=>Y8,pl:()=>z8,ota:()=>W8,no:()=>X8,nl:()=>J8,ms:()=>U8,mk:()=>v8,lt:()=>$8,ko:()=>s9,km:()=>e1,kh:()=>e9,ka:()=>a9,ja:()=>t9,it:()=>d9,is:()=>p9,id:()=>o9,hu:()=>r9,he:()=>i9,frCA:()=>c9,fr:()=>n9,fi:()=>m9,fa:()=>l9,es:()=>h9,eo:()=>u9,en:()=>a1,de:()=>y9,da:()=>f9,cs:()=>g9,ca:()=>x9,bg:()=>T9,be:()=>Z9,az:()=>_9,ar:()=>C9});var pI=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"number";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return(J)=>{switch(J.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${J.expected}، ولكن تم إدخال ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${F(J.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return` أكبر من اللازم: يفترض أن تكون ${J.origin??"القيمة"} ${W} ${J.maximum.toString()} ${Y.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${J.origin??"القيمة"} ${W} ${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`أصغر من اللازم: يفترض لـ ${J.origin} أن يكون ${W} ${J.minimum.toString()} ${Y.unit}`;return`أصغر من اللازم: يفترض لـ ${J.origin} أن يكون ${W} ${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${J.prefix}"`;if(W.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${W.suffix}"`;if(W.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${W.includes}"`;if(W.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${W.pattern}`;return`${X[W.format]??J.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${J.divisor}`;case"unrecognized_keys":return`معرف${J.keys.length>1?"ات":""} غريب${J.keys.length>1?"ة":""}: ${b(J.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${J.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${J.origin}`;default:return"مدخل غير مقبول"}}};function C9(){return{localeError:pI()}}var dI=()=>{let $={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"number";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(J)=>{switch(J.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${J.expected}, daxil olan ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Yanlış dəyər: gözlənilən ${F(J.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`Çox böyük: gözlənilən ${J.origin??"dəyər"} ${W}${J.maximum.toString()} ${Y.unit??"element"}`;return`Çox böyük: gözlənilən ${J.origin??"dəyər"} ${W}${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`Çox kiçik: gözlənilən ${J.origin} ${W}${J.minimum.toString()} ${Y.unit}`;return`Çox kiçik: gözlənilən ${J.origin} ${W}${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Yanlış mətn: "${W.prefix}" ilə başlamalıdır`;if(W.format==="ends_with")return`Yanlış mətn: "${W.suffix}" ilə bitməlidir`;if(W.format==="includes")return`Yanlış mətn: "${W.includes}" daxil olmalıdır`;if(W.format==="regex")return`Yanlış mətn: ${W.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${X[W.format]??J.format}`}case"not_multiple_of":return`Yanlış ədəd: ${J.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${J.keys.length>1?"lar":""}: ${b(J.keys,", ")}`;case"invalid_key":return`${J.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${J.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function _9(){return{localeError:dI()}}function sG($,v,U,X){let J=Math.abs($),W=J%10,Y=J%100;if(Y>=11&&Y<=19)return X;if(W===1)return v;if(W>=2&&W<=4)return U;return X}var tI=()=>{let $={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"лік";case"object":{if(Array.isArray(J))return"масіў";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return(J)=>{switch(J.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${J.expected}, атрымана ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Няправільны ўвод: чакалася ${F(J.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y){let z=Number(J.maximum),G=sG(z,Y.unit.one,Y.unit.few,Y.unit.many);return`Занадта вялікі: чакалася, што ${J.origin??"значэнне"} павінна ${Y.verb} ${W}${J.maximum.toString()} ${G}`}return`Занадта вялікі: чакалася, што ${J.origin??"значэнне"} павінна быць ${W}${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y){let z=Number(J.minimum),G=sG(z,Y.unit.one,Y.unit.few,Y.unit.many);return`Занадта малы: чакалася, што ${J.origin} павінна ${Y.verb} ${W}${J.minimum.toString()} ${G}`}return`Занадта малы: чакалася, што ${J.origin} павінна быць ${W}${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${W.prefix}"`;if(W.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${W.suffix}"`;if(W.format==="includes")return`Няправільны радок: павінен змяшчаць "${W.includes}"`;if(W.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${W.pattern}`;return`Няправільны ${X[W.format]??J.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${J.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${J.keys.length>1?"ключы":"ключ"}: ${b(J.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${J.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${J.origin}`;default:return"Няправільны ўвод"}}};function Z9(){return{localeError:tI()}}var aI=($)=>{let v=typeof $;switch(v){case"number":return Number.isNaN($)?"NaN":"число";case"object":{if(Array.isArray($))return"масив";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return v},eI=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function v(X){return $[X]??null}let U={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"};return(X)=>{switch(X.code){case"invalid_type":return`Невалиден вход: очакван ${X.expected}, получен ${aI(X.input)}`;case"invalid_value":if(X.values.length===1)return`Невалиден вход: очакван ${F(X.values[0])}`;return`Невалидна опция: очаквано едно от ${b(X.values,"|")}`;case"too_big":{let J=X.inclusive?"<=":"<",W=v(X.origin);if(W)return`Твърде голямо: очаква се ${X.origin??"стойност"} да съдържа ${J}${X.maximum.toString()} ${W.unit??"елемента"}`;return`Твърде голямо: очаква се ${X.origin??"стойност"} да бъде ${J}${X.maximum.toString()}`}case"too_small":{let J=X.inclusive?">=":">",W=v(X.origin);if(W)return`Твърде малко: очаква се ${X.origin} да съдържа ${J}${X.minimum.toString()} ${W.unit}`;return`Твърде малко: очаква се ${X.origin} да бъде ${J}${X.minimum.toString()}`}case"invalid_format":{let J=X;if(J.format==="starts_with")return`Невалиден низ: трябва да започва с "${J.prefix}"`;if(J.format==="ends_with")return`Невалиден низ: трябва да завършва с "${J.suffix}"`;if(J.format==="includes")return`Невалиден низ: трябва да включва "${J.includes}"`;if(J.format==="regex")return`Невалиден низ: трябва да съвпада с ${J.pattern}`;let W="Невалиден";if(J.format==="emoji")W="Невалидно";if(J.format==="datetime")W="Невалидно";if(J.format==="date")W="Невалидна";if(J.format==="time")W="Невалидно";if(J.format==="duration")W="Невалидна";return`${W} ${U[J.format]??X.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${X.divisor}`;case"unrecognized_keys":return`Неразпознат${X.keys.length>1?"и":""} ключ${X.keys.length>1?"ове":""}: ${b(X.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${X.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${X.origin}`;default:return"Невалиден вход"}}};function T9(){return{localeError:eI()}}var sI=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"number";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(J)=>{switch(J.code){case"invalid_type":return`Tipus invàlid: s'esperava ${J.expected}, s'ha rebut ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Valor invàlid: s'esperava ${F(J.values[0])}`;return`Opció invàlida: s'esperava una de ${b(J.values," o ")}`;case"too_big":{let W=J.inclusive?"com a màxim":"menys de",Y=v(J.origin);if(Y)return`Massa gran: s'esperava que ${J.origin??"el valor"} contingués ${W} ${J.maximum.toString()} ${Y.unit??"elements"}`;return`Massa gran: s'esperava que ${J.origin??"el valor"} fos ${W} ${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?"com a mínim":"més de",Y=v(J.origin);if(Y)return`Massa petit: s'esperava que ${J.origin} contingués ${W} ${J.minimum.toString()} ${Y.unit}`;return`Massa petit: s'esperava que ${J.origin} fos ${W} ${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Format invàlid: ha de començar amb "${W.prefix}"`;if(W.format==="ends_with")return`Format invàlid: ha d'acabar amb "${W.suffix}"`;if(W.format==="includes")return`Format invàlid: ha d'incloure "${W.includes}"`;if(W.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${W.pattern}`;return`Format invàlid per a ${X[W.format]??J.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${J.divisor}`;case"unrecognized_keys":return`Clau${J.keys.length>1?"s":""} no reconeguda${J.keys.length>1?"s":""}: ${b(J.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${J.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${J.origin}`;default:return"Entrada invàlida"}}};function x9(){return{localeError:sI()}}var $O=()=>{let $={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(J))return"pole";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return(J)=>{switch(J.code){case"invalid_type":return`Neplatný vstup: očekáváno ${J.expected}, obdrženo ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Neplatný vstup: očekáváno ${F(J.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`Hodnota je příliš velká: ${J.origin??"hodnota"} musí mít ${W}${J.maximum.toString()} ${Y.unit??"prvků"}`;return`Hodnota je příliš velká: ${J.origin??"hodnota"} musí být ${W}${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`Hodnota je příliš malá: ${J.origin??"hodnota"} musí mít ${W}${J.minimum.toString()} ${Y.unit??"prvků"}`;return`Hodnota je příliš malá: ${J.origin??"hodnota"} musí být ${W}${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Neplatný řetězec: musí začínat na "${W.prefix}"`;if(W.format==="ends_with")return`Neplatný řetězec: musí končit na "${W.suffix}"`;if(W.format==="includes")return`Neplatný řetězec: musí obsahovat "${W.includes}"`;if(W.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${W.pattern}`;return`Neplatný formát ${X[W.format]??J.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${J.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${b(J.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${J.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${J.origin}`;default:return"Neplatný vstup"}}};function g9(){return{localeError:$O()}}var vO=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},v={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};function U(Y){return $[Y]??null}function X(Y){return v[Y]??Y}let J=(Y)=>{let z=typeof Y;switch(z){case"number":return Number.isNaN(Y)?"NaN":"tal";case"object":{if(Array.isArray(Y))return"liste";if(Y===null)return"null";if(Object.getPrototypeOf(Y)!==Object.prototype&&Y.constructor)return Y.constructor.name;return"objekt"}}return z},W={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(Y)=>{switch(Y.code){case"invalid_type":return`Ugyldigt input: forventede ${X(Y.expected)}, fik ${X(J(Y.input))}`;case"invalid_value":if(Y.values.length===1)return`Ugyldig værdi: forventede ${F(Y.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${b(Y.values,"|")}`;case"too_big":{let z=Y.inclusive?"<=":"<",G=U(Y.origin),Q=X(Y.origin);if(G)return`For stor: forventede ${Q??"value"} ${G.verb} ${z} ${Y.maximum.toString()} ${G.unit??"elementer"}`;return`For stor: forventede ${Q??"value"} havde ${z} ${Y.maximum.toString()}`}case"too_small":{let z=Y.inclusive?">=":">",G=U(Y.origin),Q=X(Y.origin);if(G)return`For lille: forventede ${Q} ${G.verb} ${z} ${Y.minimum.toString()} ${G.unit}`;return`For lille: forventede ${Q} havde ${z} ${Y.minimum.toString()}`}case"invalid_format":{let z=Y;if(z.format==="starts_with")return`Ugyldig streng: skal starte med "${z.prefix}"`;if(z.format==="ends_with")return`Ugyldig streng: skal ende med "${z.suffix}"`;if(z.format==="includes")return`Ugyldig streng: skal indeholde "${z.includes}"`;if(z.format==="regex")return`Ugyldig streng: skal matche mønsteret ${z.pattern}`;return`Ugyldig ${W[z.format]??Y.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${Y.divisor}`;case"unrecognized_keys":return`${Y.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${b(Y.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${Y.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${Y.origin}`;default:return"Ugyldigt input"}}};function f9(){return{localeError:vO()}}var UO=()=>{let $={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"Zahl";case"object":{if(Array.isArray(J))return"Array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return(J)=>{switch(J.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${J.expected}, erhalten ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Ungültige Eingabe: erwartet ${F(J.values[0])}`;return`Ungültige Option: erwartet eine von ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`Zu groß: erwartet, dass ${J.origin??"Wert"} ${W}${J.maximum.toString()} ${Y.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${J.origin??"Wert"} ${W}${J.maximum.toString()} ist`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`Zu klein: erwartet, dass ${J.origin} ${W}${J.minimum.toString()} ${Y.unit} hat`;return`Zu klein: erwartet, dass ${J.origin} ${W}${J.minimum.toString()} ist`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Ungültiger String: muss mit "${W.prefix}" beginnen`;if(W.format==="ends_with")return`Ungültiger String: muss mit "${W.suffix}" enden`;if(W.format==="includes")return`Ungültiger String: muss "${W.includes}" enthalten`;if(W.format==="regex")return`Ungültiger String: muss dem Muster ${W.pattern} entsprechen`;return`Ungültig: ${X[W.format]??J.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${J.divisor} sein`;case"unrecognized_keys":return`${J.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${b(J.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${J.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${J.origin}`;default:return"Ungültige Eingabe"}}};function y9(){return{localeError:UO()}}var JO=($)=>{let v=typeof $;switch(v){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return v},XO=()=>{let $={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function v(X){return $[X]??null}let U={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(X)=>{switch(X.code){case"invalid_type":return`Invalid input: expected ${X.expected}, received ${JO(X.input)}`;case"invalid_value":if(X.values.length===1)return`Invalid input: expected ${F(X.values[0])}`;return`Invalid option: expected one of ${b(X.values,"|")}`;case"too_big":{let J=X.inclusive?"<=":"<",W=v(X.origin);if(W)return`Too big: expected ${X.origin??"value"} to have ${J}${X.maximum.toString()} ${W.unit??"elements"}`;return`Too big: expected ${X.origin??"value"} to be ${J}${X.maximum.toString()}`}case"too_small":{let J=X.inclusive?">=":">",W=v(X.origin);if(W)return`Too small: expected ${X.origin} to have ${J}${X.minimum.toString()} ${W.unit}`;return`Too small: expected ${X.origin} to be ${J}${X.minimum.toString()}`}case"invalid_format":{let J=X;if(J.format==="starts_with")return`Invalid string: must start with "${J.prefix}"`;if(J.format==="ends_with")return`Invalid string: must end with "${J.suffix}"`;if(J.format==="includes")return`Invalid string: must include "${J.includes}"`;if(J.format==="regex")return`Invalid string: must match pattern ${J.pattern}`;return`Invalid ${U[J.format]??X.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${X.divisor}`;case"unrecognized_keys":return`Unrecognized key${X.keys.length>1?"s":""}: ${b(X.keys,", ")}`;case"invalid_key":return`Invalid key in ${X.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${X.origin}`;default:return"Invalid input"}}};function a1(){return{localeError:XO()}}var WO=($)=>{let v=typeof $;switch(v){case"number":return Number.isNaN($)?"NaN":"nombro";case"object":{if(Array.isArray($))return"tabelo";if($===null)return"senvalora";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return v},YO=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function v(X){return $[X]??null}let U={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return(X)=>{switch(X.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${X.expected}, riceviĝis ${WO(X.input)}`;case"invalid_value":if(X.values.length===1)return`Nevalida enigo: atendiĝis ${F(X.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${b(X.values,"|")}`;case"too_big":{let J=X.inclusive?"<=":"<",W=v(X.origin);if(W)return`Tro granda: atendiĝis ke ${X.origin??"valoro"} havu ${J}${X.maximum.toString()} ${W.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${X.origin??"valoro"} havu ${J}${X.maximum.toString()}`}case"too_small":{let J=X.inclusive?">=":">",W=v(X.origin);if(W)return`Tro malgranda: atendiĝis ke ${X.origin} havu ${J}${X.minimum.toString()} ${W.unit}`;return`Tro malgranda: atendiĝis ke ${X.origin} estu ${J}${X.minimum.toString()}`}case"invalid_format":{let J=X;if(J.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${J.prefix}"`;if(J.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${J.suffix}"`;if(J.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${J.includes}"`;if(J.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${J.pattern}`;return`Nevalida ${U[J.format]??X.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${X.divisor}`;case"unrecognized_keys":return`Nekonata${X.keys.length>1?"j":""} ŝlosilo${X.keys.length>1?"j":""}: ${b(X.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${X.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${X.origin}`;default:return"Nevalida enigo"}}};function u9(){return{localeError:YO()}}var zO=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},v={string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};function U(Y){return $[Y]??null}function X(Y){return v[Y]??Y}let J=(Y)=>{let z=typeof Y;switch(z){case"number":return Number.isNaN(Y)?"NaN":"number";case"object":{if(Array.isArray(Y))return"array";if(Y===null)return"null";if(Object.getPrototypeOf(Y)!==Object.prototype)return Y.constructor.name;return"object"}}return z},W={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(Y)=>{switch(Y.code){case"invalid_type":return`Entrada inválida: se esperaba ${X(Y.expected)}, recibido ${X(J(Y.input))}`;case"invalid_value":if(Y.values.length===1)return`Entrada inválida: se esperaba ${F(Y.values[0])}`;return`Opción inválida: se esperaba una de ${b(Y.values,"|")}`;case"too_big":{let z=Y.inclusive?"<=":"<",G=U(Y.origin),Q=X(Y.origin);if(G)return`Demasiado grande: se esperaba que ${Q??"valor"} tuviera ${z}${Y.maximum.toString()} ${G.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${Q??"valor"} fuera ${z}${Y.maximum.toString()}`}case"too_small":{let z=Y.inclusive?">=":">",G=U(Y.origin),Q=X(Y.origin);if(G)return`Demasiado pequeño: se esperaba que ${Q} tuviera ${z}${Y.minimum.toString()} ${G.unit}`;return`Demasiado pequeño: se esperaba que ${Q} fuera ${z}${Y.minimum.toString()}`}case"invalid_format":{let z=Y;if(z.format==="starts_with")return`Cadena inválida: debe comenzar con "${z.prefix}"`;if(z.format==="ends_with")return`Cadena inválida: debe terminar en "${z.suffix}"`;if(z.format==="includes")return`Cadena inválida: debe incluir "${z.includes}"`;if(z.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${z.pattern}`;return`Inválido ${W[z.format]??Y.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${Y.divisor}`;case"unrecognized_keys":return`Llave${Y.keys.length>1?"s":""} desconocida${Y.keys.length>1?"s":""}: ${b(Y.keys,", ")}`;case"invalid_key":return`Llave inválida en ${X(Y.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${X(Y.origin)}`;default:return"Entrada inválida"}}};function h9(){return{localeError:zO()}}var GO=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"عدد";case"object":{if(Array.isArray(J))return"آرایه";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return(J)=>{switch(J.code){case"invalid_type":return`ورودی نامعتبر: می‌بایست ${J.expected} می‌بود، ${U(J.input)} دریافت شد`;case"invalid_value":if(J.values.length===1)return`ورودی نامعتبر: می‌بایست ${F(J.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${b(J.values,"|")} می‌بود`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`خیلی بزرگ: ${J.origin??"مقدار"} باید ${W}${J.maximum.toString()} ${Y.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${J.origin??"مقدار"} باید ${W}${J.maximum.toString()} باشد`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`خیلی کوچک: ${J.origin} باید ${W}${J.minimum.toString()} ${Y.unit} باشد`;return`خیلی کوچک: ${J.origin} باید ${W}${J.minimum.toString()} باشد`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`رشته نامعتبر: باید با "${W.prefix}" شروع شود`;if(W.format==="ends_with")return`رشته نامعتبر: باید با "${W.suffix}" تمام شود`;if(W.format==="includes")return`رشته نامعتبر: باید شامل "${W.includes}" باشد`;if(W.format==="regex")return`رشته نامعتبر: باید با الگوی ${W.pattern} مطابقت داشته باشد`;return`${X[W.format]??J.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${J.divisor} باشد`;case"unrecognized_keys":return`کلید${J.keys.length>1?"های":""} ناشناس: ${b(J.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${J.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${J.origin}`;default:return"ورودی نامعتبر"}}};function l9(){return{localeError:GO()}}var QO=()=>{let $={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"number";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return(J)=>{switch(J.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${J.expected}, oli ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Virheellinen syöte: täytyy olla ${F(J.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`Liian suuri: ${Y.subject} täytyy olla ${W}${J.maximum.toString()} ${Y.unit}`.trim();return`Liian suuri: arvon täytyy olla ${W}${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`Liian pieni: ${Y.subject} täytyy olla ${W}${J.minimum.toString()} ${Y.unit}`.trim();return`Liian pieni: arvon täytyy olla ${W}${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${W.prefix}"`;if(W.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${W.suffix}"`;if(W.format==="includes")return`Virheellinen syöte: täytyy sisältää "${W.includes}"`;if(W.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${W.pattern}`;return`Virheellinen ${X[W.format]??J.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${J.divisor} monikerta`;case"unrecognized_keys":return`${J.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${b(J.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function m9(){return{localeError:QO()}}var jO=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"nombre";case"object":{if(Array.isArray(J))return"tableau";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(J)=>{switch(J.code){case"invalid_type":return`Entrée invalide : ${J.expected} attendu, ${U(J.input)} reçu`;case"invalid_value":if(J.values.length===1)return`Entrée invalide : ${F(J.values[0])} attendu`;return`Option invalide : une valeur parmi ${b(J.values,"|")} attendue`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`Trop grand : ${J.origin??"valeur"} doit ${Y.verb} ${W}${J.maximum.toString()} ${Y.unit??"élément(s)"}`;return`Trop grand : ${J.origin??"valeur"} doit être ${W}${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`Trop petit : ${J.origin} doit ${Y.verb} ${W}${J.minimum.toString()} ${Y.unit}`;return`Trop petit : ${J.origin} doit être ${W}${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Chaîne invalide : doit commencer par "${W.prefix}"`;if(W.format==="ends_with")return`Chaîne invalide : doit se terminer par "${W.suffix}"`;if(W.format==="includes")return`Chaîne invalide : doit inclure "${W.includes}"`;if(W.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${W.pattern}`;return`${X[W.format]??J.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${J.divisor}`;case"unrecognized_keys":return`Clé${J.keys.length>1?"s":""} non reconnue${J.keys.length>1?"s":""} : ${b(J.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${J.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${J.origin}`;default:return"Entrée invalide"}}};function n9(){return{localeError:jO()}}var wO=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"number";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(J)=>{switch(J.code){case"invalid_type":return`Entrée invalide : attendu ${J.expected}, reçu ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Entrée invalide : attendu ${F(J.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"≤":"<",Y=v(J.origin);if(Y)return`Trop grand : attendu que ${J.origin??"la valeur"} ait ${W}${J.maximum.toString()} ${Y.unit}`;return`Trop grand : attendu que ${J.origin??"la valeur"} soit ${W}${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?"≥":">",Y=v(J.origin);if(Y)return`Trop petit : attendu que ${J.origin} ait ${W}${J.minimum.toString()} ${Y.unit}`;return`Trop petit : attendu que ${J.origin} soit ${W}${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Chaîne invalide : doit commencer par "${W.prefix}"`;if(W.format==="ends_with")return`Chaîne invalide : doit se terminer par "${W.suffix}"`;if(W.format==="includes")return`Chaîne invalide : doit inclure "${W.includes}"`;if(W.format==="regex")return`Chaîne invalide : doit correspondre au motif ${W.pattern}`;return`${X[W.format]??J.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${J.divisor}`;case"unrecognized_keys":return`Clé${J.keys.length>1?"s":""} non reconnue${J.keys.length>1?"s":""} : ${b(J.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${J.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${J.origin}`;default:return"Entrée invalide"}}};function c9(){return{localeError:wO()}}var HO=()=>{let $={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},v={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},U=(Q)=>Q?$[Q]:void 0,X=(Q)=>{let j=U(Q);if(j)return j.label;return Q??$.unknown.label},J=(Q)=>`ה${X(Q)}`,W=(Q)=>{return(U(Q)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},Y=(Q)=>{if(!Q)return null;return v[Q]??null},z=(Q)=>{let j=typeof Q;switch(j){case"number":return Number.isNaN(Q)?"NaN":"number";case"object":{if(Array.isArray(Q))return"array";if(Q===null)return"null";if(Object.getPrototypeOf(Q)!==Object.prototype&&Q.constructor)return Q.constructor.name;return"object"}default:return j}},G={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}};return(Q)=>{switch(Q.code){case"invalid_type":{let j=Q.expected,H=X(j),N=z(Q.input),w=$[N]?.label??N;return`קלט לא תקין: צריך להיות ${H}, התקבל ${w}`}case"invalid_value":{if(Q.values.length===1)return`ערך לא תקין: הערך חייב להיות ${F(Q.values[0])}`;let j=Q.values.map((w)=>F(w));if(Q.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${j[0]} או ${j[1]}`;let H=j[j.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${j.slice(0,-1).join(", ")} או ${H}`}case"too_big":{let j=Y(Q.origin),H=J(Q.origin??"value");if(Q.origin==="string")return`${j?.longLabel??"ארוך"} מדי: ${H} צריכה להכיל ${Q.maximum.toString()} ${j?.unit??""} ${Q.inclusive?"או פחות":"לכל היותר"}`.trim();if(Q.origin==="number"){let I=Q.inclusive?`קטן או שווה ל-${Q.maximum}`:`קטן מ-${Q.maximum}`;return`גדול מדי: ${H} צריך להיות ${I}`}if(Q.origin==="array"||Q.origin==="set"){let I=Q.origin==="set"?"צריכה":"צריך",D=Q.inclusive?`${Q.maximum} ${j?.unit??""} או פחות`:`פחות מ-${Q.maximum} ${j?.unit??""}`;return`גדול מדי: ${H} ${I} להכיל ${D}`.trim()}let N=Q.inclusive?"<=":"<",w=W(Q.origin??"value");if(j?.unit)return`${j.longLabel} מדי: ${H} ${w} ${N}${Q.maximum.toString()} ${j.unit}`;return`${j?.longLabel??"גדול"} מדי: ${H} ${w} ${N}${Q.maximum.toString()}`}case"too_small":{let j=Y(Q.origin),H=J(Q.origin??"value");if(Q.origin==="string")return`${j?.shortLabel??"קצר"} מדי: ${H} צריכה להכיל ${Q.minimum.toString()} ${j?.unit??""} ${Q.inclusive?"או יותר":"לפחות"}`.trim();if(Q.origin==="number"){let I=Q.inclusive?`גדול או שווה ל-${Q.minimum}`:`גדול מ-${Q.minimum}`;return`קטן מדי: ${H} צריך להיות ${I}`}if(Q.origin==="array"||Q.origin==="set"){let I=Q.origin==="set"?"צריכה":"צריך";if(Q.minimum===1&&Q.inclusive){let K=Q.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${H} ${I} להכיל ${K}`}let D=Q.inclusive?`${Q.minimum} ${j?.unit??""} או יותר`:`יותר מ-${Q.minimum} ${j?.unit??""}`;return`קטן מדי: ${H} ${I} להכיל ${D}`.trim()}let N=Q.inclusive?">=":">",w=W(Q.origin??"value");if(j?.unit)return`${j.shortLabel} מדי: ${H} ${w} ${N}${Q.minimum.toString()} ${j.unit}`;return`${j?.shortLabel??"קטן"} מדי: ${H} ${w} ${N}${Q.minimum.toString()}`}case"invalid_format":{let j=Q;if(j.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${j.prefix}"`;if(j.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${j.suffix}"`;if(j.format==="includes")return`המחרוזת חייבת לכלול "${j.includes}"`;if(j.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${j.pattern}`;let H=G[j.format],N=H?.label??j.format,I=(H?.gender??"m")==="f"?"תקינה":"תקין";return`${N} לא ${I}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${Q.divisor}`;case"unrecognized_keys":return`מפתח${Q.keys.length>1?"ות":""} לא מזוה${Q.keys.length>1?"ים":"ה"}: ${b(Q.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${J(Q.origin??"array")}`;default:return"קלט לא תקין"}}};function i9(){return{localeError:HO()}}var NO=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"szám";case"object":{if(Array.isArray(J))return"tömb";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return(J)=>{switch(J.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${J.expected}, a kapott érték ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Érvénytelen bemenet: a várt érték ${F(J.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`Túl nagy: ${J.origin??"érték"} mérete túl nagy ${W}${J.maximum.toString()} ${Y.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${J.origin??"érték"} túl nagy: ${W}${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`Túl kicsi: a bemeneti érték ${J.origin} mérete túl kicsi ${W}${J.minimum.toString()} ${Y.unit}`;return`Túl kicsi: a bemeneti érték ${J.origin} túl kicsi ${W}${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Érvénytelen string: "${W.prefix}" értékkel kell kezdődnie`;if(W.format==="ends_with")return`Érvénytelen string: "${W.suffix}" értékkel kell végződnie`;if(W.format==="includes")return`Érvénytelen string: "${W.includes}" értéket kell tartalmaznia`;if(W.format==="regex")return`Érvénytelen string: ${W.pattern} mintának kell megfelelnie`;return`Érvénytelen ${X[W.format]??J.format}`}case"not_multiple_of":return`Érvénytelen szám: ${J.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${J.keys.length>1?"s":""}: ${b(J.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${J.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${J.origin}`;default:return"Érvénytelen bemenet"}}};function r9(){return{localeError:NO()}}var IO=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"number";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return(J)=>{switch(J.code){case"invalid_type":return`Input tidak valid: diharapkan ${J.expected}, diterima ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Input tidak valid: diharapkan ${F(J.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`Terlalu besar: diharapkan ${J.origin??"value"} memiliki ${W}${J.maximum.toString()} ${Y.unit??"elemen"}`;return`Terlalu besar: diharapkan ${J.origin??"value"} menjadi ${W}${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`Terlalu kecil: diharapkan ${J.origin} memiliki ${W}${J.minimum.toString()} ${Y.unit}`;return`Terlalu kecil: diharapkan ${J.origin} menjadi ${W}${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`String tidak valid: harus dimulai dengan "${W.prefix}"`;if(W.format==="ends_with")return`String tidak valid: harus berakhir dengan "${W.suffix}"`;if(W.format==="includes")return`String tidak valid: harus menyertakan "${W.includes}"`;if(W.format==="regex")return`String tidak valid: harus sesuai pola ${W.pattern}`;return`${X[W.format]??J.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${J.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${J.keys.length>1?"s":""}: ${b(J.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${J.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${J.origin}`;default:return"Input tidak valid"}}};function o9(){return{localeError:IO()}}var OO=($)=>{let v=typeof $;switch(v){case"number":return Number.isNaN($)?"NaN":"númer";case"object":{if(Array.isArray($))return"fylki";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return v},DO=()=>{let $={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function v(X){return $[X]??null}let U={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"};return(X)=>{switch(X.code){case"invalid_type":return`Rangt gildi: Þú slóst inn ${OO(X.input)} þar sem á að vera ${X.expected}`;case"invalid_value":if(X.values.length===1)return`Rangt gildi: gert ráð fyrir ${F(X.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${b(X.values,"|")}`;case"too_big":{let J=X.inclusive?"<=":"<",W=v(X.origin);if(W)return`Of stórt: gert er ráð fyrir að ${X.origin??"gildi"} hafi ${J}${X.maximum.toString()} ${W.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${X.origin??"gildi"} sé ${J}${X.maximum.toString()}`}case"too_small":{let J=X.inclusive?">=":">",W=v(X.origin);if(W)return`Of lítið: gert er ráð fyrir að ${X.origin} hafi ${J}${X.minimum.toString()} ${W.unit}`;return`Of lítið: gert er ráð fyrir að ${X.origin} sé ${J}${X.minimum.toString()}`}case"invalid_format":{let J=X;if(J.format==="starts_with")return`Ógildur strengur: verður að byrja á "${J.prefix}"`;if(J.format==="ends_with")return`Ógildur strengur: verður að enda á "${J.suffix}"`;if(J.format==="includes")return`Ógildur strengur: verður að innihalda "${J.includes}"`;if(J.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${J.pattern}`;return`Rangt ${U[J.format]??X.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${X.divisor}`;case"unrecognized_keys":return`Óþekkt ${X.keys.length>1?"ir lyklar":"ur lykill"}: ${b(X.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${X.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${X.origin}`;default:return"Rangt gildi"}}};function p9(){return{localeError:DO()}}var bO=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"numero";case"object":{if(Array.isArray(J))return"vettore";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return(J)=>{switch(J.code){case"invalid_type":return`Input non valido: atteso ${J.expected}, ricevuto ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Input non valido: atteso ${F(J.values[0])}`;return`Opzione non valida: atteso uno tra ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`Troppo grande: ${J.origin??"valore"} deve avere ${W}${J.maximum.toString()} ${Y.unit??"elementi"}`;return`Troppo grande: ${J.origin??"valore"} deve essere ${W}${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`Troppo piccolo: ${J.origin} deve avere ${W}${J.minimum.toString()} ${Y.unit}`;return`Troppo piccolo: ${J.origin} deve essere ${W}${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Stringa non valida: deve iniziare con "${W.prefix}"`;if(W.format==="ends_with")return`Stringa non valida: deve terminare con "${W.suffix}"`;if(W.format==="includes")return`Stringa non valida: deve includere "${W.includes}"`;if(W.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${W.pattern}`;return`Invalid ${X[W.format]??J.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${J.divisor}`;case"unrecognized_keys":return`Chiav${J.keys.length>1?"i":"e"} non riconosciut${J.keys.length>1?"e":"a"}: ${b(J.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${J.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${J.origin}`;default:return"Input non valido"}}};function d9(){return{localeError:bO()}}var VO=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"数値";case"object":{if(Array.isArray(J))return"配列";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return(J)=>{switch(J.code){case"invalid_type":return`無効な入力: ${J.expected}が期待されましたが、${U(J.input)}が入力されました`;case"invalid_value":if(J.values.length===1)return`無効な入力: ${F(J.values[0])}が期待されました`;return`無効な選択: ${b(J.values,"、")}のいずれかである必要があります`;case"too_big":{let W=J.inclusive?"以下である":"より小さい",Y=v(J.origin);if(Y)return`大きすぎる値: ${J.origin??"値"}は${J.maximum.toString()}${Y.unit??"要素"}${W}必要があります`;return`大きすぎる値: ${J.origin??"値"}は${J.maximum.toString()}${W}必要があります`}case"too_small":{let W=J.inclusive?"以上である":"より大きい",Y=v(J.origin);if(Y)return`小さすぎる値: ${J.origin}は${J.minimum.toString()}${Y.unit}${W}必要があります`;return`小さすぎる値: ${J.origin}は${J.minimum.toString()}${W}必要があります`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`無効な文字列: "${W.prefix}"で始まる必要があります`;if(W.format==="ends_with")return`無効な文字列: "${W.suffix}"で終わる必要があります`;if(W.format==="includes")return`無効な文字列: "${W.includes}"を含む必要があります`;if(W.format==="regex")return`無効な文字列: パターン${W.pattern}に一致する必要があります`;return`無効な${X[W.format]??J.format}`}case"not_multiple_of":return`無効な数値: ${J.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${J.keys.length>1?"群":""}: ${b(J.keys,"、")}`;case"invalid_key":return`${J.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${J.origin}内の無効な値`;default:return"無効な入力"}}};function t9(){return{localeError:VO()}}var KO=($)=>{let v=typeof $;switch(v){case"number":return Number.isNaN($)?"NaN":"რიცხვი";case"object":{if(Array.isArray($))return"მასივი";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return{string:"სტრინგი",boolean:"ბულეანი",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"ფუნქცია"}[v]??v},BO=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function v(X){return $[X]??null}let U={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"};return(X)=>{switch(X.code){case"invalid_type":return`არასწორი შეყვანა: მოსალოდნელი ${X.expected}, მიღებული ${KO(X.input)}`;case"invalid_value":if(X.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${F(X.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${b(X.values,"|")}-დან`;case"too_big":{let J=X.inclusive?"<=":"<",W=v(X.origin);if(W)return`ზედმეტად დიდი: მოსალოდნელი ${X.origin??"მნიშვნელობა"} ${W.verb} ${J}${X.maximum.toString()} ${W.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${X.origin??"მნიშვნელობა"} იყოს ${J}${X.maximum.toString()}`}case"too_small":{let J=X.inclusive?">=":">",W=v(X.origin);if(W)return`ზედმეტად პატარა: მოსალოდნელი ${X.origin} ${W.verb} ${J}${X.minimum.toString()} ${W.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${X.origin} იყოს ${J}${X.minimum.toString()}`}case"invalid_format":{let J=X;if(J.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${J.prefix}"-ით`;if(J.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${J.suffix}"-ით`;if(J.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${J.includes}"-ს`;if(J.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${J.pattern}`;return`არასწორი ${U[J.format]??X.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${X.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${X.keys.length>1?"ები":"ი"}: ${b(X.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${X.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${X.origin}-ში`;default:return"არასწორი შეყვანა"}}};function a9(){return{localeError:BO()}}var AO=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(J))return"អារេ (Array)";if(J===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return(J)=>{switch(J.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${J.expected} ប៉ុន្តែទទួលបាន ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${F(J.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`ធំពេក៖ ត្រូវការ ${J.origin??"តម្លៃ"} ${W} ${J.maximum.toString()} ${Y.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${J.origin??"តម្លៃ"} ${W} ${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`តូចពេក៖ ត្រូវការ ${J.origin} ${W} ${J.minimum.toString()} ${Y.unit}`;return`តូចពេក៖ ត្រូវការ ${J.origin} ${W} ${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${W.prefix}"`;if(W.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${W.suffix}"`;if(W.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${W.includes}"`;if(W.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${W.pattern}`;return`មិនត្រឹមត្រូវ៖ ${X[W.format]??J.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${J.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${b(J.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${J.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${J.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function e1(){return{localeError:AO()}}function e9(){return e1()}var SO=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"number";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return(J)=>{switch(J.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${J.expected}, 받은 타입은 ${U(J.input)}입니다`;case"invalid_value":if(J.values.length===1)return`잘못된 입력: 값은 ${F(J.values[0])} 이어야 합니다`;return`잘못된 옵션: ${b(J.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let W=J.inclusive?"이하":"미만",Y=W==="미만"?"이어야 합니다":"여야 합니다",z=v(J.origin),G=z?.unit??"요소";if(z)return`${J.origin??"값"}이 너무 큽니다: ${J.maximum.toString()}${G} ${W}${Y}`;return`${J.origin??"값"}이 너무 큽니다: ${J.maximum.toString()} ${W}${Y}`}case"too_small":{let W=J.inclusive?"이상":"초과",Y=W==="이상"?"이어야 합니다":"여야 합니다",z=v(J.origin),G=z?.unit??"요소";if(z)return`${J.origin??"값"}이 너무 작습니다: ${J.minimum.toString()}${G} ${W}${Y}`;return`${J.origin??"값"}이 너무 작습니다: ${J.minimum.toString()} ${W}${Y}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`잘못된 문자열: "${W.prefix}"(으)로 시작해야 합니다`;if(W.format==="ends_with")return`잘못된 문자열: "${W.suffix}"(으)로 끝나야 합니다`;if(W.format==="includes")return`잘못된 문자열: "${W.includes}"을(를) 포함해야 합니다`;if(W.format==="regex")return`잘못된 문자열: 정규식 ${W.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${X[W.format]??J.format}`}case"not_multiple_of":return`잘못된 숫자: ${J.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${b(J.keys,", ")}`;case"invalid_key":return`잘못된 키: ${J.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${J.origin}`;default:return"잘못된 입력"}}};function s9(){return{localeError:SO()}}var qO=($)=>{return $v(typeof $,$)},$v=($,v=void 0)=>{switch($){case"number":return Number.isNaN(v)?"NaN":"skaičius";case"bigint":return"sveikasis skaičius";case"string":return"eilutė";case"boolean":return"loginė reikšmė";case"undefined":case"void":return"neapibrėžta reikšmė";case"function":return"funkcija";case"symbol":return"simbolis";case"object":{if(v===void 0)return"nežinomas objektas";if(v===null)return"nulinė reikšmė";if(Array.isArray(v))return"masyvas";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name;return"objektas"}case"null":return"nulinė reikšmė"}return $},s1=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function $Q($){let v=Math.abs($),U=v%10,X=v%100;if(X>=11&&X<=19||U===0)return"many";if(U===1)return"one";return"few"}var LO=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function v(X,J,W,Y){let z=$[X]??null;if(z===null)return z;return{unit:z.unit[J],verb:z.verb[Y][W?"inclusive":"notInclusive"]}}let U={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"};return(X)=>{switch(X.code){case"invalid_type":return`Gautas tipas ${qO(X.input)}, o tikėtasi - ${$v(X.expected)}`;case"invalid_value":if(X.values.length===1)return`Privalo būti ${F(X.values[0])}`;return`Privalo būti vienas iš ${b(X.values,"|")} pasirinkimų`;case"too_big":{let J=$v(X.origin),W=v(X.origin,$Q(Number(X.maximum)),X.inclusive??!1,"smaller");if(W?.verb)return`${s1(J??X.origin??"reikšmė")} ${W.verb} ${X.maximum.toString()} ${W.unit??"elementų"}`;let Y=X.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${s1(J??X.origin??"reikšmė")} turi būti ${Y} ${X.maximum.toString()} ${W?.unit}`}case"too_small":{let J=$v(X.origin),W=v(X.origin,$Q(Number(X.minimum)),X.inclusive??!1,"bigger");if(W?.verb)return`${s1(J??X.origin??"reikšmė")} ${W.verb} ${X.minimum.toString()} ${W.unit??"elementų"}`;let Y=X.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${s1(J??X.origin??"reikšmė")} turi būti ${Y} ${X.minimum.toString()} ${W?.unit}`}case"invalid_format":{let J=X;if(J.format==="starts_with")return`Eilutė privalo prasidėti "${J.prefix}"`;if(J.format==="ends_with")return`Eilutė privalo pasibaigti "${J.suffix}"`;if(J.format==="includes")return`Eilutė privalo įtraukti "${J.includes}"`;if(J.format==="regex")return`Eilutė privalo atitikti ${J.pattern}`;return`Neteisingas ${U[J.format]??X.format}`}case"not_multiple_of":return`Skaičius privalo būti ${X.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${X.keys.length>1?"i":"as"} rakt${X.keys.length>1?"ai":"as"}: ${b(X.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let J=$v(X.origin);return`${s1(J??X.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function $8(){return{localeError:LO()}}var FO=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"број";case"object":{if(Array.isArray(J))return"низа";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return(J)=>{switch(J.code){case"invalid_type":return`Грешен внес: се очекува ${J.expected}, примено ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Invalid input: expected ${F(J.values[0])}`;return`Грешана опција: се очекува една ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`Премногу голем: се очекува ${J.origin??"вредноста"} да има ${W}${J.maximum.toString()} ${Y.unit??"елементи"}`;return`Премногу голем: се очекува ${J.origin??"вредноста"} да биде ${W}${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`Премногу мал: се очекува ${J.origin} да има ${W}${J.minimum.toString()} ${Y.unit}`;return`Премногу мал: се очекува ${J.origin} да биде ${W}${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Неважечка низа: мора да започнува со "${W.prefix}"`;if(W.format==="ends_with")return`Неважечка низа: мора да завршува со "${W.suffix}"`;if(W.format==="includes")return`Неважечка низа: мора да вклучува "${W.includes}"`;if(W.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${W.pattern}`;return`Invalid ${X[W.format]??J.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${J.divisor}`;case"unrecognized_keys":return`${J.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${b(J.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${J.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${J.origin}`;default:return"Грешен внес"}}};function v8(){return{localeError:FO()}}var EO=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"nombor";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return(J)=>{switch(J.code){case"invalid_type":return`Input tidak sah: dijangka ${J.expected}, diterima ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Input tidak sah: dijangka ${F(J.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`Terlalu besar: dijangka ${J.origin??"nilai"} ${Y.verb} ${W}${J.maximum.toString()} ${Y.unit??"elemen"}`;return`Terlalu besar: dijangka ${J.origin??"nilai"} adalah ${W}${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`Terlalu kecil: dijangka ${J.origin} ${Y.verb} ${W}${J.minimum.toString()} ${Y.unit}`;return`Terlalu kecil: dijangka ${J.origin} adalah ${W}${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`String tidak sah: mesti bermula dengan "${W.prefix}"`;if(W.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${W.suffix}"`;if(W.format==="includes")return`String tidak sah: mesti mengandungi "${W.includes}"`;if(W.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${W.pattern}`;return`${X[W.format]??J.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${J.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${b(J.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${J.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${J.origin}`;default:return"Input tidak sah"}}};function U8(){return{localeError:EO()}}var MO=()=>{let $={string:{unit:"tekens",verb:"te hebben"},file:{unit:"bytes",verb:"te hebben"},array:{unit:"elementen",verb:"te hebben"},set:{unit:"elementen",verb:"te hebben"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"getal";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return(J)=>{switch(J.code){case"invalid_type":return`Ongeldige invoer: verwacht ${J.expected}, ontving ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Ongeldige invoer: verwacht ${F(J.values[0])}`;return`Ongeldige optie: verwacht één van ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`Te groot: verwacht dat ${J.origin??"waarde"} ${Y.verb} ${W}${J.maximum.toString()} ${Y.unit??"elementen"}`;return`Te groot: verwacht dat ${J.origin??"waarde"} ${W}${J.maximum.toString()} is`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`Te klein: verwacht dat ${J.origin} ${Y.verb} ${W}${J.minimum.toString()} ${Y.unit}`;return`Te klein: verwacht dat ${J.origin} ${W}${J.minimum.toString()} is`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Ongeldige tekst: moet met "${W.prefix}" beginnen`;if(W.format==="ends_with")return`Ongeldige tekst: moet op "${W.suffix}" eindigen`;if(W.format==="includes")return`Ongeldige tekst: moet "${W.includes}" bevatten`;if(W.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${W.pattern}`;return`Ongeldig: ${X[W.format]??J.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${J.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${J.keys.length>1?"s":""}: ${b(J.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${J.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${J.origin}`;default:return"Ongeldige invoer"}}};function J8(){return{localeError:MO()}}var PO=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"tall";case"object":{if(Array.isArray(J))return"liste";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(J)=>{switch(J.code){case"invalid_type":return`Ugyldig input: forventet ${J.expected}, fikk ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Ugyldig verdi: forventet ${F(J.values[0])}`;return`Ugyldig valg: forventet en av ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`For stor(t): forventet ${J.origin??"value"} til å ha ${W}${J.maximum.toString()} ${Y.unit??"elementer"}`;return`For stor(t): forventet ${J.origin??"value"} til å ha ${W}${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`For lite(n): forventet ${J.origin} til å ha ${W}${J.minimum.toString()} ${Y.unit}`;return`For lite(n): forventet ${J.origin} til å ha ${W}${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Ugyldig streng: må starte med "${W.prefix}"`;if(W.format==="ends_with")return`Ugyldig streng: må ende med "${W.suffix}"`;if(W.format==="includes")return`Ugyldig streng: må inneholde "${W.includes}"`;if(W.format==="regex")return`Ugyldig streng: må matche mønsteret ${W.pattern}`;return`Ugyldig ${X[W.format]??J.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${J.divisor}`;case"unrecognized_keys":return`${J.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${b(J.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${J.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${J.origin}`;default:return"Ugyldig input"}}};function X8(){return{localeError:PO()}}var RO=()=>{let $={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"numara";case"object":{if(Array.isArray(J))return"saf";if(J===null)return"gayb";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return(J)=>{switch(J.code){case"invalid_type":return`Fâsit giren: umulan ${J.expected}, alınan ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Fâsit giren: umulan ${F(J.values[0])}`;return`Fâsit tercih: mûteberler ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`Fazla büyük: ${J.origin??"value"}, ${W}${J.maximum.toString()} ${Y.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${J.origin??"value"}, ${W}${J.maximum.toString()} olmalıydı.`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`Fazla küçük: ${J.origin}, ${W}${J.minimum.toString()} ${Y.unit} sahip olmalıydı.`;return`Fazla küçük: ${J.origin}, ${W}${J.minimum.toString()} olmalıydı.`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Fâsit metin: "${W.prefix}" ile başlamalı.`;if(W.format==="ends_with")return`Fâsit metin: "${W.suffix}" ile bitmeli.`;if(W.format==="includes")return`Fâsit metin: "${W.includes}" ihtivâ etmeli.`;if(W.format==="regex")return`Fâsit metin: ${W.pattern} nakşına uymalı.`;return`Fâsit ${X[W.format]??J.format}`}case"not_multiple_of":return`Fâsit sayı: ${J.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${J.keys.length>1?"s":""}: ${b(J.keys,", ")}`;case"invalid_key":return`${J.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${J.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function W8(){return{localeError:RO()}}var kO=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"عدد";case"object":{if(Array.isArray(J))return"ارې";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return(J)=>{switch(J.code){case"invalid_type":return`ناسم ورودي: باید ${J.expected} وای, مګر ${U(J.input)} ترلاسه شو`;case"invalid_value":if(J.values.length===1)return`ناسم ورودي: باید ${F(J.values[0])} وای`;return`ناسم انتخاب: باید یو له ${b(J.values,"|")} څخه وای`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`ډیر لوی: ${J.origin??"ارزښت"} باید ${W}${J.maximum.toString()} ${Y.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${J.origin??"ارزښت"} باید ${W}${J.maximum.toString()} وي`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`ډیر کوچنی: ${J.origin} باید ${W}${J.minimum.toString()} ${Y.unit} ولري`;return`ډیر کوچنی: ${J.origin} باید ${W}${J.minimum.toString()} وي`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`ناسم متن: باید د "${W.prefix}" سره پیل شي`;if(W.format==="ends_with")return`ناسم متن: باید د "${W.suffix}" سره پای ته ورسيږي`;if(W.format==="includes")return`ناسم متن: باید "${W.includes}" ولري`;if(W.format==="regex")return`ناسم متن: باید د ${W.pattern} سره مطابقت ولري`;return`${X[W.format]??J.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${J.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${J.keys.length>1?"کلیډونه":"کلیډ"}: ${b(J.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${J.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${J.origin} کې`;default:return"ناسمه ورودي"}}};function Y8(){return{localeError:kO()}}var CO=()=>{let $={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"liczba";case"object":{if(Array.isArray(J))return"tablica";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return(J)=>{switch(J.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${J.expected}, otrzymano ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${F(J.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`Za duża wartość: oczekiwano, że ${J.origin??"wartość"} będzie mieć ${W}${J.maximum.toString()} ${Y.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${J.origin??"wartość"} będzie wynosić ${W}${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`Za mała wartość: oczekiwano, że ${J.origin??"wartość"} będzie mieć ${W}${J.minimum.toString()} ${Y.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${J.origin??"wartość"} będzie wynosić ${W}${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${W.prefix}"`;if(W.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${W.suffix}"`;if(W.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${W.includes}"`;if(W.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${W.pattern}`;return`Nieprawidłow(y/a/e) ${X[W.format]??J.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${J.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${J.keys.length>1?"s":""}: ${b(J.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${J.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${J.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function z8(){return{localeError:CO()}}var _O=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"número";case"object":{if(Array.isArray(J))return"array";if(J===null)return"nulo";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(J)=>{switch(J.code){case"invalid_type":return`Tipo inválido: esperado ${J.expected}, recebido ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Entrada inválida: esperado ${F(J.values[0])}`;return`Opção inválida: esperada uma das ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`Muito grande: esperado que ${J.origin??"valor"} tivesse ${W}${J.maximum.toString()} ${Y.unit??"elementos"}`;return`Muito grande: esperado que ${J.origin??"valor"} fosse ${W}${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`Muito pequeno: esperado que ${J.origin} tivesse ${W}${J.minimum.toString()} ${Y.unit}`;return`Muito pequeno: esperado que ${J.origin} fosse ${W}${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Texto inválido: deve começar com "${W.prefix}"`;if(W.format==="ends_with")return`Texto inválido: deve terminar com "${W.suffix}"`;if(W.format==="includes")return`Texto inválido: deve incluir "${W.includes}"`;if(W.format==="regex")return`Texto inválido: deve corresponder ao padrão ${W.pattern}`;return`${X[W.format]??J.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${J.divisor}`;case"unrecognized_keys":return`Chave${J.keys.length>1?"s":""} desconhecida${J.keys.length>1?"s":""}: ${b(J.keys,", ")}`;case"invalid_key":return`Chave inválida em ${J.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${J.origin}`;default:return"Campo inválido"}}};function G8(){return{localeError:_O()}}function vQ($,v,U,X){let J=Math.abs($),W=J%10,Y=J%100;if(Y>=11&&Y<=19)return X;if(W===1)return v;if(W>=2&&W<=4)return U;return X}var ZO=()=>{let $={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"число";case"object":{if(Array.isArray(J))return"массив";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return(J)=>{switch(J.code){case"invalid_type":return`Неверный ввод: ожидалось ${J.expected}, получено ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Неверный ввод: ожидалось ${F(J.values[0])}`;return`Неверный вариант: ожидалось одно из ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y){let z=Number(J.maximum),G=vQ(z,Y.unit.one,Y.unit.few,Y.unit.many);return`Слишком большое значение: ожидалось, что ${J.origin??"значение"} будет иметь ${W}${J.maximum.toString()} ${G}`}return`Слишком большое значение: ожидалось, что ${J.origin??"значение"} будет ${W}${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y){let z=Number(J.minimum),G=vQ(z,Y.unit.one,Y.unit.few,Y.unit.many);return`Слишком маленькое значение: ожидалось, что ${J.origin} будет иметь ${W}${J.minimum.toString()} ${G}`}return`Слишком маленькое значение: ожидалось, что ${J.origin} будет ${W}${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Неверная строка: должна начинаться с "${W.prefix}"`;if(W.format==="ends_with")return`Неверная строка: должна заканчиваться на "${W.suffix}"`;if(W.format==="includes")return`Неверная строка: должна содержать "${W.includes}"`;if(W.format==="regex")return`Неверная строка: должна соответствовать шаблону ${W.pattern}`;return`Неверный ${X[W.format]??J.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${J.divisor}`;case"unrecognized_keys":return`Нераспознанн${J.keys.length>1?"ые":"ый"} ключ${J.keys.length>1?"и":""}: ${b(J.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${J.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${J.origin}`;default:return"Неверные входные данные"}}};function Q8(){return{localeError:ZO()}}var TO=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"število";case"object":{if(Array.isArray(J))return"tabela";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"};return(J)=>{switch(J.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${J.expected}, prejeto ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Neveljaven vnos: pričakovano ${F(J.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`Preveliko: pričakovano, da bo ${J.origin??"vrednost"} imelo ${W}${J.maximum.toString()} ${Y.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${J.origin??"vrednost"} ${W}${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`Premajhno: pričakovano, da bo ${J.origin} imelo ${W}${J.minimum.toString()} ${Y.unit}`;return`Premajhno: pričakovano, da bo ${J.origin} ${W}${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Neveljaven niz: mora se začeti z "${W.prefix}"`;if(W.format==="ends_with")return`Neveljaven niz: mora se končati z "${W.suffix}"`;if(W.format==="includes")return`Neveljaven niz: mora vsebovati "${W.includes}"`;if(W.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${W.pattern}`;return`Neveljaven ${X[W.format]??J.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${J.divisor}`;case"unrecognized_keys":return`Neprepoznan${J.keys.length>1?"i ključi":" ključ"}: ${b(J.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${J.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${J.origin}`;default:return"Neveljaven vnos"}}};function j8(){return{localeError:TO()}}var xO=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"antal";case"object":{if(Array.isArray(J))return"lista";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return(J)=>{switch(J.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${J.expected}, fick ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Ogiltig inmatning: förväntat ${F(J.values[0])}`;return`Ogiltigt val: förväntade en av ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`För stor(t): förväntade ${J.origin??"värdet"} att ha ${W}${J.maximum.toString()} ${Y.unit??"element"}`;return`För stor(t): förväntat ${J.origin??"värdet"} att ha ${W}${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`För lite(t): förväntade ${J.origin??"värdet"} att ha ${W}${J.minimum.toString()} ${Y.unit}`;return`För lite(t): förväntade ${J.origin??"värdet"} att ha ${W}${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Ogiltig sträng: måste börja med "${W.prefix}"`;if(W.format==="ends_with")return`Ogiltig sträng: måste sluta med "${W.suffix}"`;if(W.format==="includes")return`Ogiltig sträng: måste innehålla "${W.includes}"`;if(W.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${W.pattern}"`;return`Ogiltig(t) ${X[W.format]??J.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${J.divisor}`;case"unrecognized_keys":return`${J.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${b(J.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${J.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${J.origin??"värdet"}`;default:return"Ogiltig input"}}};function w8(){return{localeError:xO()}}var gO=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(J))return"அணி";if(J===null)return"வெறுமை";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return(J)=>{switch(J.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${J.expected}, பெறப்பட்டது ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${F(J.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${b(J.values,"|")} இல் ஒன்று`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${J.origin??"மதிப்பு"} ${W}${J.maximum.toString()} ${Y.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${J.origin??"மதிப்பு"} ${W}${J.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${J.origin} ${W}${J.minimum.toString()} ${Y.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${J.origin} ${W}${J.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`தவறான சரம்: "${W.prefix}" இல் தொடங்க வேண்டும்`;if(W.format==="ends_with")return`தவறான சரம்: "${W.suffix}" இல் முடிவடைய வேண்டும்`;if(W.format==="includes")return`தவறான சரம்: "${W.includes}" ஐ உள்ளடக்க வேண்டும்`;if(W.format==="regex")return`தவறான சரம்: ${W.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${X[W.format]??J.format}`}case"not_multiple_of":return`தவறான எண்: ${J.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${J.keys.length>1?"கள்":""}: ${b(J.keys,", ")}`;case"invalid_key":return`${J.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${J.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function H8(){return{localeError:gO()}}var fO=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(J))return"อาร์เรย์ (Array)";if(J===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return(J)=>{switch(J.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${J.expected} แต่ได้รับ ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${F(J.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"ไม่เกิน":"น้อยกว่า",Y=v(J.origin);if(Y)return`เกินกำหนด: ${J.origin??"ค่า"} ควรมี${W} ${J.maximum.toString()} ${Y.unit??"รายการ"}`;return`เกินกำหนด: ${J.origin??"ค่า"} ควรมี${W} ${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?"อย่างน้อย":"มากกว่า",Y=v(J.origin);if(Y)return`น้อยกว่ากำหนด: ${J.origin} ควรมี${W} ${J.minimum.toString()} ${Y.unit}`;return`น้อยกว่ากำหนด: ${J.origin} ควรมี${W} ${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${W.prefix}"`;if(W.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${W.suffix}"`;if(W.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${W.includes}" อยู่ในข้อความ`;if(W.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${W.pattern}`;return`รูปแบบไม่ถูกต้อง: ${X[W.format]??J.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${J.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${b(J.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${J.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${J.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function N8(){return{localeError:fO()}}var yO=($)=>{let v=typeof $;switch(v){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return v},uO=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function v(X){return $[X]??null}let U={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return(X)=>{switch(X.code){case"invalid_type":return`Geçersiz değer: beklenen ${X.expected}, alınan ${yO(X.input)}`;case"invalid_value":if(X.values.length===1)return`Geçersiz değer: beklenen ${F(X.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${b(X.values,"|")}`;case"too_big":{let J=X.inclusive?"<=":"<",W=v(X.origin);if(W)return`Çok büyük: beklenen ${X.origin??"değer"} ${J}${X.maximum.toString()} ${W.unit??"öğe"}`;return`Çok büyük: beklenen ${X.origin??"değer"} ${J}${X.maximum.toString()}`}case"too_small":{let J=X.inclusive?">=":">",W=v(X.origin);if(W)return`Çok küçük: beklenen ${X.origin} ${J}${X.minimum.toString()} ${W.unit}`;return`Çok küçük: beklenen ${X.origin} ${J}${X.minimum.toString()}`}case"invalid_format":{let J=X;if(J.format==="starts_with")return`Geçersiz metin: "${J.prefix}" ile başlamalı`;if(J.format==="ends_with")return`Geçersiz metin: "${J.suffix}" ile bitmeli`;if(J.format==="includes")return`Geçersiz metin: "${J.includes}" içermeli`;if(J.format==="regex")return`Geçersiz metin: ${J.pattern} desenine uymalı`;return`Geçersiz ${U[J.format]??X.format}`}case"not_multiple_of":return`Geçersiz sayı: ${X.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${X.keys.length>1?"lar":""}: ${b(X.keys,", ")}`;case"invalid_key":return`${X.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${X.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function I8(){return{localeError:uO()}}var hO=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"число";case"object":{if(Array.isArray(J))return"масив";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return(J)=>{switch(J.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${J.expected}, отримано ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Неправильні вхідні дані: очікується ${F(J.values[0])}`;return`Неправильна опція: очікується одне з ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`Занадто велике: очікується, що ${J.origin??"значення"} ${Y.verb} ${W}${J.maximum.toString()} ${Y.unit??"елементів"}`;return`Занадто велике: очікується, що ${J.origin??"значення"} буде ${W}${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`Занадто мале: очікується, що ${J.origin} ${Y.verb} ${W}${J.minimum.toString()} ${Y.unit}`;return`Занадто мале: очікується, що ${J.origin} буде ${W}${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Неправильний рядок: повинен починатися з "${W.prefix}"`;if(W.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${W.suffix}"`;if(W.format==="includes")return`Неправильний рядок: повинен містити "${W.includes}"`;if(W.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${W.pattern}`;return`Неправильний ${X[W.format]??J.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${J.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${J.keys.length>1?"і":""}: ${b(J.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${J.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${J.origin}`;default:return"Неправильні вхідні дані"}}};function vv(){return{localeError:hO()}}function O8(){return vv()}var lO=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"نمبر";case"object":{if(Array.isArray(J))return"آرے";if(J===null)return"نل";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return(J)=>{switch(J.code){case"invalid_type":return`غلط ان پٹ: ${J.expected} متوقع تھا، ${U(J.input)} موصول ہوا`;case"invalid_value":if(J.values.length===1)return`غلط ان پٹ: ${F(J.values[0])} متوقع تھا`;return`غلط آپشن: ${b(J.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`بہت بڑا: ${J.origin??"ویلیو"} کے ${W}${J.maximum.toString()} ${Y.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${J.origin??"ویلیو"} کا ${W}${J.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`بہت چھوٹا: ${J.origin} کے ${W}${J.minimum.toString()} ${Y.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${J.origin} کا ${W}${J.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`غلط سٹرنگ: "${W.prefix}" سے شروع ہونا چاہیے`;if(W.format==="ends_with")return`غلط سٹرنگ: "${W.suffix}" پر ختم ہونا چاہیے`;if(W.format==="includes")return`غلط سٹرنگ: "${W.includes}" شامل ہونا چاہیے`;if(W.format==="regex")return`غلط سٹرنگ: پیٹرن ${W.pattern} سے میچ ہونا چاہیے`;return`غلط ${X[W.format]??J.format}`}case"not_multiple_of":return`غلط نمبر: ${J.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${J.keys.length>1?"ز":""}: ${b(J.keys,"، ")}`;case"invalid_key":return`${J.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${J.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function D8(){return{localeError:lO()}}var mO=()=>{let $={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"số";case"object":{if(Array.isArray(J))return"mảng";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return(J)=>{switch(J.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${J.expected}, nhận được ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${F(J.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`Quá lớn: mong đợi ${J.origin??"giá trị"} ${Y.verb} ${W}${J.maximum.toString()} ${Y.unit??"phần tử"}`;return`Quá lớn: mong đợi ${J.origin??"giá trị"} ${W}${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`Quá nhỏ: mong đợi ${J.origin} ${Y.verb} ${W}${J.minimum.toString()} ${Y.unit}`;return`Quá nhỏ: mong đợi ${J.origin} ${W}${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${W.prefix}"`;if(W.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${W.suffix}"`;if(W.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${W.includes}"`;if(W.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${W.pattern}`;return`${X[W.format]??J.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${J.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${b(J.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${J.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${J.origin}`;default:return"Đầu vào không hợp lệ"}}};function b8(){return{localeError:mO()}}var nO=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(J))return"数组";if(J===null)return"空值(null)";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return(J)=>{switch(J.code){case"invalid_type":return`无效输入:期望 ${J.expected},实际接收 ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`无效输入:期望 ${F(J.values[0])}`;return`无效选项:期望以下之一 ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`数值过大:期望 ${J.origin??"值"} ${W}${J.maximum.toString()} ${Y.unit??"个元素"}`;return`数值过大:期望 ${J.origin??"值"} ${W}${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`数值过小:期望 ${J.origin} ${W}${J.minimum.toString()} ${Y.unit}`;return`数值过小:期望 ${J.origin} ${W}${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`无效字符串:必须以 "${W.prefix}" 开头`;if(W.format==="ends_with")return`无效字符串:必须以 "${W.suffix}" 结尾`;if(W.format==="includes")return`无效字符串:必须包含 "${W.includes}"`;if(W.format==="regex")return`无效字符串:必须满足正则表达式 ${W.pattern}`;return`无效${X[W.format]??J.format}`}case"not_multiple_of":return`无效数字:必须是 ${J.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${b(J.keys,", ")}`;case"invalid_key":return`${J.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${J.origin} 中包含无效值(value)`;default:return"无效输入"}}};function V8(){return{localeError:nO()}}var cO=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"number";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return(J)=>{switch(J.code){case"invalid_type":return`無效的輸入值:預期為 ${J.expected},但收到 ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`無效的輸入值:預期為 ${F(J.values[0])}`;return`無效的選項:預期為以下其中之一 ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`數值過大:預期 ${J.origin??"值"} 應為 ${W}${J.maximum.toString()} ${Y.unit??"個元素"}`;return`數值過大:預期 ${J.origin??"值"} 應為 ${W}${J.maximum.toString()}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`數值過小:預期 ${J.origin} 應為 ${W}${J.minimum.toString()} ${Y.unit}`;return`數值過小:預期 ${J.origin} 應為 ${W}${J.minimum.toString()}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`無效的字串:必須以 "${W.prefix}" 開頭`;if(W.format==="ends_with")return`無效的字串:必須以 "${W.suffix}" 結尾`;if(W.format==="includes")return`無效的字串:必須包含 "${W.includes}"`;if(W.format==="regex")return`無效的字串:必須符合格式 ${W.pattern}`;return`無效的 ${X[W.format]??J.format}`}case"not_multiple_of":return`無效的數字:必須為 ${J.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${J.keys.length>1?"們":""}:${b(J.keys,"、")}`;case"invalid_key":return`${J.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${J.origin} 中有無效的值`;default:return"無效的輸入值"}}};function K8(){return{localeError:cO()}}var iO=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function v(J){return $[J]??null}let U=(J)=>{let W=typeof J;switch(W){case"number":return Number.isNaN(J)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(J))return"akopọ";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return W},X={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"};return(J)=>{switch(J.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${J.expected}, àmọ̀ a rí ${U(J.input)}`;case"invalid_value":if(J.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${F(J.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${b(J.values,"|")}`;case"too_big":{let W=J.inclusive?"<=":"<",Y=v(J.origin);if(Y)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${J.origin??"iye"} ${Y.verb} ${W}${J.maximum} ${Y.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${W}${J.maximum}`}case"too_small":{let W=J.inclusive?">=":">",Y=v(J.origin);if(Y)return`Kéré ju: a ní láti jẹ́ pé ${J.origin} ${Y.verb} ${W}${J.minimum} ${Y.unit}`;return`Kéré ju: a ní láti jẹ́ ${W}${J.minimum}`}case"invalid_format":{let W=J;if(W.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${W.prefix}"`;if(W.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${W.suffix}"`;if(W.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${W.includes}"`;if(W.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${W.pattern}`;return`Aṣìṣe: ${X[W.format]??J.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${J.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${b(J.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${J.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${J.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function B8(){return{localeError:iO()}}var UQ,WJ=Symbol("ZodOutput"),YJ=Symbol("ZodInput");class Uv{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...v){let U=v[0];if(this._map.set($,U),U&&typeof U==="object"&&"id"in U){if(this._idmap.has(U.id))throw Error(`ID ${U.id} already exists in the registry`);this._idmap.set(U.id,$)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let v=this._map.get($);if(v&&typeof v==="object"&&"id"in v)this._idmap.delete(v.id);return this._map.delete($),this}get($){let v=$._zod.parent;if(v){let U={...this.get(v)??{}};delete U.id;let X={...U,...this._map.get($)};return Object.keys(X).length?X:void 0}return this._map.get($)}has($){return this._map.has($)}}function Jv(){return new Uv}(UQ=globalThis).__zod_globalRegistry??(UQ.__zod_globalRegistry=Jv());var P$=globalThis.__zod_globalRegistry;function zJ($,v){return new $({type:"string",...E(v)})}function A8($,v){return new $({type:"string",coerce:!0,...E(v)})}function Xv($,v){return new $({type:"string",format:"email",check:"string_format",abort:!1,...E(v)})}function s4($,v){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...E(v)})}function Wv($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...E(v)})}function Yv($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(v)})}function zv($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(v)})}function Gv($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(v)})}function $1($,v){return new $({type:"string",format:"url",check:"string_format",abort:!1,...E(v)})}function Qv($,v){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...E(v)})}function jv($,v){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(v)})}function wv($,v){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...E(v)})}function Hv($,v){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(v)})}function Nv($,v){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...E(v)})}function Iv($,v){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...E(v)})}function Ov($,v){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(v)})}function Dv($,v){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(v)})}function bv($,v){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...E(v)})}function GJ($,v){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...E(v)})}function Vv($,v){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(v)})}function Kv($,v){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(v)})}function Bv($,v){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...E(v)})}function Av($,v){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...E(v)})}function Sv($,v){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...E(v)})}function qv($,v){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...E(v)})}var QJ={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function S8($,v){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(v)})}function q8($,v){return new $({type:"string",format:"date",check:"string_format",...E(v)})}function L8($,v){return new $({type:"string",format:"time",check:"string_format",precision:null,...E(v)})}function F8($,v){return new $({type:"string",format:"duration",check:"string_format",...E(v)})}function jJ($,v){return new $({type:"number",checks:[],...E(v)})}function E8($,v){return new $({type:"number",coerce:!0,checks:[],...E(v)})}function wJ($,v){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...E(v)})}function HJ($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...E(v)})}function NJ($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...E(v)})}function IJ($,v){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...E(v)})}function OJ($,v){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...E(v)})}function DJ($,v){return new $({type:"boolean",...E(v)})}function M8($,v){return new $({type:"boolean",coerce:!0,...E(v)})}function bJ($,v){return new $({type:"bigint",...E(v)})}function P8($,v){return new $({type:"bigint",coerce:!0,...E(v)})}function VJ($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...E(v)})}function KJ($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...E(v)})}function BJ($,v){return new $({type:"symbol",...E(v)})}function AJ($,v){return new $({type:"undefined",...E(v)})}function SJ($,v){return new $({type:"null",...E(v)})}function qJ($){return new $({type:"any"})}function LJ($){return new $({type:"unknown"})}function FJ($,v){return new $({type:"never",...E(v)})}function EJ($,v){return new $({type:"void",...E(v)})}function MJ($,v){return new $({type:"date",...E(v)})}function R8($,v){return new $({type:"date",coerce:!0,...E(v)})}function PJ($,v){return new $({type:"nan",...E(v)})}function T6($,v){return new p0({check:"less_than",...E(v),value:$,inclusive:!1})}function e$($,v){return new p0({check:"less_than",...E(v),value:$,inclusive:!0})}function x6($,v){return new d0({check:"greater_than",...E(v),value:$,inclusive:!1})}function y$($,v){return new d0({check:"greater_than",...E(v),value:$,inclusive:!0})}function k8($){return x6(0,$)}function C8($){return T6(0,$)}function _8($){return e$(0,$)}function Z8($){return y$(0,$)}function A4($,v){return new W9({check:"multiple_of",...E(v),value:$})}function v1($,v){return new G9({check:"max_size",...E(v),maximum:$})}function S4($,v){return new Q9({check:"min_size",...E(v),minimum:$})}function Lv($,v){return new j9({check:"size_equals",...E(v),size:$})}function U1($,v){return new w9({check:"max_length",...E(v),maximum:$})}function v4($,v){return new H9({check:"min_length",...E(v),minimum:$})}function J1($,v){return new N9({check:"length_equals",...E(v),length:$})}function Fv($,v){return new I9({check:"string_format",format:"regex",...E(v),pattern:$})}function Ev($){return new O9({check:"string_format",format:"lowercase",...E($)})}function Mv($){return new D9({check:"string_format",format:"uppercase",...E($)})}function Pv($,v){return new b9({check:"string_format",format:"includes",...E(v),includes:$})}function Rv($,v){return new V9({check:"string_format",format:"starts_with",...E(v),prefix:$})}function kv($,v){return new K9({check:"string_format",format:"ends_with",...E(v),suffix:$})}function T8($,v,U){return new B9({check:"property",property:$,schema:v,...E(U)})}function Cv($,v){return new A9({check:"mime_type",mime:$,...E(v)})}function B6($){return new S9({check:"overwrite",tx:$})}function _v($){return B6((v)=>v.normalize($))}function Zv(){return B6(($)=>$.trim())}function Tv(){return B6(($)=>$.toLowerCase())}function xv(){return B6(($)=>$.toUpperCase())}function gv(){return B6(($)=>qW($))}function x8($,v,U){return new $({type:"array",element:v,...E(U)})}function oO($,v,U){return new $({type:"union",options:v,...E(U)})}function pO($,v,U,X){return new $({type:"union",options:U,discriminator:v,...E(X)})}function dO($,v,U){return new $({type:"intersection",left:v,right:U})}function tO($,v,U,X){let J=U instanceof l;return new $({type:"tuple",items:v,rest:J?U:null,...E(J?X:U)})}function aO($,v,U,X){return new $({type:"record",keyType:v,valueType:U,...E(X)})}function eO($,v,U,X){return new $({type:"map",keyType:v,valueType:U,...E(X)})}function sO($,v,U){return new $({type:"set",valueType:v,...E(U)})}function $D($,v,U){let X=Array.isArray(v)?Object.fromEntries(v.map((J)=>[J,J])):v;return new $({type:"enum",entries:X,...E(U)})}function vD($,v,U){return new $({type:"enum",entries:v,...E(U)})}function UD($,v,U){return new $({type:"literal",values:Array.isArray(v)?v:[v],...E(U)})}function RJ($,v){return new $({type:"file",...E(v)})}function JD($,v){return new $({type:"transform",transform:v})}function XD($,v){return new $({type:"optional",innerType:v})}function WD($,v){return new $({type:"nullable",innerType:v})}function YD($,v,U){return new $({type:"default",innerType:v,get defaultValue(){return typeof U==="function"?U():FW(U)}})}function zD($,v,U){return new $({type:"nonoptional",innerType:v,...E(U)})}function GD($,v){return new $({type:"success",innerType:v})}function QD($,v,U){return new $({type:"catch",innerType:v,catchValue:typeof U==="function"?U:()=>U})}function jD($,v,U){return new $({type:"pipe",in:v,out:U})}function wD($,v){return new $({type:"readonly",innerType:v})}function HD($,v,U){return new $({type:"template_literal",parts:v,...E(U)})}function ND($,v){return new $({type:"lazy",getter:v})}function ID($,v){return new $({type:"promise",innerType:v})}function kJ($,v,U){let X=E(U);return X.abort??(X.abort=!0),new $({type:"custom",check:"custom",fn:v,...X})}function CJ($,v,U){return new $({type:"custom",check:"custom",fn:v,...E(U)})}function _J($){let v=JQ((U)=>{return U.addIssue=(X)=>{if(typeof X==="string")U.issues.push(m4(X,U.value,v._zod.def));else{let J=X;if(J.fatal)J.continue=!1;J.code??(J.code="custom"),J.input??(J.input=U.value),J.inst??(J.inst=v),J.continue??(J.continue=!v._zod.def.abort),U.issues.push(m4(J))}},$(U.value,U)});return v}function JQ($,v){let U=new z$({check:"custom",...E(v)});return U._zod.check=$,U}function ZJ($){let v=new z$({check:"describe"});return v._zod.onattach=[(U)=>{let X=P$.get(U)??{};P$.add(U,{...X,description:$})}],v._zod.check=()=>{},v}function TJ($){let v=new z$({check:"meta"});return v._zod.onattach=[(U)=>{let X=P$.get(U)??{};P$.add(U,{...X,...$})}],v._zod.check=()=>{},v}function xJ($,v){let U=E(v),X=U.truthy??["true","1","yes","on","y","enabled"],J=U.falsy??["false","0","no","off","n","disabled"];if(U.case!=="sensitive")X=X.map((w)=>typeof w==="string"?w.toLowerCase():w),J=J.map((w)=>typeof w==="string"?w.toLowerCase():w);let W=new Set(X),Y=new Set(J),z=$.Codec??a4,G=$.Boolean??t4,j=new($.String??$4)({type:"string",error:U.error}),H=new G({type:"boolean",error:U.error}),N=new z({type:"pipe",in:j,out:H,transform:(w,I)=>{let D=w;if(U.case!=="sensitive")D=D.toLowerCase();if(W.has(D))return!0;else if(Y.has(D))return!1;else return I.issues.push({code:"invalid_value",expected:"stringbool",values:[...W,...Y],input:I.value,inst:N,continue:!1}),{}},reverseTransform:(w,I)=>{if(w===!0)return X[0]||"true";else return J[0]||"false"},error:U.error});return N}function q4($,v,U,X={}){let J=E(X),W={...E(X),check:"string_format",type:"string",format:v,fn:typeof U==="function"?U:(z)=>U.test(z),...J};if(U instanceof RegExp)W.pattern=U;return new $(W)}class gJ{constructor($){this.counter=0,this.metadataRegistry=$?.metadata??P$,this.target=$?.target??"draft-2020-12",this.unrepresentable=$?.unrepresentable??"throw",this.override=$?.override??(()=>{}),this.io=$?.io??"output",this.seen=new Map}process($,v={path:[],schemaPath:[]}){var U;let X=$._zod.def,J={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},W=this.seen.get($);if(W){if(W.count++,v.schemaPath.includes($))W.cycle=v.path;return W.schema}let Y={schema:{},count:1,cycle:void 0,path:v.path};this.seen.set($,Y);let z=$._zod.toJSONSchema?.();if(z)Y.schema=z;else{let j={...v,schemaPath:[...v.schemaPath,$],path:v.path},H=$._zod.parent;if(H)Y.ref=H,this.process(H,j),this.seen.get(H).isParent=!0;else{let N=Y.schema;switch(X.type){case"string":{let w=N;w.type="string";let{minimum:I,maximum:D,format:K,patterns:B,contentEncoding:x}=$._zod.bag;if(typeof I==="number")w.minLength=I;if(typeof D==="number")w.maxLength=D;if(K){if(w.format=J[K]??K,w.format==="")delete w.format}if(x)w.contentEncoding=x;if(B&&B.size>0){let R=[...B];if(R.length===1)w.pattern=R[0].source;else if(R.length>1)Y.schema.allOf=[...R.map((y)=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))]}break}case"number":{let w=N,{minimum:I,maximum:D,format:K,multipleOf:B,exclusiveMaximum:x,exclusiveMinimum:R}=$._zod.bag;if(typeof K==="string"&&K.includes("int"))w.type="integer";else w.type="number";if(typeof R==="number")if(this.target==="draft-4"||this.target==="openapi-3.0")w.minimum=R,w.exclusiveMinimum=!0;else w.exclusiveMinimum=R;if(typeof I==="number"){if(w.minimum=I,typeof R==="number"&&this.target!=="draft-4")if(R>=I)delete w.minimum;else delete w.exclusiveMinimum}if(typeof x==="number")if(this.target==="draft-4"||this.target==="openapi-3.0")w.maximum=x,w.exclusiveMaximum=!0;else w.exclusiveMaximum=x;if(typeof D==="number"){if(w.maximum=D,typeof x==="number"&&this.target!=="draft-4")if(x<=D)delete w.maximum;else delete w.exclusiveMaximum}if(typeof B==="number")w.multipleOf=B;break}case"boolean":{let w=N;w.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{if(this.target==="openapi-3.0")N.type="string",N.nullable=!0,N.enum=[null];else N.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"never":{N.not={};break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let w=N,{minimum:I,maximum:D}=$._zod.bag;if(typeof I==="number")w.minItems=I;if(typeof D==="number")w.maxItems=D;w.type="array",w.items=this.process(X.element,{...j,path:[...j.path,"items"]});break}case"object":{let w=N;w.type="object",w.properties={};let I=X.shape;for(let B in I)w.properties[B]=this.process(I[B],{...j,path:[...j.path,"properties",B]});let D=new Set(Object.keys(I)),K=new Set([...D].filter((B)=>{let x=X.shape[B]._zod;if(this.io==="input")return x.optin===void 0;else return x.optout===void 0}));if(K.size>0)w.required=Array.from(K);if(X.catchall?._zod.def.type==="never")w.additionalProperties=!1;else if(!X.catchall){if(this.io==="output")w.additionalProperties=!1}else if(X.catchall)w.additionalProperties=this.process(X.catchall,{...j,path:[...j.path,"additionalProperties"]});break}case"union":{let w=N,I=X.discriminator!==void 0,D=X.options.map((K,B)=>this.process(K,{...j,path:[...j.path,I?"oneOf":"anyOf",B]}));if(I)w.oneOf=D;else w.anyOf=D;break}case"intersection":{let w=N,I=this.process(X.left,{...j,path:[...j.path,"allOf",0]}),D=this.process(X.right,{...j,path:[...j.path,"allOf",1]}),K=(x)=>("allOf"in x)&&Object.keys(x).length===1,B=[...K(I)?I.allOf:[I],...K(D)?D.allOf:[D]];w.allOf=B;break}case"tuple":{let w=N;w.type="array";let I=this.target==="draft-2020-12"?"prefixItems":"items",D=this.target==="draft-2020-12"?"items":this.target==="openapi-3.0"?"items":"additionalItems",K=X.items.map((y,T)=>this.process(y,{...j,path:[...j.path,I,T]})),B=X.rest?this.process(X.rest,{...j,path:[...j.path,D,...this.target==="openapi-3.0"?[X.items.length]:[]]}):null;if(this.target==="draft-2020-12"){if(w.prefixItems=K,B)w.items=B}else if(this.target==="openapi-3.0"){if(w.items={anyOf:K},B)w.items.anyOf.push(B);if(w.minItems=K.length,!B)w.maxItems=K.length}else if(w.items=K,B)w.additionalItems=B;let{minimum:x,maximum:R}=$._zod.bag;if(typeof x==="number")w.minItems=x;if(typeof R==="number")w.maxItems=R;break}case"record":{let w=N;if(w.type="object",this.target==="draft-7"||this.target==="draft-2020-12")w.propertyNames=this.process(X.keyType,{...j,path:[...j.path,"propertyNames"]});w.additionalProperties=this.process(X.valueType,{...j,path:[...j.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let w=N,I=u1(X.entries);if(I.every((D)=>typeof D==="number"))w.type="number";if(I.every((D)=>typeof D==="string"))w.type="string";w.enum=I;break}case"literal":{let w=N,I=[];for(let D of X.values)if(D===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof D==="bigint")if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else I.push(Number(D));else I.push(D);if(I.length===0);else if(I.length===1){let D=I[0];if(w.type=D===null?"null":typeof D,this.target==="draft-4"||this.target==="openapi-3.0")w.enum=[D];else w.const=D}else{if(I.every((D)=>typeof D==="number"))w.type="number";if(I.every((D)=>typeof D==="string"))w.type="string";if(I.every((D)=>typeof D==="boolean"))w.type="string";if(I.every((D)=>D===null))w.type="null";w.enum=I}break}case"file":{let w=N,I={type:"string",format:"binary",contentEncoding:"binary"},{minimum:D,maximum:K,mime:B}=$._zod.bag;if(D!==void 0)I.minLength=D;if(K!==void 0)I.maxLength=K;if(B)if(B.length===1)I.contentMediaType=B[0],Object.assign(w,I);else w.anyOf=B.map((x)=>{return{...I,contentMediaType:x}});else Object.assign(w,I);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let w=this.process(X.innerType,j);if(this.target==="openapi-3.0")Y.ref=X.innerType,N.nullable=!0;else N.anyOf=[w,{type:"null"}];break}case"nonoptional":{this.process(X.innerType,j),Y.ref=X.innerType;break}case"success":{let w=N;w.type="boolean";break}case"default":{this.process(X.innerType,j),Y.ref=X.innerType,N.default=JSON.parse(JSON.stringify(X.defaultValue));break}case"prefault":{if(this.process(X.innerType,j),Y.ref=X.innerType,this.io==="input")N._prefault=JSON.parse(JSON.stringify(X.defaultValue));break}case"catch":{this.process(X.innerType,j),Y.ref=X.innerType;let w;try{w=X.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}N.default=w;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let w=N,I=$._zod.pattern;if(!I)throw Error("Pattern not found in template literal");w.type="string",w.pattern=I.source;break}case"pipe":{let w=this.io==="input"?X.in._zod.def.type==="transform"?X.out:X.in:X.out;this.process(w,j),Y.ref=w;break}case"readonly":{this.process(X.innerType,j),Y.ref=X.innerType,N.readOnly=!0;break}case"promise":{this.process(X.innerType,j),Y.ref=X.innerType;break}case"optional":{this.process(X.innerType,j),Y.ref=X.innerType;break}case"lazy":{let w=$._zod.innerType;this.process(w,j),Y.ref=w;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}case"function":{if(this.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema");break}default:}}}let G=this.metadataRegistry.get($);if(G)Object.assign(Y.schema,G);if(this.io==="input"&&_$($))delete Y.schema.examples,delete Y.schema.default;if(this.io==="input"&&Y.schema._prefault)(U=Y.schema).default??(U.default=Y.schema._prefault);return delete Y.schema._prefault,this.seen.get($).schema}emit($,v){let U={cycles:v?.cycles??"ref",reused:v?.reused??"inline",external:v?.external??void 0},X=this.seen.get($);if(!X)throw Error("Unprocessed schema. This is a bug in Zod.");let J=(Q)=>{let j=this.target==="draft-2020-12"?"$defs":"definitions";if(U.external){let I=U.external.registry.get(Q[0])?.id,D=U.external.uri??((B)=>B);if(I)return{ref:D(I)};let K=Q[1].defId??Q[1].schema.id??`schema${this.counter++}`;return Q[1].defId=K,{defId:K,ref:`${D("__shared")}#/${j}/${K}`}}if(Q[1]===X)return{ref:"#"};let N=`${"#"}/${j}/`,w=Q[1].schema.id??`__schema${this.counter++}`;return{defId:w,ref:N+w}},W=(Q)=>{if(Q[1].schema.$ref)return;let j=Q[1],{ref:H,defId:N}=J(Q);if(j.def={...j.schema},N)j.defId=N;let w=j.schema;for(let I in w)delete w[I];w.$ref=H};if(U.cycles==="throw")for(let Q of this.seen.entries()){let j=Q[1];if(j.cycle)throw Error(`Cycle detected: #/${j.cycle?.join("/")}/<root>
11
32
 
12
- IMPORTANT USAGE NOTES:
13
- - Datalog queries provide advanced filtering capabilities using Datalog syntax
14
- - Text search is simpler and looks for content containing the specified text
15
- - Results can include block children for context
16
- - Large result sets can be limited to improve performance
33
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let Q of this.seen.entries()){let j=Q[1];if($===Q[0]){W(Q);continue}if(U.external){let N=U.external.registry.get(Q[0])?.id;if($!==Q[0]&&N){W(Q);continue}}if(this.metadataRegistry.get(Q[0])?.id){W(Q);continue}if(j.cycle){W(Q);continue}if(j.count>1){if(U.reused==="ref"){W(Q);continue}}}let Y=(Q,j)=>{let H=this.seen.get(Q),N=H.def??H.schema,w={...N};if(H.ref===null)return;let I=H.ref;if(H.ref=null,I){Y(I,j);let D=this.seen.get(I).schema;if(D.$ref&&(j.target==="draft-7"||j.target==="draft-4"||j.target==="openapi-3.0"))N.allOf=N.allOf??[],N.allOf.push(D);else Object.assign(N,D),Object.assign(N,w)}if(!H.isParent)this.override({zodSchema:Q,jsonSchema:N,path:H.path??[]})};for(let Q of[...this.seen.entries()].reverse())Y(Q[0],{target:this.target});let z={};if(this.target==="draft-2020-12")z.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")z.$schema="http://json-schema.org/draft-07/schema#";else if(this.target==="draft-4")z.$schema="http://json-schema.org/draft-04/schema#";else if(this.target==="openapi-3.0");else console.warn(`Invalid target: ${this.target}`);if(U.external?.uri){let Q=U.external.registry.get($)?.id;if(!Q)throw Error("Schema is missing an `id` property");z.$id=U.external.uri(Q)}Object.assign(z,X.def);let G=U.external?.defs??{};for(let Q of this.seen.entries()){let j=Q[1];if(j.def&&j.defId)G[j.defId]=j.def}if(U.external);else if(Object.keys(G).length>0)if(this.target==="draft-2020-12")z.$defs=G;else z.definitions=G;try{return JSON.parse(JSON.stringify(z))}catch(Q){throw Error("Error converting schema to JSON.")}}}function X1($,v){if($ instanceof Uv){let X=new gJ(v),J={};for(let z of $._idmap.entries()){let[G,Q]=z;X.process(Q)}let W={},Y={registry:$,uri:v?.uri,defs:J};for(let z of $._idmap.entries()){let[G,Q]=z;W[G]=X.emit(Q,{...v,external:Y})}if(Object.keys(J).length>0){let z=X.target==="draft-2020-12"?"$defs":"definitions";W.__shared={[z]:J}}return{schemas:W}}let U=new gJ(v);return U.process($),U.emit($,v)}function _$($,v){let U=v??{seen:new Set};if(U.seen.has($))return!1;U.seen.add($);let X=$._zod.def;if(X.type==="transform")return!0;if(X.type==="array")return _$(X.element,U);if(X.type==="set")return _$(X.valueType,U);if(X.type==="lazy")return _$(X.getter(),U);if(X.type==="promise"||X.type==="optional"||X.type==="nonoptional"||X.type==="nullable"||X.type==="readonly"||X.type==="default"||X.type==="prefault")return _$(X.innerType,U);if(X.type==="intersection")return _$(X.left,U)||_$(X.right,U);if(X.type==="record"||X.type==="map")return _$(X.keyType,U)||_$(X.valueType,U);if(X.type==="pipe")return _$(X.in,U)||_$(X.out,U);if(X.type==="object"){for(let J in X.shape)if(_$(X.shape[J],U))return!0;return!1}if(X.type==="union"){for(let J of X.options)if(_$(J,U))return!0;return!1}if(X.type==="tuple"){for(let J of X.items)if(_$(J,U))return!0;if(X.rest&&_$(X.rest,U))return!0;return!1}return!1}var XQ={};var DD=O("ZodMiniType",($,v)=>{if(!$._zod)throw Error("Uninitialized schema in ZodMiniType.");l.init($,v),$.def=v,$.type=v.type,$.parse=(U,X)=>V4($,U,X,{callee:$.parse}),$.safeParse=(U,X)=>e6($,U,X),$.parseAsync=async(U,X)=>K4($,U,X,{callee:$.parseAsync}),$.safeParseAsync=async(U,X)=>s6($,U,X),$.check=(...U)=>{return $.clone({...v,checks:[...v.checks??[],...U.map((X)=>typeof X==="function"?{_zod:{check:X,def:{check:"custom"},onattach:[]}}:X)]})},$.clone=(U,X)=>F$($,U,X),$.brand=()=>$,$.register=(U,X)=>{return U.add($,X),$}});var bD=O("ZodMiniObject",($,v)=>{TU.init($,v),DD.init($,v),q.defineLazy($,"shape",()=>v.shape)});function g8($,v){let U={type:"object",shape:$??{},...q.normalizeParams(v)};return new bD(U)}function X6($){return!!$._zod}function W1($){let v=Object.values($);if(v.length===0)return g8({});let U=v.every(X6),X=v.every((J)=>!X6(J));if(U)return g8($);if(X)return VG($);throw Error("Mixed Zod versions detected in object shape.")}function fJ($,v){if(X6($))return e6($,v);return $.safeParse(v)}async function yJ($,v){if(X6($))return await s6($,v);return await $.safeParseAsync(v)}function Y1($){var v,U;if(!$)return;let X;if(X6($))X=(U=(v=$._zod)===null||v===void 0?void 0:v.def)===null||U===void 0?void 0:U.shape;else X=$.shape;if(!X)return;if(typeof X==="function")try{return X()}catch(J){return}return X}function z1($){var v;if(!$)return;if(typeof $==="object"){let U=$,X=$;if(!U._def&&!X._zod){let J=Object.values($);if(J.length>0&&J.every((W)=>typeof W==="object"&&W!==null&&(W._def!==void 0||W._zod!==void 0||typeof W.parse==="function")))return W1($)}}if(X6($)){let X=(v=$._zod)===null||v===void 0?void 0:v.def;if(X&&(X.typeName==="object"||X.shape!==void 0))return $}else if($.shape!==void 0)return $;return}function uJ($){if($&&typeof $==="object"){if("message"in $&&typeof $.message==="string")return $.message;if("issues"in $&&Array.isArray($.issues)&&$.issues.length>0){let v=$.issues[0];if(v&&typeof v==="object"&&"message"in v)return String(v.message)}try{return JSON.stringify($)}catch(v){return String($)}}return String($)}function WQ($){var v,U,X,J;if(X6($))return(U=(v=$._zod)===null||v===void 0?void 0:v.def)===null||U===void 0?void 0:U.description;let W=$;return(X=$.description)!==null&&X!==void 0?X:(J=W._def)===null||J===void 0?void 0:J.description}function YQ($){var v,U,X;if(X6($))return((U=(v=$._zod)===null||v===void 0?void 0:v.def)===null||U===void 0?void 0:U.typeName)==="ZodOptional";let J=$;if(typeof $.isOptional==="function")return $.isOptional();return((X=J._def)===null||X===void 0?void 0:X.typeName)==="ZodOptional"}function hJ($){var v;if(X6($)){let Y=(v=$._zod)===null||v===void 0?void 0:v.def;if(Y){if(Y.value!==void 0)return Y.value;if(Array.isArray(Y.values)&&Y.values.length>0)return Y.values[0]}}let X=$._def;if(X){if(X.value!==void 0)return X.value;if(Array.isArray(X.values)&&X.values.length>0)return X.values[0]}let J=$.value;if(J!==void 0)return J;return}var A={};H4(A,{xid:()=>xD,void:()=>Yb,uuidv7:()=>MD,uuidv6:()=>ED,uuidv4:()=>FD,uuid:()=>LD,util:()=>q,url:()=>PD,uppercase:()=>Mv,unknown:()=>w$,union:()=>H$,undefined:()=>Xb,ulid:()=>TD,uint64:()=>Ub,uint32:()=>sD,tuple:()=>SQ,trim:()=>Zv,treeifyError:()=>f0,transform:()=>SY,toUpperCase:()=>xv,toLowerCase:()=>Tv,toJSONSchema:()=>X1,templateLiteral:()=>Kb,symbol:()=>Jb,superRefine:()=>rQ,success:()=>Db,stringbool:()=>Eb,stringFormat:()=>rD,string:()=>V,strictObject:()=>Qb,startsWith:()=>Rv,slugify:()=>gv,size:()=>Lv,setErrorMap:()=>Rb,set:()=>Hb,safeParseAsync:()=>c8,safeParse:()=>n8,safeEncodeAsync:()=>a8,safeEncode:()=>d8,safeDecodeAsync:()=>e8,safeDecode:()=>t8,registry:()=>Jv,regexes:()=>f$,regex:()=>Fv,refine:()=>iQ,record:()=>O$,readonly:()=>uQ,property:()=>T8,promise:()=>Bb,prettifyError:()=>y0,preprocess:()=>PY,prefault:()=>_Q,positive:()=>k8,pipe:()=>pJ,partialRecord:()=>jb,parseAsync:()=>m8,parse:()=>l8,overwrite:()=>B6,optional:()=>c,object:()=>_,number:()=>I$,nullish:()=>Ob,nullable:()=>oJ,null:()=>NQ,normalize:()=>_v,nonpositive:()=>_8,nonoptional:()=>ZQ,nonnegative:()=>Z8,never:()=>VY,negative:()=>C8,nativeEnum:()=>Nb,nanoid:()=>CD,nan:()=>bb,multipleOf:()=>A4,minSize:()=>S4,minLength:()=>v4,mime:()=>Cv,meta:()=>Lb,maxSize:()=>v1,maxLength:()=>U1,map:()=>wb,mac:()=>yD,lte:()=>e$,lt:()=>T6,lowercase:()=>Ev,looseObject:()=>A6,locales:()=>e4,literal:()=>f,length:()=>J1,lazy:()=>mQ,ksuid:()=>gD,keyof:()=>Gb,jwt:()=>iD,json:()=>Mb,iso:()=>iJ,ipv6:()=>uD,ipv4:()=>fD,intersection:()=>nv,int64:()=>vb,int32:()=>eD,int:()=>s8,instanceof:()=>Fb,includes:()=>Pv,httpUrl:()=>RD,hostname:()=>oD,hex:()=>pD,hash:()=>dD,guid:()=>qD,gte:()=>y$,gt:()=>x6,globalRegistry:()=>P$,getErrorMap:()=>kb,function:()=>Ab,formatError:()=>c4,float64:()=>aD,float32:()=>tD,flattenError:()=>n4,file:()=>Ib,enum:()=>h$,endsWith:()=>kv,encodeAsync:()=>o8,encode:()=>i8,emoji:()=>kD,email:()=>SD,e164:()=>cD,discriminatedUnion:()=>BY,describe:()=>qb,decodeAsync:()=>p8,decode:()=>r8,date:()=>zb,custom:()=>MY,cuid2:()=>ZD,cuid:()=>_D,core:()=>J6,config:()=>B$,coerce:()=>kY,codec:()=>Vb,clone:()=>F$,cidrv6:()=>lD,cidrv4:()=>hD,check:()=>Sb,catch:()=>gQ,boolean:()=>q$,bigint:()=>$b,base64url:()=>nD,base64:()=>mD,array:()=>e,any:()=>Wb,_function:()=>Ab,_default:()=>kQ,_ZodString:()=>$Y,ZodXID:()=>zY,ZodVoid:()=>bQ,ZodUnknown:()=>OQ,ZodUnion:()=>KY,ZodUndefined:()=>wQ,ZodUUID:()=>g6,ZodURL:()=>dJ,ZodULID:()=>YY,ZodType:()=>o,ZodTuple:()=>AQ,ZodTransform:()=>MQ,ZodTemplateLiteral:()=>hQ,ZodSymbol:()=>jQ,ZodSuccess:()=>TQ,ZodStringFormat:()=>Q$,ZodString:()=>yv,ZodSet:()=>LQ,ZodRecord:()=>AY,ZodRealError:()=>u$,ZodReadonly:()=>yQ,ZodPromise:()=>nQ,ZodPrefault:()=>CQ,ZodPipe:()=>FY,ZodOptional:()=>qY,ZodObject:()=>aJ,ZodNumberFormat:()=>G1,ZodNumber:()=>hv,ZodNullable:()=>PQ,ZodNull:()=>HQ,ZodNonOptional:()=>LY,ZodNever:()=>DQ,ZodNanoID:()=>JY,ZodNaN:()=>fQ,ZodMap:()=>qQ,ZodMAC:()=>QQ,ZodLiteral:()=>FQ,ZodLazy:()=>lQ,ZodKSUID:()=>GY,ZodJWT:()=>DY,ZodIssueCode:()=>Pb,ZodIntersection:()=>BQ,ZodISOTime:()=>nJ,ZodISODuration:()=>cJ,ZodISODateTime:()=>lJ,ZodISODate:()=>mJ,ZodIPv6:()=>jY,ZodIPv4:()=>QY,ZodGUID:()=>rJ,ZodFunction:()=>cQ,ZodFirstPartyTypeKind:()=>RY,ZodFile:()=>EQ,ZodError:()=>BD,ZodEnum:()=>fv,ZodEmoji:()=>UY,ZodEmail:()=>vY,ZodE164:()=>OY,ZodDiscriminatedUnion:()=>KQ,ZodDefault:()=>RQ,ZodDate:()=>tJ,ZodCustomStringFormat:()=>uv,ZodCustom:()=>eJ,ZodCodec:()=>EY,ZodCatch:()=>xQ,ZodCUID2:()=>WY,ZodCUID:()=>XY,ZodCIDRv6:()=>HY,ZodCIDRv4:()=>wY,ZodBoolean:()=>lv,ZodBigIntFormat:()=>bY,ZodBigInt:()=>mv,ZodBase64URL:()=>IY,ZodBase64:()=>NY,ZodArray:()=>VQ,ZodAny:()=>IQ,TimePrecision:()=>QJ,NEVER:()=>Z0,$output:()=>WJ,$input:()=>YJ,$brand:()=>T0});var iJ={};H4(iJ,{time:()=>u8,duration:()=>h8,datetime:()=>f8,date:()=>y8,ZodISOTime:()=>nJ,ZodISODuration:()=>cJ,ZodISODateTime:()=>lJ,ZodISODate:()=>mJ});var lJ=O("ZodISODateTime",($,v)=>{F9.init($,v),Q$.init($,v)});function f8($){return S8(lJ,$)}var mJ=O("ZodISODate",($,v)=>{E9.init($,v),Q$.init($,v)});function y8($){return q8(mJ,$)}var nJ=O("ZodISOTime",($,v)=>{M9.init($,v),Q$.init($,v)});function u8($){return L8(nJ,$)}var cJ=O("ZodISODuration",($,v)=>{P9.init($,v),Q$.init($,v)});function h8($){return F8(cJ,$)}var GQ=($,v)=>{c1.init($,v),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>c4($,U)},flatten:{value:(U)=>n4($,U)},addIssue:{value:(U)=>{$.issues.push(U),$.message=JSON.stringify($.issues,h4,2)}},addIssues:{value:(U)=>{$.issues.push(...U),$.message=JSON.stringify($.issues,h4,2)}},isEmpty:{get(){return $.issues.length===0}}})},BD=O("ZodError",GQ),u$=O("ZodError",GQ,{Parent:Error});var l8=i4(u$),m8=r4(u$),n8=o4(u$),c8=p4(u$),i8=u0(u$),r8=h0(u$),o8=l0(u$),p8=m0(u$),d8=n0(u$),t8=c0(u$),a8=i0(u$),e8=r0(u$);var o=O("ZodType",($,v)=>{return l.init($,v),$.def=v,$.type=v.type,Object.defineProperty($,"_def",{value:v}),$.check=(...U)=>{return $.clone(q.mergeDefs(v,{checks:[...v.checks??[],...U.map((X)=>typeof X==="function"?{_zod:{check:X,def:{check:"custom"},onattach:[]}}:X)]}))},$.clone=(U,X)=>F$($,U,X),$.brand=()=>$,$.register=(U,X)=>{return U.add($,X),$},$.parse=(U,X)=>l8($,U,X,{callee:$.parse}),$.safeParse=(U,X)=>n8($,U,X),$.parseAsync=async(U,X)=>m8($,U,X,{callee:$.parseAsync}),$.safeParseAsync=async(U,X)=>c8($,U,X),$.spa=$.safeParseAsync,$.encode=(U,X)=>i8($,U,X),$.decode=(U,X)=>r8($,U,X),$.encodeAsync=async(U,X)=>o8($,U,X),$.decodeAsync=async(U,X)=>p8($,U,X),$.safeEncode=(U,X)=>d8($,U,X),$.safeDecode=(U,X)=>t8($,U,X),$.safeEncodeAsync=async(U,X)=>a8($,U,X),$.safeDecodeAsync=async(U,X)=>e8($,U,X),$.refine=(U,X)=>$.check(iQ(U,X)),$.superRefine=(U)=>$.check(rQ(U)),$.overwrite=(U)=>$.check(B6(U)),$.optional=()=>c($),$.nullable=()=>oJ($),$.nullish=()=>c(oJ($)),$.nonoptional=(U)=>ZQ($,U),$.array=()=>e($),$.or=(U)=>H$([$,U]),$.and=(U)=>nv($,U),$.transform=(U)=>pJ($,SY(U)),$.default=(U)=>kQ($,U),$.prefault=(U)=>_Q($,U),$.catch=(U)=>gQ($,U),$.pipe=(U)=>pJ($,U),$.readonly=()=>uQ($),$.describe=(U)=>{let X=$.clone();return P$.add(X,{description:U}),X},Object.defineProperty($,"description",{get(){return P$.get($)?.description},configurable:!0}),$.meta=(...U)=>{if(U.length===0)return P$.get($);let X=$.clone();return P$.add(X,U[0]),X},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$}),$Y=O("_ZodString",($,v)=>{$4.init($,v),o.init($,v);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...X)=>$.check(Fv(...X)),$.includes=(...X)=>$.check(Pv(...X)),$.startsWith=(...X)=>$.check(Rv(...X)),$.endsWith=(...X)=>$.check(kv(...X)),$.min=(...X)=>$.check(v4(...X)),$.max=(...X)=>$.check(U1(...X)),$.length=(...X)=>$.check(J1(...X)),$.nonempty=(...X)=>$.check(v4(1,...X)),$.lowercase=(X)=>$.check(Ev(X)),$.uppercase=(X)=>$.check(Mv(X)),$.trim=()=>$.check(Zv()),$.normalize=(...X)=>$.check(_v(...X)),$.toLowerCase=()=>$.check(Tv()),$.toUpperCase=()=>$.check(xv()),$.slugify=()=>$.check(gv())}),yv=O("ZodString",($,v)=>{$4.init($,v),$Y.init($,v),$.email=(U)=>$.check(Xv(vY,U)),$.url=(U)=>$.check($1(dJ,U)),$.jwt=(U)=>$.check(qv(DY,U)),$.emoji=(U)=>$.check(Qv(UY,U)),$.guid=(U)=>$.check(s4(rJ,U)),$.uuid=(U)=>$.check(Wv(g6,U)),$.uuidv4=(U)=>$.check(Yv(g6,U)),$.uuidv6=(U)=>$.check(zv(g6,U)),$.uuidv7=(U)=>$.check(Gv(g6,U)),$.nanoid=(U)=>$.check(jv(JY,U)),$.guid=(U)=>$.check(s4(rJ,U)),$.cuid=(U)=>$.check(wv(XY,U)),$.cuid2=(U)=>$.check(Hv(WY,U)),$.ulid=(U)=>$.check(Nv(YY,U)),$.base64=(U)=>$.check(Bv(NY,U)),$.base64url=(U)=>$.check(Av(IY,U)),$.xid=(U)=>$.check(Iv(zY,U)),$.ksuid=(U)=>$.check(Ov(GY,U)),$.ipv4=(U)=>$.check(Dv(QY,U)),$.ipv6=(U)=>$.check(bv(jY,U)),$.cidrv4=(U)=>$.check(Vv(wY,U)),$.cidrv6=(U)=>$.check(Kv(HY,U)),$.e164=(U)=>$.check(Sv(OY,U)),$.datetime=(U)=>$.check(f8(U)),$.date=(U)=>$.check(y8(U)),$.time=(U)=>$.check(u8(U)),$.duration=(U)=>$.check(h8(U))});function V($){return zJ(yv,$)}var Q$=O("ZodStringFormat",($,v)=>{W$.init($,v),$Y.init($,v)}),vY=O("ZodEmail",($,v)=>{XU.init($,v),Q$.init($,v)});function SD($){return Xv(vY,$)}var rJ=O("ZodGUID",($,v)=>{UU.init($,v),Q$.init($,v)});function qD($){return s4(rJ,$)}var g6=O("ZodUUID",($,v)=>{JU.init($,v),Q$.init($,v)});function LD($){return Wv(g6,$)}function FD($){return Yv(g6,$)}function ED($){return zv(g6,$)}function MD($){return Gv(g6,$)}var dJ=O("ZodURL",($,v)=>{WU.init($,v),Q$.init($,v)});function PD($){return $1(dJ,$)}function RD($){return $1(dJ,{protocol:/^https?$/,hostname:f$.domain,...q.normalizeParams($)})}var UY=O("ZodEmoji",($,v)=>{YU.init($,v),Q$.init($,v)});function kD($){return Qv(UY,$)}var JY=O("ZodNanoID",($,v)=>{zU.init($,v),Q$.init($,v)});function CD($){return jv(JY,$)}var XY=O("ZodCUID",($,v)=>{GU.init($,v),Q$.init($,v)});function _D($){return wv(XY,$)}var WY=O("ZodCUID2",($,v)=>{QU.init($,v),Q$.init($,v)});function ZD($){return Hv(WY,$)}var YY=O("ZodULID",($,v)=>{jU.init($,v),Q$.init($,v)});function TD($){return Nv(YY,$)}var zY=O("ZodXID",($,v)=>{wU.init($,v),Q$.init($,v)});function xD($){return Iv(zY,$)}var GY=O("ZodKSUID",($,v)=>{HU.init($,v),Q$.init($,v)});function gD($){return Ov(GY,$)}var QY=O("ZodIPv4",($,v)=>{NU.init($,v),Q$.init($,v)});function fD($){return Dv(QY,$)}var QQ=O("ZodMAC",($,v)=>{OU.init($,v),Q$.init($,v)});function yD($){return GJ(QQ,$)}var jY=O("ZodIPv6",($,v)=>{IU.init($,v),Q$.init($,v)});function uD($){return bv(jY,$)}var wY=O("ZodCIDRv4",($,v)=>{DU.init($,v),Q$.init($,v)});function hD($){return Vv(wY,$)}var HY=O("ZodCIDRv6",($,v)=>{bU.init($,v),Q$.init($,v)});function lD($){return Kv(HY,$)}var NY=O("ZodBase64",($,v)=>{VU.init($,v),Q$.init($,v)});function mD($){return Bv(NY,$)}var IY=O("ZodBase64URL",($,v)=>{KU.init($,v),Q$.init($,v)});function nD($){return Av(IY,$)}var OY=O("ZodE164",($,v)=>{BU.init($,v),Q$.init($,v)});function cD($){return Sv(OY,$)}var DY=O("ZodJWT",($,v)=>{AU.init($,v),Q$.init($,v)});function iD($){return qv(DY,$)}var uv=O("ZodCustomStringFormat",($,v)=>{SU.init($,v),Q$.init($,v)});function rD($,v,U={}){return q4(uv,$,v,U)}function oD($){return q4(uv,"hostname",f$.hostname,$)}function pD($){return q4(uv,"hex",f$.hex,$)}function dD($,v){let U=v?.enc??"hex",X=`${$}_${U}`,J=f$[X];if(!J)throw Error(`Unrecognized hash format: ${X}`);return q4(uv,X,J,v)}var hv=O("ZodNumber",($,v)=>{o1.init($,v),o.init($,v),$.gt=(X,J)=>$.check(x6(X,J)),$.gte=(X,J)=>$.check(y$(X,J)),$.min=(X,J)=>$.check(y$(X,J)),$.lt=(X,J)=>$.check(T6(X,J)),$.lte=(X,J)=>$.check(e$(X,J)),$.max=(X,J)=>$.check(e$(X,J)),$.int=(X)=>$.check(s8(X)),$.safe=(X)=>$.check(s8(X)),$.positive=(X)=>$.check(x6(0,X)),$.nonnegative=(X)=>$.check(y$(0,X)),$.negative=(X)=>$.check(T6(0,X)),$.nonpositive=(X)=>$.check(e$(0,X)),$.multipleOf=(X,J)=>$.check(A4(X,J)),$.step=(X,J)=>$.check(A4(X,J)),$.finite=()=>$;let U=$._zod.bag;$.minValue=Math.max(U.minimum??Number.NEGATIVE_INFINITY,U.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(U.maximum??Number.POSITIVE_INFINITY,U.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(U.format??"").includes("int")||Number.isSafeInteger(U.multipleOf??0.5),$.isFinite=!0,$.format=U.format??null});function I$($){return jJ(hv,$)}var G1=O("ZodNumberFormat",($,v)=>{qU.init($,v),hv.init($,v)});function s8($){return wJ(G1,$)}function tD($){return HJ(G1,$)}function aD($){return NJ(G1,$)}function eD($){return IJ(G1,$)}function sD($){return OJ(G1,$)}var lv=O("ZodBoolean",($,v)=>{t4.init($,v),o.init($,v)});function q$($){return DJ(lv,$)}var mv=O("ZodBigInt",($,v)=>{p1.init($,v),o.init($,v),$.gte=(X,J)=>$.check(y$(X,J)),$.min=(X,J)=>$.check(y$(X,J)),$.gt=(X,J)=>$.check(x6(X,J)),$.gte=(X,J)=>$.check(y$(X,J)),$.min=(X,J)=>$.check(y$(X,J)),$.lt=(X,J)=>$.check(T6(X,J)),$.lte=(X,J)=>$.check(e$(X,J)),$.max=(X,J)=>$.check(e$(X,J)),$.positive=(X)=>$.check(x6(BigInt(0),X)),$.negative=(X)=>$.check(T6(BigInt(0),X)),$.nonpositive=(X)=>$.check(e$(BigInt(0),X)),$.nonnegative=(X)=>$.check(y$(BigInt(0),X)),$.multipleOf=(X,J)=>$.check(A4(X,J));let U=$._zod.bag;$.minValue=U.minimum??null,$.maxValue=U.maximum??null,$.format=U.format??null});function $b($){return bJ(mv,$)}var bY=O("ZodBigIntFormat",($,v)=>{LU.init($,v),mv.init($,v)});function vb($){return VJ(bY,$)}function Ub($){return KJ(bY,$)}var jQ=O("ZodSymbol",($,v)=>{FU.init($,v),o.init($,v)});function Jb($){return BJ(jQ,$)}var wQ=O("ZodUndefined",($,v)=>{EU.init($,v),o.init($,v)});function Xb($){return AJ(wQ,$)}var HQ=O("ZodNull",($,v)=>{MU.init($,v),o.init($,v)});function NQ($){return SJ(HQ,$)}var IQ=O("ZodAny",($,v)=>{PU.init($,v),o.init($,v)});function Wb(){return qJ(IQ)}var OQ=O("ZodUnknown",($,v)=>{RU.init($,v),o.init($,v)});function w$(){return LJ(OQ)}var DQ=O("ZodNever",($,v)=>{kU.init($,v),o.init($,v)});function VY($){return FJ(DQ,$)}var bQ=O("ZodVoid",($,v)=>{CU.init($,v),o.init($,v)});function Yb($){return EJ(bQ,$)}var tJ=O("ZodDate",($,v)=>{_U.init($,v),o.init($,v),$.min=(X,J)=>$.check(y$(X,J)),$.max=(X,J)=>$.check(e$(X,J));let U=$._zod.bag;$.minDate=U.minimum?new Date(U.minimum):null,$.maxDate=U.maximum?new Date(U.maximum):null});function zb($){return MJ(tJ,$)}var VQ=O("ZodArray",($,v)=>{ZU.init($,v),o.init($,v),$.element=v.element,$.min=(U,X)=>$.check(v4(U,X)),$.nonempty=(U)=>$.check(v4(1,U)),$.max=(U,X)=>$.check(U1(U,X)),$.length=(U,X)=>$.check(J1(U,X)),$.unwrap=()=>$.element});function e($,v){return x8(VQ,$,v)}function Gb($){let v=$._zod.def.shape;return h$(Object.keys(v))}var aJ=O("ZodObject",($,v)=>{k9.init($,v),o.init($,v),q.defineLazy($,"shape",()=>{return v.shape}),$.keyof=()=>h$(Object.keys($._zod.def.shape)),$.catchall=(U)=>$.clone({...$._zod.def,catchall:U}),$.passthrough=()=>$.clone({...$._zod.def,catchall:w$()}),$.loose=()=>$.clone({...$._zod.def,catchall:w$()}),$.strict=()=>$.clone({...$._zod.def,catchall:VY()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(U)=>{return q.extend($,U)},$.safeExtend=(U)=>{return q.safeExtend($,U)},$.merge=(U)=>q.merge($,U),$.pick=(U)=>q.pick($,U),$.omit=(U)=>q.omit($,U),$.partial=(...U)=>q.partial(qY,$,U[0]),$.required=(...U)=>q.required(LY,$,U[0])});function _($,v){let U={type:"object",shape:$??{},...q.normalizeParams(v)};return new aJ(U)}function Qb($,v){return new aJ({type:"object",shape:$,catchall:VY(),...q.normalizeParams(v)})}function A6($,v){return new aJ({type:"object",shape:$,catchall:w$(),...q.normalizeParams(v)})}var KY=O("ZodUnion",($,v)=>{d1.init($,v),o.init($,v),$.options=v.options});function H$($,v){return new KY({type:"union",options:$,...q.normalizeParams(v)})}var KQ=O("ZodDiscriminatedUnion",($,v)=>{KY.init($,v),xU.init($,v)});function BY($,v,U){return new KQ({type:"union",options:v,discriminator:$,...q.normalizeParams(U)})}var BQ=O("ZodIntersection",($,v)=>{gU.init($,v),o.init($,v)});function nv($,v){return new BQ({type:"intersection",left:$,right:v})}var AQ=O("ZodTuple",($,v)=>{t1.init($,v),o.init($,v),$.rest=(U)=>$.clone({...$._zod.def,rest:U})});function SQ($,v,U){let X=v instanceof l,J=X?U:v;return new AQ({type:"tuple",items:$,rest:X?v:null,...q.normalizeParams(J)})}var AY=O("ZodRecord",($,v)=>{fU.init($,v),o.init($,v),$.keyType=v.keyType,$.valueType=v.valueType});function O$($,v,U){return new AY({type:"record",keyType:$,valueType:v,...q.normalizeParams(U)})}function jb($,v,U){let X=F$($);return X._zod.values=void 0,new AY({type:"record",keyType:X,valueType:v,...q.normalizeParams(U)})}var qQ=O("ZodMap",($,v)=>{yU.init($,v),o.init($,v),$.keyType=v.keyType,$.valueType=v.valueType});function wb($,v,U){return new qQ({type:"map",keyType:$,valueType:v,...q.normalizeParams(U)})}var LQ=O("ZodSet",($,v)=>{uU.init($,v),o.init($,v),$.min=(...U)=>$.check(S4(...U)),$.nonempty=(U)=>$.check(S4(1,U)),$.max=(...U)=>$.check(v1(...U)),$.size=(...U)=>$.check(Lv(...U))});function Hb($,v){return new LQ({type:"set",valueType:$,...q.normalizeParams(v)})}var fv=O("ZodEnum",($,v)=>{hU.init($,v),o.init($,v),$.enum=v.entries,$.options=Object.values(v.entries);let U=new Set(Object.keys(v.entries));$.extract=(X,J)=>{let W={};for(let Y of X)if(U.has(Y))W[Y]=v.entries[Y];else throw Error(`Key ${Y} not found in enum`);return new fv({...v,checks:[],...q.normalizeParams(J),entries:W})},$.exclude=(X,J)=>{let W={...v.entries};for(let Y of X)if(U.has(Y))delete W[Y];else throw Error(`Key ${Y} not found in enum`);return new fv({...v,checks:[],...q.normalizeParams(J),entries:W})}});function h$($,v){let U=Array.isArray($)?Object.fromEntries($.map((X)=>[X,X])):$;return new fv({type:"enum",entries:U,...q.normalizeParams(v)})}function Nb($,v){return new fv({type:"enum",entries:$,...q.normalizeParams(v)})}var FQ=O("ZodLiteral",($,v)=>{lU.init($,v),o.init($,v),$.values=new Set(v.values),Object.defineProperty($,"value",{get(){if(v.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return v.values[0]}})});function f($,v){return new FQ({type:"literal",values:Array.isArray($)?$:[$],...q.normalizeParams(v)})}var EQ=O("ZodFile",($,v)=>{mU.init($,v),o.init($,v),$.min=(U,X)=>$.check(S4(U,X)),$.max=(U,X)=>$.check(v1(U,X)),$.mime=(U,X)=>$.check(Cv(Array.isArray(U)?U:[U],X))});function Ib($){return RJ(EQ,$)}var MQ=O("ZodTransform",($,v)=>{nU.init($,v),o.init($,v),$._zod.parse=(U,X)=>{if(X.direction==="backward")throw new D4($.constructor.name);U.addIssue=(W)=>{if(typeof W==="string")U.issues.push(q.issue(W,U.value,v));else{let Y=W;if(Y.fatal)Y.continue=!1;Y.code??(Y.code="custom"),Y.input??(Y.input=U.value),Y.inst??(Y.inst=$),U.issues.push(q.issue(Y))}};let J=v.transform(U.value,U);if(J instanceof Promise)return J.then((W)=>{return U.value=W,U});return U.value=J,U}});function SY($){return new MQ({type:"transform",transform:$})}var qY=O("ZodOptional",($,v)=>{cU.init($,v),o.init($,v),$.unwrap=()=>$._zod.def.innerType});function c($){return new qY({type:"optional",innerType:$})}var PQ=O("ZodNullable",($,v)=>{iU.init($,v),o.init($,v),$.unwrap=()=>$._zod.def.innerType});function oJ($){return new PQ({type:"nullable",innerType:$})}function Ob($){return c(oJ($))}var RQ=O("ZodDefault",($,v)=>{rU.init($,v),o.init($,v),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function kQ($,v){return new RQ({type:"default",innerType:$,get defaultValue(){return typeof v==="function"?v():q.shallowClone(v)}})}var CQ=O("ZodPrefault",($,v)=>{oU.init($,v),o.init($,v),$.unwrap=()=>$._zod.def.innerType});function _Q($,v){return new CQ({type:"prefault",innerType:$,get defaultValue(){return typeof v==="function"?v():q.shallowClone(v)}})}var LY=O("ZodNonOptional",($,v)=>{pU.init($,v),o.init($,v),$.unwrap=()=>$._zod.def.innerType});function ZQ($,v){return new LY({type:"nonoptional",innerType:$,...q.normalizeParams(v)})}var TQ=O("ZodSuccess",($,v)=>{dU.init($,v),o.init($,v),$.unwrap=()=>$._zod.def.innerType});function Db($){return new TQ({type:"success",innerType:$})}var xQ=O("ZodCatch",($,v)=>{tU.init($,v),o.init($,v),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function gQ($,v){return new xQ({type:"catch",innerType:$,catchValue:typeof v==="function"?v:()=>v})}var fQ=O("ZodNaN",($,v)=>{aU.init($,v),o.init($,v)});function bb($){return PJ(fQ,$)}var FY=O("ZodPipe",($,v)=>{eU.init($,v),o.init($,v),$.in=v.in,$.out=v.out});function pJ($,v){return new FY({type:"pipe",in:$,out:v})}var EY=O("ZodCodec",($,v)=>{FY.init($,v),a4.init($,v)});function Vb($,v,U){return new EY({type:"pipe",in:$,out:v,transform:U.decode,reverseTransform:U.encode})}var yQ=O("ZodReadonly",($,v)=>{sU.init($,v),o.init($,v),$.unwrap=()=>$._zod.def.innerType});function uQ($){return new yQ({type:"readonly",innerType:$})}var hQ=O("ZodTemplateLiteral",($,v)=>{$J.init($,v),o.init($,v)});function Kb($,v){return new hQ({type:"template_literal",parts:$,...q.normalizeParams(v)})}var lQ=O("ZodLazy",($,v)=>{JJ.init($,v),o.init($,v),$.unwrap=()=>$._zod.def.getter()});function mQ($){return new lQ({type:"lazy",getter:$})}var nQ=O("ZodPromise",($,v)=>{UJ.init($,v),o.init($,v),$.unwrap=()=>$._zod.def.innerType});function Bb($){return new nQ({type:"promise",innerType:$})}var cQ=O("ZodFunction",($,v)=>{vJ.init($,v),o.init($,v)});function Ab($){return new cQ({type:"function",input:Array.isArray($?.input)?SQ($?.input):$?.input??e(w$()),output:$?.output??w$()})}var eJ=O("ZodCustom",($,v)=>{XJ.init($,v),o.init($,v)});function Sb($){let v=new z$({check:"custom"});return v._zod.check=$,v}function MY($,v){return kJ(eJ,$??(()=>!0),v)}function iQ($,v={}){return CJ(eJ,$,v)}function rQ($){return _J($)}var qb=ZJ,Lb=TJ;function Fb($,v={error:`Input not instance of ${$.name}`}){let U=new eJ({type:"custom",check:"custom",fn:(X)=>X instanceof $,abort:!0,...q.normalizeParams(v)});return U._zod.bag.Class=$,U}var Eb=(...$)=>xJ({Codec:EY,Boolean:lv,String:yv},...$);function Mb($){let v=mQ(()=>{return H$([V($),I$(),q$(),NQ(),e(v),O$(V(),v)])});return v}function PY($,v){return pJ(SY($),v)}var Pb={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function Rb($){B$({customError:$})}function kb(){return B$().customError}var RY;(function($){})(RY||(RY={}));var kY={};H4(kY,{string:()=>Cb,number:()=>_b,date:()=>xb,boolean:()=>Zb,bigint:()=>Tb});function Cb($){return A8(yv,$)}function _b($){return E8(hv,$)}function Zb($){return M8(lv,$)}function Tb($){return P8(mv,$)}function xb($){return R8(tJ,$)}B$(a1());var CY="2025-06-18";var oQ=[CY,"2025-03-26","2024-11-05","2024-10-07"],$X="2.0",S6=MY(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),pQ=H$([V(),I$().int()]),dQ=V(),gb=A6({progressToken:pQ.optional()}),W6=A6({_meta:gb.optional()}),l$=_({method:V(),params:W6.optional()}),j1=A6({_meta:O$(V(),w$()).optional()}),Y6=_({method:V(),params:j1.optional()}),s$=A6({_meta:O$(V(),w$()).optional()}),vX=H$([V(),I$().int()]),tQ=_({jsonrpc:f($X),id:vX,...l$.shape}).strict(),aQ=($)=>tQ.safeParse($).success,eQ=_({jsonrpc:f($X),...Y6.shape}).strict(),sQ=($)=>eQ.safeParse($).success,$7=_({jsonrpc:f($X),id:vX,result:s$}).strict(),_Y=($)=>$7.safeParse($).success,Y$;(function($){$[$.ConnectionClosed=-32000]="ConnectionClosed",$[$.RequestTimeout=-32001]="RequestTimeout",$[$.ParseError=-32700]="ParseError",$[$.InvalidRequest=-32600]="InvalidRequest",$[$.MethodNotFound=-32601]="MethodNotFound",$[$.InvalidParams=-32602]="InvalidParams",$[$.InternalError=-32603]="InternalError",$[$.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Y$||(Y$={}));var v7=_({jsonrpc:f($X),id:vX,error:_({code:I$().int(),message:V(),data:c(w$())})}).strict(),U7=($)=>v7.safeParse($).success,J7=H$([tQ,eQ,$7,v7]),UX=s$.strict(),fb=j1.extend({requestId:vX,reason:V().optional()}),JX=Y6.extend({method:f("notifications/cancelled"),params:fb}),yb=_({src:V(),mimeType:V().optional(),sizes:e(V()).optional()}),cv=_({icons:e(yb).optional()}),Q1=_({name:V(),title:V().optional()}),X7=Q1.extend({...Q1.shape,...cv.shape,version:V(),websiteUrl:V().optional()}),ub=nv(_({applyDefaults:q$().optional()}),O$(V(),w$())),hb=PY(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},nv(_({form:ub.optional(),url:S6.optional()}),O$(V(),w$()).optional())),lb=_({experimental:O$(V(),S6).optional(),sampling:_({context:S6.optional(),tools:S6.optional()}).optional(),elicitation:hb.optional(),roots:_({listChanged:q$().optional()}).optional()}),mb=W6.extend({protocolVersion:V(),capabilities:lb,clientInfo:X7}),ZY=l$.extend({method:f("initialize"),params:mb});var nb=_({experimental:O$(V(),S6).optional(),logging:S6.optional(),completions:S6.optional(),prompts:c(_({listChanged:c(q$())})),resources:_({subscribe:q$().optional(),listChanged:q$().optional()}).optional(),tools:_({listChanged:q$().optional()}).optional()}),cb=s$.extend({protocolVersion:V(),capabilities:nb,serverInfo:X7,instructions:V().optional()}),TY=Y6.extend({method:f("notifications/initialized")});var XX=l$.extend({method:f("ping")}),ib=_({progress:I$(),total:c(I$()),message:c(V())}),rb=_({...j1.shape,...ib.shape,progressToken:pQ}),WX=Y6.extend({method:f("notifications/progress"),params:rb}),ob=W6.extend({cursor:dQ.optional()}),YX=l$.extend({params:ob.optional()}),zX=s$.extend({nextCursor:c(dQ)}),W7=_({uri:V(),mimeType:c(V()),_meta:O$(V(),w$()).optional()}),Y7=W7.extend({text:V()}),xY=V().refine(($)=>{try{return atob($),!0}catch(v){return!1}},{message:"Invalid Base64 string"}),z7=W7.extend({blob:xY}),G7=_({...Q1.shape,...cv.shape,uri:V(),description:c(V()),mimeType:c(V()),_meta:c(A6({}))}),pb=_({...Q1.shape,...cv.shape,uriTemplate:V(),description:c(V()),mimeType:c(V()),_meta:c(A6({}))}),GX=YX.extend({method:f("resources/list")}),db=zX.extend({resources:e(G7)}),QX=YX.extend({method:f("resources/templates/list")}),tb=zX.extend({resourceTemplates:e(pb)}),gY=W6.extend({uri:V()}),ab=gY,jX=l$.extend({method:f("resources/read"),params:ab}),eb=s$.extend({contents:e(H$([Y7,z7]))}),sb=Y6.extend({method:f("notifications/resources/list_changed")}),$V=gY,vV=l$.extend({method:f("resources/subscribe"),params:$V}),UV=gY,JV=l$.extend({method:f("resources/unsubscribe"),params:UV}),XV=j1.extend({uri:V()}),WV=Y6.extend({method:f("notifications/resources/updated"),params:XV}),YV=_({name:V(),description:c(V()),required:c(q$())}),zV=_({...Q1.shape,...cv.shape,description:c(V()),arguments:c(e(YV)),_meta:c(A6({}))}),wX=YX.extend({method:f("prompts/list")}),GV=zX.extend({prompts:e(zV)}),QV=W6.extend({name:V(),arguments:O$(V(),V()).optional()}),HX=l$.extend({method:f("prompts/get"),params:QV}),Q7=_({type:f("text"),text:V(),_meta:O$(V(),w$()).optional()}),j7=_({type:f("image"),data:xY,mimeType:V(),_meta:O$(V(),w$()).optional()}),w7=_({type:f("audio"),data:xY,mimeType:V(),_meta:O$(V(),w$()).optional()}),jV=_({type:f("tool_use"),name:V(),id:V(),input:_({}).passthrough(),_meta:c(_({}).passthrough())}).passthrough(),wV=_({type:f("resource"),resource:H$([Y7,z7]),_meta:O$(V(),w$()).optional()}),HV=G7.extend({type:f("resource_link")}),fY=H$([Q7,j7,w7,HV,wV]),NV=_({role:h$(["user","assistant"]),content:fY}),IV=s$.extend({description:c(V()),messages:e(NV)}),OV=Y6.extend({method:f("notifications/prompts/list_changed")}),DV=_({title:V().optional(),readOnlyHint:q$().optional(),destructiveHint:q$().optional(),idempotentHint:q$().optional(),openWorldHint:q$().optional()}),H7=_({...Q1.shape,...cv.shape,description:V().optional(),inputSchema:_({type:f("object"),properties:O$(V(),S6).optional(),required:e(V()).optional()}).catchall(w$()),outputSchema:_({type:f("object"),properties:O$(V(),S6).optional(),required:e(V()).optional()}).catchall(w$()).optional(),annotations:c(DV),_meta:O$(V(),w$()).optional()}),NX=YX.extend({method:f("tools/list")}),bV=zX.extend({tools:e(H7)}),N7=s$.extend({content:e(fY).default([]),structuredContent:O$(V(),w$()).optional(),isError:c(q$())}),PZ=N7.or(s$.extend({toolResult:w$()})),VV=W6.extend({name:V(),arguments:c(O$(V(),w$()))}),IX=l$.extend({method:f("tools/call"),params:VV}),KV=Y6.extend({method:f("notifications/tools/list_changed")}),iv=h$(["debug","info","notice","warning","error","critical","alert","emergency"]),BV=W6.extend({level:iv}),yY=l$.extend({method:f("logging/setLevel"),params:BV}),AV=j1.extend({level:iv,logger:V().optional(),data:w$()}),SV=Y6.extend({method:f("notifications/message"),params:AV}),qV=_({name:V().optional()}),LV=_({hints:c(e(qV)),costPriority:c(I$().min(0).max(1)),speedPriority:c(I$().min(0).max(1)),intelligencePriority:c(I$().min(0).max(1))}),FV=_({mode:c(h$(["auto","required","none"]))}),EV=_({type:f("tool_result"),toolUseId:V().describe("The unique identifier for the corresponding tool call."),content:e(fY).default([]),structuredContent:_({}).passthrough().optional(),isError:c(q$()),_meta:c(_({}).passthrough())}).passthrough(),sJ=BY("type",[Q7,j7,w7,jV,EV]),MV=_({role:h$(["user","assistant"]),content:H$([sJ,e(sJ)]),_meta:c(_({}).passthrough())}).passthrough(),PV=W6.extend({messages:e(MV),modelPreferences:LV.optional(),systemPrompt:V().optional(),includeContext:h$(["none","thisServer","allServers"]).optional(),temperature:I$().optional(),maxTokens:I$().int(),stopSequences:e(V()).optional(),metadata:S6.optional(),tools:c(e(H7)),toolChoice:c(FV)}),RV=l$.extend({method:f("sampling/createMessage"),params:PV}),uY=s$.extend({model:V(),stopReason:c(h$(["endTurn","stopSequence","maxTokens","toolUse"]).or(V())),role:h$(["user","assistant"]),content:H$([sJ,e(sJ)])}),kV=_({type:f("boolean"),title:V().optional(),description:V().optional(),default:q$().optional()}),CV=_({type:f("string"),title:V().optional(),description:V().optional(),minLength:I$().optional(),maxLength:I$().optional(),format:h$(["email","uri","date","date-time"]).optional(),default:V().optional()}),_V=_({type:h$(["number","integer"]),title:V().optional(),description:V().optional(),minimum:I$().optional(),maximum:I$().optional(),default:I$().optional()}),ZV=_({type:f("string"),title:V().optional(),description:V().optional(),enum:e(V()),default:V().optional()}),TV=_({type:f("string"),title:V().optional(),description:V().optional(),oneOf:e(_({const:V(),title:V()})),default:V().optional()}),xV=_({type:f("string"),title:V().optional(),description:V().optional(),enum:e(V()),enumNames:e(V()).optional(),default:V().optional()}),gV=H$([ZV,TV]),fV=_({type:f("array"),title:V().optional(),description:V().optional(),minItems:I$().optional(),maxItems:I$().optional(),items:_({type:f("string"),enum:e(V())}),default:e(V()).optional()}),yV=_({type:f("array"),title:V().optional(),description:V().optional(),minItems:I$().optional(),maxItems:I$().optional(),items:_({anyOf:e(_({const:V(),title:V()}))}),default:e(V()).optional()}),uV=H$([fV,yV]),hV=H$([xV,gV,uV]),lV=H$([hV,kV,CV,_V]),mV=W6.extend({mode:f("form").optional(),message:V(),requestedSchema:_({type:f("object"),properties:O$(V(),lV),required:e(V()).optional()})}),nV=W6.extend({mode:f("url"),message:V(),elicitationId:V(),url:V().url()}),cV=H$([mV,nV]),iV=l$.extend({method:f("elicitation/create"),params:cV}),rV=j1.extend({elicitationId:V()}),oV=Y6.extend({method:f("notifications/elicitation/complete"),params:rV}),OX=s$.extend({action:h$(["accept","decline","cancel"]),content:O$(V(),H$([V(),I$(),q$(),e(V())])).optional()}),pV=_({type:f("ref/resource"),uri:V()});var dV=_({type:f("ref/prompt"),name:V()}),tV=W6.extend({ref:H$([dV,pV]),argument:_({name:V(),value:V()}),context:_({arguments:O$(V(),V()).optional()}).optional()}),DX=l$.extend({method:f("completion/complete"),params:tV});function I7($){if($.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${$.params.ref.type}`)}function O7($){if($.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${$.params.ref.type}`)}var aV=s$.extend({completion:A6({values:e(V()).max(100),total:c(I$().int()),hasMore:c(q$())})}),eV=_({uri:V().startsWith("file://"),name:V().optional(),_meta:O$(V(),w$()).optional()}),sV=l$.extend({method:f("roots/list")}),hY=s$.extend({roots:e(eV)}),$K=Y6.extend({method:f("notifications/roots/list_changed")}),RZ=H$([XX,ZY,DX,yY,HX,wX,GX,QX,jX,vV,JV,IX,NX]),kZ=H$([JX,WX,TY,$K]),CZ=H$([UX,uY,OX,hY]),_Z=H$([XX,RV,iV,sV]),ZZ=H$([JX,WX,SV,WV,sb,KV,OV,oV]),TZ=H$([UX,cb,aV,IV,GV,db,tb,eb,N7,bV]);class G$ extends Error{constructor($,v,U){super(`MCP error ${$}: ${v}`);this.code=$,this.data=U,this.name="McpError"}static fromError($,v,U){if($===Y$.UrlElicitationRequired&&U){let X=U;if(X.elicitations)return new D7(X.elicitations,v)}return new G$($,v,U)}}class D7 extends G${constructor($,v=`URL elicitation${$.length>1?"s":""} required`){super(Y$.UrlElicitationRequired,v,{elicitations:$})}get elicitations(){var $,v;return(v=($=this.data)===null||$===void 0?void 0:$.elicitations)!==null&&v!==void 0?v:[]}}var V7=Symbol("Let zodToJsonSchema decide on which parser to use");var b7={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"},K7=($)=>typeof $==="string"?{...b7,name:$}:{...b7,...$};var B7=($)=>{let v=K7($),U=v.name!==void 0?[...v.basePath,v.definitionPath,v.name]:v.basePath;return{...v,flags:{hasReferencedOpenAiAnyType:!1},currentPath:U,propertyPath:void 0,seen:new Map(Object.entries(v.definitions).map(([X,J])=>[J._def,{def:J._def,path:[...v.basePath,v.definitionPath,X],jsonSchema:void 0}]))}};function lY($,v,U,X){if(!X?.errorMessages)return;if(U)$.errorMessage={...$.errorMessage,[v]:U}}function s($,v,U,X,J){$[v]=U,lY($,v,X,J)}var bX=($,v)=>{let U=0;for(;U<$.length&&U<v.length;U++)if($[U]!==v[U])break;return[($.length-U).toString(),...v.slice(U)].join("/")};function D$($){if($.target!=="openAi")return{};let v=[...$.basePath,$.definitionPath,$.openAiAnyTypeName];return $.flags.hasReferencedOpenAiAnyType=!0,{$ref:$.$refStrategy==="relative"?bX(v,$.currentPath):v.join("/")}}function A7($,v){let U={type:"array"};if($.type?._def&&$.type?._def?.typeName!==L.ZodAny)U.items=h($.type._def,{...v,currentPath:[...v.currentPath,"items"]});if($.minLength)s(U,"minItems",$.minLength.value,$.minLength.message,v);if($.maxLength)s(U,"maxItems",$.maxLength.value,$.maxLength.message,v);if($.exactLength)s(U,"minItems",$.exactLength.value,$.exactLength.message,v),s(U,"maxItems",$.exactLength.value,$.exactLength.message,v);return U}function S7($,v){let U={type:"integer",format:"int64"};if(!$.checks)return U;for(let X of $.checks)switch(X.kind){case"min":if(v.target==="jsonSchema7")if(X.inclusive)s(U,"minimum",X.value,X.message,v);else s(U,"exclusiveMinimum",X.value,X.message,v);else{if(!X.inclusive)U.exclusiveMinimum=!0;s(U,"minimum",X.value,X.message,v)}break;case"max":if(v.target==="jsonSchema7")if(X.inclusive)s(U,"maximum",X.value,X.message,v);else s(U,"exclusiveMaximum",X.value,X.message,v);else{if(!X.inclusive)U.exclusiveMaximum=!0;s(U,"maximum",X.value,X.message,v)}break;case"multipleOf":s(U,"multipleOf",X.value,X.message,v);break}return U}function q7(){return{type:"boolean"}}function VX($,v){return h($.type._def,v)}var L7=($,v)=>{return h($.innerType._def,v)};function mY($,v,U){let X=U??v.dateStrategy;if(Array.isArray(X))return{anyOf:X.map((J,W)=>mY($,v,J))};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 vK($,v)}}var vK=($,v)=>{let U={type:"integer",format:"unix-time"};if(v.target==="openApi3")return U;for(let X of $.checks)switch(X.kind){case"min":s(U,"minimum",X.value,X.message,v);break;case"max":s(U,"maximum",X.value,X.message,v);break}return U};function F7($,v){return{...h($.innerType._def,v),default:$.defaultValue()}}function E7($,v){return v.effectStrategy==="input"?h($.schema._def,v):D$(v)}function M7($){return{type:"string",enum:Array.from($.values)}}var UK=($)=>{if("type"in $&&$.type==="string")return!1;return"allOf"in $};function P7($,v){let U=[h($.left._def,{...v,currentPath:[...v.currentPath,"allOf","0"]}),h($.right._def,{...v,currentPath:[...v.currentPath,"allOf","1"]})].filter((W)=>!!W),X=v.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,J=[];return U.forEach((W)=>{if(UK(W)){if(J.push(...W.allOf),W.unevaluatedProperties===void 0)X=void 0}else{let Y=W;if("additionalProperties"in W&&W.additionalProperties===!1){let{additionalProperties:z,...G}=W;Y=G}else X=void 0;J.push(Y)}}),J.length?{allOf:J,...X}:void 0}function R7($,v){let U=typeof $.value;if(U!=="bigint"&&U!=="number"&&U!=="boolean"&&U!=="string")return{type:Array.isArray($.value)?"array":"object"};if(v.target==="openApi3")return{type:U==="bigint"?"integer":U,enum:[$.value]};return{type:U==="bigint"?"integer":U,const:$.value}}var nY=void 0,z6={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(nY===void 0)nY=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return nY},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 KX($,v){let U={type:"string"};if($.checks)for(let X of $.checks)switch(X.kind){case"min":s(U,"minLength",typeof U.minLength==="number"?Math.max(U.minLength,X.value):X.value,X.message,v);break;case"max":s(U,"maxLength",typeof U.maxLength==="number"?Math.min(U.maxLength,X.value):X.value,X.message,v);break;case"email":switch(v.emailStrategy){case"format:email":G6(U,"email",X.message,v);break;case"format:idn-email":G6(U,"idn-email",X.message,v);break;case"pattern:zod":Z$(U,z6.email,X.message,v);break}break;case"url":G6(U,"uri",X.message,v);break;case"uuid":G6(U,"uuid",X.message,v);break;case"regex":Z$(U,X.regex,X.message,v);break;case"cuid":Z$(U,z6.cuid,X.message,v);break;case"cuid2":Z$(U,z6.cuid2,X.message,v);break;case"startsWith":Z$(U,RegExp(`^${cY(X.value,v)}`),X.message,v);break;case"endsWith":Z$(U,RegExp(`${cY(X.value,v)}$`),X.message,v);break;case"datetime":G6(U,"date-time",X.message,v);break;case"date":G6(U,"date",X.message,v);break;case"time":G6(U,"time",X.message,v);break;case"duration":G6(U,"duration",X.message,v);break;case"length":s(U,"minLength",typeof U.minLength==="number"?Math.max(U.minLength,X.value):X.value,X.message,v),s(U,"maxLength",typeof U.maxLength==="number"?Math.min(U.maxLength,X.value):X.value,X.message,v);break;case"includes":{Z$(U,RegExp(cY(X.value,v)),X.message,v);break}case"ip":{if(X.version!=="v6")G6(U,"ipv4",X.message,v);if(X.version!=="v4")G6(U,"ipv6",X.message,v);break}case"base64url":Z$(U,z6.base64url,X.message,v);break;case"jwt":Z$(U,z6.jwt,X.message,v);break;case"cidr":{if(X.version!=="v6")Z$(U,z6.ipv4Cidr,X.message,v);if(X.version!=="v4")Z$(U,z6.ipv6Cidr,X.message,v);break}case"emoji":Z$(U,z6.emoji(),X.message,v);break;case"ulid":{Z$(U,z6.ulid,X.message,v);break}case"base64":{switch(v.base64Strategy){case"format:binary":{G6(U,"binary",X.message,v);break}case"contentEncoding:base64":{s(U,"contentEncoding","base64",X.message,v);break}case"pattern:zod":{Z$(U,z6.base64,X.message,v);break}}break}case"nanoid":Z$(U,z6.nanoid,X.message,v);case"toLowerCase":case"toUpperCase":case"trim":break;default:((J)=>{})(X)}return U}function cY($,v){return v.patternStrategy==="escape"?XK($):$}var JK=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function XK($){let v="";for(let U=0;U<$.length;U++){if(!JK.has($[U]))v+="\\";v+=$[U]}return v}function G6($,v,U,X){if($.format||$.anyOf?.some((J)=>J.format)){if(!$.anyOf)$.anyOf=[];if($.format){if($.anyOf.push({format:$.format,...$.errorMessage&&X.errorMessages&&{errorMessage:{format:$.errorMessage.format}}}),delete $.format,$.errorMessage){if(delete $.errorMessage.format,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.anyOf.push({format:v,...U&&X.errorMessages&&{errorMessage:{format:U}}})}else s($,"format",v,U,X)}function Z$($,v,U,X){if($.pattern||$.allOf?.some((J)=>J.pattern)){if(!$.allOf)$.allOf=[];if($.pattern){if($.allOf.push({pattern:$.pattern,...$.errorMessage&&X.errorMessages&&{errorMessage:{pattern:$.errorMessage.pattern}}}),delete $.pattern,$.errorMessage){if(delete $.errorMessage.pattern,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.allOf.push({pattern:k7(v,X),...U&&X.errorMessages&&{errorMessage:{pattern:U}}})}else s($,"pattern",k7(v,X),U,X)}function k7($,v){if(!v.applyRegexFlags||!$.flags)return $.source;let U={i:$.flags.includes("i"),m:$.flags.includes("m"),s:$.flags.includes("s")},X=U.i?$.source.toLowerCase():$.source,J="",W=!1,Y=!1,z=!1;for(let G=0;G<X.length;G++){if(W){J+=X[G],W=!1;continue}if(U.i){if(Y){if(X[G].match(/[a-z]/)){if(z)J+=X[G],J+=`${X[G-2]}-${X[G]}`.toUpperCase(),z=!1;else if(X[G+1]==="-"&&X[G+2]?.match(/[a-z]/))J+=X[G],z=!0;else J+=`${X[G]}${X[G].toUpperCase()}`;continue}}else if(X[G].match(/[a-z]/)){J+=`[${X[G]}${X[G].toUpperCase()}]`;continue}}if(U.m){if(X[G]==="^"){J+=`(^|(?<=[\r
34
+ ]))`;continue}else if(X[G]==="$"){J+=`($|(?=[\r
35
+ ]))`;continue}}if(U.s&&X[G]==="."){J+=Y?`${X[G]}\r
36
+ `:`[${X[G]}\r
37
+ ]`;continue}if(J+=X[G],X[G]==="\\")W=!0;else if(Y&&X[G]==="]")Y=!1;else if(!Y&&X[G]==="[")Y=!0}try{new RegExp(J)}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`),$.source}return J}function BX($,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"&&$.keyType?._def.typeName===L.ZodEnum)return{type:"object",required:$.keyType._def.values,properties:$.keyType._def.values.reduce((X,J)=>({...X,[J]:h($.valueType._def,{...v,currentPath:[...v.currentPath,"properties",J]})??D$(v)}),{}),additionalProperties:v.rejectedAdditionalProperties};let U={type:"object",additionalProperties:h($.valueType._def,{...v,currentPath:[...v.currentPath,"additionalProperties"]})??v.allowedAdditionalProperties};if(v.target==="openApi3")return U;if($.keyType?._def.typeName===L.ZodString&&$.keyType._def.checks?.length){let{type:X,...J}=KX($.keyType._def,v);return{...U,propertyNames:J}}else if($.keyType?._def.typeName===L.ZodEnum)return{...U,propertyNames:{enum:$.keyType._def.values}};else if($.keyType?._def.typeName===L.ZodBranded&&$.keyType._def.type._def.typeName===L.ZodString&&$.keyType._def.type._def.checks?.length){let{type:X,...J}=VX($.keyType._def,v);return{...U,propertyNames:J}}return U}function C7($,v){if(v.mapStrategy==="record")return BX($,v);let U=h($.keyType._def,{...v,currentPath:[...v.currentPath,"items","items","0"]})||D$(v),X=h($.valueType._def,{...v,currentPath:[...v.currentPath,"items","items","1"]})||D$(v);return{type:"array",maxItems:125,items:{type:"array",items:[U,X],minItems:2,maxItems:2}}}function _7($){let v=$.values,X=Object.keys($.values).filter((W)=>{return typeof v[v[W]]!=="number"}).map((W)=>v[W]),J=Array.from(new Set(X.map((W)=>typeof W)));return{type:J.length===1?J[0]==="string"?"string":"number":["string","number"],enum:X}}function Z7($){return $.target==="openAi"?void 0:{not:D$({...$,currentPath:[...$.currentPath,"not"]})}}function T7($){return $.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var rv={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function g7($,v){if(v.target==="openApi3")return x7($,v);let U=$.options instanceof Map?Array.from($.options.values()):$.options;if(U.every((X)=>(X._def.typeName in rv)&&(!X._def.checks||!X._def.checks.length))){let X=U.reduce((J,W)=>{let Y=rv[W._def.typeName];return Y&&!J.includes(Y)?[...J,Y]:J},[]);return{type:X.length>1?X:X[0]}}else if(U.every((X)=>X._def.typeName==="ZodLiteral"&&!X.description)){let X=U.reduce((J,W)=>{let Y=typeof W._def.value;switch(Y){case"string":case"number":case"boolean":return[...J,Y];case"bigint":return[...J,"integer"];case"object":if(W._def.value===null)return[...J,"null"];case"symbol":case"undefined":case"function":default:return J}},[]);if(X.length===U.length){let J=X.filter((W,Y,z)=>z.indexOf(W)===Y);return{type:J.length>1?J:J[0],enum:U.reduce((W,Y)=>{return W.includes(Y._def.value)?W:[...W,Y._def.value]},[])}}}else if(U.every((X)=>X._def.typeName==="ZodEnum"))return{type:"string",enum:U.reduce((X,J)=>[...X,...J._def.values.filter((W)=>!X.includes(W))],[])};return x7($,v)}var x7=($,v)=>{let U=($.options instanceof Map?Array.from($.options.values()):$.options).map((X,J)=>h(X._def,{...v,currentPath:[...v.currentPath,"anyOf",`${J}`]})).filter((X)=>!!X&&(!v.strictUnions||typeof X==="object"&&Object.keys(X).length>0));return U.length?{anyOf:U}:void 0};function f7($,v){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes($.innerType._def.typeName)&&(!$.innerType._def.checks||!$.innerType._def.checks.length)){if(v.target==="openApi3")return{type:rv[$.innerType._def.typeName],nullable:!0};return{type:[rv[$.innerType._def.typeName],"null"]}}if(v.target==="openApi3"){let X=h($.innerType._def,{...v,currentPath:[...v.currentPath]});if(X&&"$ref"in X)return{allOf:[X],nullable:!0};return X&&{...X,nullable:!0}}let U=h($.innerType._def,{...v,currentPath:[...v.currentPath,"anyOf","0"]});return U&&{anyOf:[U,{type:"null"}]}}function y7($,v){let U={type:"number"};if(!$.checks)return U;for(let X of $.checks)switch(X.kind){case"int":U.type="integer",lY(U,"type",X.message,v);break;case"min":if(v.target==="jsonSchema7")if(X.inclusive)s(U,"minimum",X.value,X.message,v);else s(U,"exclusiveMinimum",X.value,X.message,v);else{if(!X.inclusive)U.exclusiveMinimum=!0;s(U,"minimum",X.value,X.message,v)}break;case"max":if(v.target==="jsonSchema7")if(X.inclusive)s(U,"maximum",X.value,X.message,v);else s(U,"exclusiveMaximum",X.value,X.message,v);else{if(!X.inclusive)U.exclusiveMaximum=!0;s(U,"maximum",X.value,X.message,v)}break;case"multipleOf":s(U,"multipleOf",X.value,X.message,v);break}return U}function u7($,v){let U=v.target==="openAi",X={type:"object",properties:{}},J=[],W=$.shape();for(let z in W){let G=W[z];if(G===void 0||G._def===void 0)continue;let Q=YK(G);if(Q&&U){if(G._def.typeName==="ZodOptional")G=G._def.innerType;if(!G.isNullable())G=G.nullable();Q=!1}let j=h(G._def,{...v,currentPath:[...v.currentPath,"properties",z],propertyPath:[...v.currentPath,"properties",z]});if(j===void 0)continue;if(X.properties[z]=j,!Q)J.push(z)}if(J.length)X.required=J;let Y=WK($,v);if(Y!==void 0)X.additionalProperties=Y;return X}function WK($,v){if($.catchall._def.typeName!=="ZodNever")return h($.catchall._def,{...v,currentPath:[...v.currentPath,"additionalProperties"]});switch($.unknownKeys){case"passthrough":return v.allowedAdditionalProperties;case"strict":return v.rejectedAdditionalProperties;case"strip":return v.removeAdditionalStrategy==="strict"?v.allowedAdditionalProperties:v.rejectedAdditionalProperties}}function YK($){try{return $.isOptional()}catch{return!0}}var h7=($,v)=>{if(v.currentPath.toString()===v.propertyPath?.toString())return h($.innerType._def,v);let U=h($.innerType._def,{...v,currentPath:[...v.currentPath,"anyOf","1"]});return U?{anyOf:[{not:D$(v)},U]}:D$(v)};var l7=($,v)=>{if(v.pipeStrategy==="input")return h($.in._def,v);else if(v.pipeStrategy==="output")return h($.out._def,v);let U=h($.in._def,{...v,currentPath:[...v.currentPath,"allOf","0"]}),X=h($.out._def,{...v,currentPath:[...v.currentPath,"allOf",U?"1":"0"]});return{allOf:[U,X].filter((J)=>J!==void 0)}};function m7($,v){return h($.type._def,v)}function n7($,v){let X={type:"array",uniqueItems:!0,items:h($.valueType._def,{...v,currentPath:[...v.currentPath,"items"]})};if($.minSize)s(X,"minItems",$.minSize.value,$.minSize.message,v);if($.maxSize)s(X,"maxItems",$.maxSize.value,$.maxSize.message,v);return X}function c7($,v){if($.rest)return{type:"array",minItems:$.items.length,items:$.items.map((U,X)=>h(U._def,{...v,currentPath:[...v.currentPath,"items",`${X}`]})).reduce((U,X)=>X===void 0?U:[...U,X],[]),additionalItems:h($.rest._def,{...v,currentPath:[...v.currentPath,"additionalItems"]})};else return{type:"array",minItems:$.items.length,maxItems:$.items.length,items:$.items.map((U,X)=>h(U._def,{...v,currentPath:[...v.currentPath,"items",`${X}`]})).reduce((U,X)=>X===void 0?U:[...U,X],[])}}function i7($){return{not:D$($)}}function r7($){return D$($)}var o7=($,v)=>{return h($.innerType._def,v)};var p7=($,v,U)=>{switch(v){case L.ZodString:return KX($,U);case L.ZodNumber:return y7($,U);case L.ZodObject:return u7($,U);case L.ZodBigInt:return S7($,U);case L.ZodBoolean:return q7();case L.ZodDate:return mY($,U);case L.ZodUndefined:return i7(U);case L.ZodNull:return T7(U);case L.ZodArray:return A7($,U);case L.ZodUnion:case L.ZodDiscriminatedUnion:return g7($,U);case L.ZodIntersection:return P7($,U);case L.ZodTuple:return c7($,U);case L.ZodRecord:return BX($,U);case L.ZodLiteral:return R7($,U);case L.ZodEnum:return M7($);case L.ZodNativeEnum:return _7($);case L.ZodNullable:return f7($,U);case L.ZodOptional:return h7($,U);case L.ZodMap:return C7($,U);case L.ZodSet:return n7($,U);case L.ZodLazy:return()=>$.getter()._def;case L.ZodPromise:return m7($,U);case L.ZodNaN:case L.ZodNever:return Z7(U);case L.ZodEffects:return E7($,U);case L.ZodAny:return D$(U);case L.ZodUnknown:return r7(U);case L.ZodDefault:return F7($,U);case L.ZodBranded:return VX($,U);case L.ZodReadonly:return o7($,U);case L.ZodCatch:return L7($,U);case L.ZodPipeline:return l7($,U);case L.ZodFunction:case L.ZodVoid:case L.ZodSymbol:return;default:return((X)=>{return})(v)}};function h($,v,U=!1){let X=v.seen.get($);if(v.override){let z=v.override?.($,v,X,U);if(z!==V7)return z}if(X&&!U){let z=zK(X,v);if(z!==void 0)return z}let J={def:$,path:v.currentPath,jsonSchema:void 0};v.seen.set($,J);let W=p7($,$.typeName,v),Y=typeof W==="function"?h(W(),v):W;if(Y)GK($,v,Y);if(v.postProcess){let z=v.postProcess(Y,$,v);return J.jsonSchema=Y,z}return J.jsonSchema=Y,Y}var zK=($,v)=>{switch(v.$refStrategy){case"root":return{$ref:$.path.join("/")};case"relative":return{$ref:bX(v.currentPath,$.path)};case"none":case"seen":{if($.path.length<v.currentPath.length&&$.path.every((U,X)=>v.currentPath[X]===U))return console.warn(`Recursive reference detected at ${v.currentPath.join("/")}! Defaulting to any`),D$(v);return v.$refStrategy==="seen"?D$(v):void 0}}},GK=($,v,U)=>{if($.description){if(U.description=$.description,v.markdownDescription)U.markdownDescription=$.description}return U};var iY=($,v)=>{let U=B7(v),X=typeof v==="object"&&v.definitions?Object.entries(v.definitions).reduce((G,[Q,j])=>({...G,[Q]:h(j._def,{...U,currentPath:[...U.basePath,U.definitionPath,Q]},!0)??D$(U)}),{}):void 0,J=typeof v==="string"?v:v?.nameStrategy==="title"?void 0:v?.name,W=h($._def,J===void 0?U:{...U,currentPath:[...U.basePath,U.definitionPath,J]},!1)??D$(U),Y=typeof v==="object"&&v.name!==void 0&&v.nameStrategy==="title"?v.name:void 0;if(Y!==void 0)W.title=Y;if(U.flags.hasReferencedOpenAiAnyType){if(!X)X={};if(!X[U.openAiAnyTypeName])X[U.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:U.$refStrategy==="relative"?"1":[...U.basePath,U.definitionPath,U.openAiAnyTypeName].join("/")}}}let z=J===void 0?X?{...W,[U.definitionPath]:X}:W:{$ref:[...U.$refStrategy==="relative"?[]:U.basePath,U.definitionPath,J].join("/"),[U.definitionPath]:{...X,[J]:W}};if(U.target==="jsonSchema7")z.$schema="http://json-schema.org/draft-07/schema#";else if(U.target==="jsonSchema2019-09"||U.target==="openAi")z.$schema="https://json-schema.org/draft/2019-09/schema#";if(U.target==="openAi"&&(("anyOf"in z)||("oneOf"in z)||("allOf"in z)||("type"in z)&&Array.isArray(z.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return z};function QK($){if(!$)return"draft-7";if($==="jsonSchema7"||$==="draft-7")return"draft-7";if($==="jsonSchema2019-09"||$==="draft-2020-12")return"draft-2020-12";return"draft-7"}function rY($,v){var U,X,J;if(X6($))return X1($,{target:QK(v===null||v===void 0?void 0:v.target),io:(U=v===null||v===void 0?void 0:v.pipeStrategy)!==null&&U!==void 0?U:"input"});return iY($,{strictUnions:(X=v===null||v===void 0?void 0:v.strictUnions)!==null&&X!==void 0?X:!0,pipeStrategy:(J=v===null||v===void 0?void 0:v.pipeStrategy)!==null&&J!==void 0?J:"input"})}function oY($){let v=Y1($),U=v===null||v===void 0?void 0:v.method;if(!U)throw Error("Schema is missing a method literal");let X=hJ(U);if(typeof X!=="string")throw Error("Schema method literal must be a string");return X}function pY($,v){let U=fJ($,v);if(!U.success)throw U.error;return U.data}var jK=60000;class dY{constructor($){this._options=$,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(JX,(v)=>{let U=this._requestHandlerAbortControllers.get(v.params.requestId);U===null||U===void 0||U.abort(v.params.reason)}),this.setNotificationHandler(WX,(v)=>{this._onprogress(v)}),this.setRequestHandler(XX,(v)=>({}))}_setupTimeout($,v,U,X,J=!1){this._timeoutInfo.set($,{timeoutId:setTimeout(X,v),startTime:Date.now(),timeout:v,maxTotalTimeout:U,resetTimeoutOnProgress:J,onTimeout:X})}_resetTimeout($){let v=this._timeoutInfo.get($);if(!v)return!1;let U=Date.now()-v.startTime;if(v.maxTotalTimeout&&U>=v.maxTotalTimeout)throw this._timeoutInfo.delete($),G$.fromError(Y$.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:v.maxTotalTimeout,totalElapsed:U});return clearTimeout(v.timeoutId),v.timeoutId=setTimeout(v.onTimeout,v.timeout),!0}_cleanupTimeout($){let v=this._timeoutInfo.get($);if(v)clearTimeout(v.timeoutId),this._timeoutInfo.delete($)}async connect($){var v,U,X;this._transport=$;let J=(v=this.transport)===null||v===void 0?void 0:v.onclose;this._transport.onclose=()=>{J===null||J===void 0||J(),this._onclose()};let W=(U=this.transport)===null||U===void 0?void 0:U.onerror;this._transport.onerror=(z)=>{W===null||W===void 0||W(z),this._onerror(z)};let Y=(X=this._transport)===null||X===void 0?void 0:X.onmessage;this._transport.onmessage=(z,G)=>{if(Y===null||Y===void 0||Y(z,G),_Y(z)||U7(z))this._onresponse(z);else if(aQ(z))this._onrequest(z,G);else if(sQ(z))this._onnotification(z);else this._onerror(Error(`Unknown message type: ${JSON.stringify(z)}`))},await this._transport.start()}_onclose(){var $;let v=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,($=this.onclose)===null||$===void 0||$.call(this);let U=G$.fromError(Y$.ConnectionClosed,"Connection closed");for(let X of v.values())X(U)}_onerror($){var v;(v=this.onerror)===null||v===void 0||v.call(this,$)}_onnotification($){var v;let U=(v=this._notificationHandlers.get($.method))!==null&&v!==void 0?v:this.fallbackNotificationHandler;if(U===void 0)return;Promise.resolve().then(()=>U($)).catch((X)=>this._onerror(Error(`Uncaught error in notification handler: ${X}`)))}_onrequest($,v){var U,X;let J=(U=this._requestHandlers.get($.method))!==null&&U!==void 0?U:this.fallbackRequestHandler,W=this._transport;if(J===void 0){W===null||W===void 0||W.send({jsonrpc:"2.0",id:$.id,error:{code:Y$.MethodNotFound,message:"Method not found"}}).catch((G)=>this._onerror(Error(`Failed to send an error response: ${G}`)));return}let Y=new AbortController;this._requestHandlerAbortControllers.set($.id,Y);let z={signal:Y.signal,sessionId:W===null||W===void 0?void 0:W.sessionId,_meta:(X=$.params)===null||X===void 0?void 0:X._meta,sendNotification:(G)=>this.notification(G,{relatedRequestId:$.id}),sendRequest:(G,Q,j)=>this.request(G,Q,{...j,relatedRequestId:$.id}),authInfo:v===null||v===void 0?void 0:v.authInfo,requestId:$.id,requestInfo:v===null||v===void 0?void 0:v.requestInfo};Promise.resolve().then(()=>J($,z)).then((G)=>{if(Y.signal.aborted)return;return W===null||W===void 0?void 0:W.send({result:G,jsonrpc:"2.0",id:$.id})},(G)=>{var Q;if(Y.signal.aborted)return;return W===null||W===void 0?void 0:W.send({jsonrpc:"2.0",id:$.id,error:{code:Number.isSafeInteger(G.code)?G.code:Y$.InternalError,message:(Q=G.message)!==null&&Q!==void 0?Q:"Internal error",...G.data!==void 0&&{data:G.data}}})}).catch((G)=>this._onerror(Error(`Failed to send response: ${G}`))).finally(()=>{this._requestHandlerAbortControllers.delete($.id)})}_onprogress($){let{progressToken:v,...U}=$.params,X=Number(v),J=this._progressHandlers.get(X);if(!J){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify($)}`));return}let W=this._responseHandlers.get(X),Y=this._timeoutInfo.get(X);if(Y&&W&&Y.resetTimeoutOnProgress)try{this._resetTimeout(X)}catch(z){W(z);return}J(U)}_onresponse($){let v=Number($.id),U=this._responseHandlers.get(v);if(U===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify($)}`));return}if(this._responseHandlers.delete(v),this._progressHandlers.delete(v),this._cleanupTimeout(v),_Y($))U($);else{let X=G$.fromError($.error.code,$.error.message,$.error.data);U(X)}}get transport(){return this._transport}async close(){var $;await(($=this._transport)===null||$===void 0?void 0:$.close())}request($,v,U){let{relatedRequestId:X,resumptionToken:J,onresumptiontoken:W}=U!==null&&U!==void 0?U:{};return new Promise((Y,z)=>{var G,Q,j,H,N,w;if(!this._transport){z(Error("Not connected"));return}if(((G=this._options)===null||G===void 0?void 0:G.enforceStrictCapabilities)===!0)this.assertCapabilityForMethod($.method);(Q=U===null||U===void 0?void 0:U.signal)===null||Q===void 0||Q.throwIfAborted();let I=this._requestMessageId++,D={...$,jsonrpc:"2.0",id:I};if(U===null||U===void 0?void 0:U.onprogress)this._progressHandlers.set(I,U.onprogress),D.params={...$.params,_meta:{...((j=$.params)===null||j===void 0?void 0:j._meta)||{},progressToken:I}};let K=(R)=>{var y;this._responseHandlers.delete(I),this._progressHandlers.delete(I),this._cleanupTimeout(I),(y=this._transport)===null||y===void 0||y.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:I,reason:String(R)}},{relatedRequestId:X,resumptionToken:J,onresumptiontoken:W}).catch((T)=>this._onerror(Error(`Failed to send cancellation: ${T}`))),z(R)};this._responseHandlers.set(I,(R)=>{var y;if((y=U===null||U===void 0?void 0:U.signal)===null||y===void 0?void 0:y.aborted)return;if(R instanceof Error)return z(R);try{let T=fJ(v,R.result);if(!T.success)z(T.error);else Y(T.data)}catch(T){z(T)}}),(H=U===null||U===void 0?void 0:U.signal)===null||H===void 0||H.addEventListener("abort",()=>{var R;K((R=U===null||U===void 0?void 0:U.signal)===null||R===void 0?void 0:R.reason)});let B=(N=U===null||U===void 0?void 0:U.timeout)!==null&&N!==void 0?N:jK,x=()=>K(G$.fromError(Y$.RequestTimeout,"Request timed out",{timeout:B}));this._setupTimeout(I,B,U===null||U===void 0?void 0:U.maxTotalTimeout,x,(w=U===null||U===void 0?void 0:U.resetTimeoutOnProgress)!==null&&w!==void 0?w:!1),this._transport.send(D,{relatedRequestId:X,resumptionToken:J,onresumptiontoken:W}).catch((R)=>{this._cleanupTimeout(I),z(R)})})}async notification($,v){var U,X;if(!this._transport)throw Error("Not connected");if(this.assertNotificationCapability($.method),((X=(U=this._options)===null||U===void 0?void 0:U.debouncedNotificationMethods)!==null&&X!==void 0?X:[]).includes($.method)&&!$.params&&!(v===null||v===void 0?void 0:v.relatedRequestId)){if(this._pendingDebouncedNotifications.has($.method))return;this._pendingDebouncedNotifications.add($.method),Promise.resolve().then(()=>{var z;if(this._pendingDebouncedNotifications.delete($.method),!this._transport)return;let G={...$,jsonrpc:"2.0"};(z=this._transport)===null||z===void 0||z.send(G,v).catch((Q)=>this._onerror(Q))});return}let Y={...$,jsonrpc:"2.0"};await this._transport.send(Y,v)}setRequestHandler($,v){let U=oY($);this.assertRequestHandlerCapability(U),this._requestHandlers.set(U,(X,J)=>{let W=pY($,X);return Promise.resolve(v(W,J))})}removeRequestHandler($){this._requestHandlers.delete($)}assertCanSetRequestHandler($){if(this._requestHandlers.has($))throw Error(`A request handler for ${$} already exists, which would be overridden`)}setNotificationHandler($,v){let U=oY($);this._notificationHandlers.set(U,(X)=>{let J=pY($,X);return Promise.resolve(v(J))})}removeNotificationHandler($){this._notificationHandlers.delete($)}}function d7($){return $!==null&&typeof $==="object"&&!Array.isArray($)}function t7($,v){let U={...$};for(let X in v){let J=X,W=v[J];if(W===void 0)continue;let Y=U[J];if(d7(Y)&&d7(W))U[J]={...Y,...W};else U[J]=W}return U}var MH=IW(nz(),1),PH=IW(EH(),1);function KM(){let $=new MH.Ajv({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return PH.default($),$}class sz{constructor($){this._ajv=$!==null&&$!==void 0?$:KM()}getValidator($){var v;let U="$id"in $&&typeof $.$id==="string"?(v=this._ajv.getSchema($.$id))!==null&&v!==void 0?v:this._ajv.compile($):this._ajv.compile($);return(X)=>{if(U(X))return{valid:!0,data:X,errorMessage:void 0};else return{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(U.errors)}}}}class $G extends dY{constructor($,v){var U,X;super(v);if(this._serverInfo=$,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(iv.options.map((J,W)=>[J,W])),this.isMessageIgnored=(J,W)=>{let Y=this._loggingLevels.get(W);return Y?this.LOG_LEVEL_SEVERITY.get(J)<this.LOG_LEVEL_SEVERITY.get(Y):!1},this._capabilities=(U=v===null||v===void 0?void 0:v.capabilities)!==null&&U!==void 0?U:{},this._instructions=v===null||v===void 0?void 0:v.instructions,this._jsonSchemaValidator=(X=v===null||v===void 0?void 0:v.jsonSchemaValidator)!==null&&X!==void 0?X:new sz,this.setRequestHandler(ZY,(J)=>this._oninitialize(J)),this.setNotificationHandler(TY,()=>{var J;return(J=this.oninitialized)===null||J===void 0?void 0:J.call(this)}),this._capabilities.logging)this.setRequestHandler(yY,async(J,W)=>{var Y;let z=W.sessionId||((Y=W.requestInfo)===null||Y===void 0?void 0:Y.headers["mcp-session-id"])||void 0,{level:G}=J.params,Q=iv.safeParse(G);if(Q.success)this._loggingLevels.set(z,Q.data);return{}})}registerCapabilities($){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=t7(this._capabilities,$)}assertCapabilityForMethod($){var v,U,X;switch($){case"sampling/createMessage":if(!((v=this._clientCapabilities)===null||v===void 0?void 0:v.sampling))throw Error(`Client does not support sampling (required for ${$})`);break;case"elicitation/create":if(!((U=this._clientCapabilities)===null||U===void 0?void 0:U.elicitation))throw Error(`Client does not support elicitation (required for ${$})`);break;case"roots/list":if(!((X=this._clientCapabilities)===null||X===void 0?void 0:X.roots))throw Error(`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){var v,U;switch($){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${$})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/elicitation/complete":if(!((U=(v=this._clientCapabilities)===null||v===void 0?void 0:v.elicitation)===null||U===void 0?void 0:U.url))throw Error(`Client does not support URL elicitation (required for ${$})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability($){switch($){case"completion/complete":if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${$})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${$})`);break;case"ping":case"initialize":break}}async _oninitialize($){let v=$.params.protocolVersion;return this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo,{protocolVersion:oQ.includes(v)?v:CY,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"},UX)}async createMessage($,v){var U,X;if($.tools||$.toolChoice){if(!((X=(U=this._clientCapabilities)===null||U===void 0?void 0:U.sampling)===null||X===void 0?void 0:X.tools))throw Error("Client does not support sampling tools capability.")}if($.messages.length>0){let J=$.messages[$.messages.length-1],W=Array.isArray(J.content)?J.content:[J.content],Y=W.some((j)=>j.type==="tool_result"),z=$.messages.length>1?$.messages[$.messages.length-2]:void 0,G=z?Array.isArray(z.content)?z.content:[z.content]:[],Q=G.some((j)=>j.type==="tool_use");if(Y){if(W.some((j)=>j.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!Q)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(Q){let j=new Set(G.filter((N)=>N.type==="tool_use").map((N)=>N.id)),H=new Set(W.filter((N)=>N.type==="tool_result").map((N)=>N.toolUseId));if(j.size!==H.size||![...j].every((N)=>H.has(N)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.request({method:"sampling/createMessage",params:$},uY,v)}async elicitInput($,v){var U,X,J,W,Y;switch((U=$.mode)!==null&&U!==void 0?U:"form"){case"url":{if(!((J=(X=this._clientCapabilities)===null||X===void 0?void 0:X.elicitation)===null||J===void 0?void 0:J.url))throw Error("Client does not support url elicitation.");let G=$;return this.request({method:"elicitation/create",params:G},OX,v)}case"form":{if(!((Y=(W=this._clientCapabilities)===null||W===void 0?void 0:W.elicitation)===null||Y===void 0?void 0:Y.form))throw Error("Client does not support form elicitation.");let G=$.mode==="form"?$:{...$,mode:"form"},Q=await this.request({method:"elicitation/create",params:G},OX,v);if(Q.action==="accept"&&Q.content&&G.requestedSchema)try{let H=this._jsonSchemaValidator.getValidator(G.requestedSchema)(Q.content);if(!H.valid)throw new G$(Y$.InvalidParams,`Elicitation response content does not match requested schema: ${H.errorMessage}`)}catch(j){if(j instanceof G$)throw j;throw new G$(Y$.InternalError,`Error validating elicitation response: ${j instanceof Error?j.message:String(j)}`)}return Q}}}createElicitationCompletionNotifier($,v){var U,X;if(!((X=(U=this._clientCapabilities)===null||U===void 0?void 0:U.elicitation)===null||X===void 0?void 0:X.url))throw Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:$}},v)}async listRoots($,v){return this.request({method:"roots/list",params:$},hY,v)}async sendLoggingMessage($,v){if(this._capabilities.logging){if(!this.isMessageIgnored($.level,v))return this.notification({method:"notifications/message",params:$})}}async sendResourceUpdated($){return this.notification({method:"notifications/resources/updated",params:$})}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 kH=Symbol.for("mcp.completable");function CH($){return!!$&&typeof $==="object"&&kH in $}function _H($){let v=$[kH];return v===null||v===void 0?void 0:v.complete}var RH;(function($){$.Completable="McpCompletable"})(RH||(RH={}));class m6{static isTemplate($){return/\{[^}\s]+\}/.test($)}static validateLength($,v,U){if($.length>v)throw Error(`${U} exceeds maximum length of ${v} characters (got ${$.length})`)}get variableNames(){return this.parts.flatMap(($)=>typeof $==="string"?[]:$.names)}constructor($){m6.validateLength($,1e6,"Template"),this.template=$,this.parts=this.parse($)}toString(){return this.template}parse($){let v=[],U="",X=0,J=0;while(X<$.length)if($[X]==="{"){if(U)v.push(U),U="";let W=$.indexOf("}",X);if(W===-1)throw Error("Unclosed template expression");if(J++,J>1e4)throw Error("Template contains too many expressions (max 10000)");let Y=$.slice(X+1,W),z=this.getOperator(Y),G=Y.includes("*"),Q=this.getNames(Y),j=Q[0];for(let H of Q)m6.validateLength(H,1e6,"Variable name");v.push({name:j,operator:z,names:Q,exploded:G}),X=W+1}else U+=$[X],X++;if(U)v.push(U);return v}getOperator($){return["+","#",".","/","?","&"].find((U)=>$.startsWith(U))||""}getNames($){let v=this.getOperator($);return $.slice(v.length).split(",").map((U)=>U.replace("*","").trim()).filter((U)=>U.length>0)}encodeValue($,v){if(m6.validateLength($,1e6,"Variable value"),v==="+"||v==="#")return encodeURI($);return encodeURIComponent($)}expandPart($,v){if($.operator==="?"||$.operator==="&"){let W=$.names.map((z)=>{let G=v[z];if(G===void 0)return"";let Q=Array.isArray(G)?G.map((j)=>this.encodeValue(j,$.operator)).join(","):this.encodeValue(G.toString(),$.operator);return`${z}=${Q}`}).filter((z)=>z.length>0);if(W.length===0)return"";return($.operator==="?"?"?":"&")+W.join("&")}if($.names.length>1){let W=$.names.map((Y)=>v[Y]).filter((Y)=>Y!==void 0);if(W.length===0)return"";return W.map((Y)=>Array.isArray(Y)?Y[0]:Y).join(",")}let U=v[$.name];if(U===void 0)return"";let J=(Array.isArray(U)?U:[U]).map((W)=>this.encodeValue(W,$.operator));switch($.operator){case"":return J.join(",");case"+":return J.join(",");case"#":return"#"+J.join(",");case".":return"."+J.join(".");case"/":return"/"+J.join("/");default:return J.join(",")}}expand($){let v="",U=!1;for(let X of this.parts){if(typeof X==="string"){v+=X;continue}let J=this.expandPart(X,$);if(!J)continue;if((X.operator==="?"||X.operator==="&")&&U)v+=J.replace("?","&");else v+=J;if(X.operator==="?"||X.operator==="&")U=!0}return v}escapeRegExp($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}partToRegExp($){let v=[];for(let J of $.names)m6.validateLength(J,1e6,"Variable name");if($.operator==="?"||$.operator==="&"){for(let J=0;J<$.names.length;J++){let W=$.names[J],Y=J===0?"\\"+$.operator:"&";v.push({pattern:Y+this.escapeRegExp(W)+"=([^&]+)",name:W})}return v}let U,X=$.name;switch($.operator){case"":U=$.exploded?"([^/]+(?:,[^/]+)*)":"([^/,]+)";break;case"+":case"#":U="(.+)";break;case".":U="\\.([^/,]+)";break;case"/":U="/"+($.exploded?"([^/]+(?:,[^/]+)*)":"([^/,]+)");break;default:U="([^/]+)"}return v.push({pattern:U,name:X}),v}match($){m6.validateLength($,1e6,"URI");let v="^",U=[];for(let Y of this.parts)if(typeof Y==="string")v+=this.escapeRegExp(Y);else{let z=this.partToRegExp(Y);for(let{pattern:G,name:Q}of z)v+=G,U.push({name:Q,exploded:Y.exploded})}v+="$",m6.validateLength(v,1e6,"Generated regex pattern");let X=new RegExp(v),J=$.match(X);if(!J)return null;let W={};for(let Y=0;Y<U.length;Y++){let{name:z,exploded:G}=U[Y],Q=J[Y+1],j=z.replace("*","");if(G&&Q.includes(","))W[j]=Q.split(",");else W[j]=Q}return W}}var BM=/^[A-Za-z0-9._-]{1,128}$/;function AM($){let v=[];if($.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if($.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${$.length})`]};if($.includes(" "))v.push("Tool name contains spaces, which may cause parsing issues");if($.includes(","))v.push("Tool name contains commas, which may cause parsing issues");if($.startsWith("-")||$.endsWith("-"))v.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if($.startsWith(".")||$.endsWith("."))v.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!BM.test($)){let U=$.split("").filter((X)=>!/[A-Za-z0-9._-]/.test(X)).filter((X,J,W)=>W.indexOf(X)===J);return v.push(`Tool name contains invalid characters: ${U.map((X)=>`"${X}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:v}}return{isValid:!0,warnings:v}}function SM($,v){if(v.length>0){console.warn(`Tool name validation warning for "${$}":`);for(let U of v)console.warn(` - ${U}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function vG($){let v=AM($);return SM($,v.warnings),v.isValid}class JG{constructor($,v){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new $G($,v)}async connect($){return await this.server.connect($)}async close(){await this.server.close()}setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler(Q4(NX)),this.server.assertCanSetRequestHandler(Q4(IX)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(NX,()=>({tools:Object.entries(this._registeredTools).filter(([,$])=>$.enabled).map(([$,v])=>{let U={name:$,title:v.title,description:v.description,inputSchema:(()=>{let X=z1(v.inputSchema);return X?rY(X,{strictUnions:!0,pipeStrategy:"input"}):qM})(),annotations:v.annotations,_meta:v._meta};if(v.outputSchema){let X=z1(v.outputSchema);if(X)U.outputSchema=rY(X,{strictUnions:!0,pipeStrategy:"output"})}return U})})),this.server.setRequestHandler(IX,async($,v)=>{let U=this._registeredTools[$.params.name],X;try{if(!U)throw new G$(Y$.InvalidParams,`Tool ${$.params.name} not found`);if(!U.enabled)throw new G$(Y$.InvalidParams,`Tool ${$.params.name} disabled`);if(U.inputSchema){let J=U.callback,W=z1(U.inputSchema),Y=W!==null&&W!==void 0?W:U.inputSchema,z=await yJ(Y,$.params.arguments);if(!z.success)throw new G$(Y$.InvalidParams,`Input validation error: Invalid arguments for tool ${$.params.name}: ${uJ(z.error)}`);let G=z.data;X=await Promise.resolve(J(G,v))}else{let J=U.callback;X=await Promise.resolve(J(v))}if(U.outputSchema&&!X.isError){if(!X.structuredContent)throw new G$(Y$.InvalidParams,`Output validation error: Tool ${$.params.name} has an output schema but no structured content was provided`);let J=z1(U.outputSchema),W=await yJ(J,X.structuredContent);if(!W.success)throw new G$(Y$.InvalidParams,`Output validation error: Invalid structured content for tool ${$.params.name}: ${uJ(W.error)}`)}}catch(J){if(J instanceof G$){if(J.code===Y$.UrlElicitationRequired)throw J}return this.createToolError(J instanceof Error?J.message:String(J))}return X}),this._toolHandlersInitialized=!0}createToolError($){return{content:[{type:"text",text:$}],isError:!0}}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(Q4(DX)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(DX,async($)=>{switch($.params.ref.type){case"ref/prompt":return I7($),this.handlePromptCompletion($,$.params.ref);case"ref/resource":return O7($),this.handleResourceCompletion($,$.params.ref);default:throw new G$(Y$.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,v){let U=this._registeredPrompts[v.name];if(!U)throw new G$(Y$.InvalidParams,`Prompt ${v.name} not found`);if(!U.enabled)throw new G$(Y$.InvalidParams,`Prompt ${v.name} disabled`);if(!U.argsSchema)return D0;let X=Y1(U.argsSchema),J=X===null||X===void 0?void 0:X[$.params.argument.name];if(!CH(J))return D0;let W=_H(J);if(!W)return D0;let Y=await W($.params.argument.value,$.params.context);return TH(Y)}async handleResourceCompletion($,v){let U=Object.values(this._registeredResourceTemplates).find((W)=>W.resourceTemplate.uriTemplate.toString()===v.uri);if(!U){if(this._registeredResources[v.uri])return D0;throw new G$(Y$.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let X=U.resourceTemplate.completeCallback($.params.argument.name);if(!X)return D0;let J=await X($.params.argument.value,$.params.context);return TH(J)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(Q4(GX)),this.server.assertCanSetRequestHandler(Q4(QX)),this.server.assertCanSetRequestHandler(Q4(jX)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(GX,async($,v)=>{let U=Object.entries(this._registeredResources).filter(([J,W])=>W.enabled).map(([J,W])=>({uri:J,name:W.name,...W.metadata})),X=[];for(let J of Object.values(this._registeredResourceTemplates)){if(!J.resourceTemplate.listCallback)continue;let W=await J.resourceTemplate.listCallback(v);for(let Y of W.resources)X.push({...J.metadata,...Y})}return{resources:[...U,...X]}}),this.server.setRequestHandler(QX,async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([v,U])=>({name:v,uriTemplate:U.resourceTemplate.uriTemplate.toString(),...U.metadata}))}}),this.server.setRequestHandler(jX,async($,v)=>{let U=new URL($.params.uri),X=this._registeredResources[U.toString()];if(X){if(!X.enabled)throw new G$(Y$.InvalidParams,`Resource ${U} disabled`);return X.readCallback(U,v)}for(let J of Object.values(this._registeredResourceTemplates)){let W=J.resourceTemplate.uriTemplate.match(U.toString());if(W)return J.readCallback(U,W,v)}throw new G$(Y$.InvalidParams,`Resource ${U} not found`)}),this.setCompletionRequestHandler(),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(Q4(wX)),this.server.assertCanSetRequestHandler(Q4(HX)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(wX,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,$])=>$.enabled).map(([$,v])=>{return{name:$,title:v.title,description:v.description,arguments:v.argsSchema?FM(v.argsSchema):void 0}})})),this.server.setRequestHandler(HX,async($,v)=>{let U=this._registeredPrompts[$.params.name];if(!U)throw new G$(Y$.InvalidParams,`Prompt ${$.params.name} not found`);if(!U.enabled)throw new G$(Y$.InvalidParams,`Prompt ${$.params.name} disabled`);if(U.argsSchema){let X=z1(U.argsSchema),J=await yJ(X,$.params.arguments);if(!J.success)throw new G$(Y$.InvalidParams,`Invalid arguments for prompt ${$.params.name}: ${uJ(J.error)}`);let W=J.data,Y=U.callback;return await Promise.resolve(Y(W,v))}else{let X=U.callback;return await Promise.resolve(X(v))}}),this.setCompletionRequestHandler(),this._promptHandlersInitialized=!0}resource($,v,...U){let X;if(typeof U[0]==="object")X=U.shift();let J=U[0];if(typeof v==="string"){if(this._registeredResources[v])throw Error(`Resource ${v} is already registered`);let W=this._createRegisteredResource($,void 0,v,X,J);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),W}else{if(this._registeredResourceTemplates[$])throw Error(`Resource template ${$} is already registered`);let W=this._createRegisteredResourceTemplate($,void 0,v,X,J);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),W}}registerResource($,v,U,X){if(typeof v==="string"){if(this._registeredResources[v])throw Error(`Resource ${v} is already registered`);let J=this._createRegisteredResource($,U.title,v,U,X);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),J}else{if(this._registeredResourceTemplates[$])throw Error(`Resource template ${$} is already registered`);let J=this._createRegisteredResourceTemplate($,U.title,v,U,X);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),J}}_createRegisteredResource($,v,U,X,J){let W={name:$,title:v,metadata:X,readCallback:J,enabled:!0,disable:()=>W.update({enabled:!1}),enable:()=>W.update({enabled:!0}),remove:()=>W.update({uri:null}),update:(Y)=>{if(typeof Y.uri<"u"&&Y.uri!==U){if(delete this._registeredResources[U],Y.uri)this._registeredResources[Y.uri]=W}if(typeof Y.name<"u")W.name=Y.name;if(typeof Y.title<"u")W.title=Y.title;if(typeof Y.metadata<"u")W.metadata=Y.metadata;if(typeof Y.callback<"u")W.readCallback=Y.callback;if(typeof Y.enabled<"u")W.enabled=Y.enabled;this.sendResourceListChanged()}};return this._registeredResources[U]=W,W}_createRegisteredResourceTemplate($,v,U,X,J){let W={resourceTemplate:U,title:v,metadata:X,readCallback:J,enabled:!0,disable:()=>W.update({enabled:!1}),enable:()=>W.update({enabled:!0}),remove:()=>W.update({name:null}),update:(Y)=>{if(typeof Y.name<"u"&&Y.name!==$){if(delete this._registeredResourceTemplates[$],Y.name)this._registeredResourceTemplates[Y.name]=W}if(typeof Y.title<"u")W.title=Y.title;if(typeof Y.template<"u")W.resourceTemplate=Y.template;if(typeof Y.metadata<"u")W.metadata=Y.metadata;if(typeof Y.callback<"u")W.readCallback=Y.callback;if(typeof Y.enabled<"u")W.enabled=Y.enabled;this.sendResourceListChanged()}};return this._registeredResourceTemplates[$]=W,W}_createRegisteredPrompt($,v,U,X,J){let W={title:v,description:U,argsSchema:X===void 0?void 0:W1(X),callback:J,enabled:!0,disable:()=>W.update({enabled:!1}),enable:()=>W.update({enabled:!0}),remove:()=>W.update({name:null}),update:(Y)=>{if(typeof Y.name<"u"&&Y.name!==$){if(delete this._registeredPrompts[$],Y.name)this._registeredPrompts[Y.name]=W}if(typeof Y.title<"u")W.title=Y.title;if(typeof Y.description<"u")W.description=Y.description;if(typeof Y.argsSchema<"u")W.argsSchema=W1(Y.argsSchema);if(typeof Y.callback<"u")W.callback=Y.callback;if(typeof Y.enabled<"u")W.enabled=Y.enabled;this.sendPromptListChanged()}};return this._registeredPrompts[$]=W,W}_createRegisteredTool($,v,U,X,J,W,Y,z){vG($);let G={title:v,description:U,inputSchema:ZH(X),outputSchema:ZH(J),annotations:W,_meta:Y,callback:z,enabled:!0,disable:()=>G.update({enabled:!1}),enable:()=>G.update({enabled:!0}),remove:()=>G.update({name:null}),update:(Q)=>{if(typeof Q.name<"u"&&Q.name!==$){if(typeof Q.name==="string")vG(Q.name);if(delete this._registeredTools[$],Q.name)this._registeredTools[Q.name]=G}if(typeof Q.title<"u")G.title=Q.title;if(typeof Q.description<"u")G.description=Q.description;if(typeof Q.paramsSchema<"u")G.inputSchema=W1(Q.paramsSchema);if(typeof Q.callback<"u")G.callback=Q.callback;if(typeof Q.annotations<"u")G.annotations=Q.annotations;if(typeof Q._meta<"u")G._meta=Q._meta;if(typeof Q.enabled<"u")G.enabled=Q.enabled;this.sendToolListChanged()}};return this._registeredTools[$]=G,this.setToolRequestHandlers(),this.sendToolListChanged(),G}tool($,...v){if(this._registeredTools[$])throw Error(`Tool ${$} is already registered`);let U,X,J,W;if(typeof v[0]==="string")U=v.shift();if(v.length>1){let z=v[0];if(UG(z)){if(X=v.shift(),v.length>1&&typeof v[0]==="object"&&v[0]!==null&&!UG(v[0]))W=v.shift()}else if(typeof z==="object"&&z!==null)W=v.shift()}let Y=v[0];return this._createRegisteredTool($,void 0,U,X,J,W,void 0,Y)}registerTool($,v,U){if(this._registeredTools[$])throw Error(`Tool ${$} is already registered`);let{title:X,description:J,inputSchema:W,outputSchema:Y,annotations:z,_meta:G}=v;return this._createRegisteredTool($,X,J,W,Y,z,G,U)}prompt($,...v){if(this._registeredPrompts[$])throw Error(`Prompt ${$} is already registered`);let U;if(typeof v[0]==="string")U=v.shift();let X;if(v.length>1)X=v.shift();let J=v[0],W=this._createRegisteredPrompt($,void 0,U,X,J);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),W}registerPrompt($,v,U){if(this._registeredPrompts[$])throw Error(`Prompt ${$} is already registered`);let{title:X,description:J,argsSchema:W}=v,Y=this._createRegisteredPrompt($,X,J,W,U);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),Y}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage($,v){return this.server.sendLoggingMessage($,v)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}}class k4{constructor($,v){this._callbacks=v,this._uriTemplate=typeof $==="string"?new m6($):$}get uriTemplate(){return this._uriTemplate}get listCallback(){return this._callbacks.list}completeCallback($){var v;return(v=this._callbacks.complete)===null||v===void 0?void 0:v[$]}}var qM={type:"object",properties:{}};function UG($){if(typeof $!=="object"||$===null)return!1;return Object.keys($).length===0||Object.values($).some(LM)}function LM($){return $!==null&&typeof $==="object"&&"parse"in $&&typeof $.parse==="function"&&"safeParse"in $&&typeof $.safeParse==="function"}function ZH($){if(!$)return;if(UG($))return W1($);return $}function FM($){let v=Y1($);if(!v)return[];return Object.entries(v).map(([U,X])=>{let J=WQ(X),W=YQ(X);return{name:U,description:J,required:!W}})}function Q4($){let v=Y1($),U=v===null||v===void 0?void 0:v.method;if(!U)throw Error("Schema is missing a method literal");let X=hJ(U);if(typeof X==="string")return X;throw Error("Schema method literal must be a string")}function TH($){return{completion:{values:$.slice(0,100),total:$.length,hasMore:$.length>100}}}var D0={completion:{values:[],hasMore:!1}};import gH from"node:process";class XG{append($){this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){if(!this._buffer)return null;let $=this._buffer.indexOf(`
38
+ `);if($===-1)return null;let v=this._buffer.toString("utf8",0,$).replace(/\r$/,"");return this._buffer=this._buffer.subarray($+1),EM(v)}clear(){this._buffer=void 0}}function EM($){return J7.parse(JSON.parse($))}function xH($){return JSON.stringify($)+`
39
+ `}class WG{constructor($=gH.stdin,v=gH.stdout){this._stdin=$,this._stdout=v,this._readBuffer=new XG,this._started=!1,this._ondata=(U)=>{this._readBuffer.append(U),this.processReadBuffer()},this._onerror=(U)=>{var X;(X=this.onerror)===null||X===void 0||X.call(this,U)}}async start(){if(this._started)throw 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 $,v;while(!0)try{let U=this._readBuffer.readMessage();if(U===null)break;($=this.onmessage)===null||$===void 0||$.call(this,U)}catch(U){(v=this.onerror)===null||v===void 0||v.call(this,U)}}async close(){var $;if(this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),($=this.onclose)===null||$===void 0||$.call(this)}send($){return new Promise((v)=>{let U=xH($);if(this._stdout.write(U))v();else this._stdout.once("drain",v)})}}var nH=IW(mH(),1);import j4 from"node:process";nH.config();var pM=()=>{let $=j4.env.LOGSEQ_TOKEN||"",v=j4.env.LOGSEQ_API_TOKEN||"",U=j4.env.LOGSEQ_MCP_TOKEN||"",X=(J)=>J==="your-logseq-token-here";if(!X($)&&$)return $;if(!X(v)&&v)return v;if(!X(U)&&U)return U;if($)return $;if(v)return v;if(U)return U;return""},cH=pM();if(!cH&&j4.env.TEST_TYPE!=="unit"&&j4.env.MOCK_LOGSEQ_API!=="true")console.error("Error: No Logseq API token found. Please set LOGSEQ_TOKEN, LOGSEQ_API_TOKEN, or LOGSEQ_MCP_TOKEN environment variable."),j4.exit(1);var dM=j4.env.LOGSEQ_PORT||"12315",tM=j4.env.LOGSEQ_HOST||"127.0.0.1",iH=cH,rH=`http://${tM}:${dM}/api`,X$=(...$)=>{console.error(...$)};function aM($){$.prompt("create-daily-note",{sections:A.string().optional()},(v)=>{return{messages:[{role:"user",content:{type:"text",text:`Create a daily note for today with the following sections:
17
40
 
18
- EXAMPLES:
19
- 1) Find all TODO blocks:
20
- - type: "datalog"
21
- - query: "[:find (pull ?b [*]) :where [?b :block/marker ?marker] [(= ?marker "TODO")]]"
41
+ ${(v.sections||"Tasks,Notes,Journal").split(",").map((W)=>W.trim()).map((W)=>`## ${W}
22
42
 
23
- 2) Search for blocks containing specific text:
24
- - type: "search"
25
- - query: "project meeting"
26
- - limit: 5
43
+ `).join("")}
44
+ This will help me organize my day and keep track of important information.`}}]}})}function eM($){$.prompt("search-knowledge",{query:A.string().optional()},(v)=>({messages:[{role:"user",content:{type:"text",text:`Search my Logseq knowledge base for information about "${v.query||""}". Use the search-blocks tool with the query parameter set to "${v.query||""}" to find relevant blocks, then summarize the findings.`}}]}))}function sM($){$.prompt("summarize-page",{pageName:A.string()},(v)=>({messages:[{role:"user",content:{type:"text",text:`Create a concise summary of the "${v.pageName}" page. First get the full page content, analyze it, and then generate a summary that captures the main points, key insights, and important details.`}}]}))}function $P($){$.prompt("create-nested-content",{pageName:A.string(),content:A.string()},(v)=>({messages:[{role:"user",content:{type:"text",text:`Create a well-structured nested hierarchy of blocks in page "${v.pageName}" from the following content:
27
45
 
28
- 3) Find blocks with a specific property:
29
- - type: "datalog"
30
- - query: "[:find (pull ?b [*]) :where [?b :block/properties ?p] [(get ?p :priority) ?v] [(= ?v "A")]]"
46
+ ${v.content}
31
47
 
32
- 4) Find all journal pages:
33
- - type: "datalog"
34
- - query: "[:find (pull ?p [*]) :where [?p :block/journal? true]]"
35
- `,{type:Q.enum(["datalog","search"]).default("datalog").describe(`Query type:
36
- - datalog: Advanced Datalog query using Logseq's Datalog syntax (more powerful)
37
- - search: Simple text search to find blocks containing specific text (easier to use)`),query:Q.string().describe("The query to execute - either a Datalog query string or a text search term"),includeChildren:Q.boolean().optional().default(!0).describe("Whether to include child blocks in results. Provides context but may increase response size."),limit:Q.number().optional().describe("Maximum number of results to return. Use this for large result sets to avoid performance issues.")},async({type:X,query:W,includeChildren:J=!0,limit:Y})=>{try{if(C(`Executing ${X} query: ${W}`),X==="search"){let G=`[:find (pull ?b [*])
38
- :where
39
- [?b :block/content ?c]
40
- [(clojure.string/includes? ?c "${W}")]]`,H=await K("logseq.DB.datascriptQuery",[G]);C(`Search result count: ${Array.isArray(H)?H.length:H?1:0}`);let w=Array.isArray(H)?H:H?[H]:[];if(Y&&Y>0&&w.length>Y)w=w.slice(0,Y);if(w.length===0)return{isError:!1,content:[{type:"text",text:`No results found for search: "${W}"`}]};return{isError:!1,content:[{type:"text",text:JSON.stringify(w,null,2)}]}}else{let G=await K("logseq.DB.datascriptQuery",[W]),H=Array.isArray(G)?G:G?[G]:[];if(Y&&Y>0&&H.length>Y)H=H.slice(0,Y);let w=H.some((B)=>B&&(B.uuid||Array.isArray(B)&&B[0]?.uuid));if(J&&w&&H.length>0)H=await Promise.all(H.map(async(D)=>{let j=D.uuid||(Array.isArray(D)?D[0]?.uuid:null);if(!j)return D;try{return await K("logseq.Editor.getBlock",[j,{includeChildren:!0}])||D}catch(R){return D}}));if(C(`Query result (processed): ${H.length} items`),H.length===0)return{isError:!1,content:[{type:"text",text:"No results found for Datalog query"}]};return{isError:!1,content:[{type:"text",text:JSON.stringify(H,null,2)}]}}}catch(G){return console.error(`Error in query operation: ${G}`),{isError:!0,content:[{type:"text",text:`Error in query operation: ${G}`}]}}})}var r0=($,X=!0)=>{if(!X)return $;return $.split(`
41
- `).map((W)=>W.replace(/^\s*-\s+/,"")).join(`
42
- `)},q4=($,X=!0)=>{return $.map((W)=>{if(typeof W==="string")return r0(W,X);if(W&&typeof W==="object"){let J={...W};if(W.content)J.content=r0(W.content,X);if(W.children&&Array.isArray(W.children)&&W.children.length>0)J.children=q4(W.children,X);return J}return W})};function R4($){let X=_3($);E3($,X)}function _3($){let X=async(W)=>{let{operation:J}=W;try{let Y;if(J==="get"){let{uuid:G,includeChildren:H=!0}=W;if(!G)return{isError:!0,content:[{type:"text",text:"UUID is required for get operation"}]};if(Y=await K("logseq.Editor.getBlock",[G,{includeChildren:H}]),!Y)return{isError:!0,content:[{type:"text",text:`Block with UUID "${G}" not found`}]};return{isError:!1,content:[{type:"text",text:JSON.stringify(Y,null,2)}]}}else if(J==="get-current"){if(Y=await K("logseq.Editor.getCurrentBlock",[]),!Y)return{isError:!0,content:[{type:"text",text:"No block is currently focused"}]};return{isError:!1,content:[{type:"text",text:JSON.stringify(Y,null,2)}]}}else if(J==="get-selected"){if(Y=await K("logseq.Editor.getSelectedBlocks",[]),!Y||!Array.isArray(Y)||Y.length===0)return{isError:!0,content:[{type:"text",text:"No blocks are currently selected"}]};return{isError:!1,content:[{type:"text",text:JSON.stringify(Y,null,2)}]}}else if(J==="get-siblings"){let{uuid:G,direction:H="next"}=W;if(!G)return{isError:!0,content:[{type:"text",text:"UUID is required for get-siblings operation"}]};if(Y=await K(H==="previous"?"logseq.Editor.getPreviousSiblingBlock":"logseq.Editor.getNextSiblingBlock",[G]),!Y)return{isError:!0,content:[{type:"text",text:`No ${H} sibling found for block "${G}"`}]};return{isError:!1,content:[{type:"text",text:JSON.stringify(Y,null,2)}]}}else if(J==="create"){let{target:G,content:H,blocks:w,position:B="child",preventAutoFormat:D=!0,stripLeadingHyphen:j=!0,properties:R,keepUUID:f=!1}=W;if(!G)return{isError:!0,content:[{type:"text",text:"Target page name or block UUID is required for create operation"}]};if(!H&&(!w||w.length===0))return{isError:!0,content:[{type:"text",text:"Content or blocks array is required for create operation"}]};if(H){let v=!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(G),T={properties:R};if(D)T.preventAutoFormat=!0;let y=r0(H,j);if(!y.trim())return{isError:!1,content:[{type:"text",text:"Skipped adding empty block"}]};if(!v){if(B==="before"||B==="after")T.sibling=!0,T.before=B==="before"}else if(T.isPageBlock=!0,B==="first"||B==="last"){let E=await K("logseq.Editor.getPageBlocksTree",[G]),d=Array.isArray(E)&&E.length>0;if(B==="first"&&d)T.before=E[0].uuid;else if(B==="last"&&d)T.after=E[E.length-1].uuid}return Y=await K("logseq.Editor.insertBlock",[G,y,T]),{isError:!1,content:[{type:"text",text:JSON.stringify(Y,null,2)}]}}else if(w&&w.length>0){let v=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(G),y=q4(w,j).filter((E)=>{if(typeof E==="string")return E.trim().length>0;if(E&&typeof E==="object"&&E.content)return E.content.trim().length>0;return!1});if(y.length===0)return{isError:!1,content:[{type:"text",text:"Skipped adding empty blocks"}]};if(v)return Y=await K("logseq.Editor.insertBatchBlock",[G,y,{sibling:B==="before"||B==="after",before:B==="before",keepUUID:f,preventAutoFormat:D}]),{isError:!1,content:[{type:"text",text:JSON.stringify(Y,null,2)}]};else{let E=[];for(let d of y){let Y0={properties:d.properties,isPageBlock:!0};if(D)Y0.preventAutoFormat=!0;if(B==="first"||B==="last"){let O0=await K("logseq.Editor.getPageBlocksTree",[G]),a0=Array.isArray(O0)&&O0.length>0;if(B==="first"&&a0)if(E.length===0)Y0.before=O0[0].uuid;else Y0.after=E[E.length-1].uuid;else if(B==="last"&&a0)if(E.length===0)Y0.after=O0[O0.length-1].uuid;else Y0.after=E[E.length-1].uuid}else if(E.length>0)Y0.after=E[E.length-1].uuid;let N0=await K("logseq.Editor.insertBlock",[G,d.content,Y0]);if(E.push(N0),d.children&&d.children.length>0)await K("logseq.Editor.insertBatchBlock",[N0.uuid,d.children,{preventAutoFormat:D,keepUUID:f}])}return{isError:!1,content:[{type:"text",text:JSON.stringify(E,null,2)}]}}}return{isError:!0,content:[{type:"text",text:"Invalid parameters for create operation"}]}}else if(J==="update"){let{uuid:G,content:H,properties:w,preventAutoFormat:B=!0,stripLeadingHyphen:D=!0,blocks:j}=W;if(G&&H){let R={};if(w)R.properties=w;if(B)R.preventAutoFormat=!0;let f=r0(H,D);await K("logseq.Editor.updateBlock",[G,f,R]);let b=await K("logseq.Editor.getBlock",[G]);return{isError:!1,content:[{type:"text",text:JSON.stringify(b,null,2)}]}}else if(j&&j.length>0){let R=[],f=[];for(let b of j){if(!b.uuid||!b.content){f.push({uuid:b.uuid||"missing-uuid",error:"Missing required uuid or content"});continue}try{let v={};if(b.properties)v.properties=b.properties;if(B)v.preventAutoFormat=!0;let T=r0(b.content,D);await K("logseq.Editor.updateBlock",[b.uuid,T,v]);let y=await K("logseq.Editor.getBlock",[b.uuid]);R.push(y)}catch(v){f.push({uuid:b.uuid,error:`${v}`})}}return{isError:f.length===j.length,content:[{type:"text",text:JSON.stringify({updated:R,failed:f},null,2)}]}}else return{isError:!0,content:[{type:"text",text:"UUID and content are required for update operation"}]}}else if(J==="move"){let{uuid:G,target:H,position:w="child",includeChildren:B=!0}=W;if(!G||!H)return{isError:!0,content:[{type:"text",text:"Source UUID and target UUID are required for move operation"}]};return await K("logseq.Editor.moveBlock",[G,H,{before:w==="before",children:B}]),{isError:!1,content:[{type:"text",text:`Block ${G} moved successfully to ${w} ${H}`}]}}else if(J==="remove"){let{uuid:G,uuids:H}=W;if(G)return await K("logseq.Editor.removeBlock",[G]),{isError:!1,content:[{type:"text",text:`Block ${G} removed successfully`}]};else if(H&&H.length>0){let w=[],B=[];for(let D of H)try{await K("logseq.Editor.removeBlock",[D]),w.push({uuid:D})}catch(j){B.push({uuid:D,error:`${j}`})}return{isError:B.length===H.length,content:[{type:"text",text:JSON.stringify({removed:w,failed:B},null,2)}]}}else return{isError:!0,content:[{type:"text",text:"UUID or uuids array is required for remove operation"}]}}else if(J==="toggle-collapse"){let{uuid:G,collapsed:H}=W;if(!G||H===void 0)return{isError:!0,content:[{type:"text",text:"UUID and collapsed state are required for toggle-collapse operation"}]};return await K("logseq.Editor.setBlockCollapsed",[G,{flag:H}]),{isError:!1,content:[{type:"text",text:`Block ${G} ${H==="toggle"?"toggled":H?"collapsed":"expanded"} successfully`}]}}else if(J==="select"){let{uuid:G}=W;if(!G)return{isError:!0,content:[{type:"text",text:"UUID is required for select operation"}]};return await K("logseq.Editor.selectBlock",[G]),{isError:!1,content:[{type:"text",text:`Block ${G} selected successfully`}]}}else if(J==="edit"){let{uuid:G,pos:H}=W;if(!G)return{isError:!0,content:[{type:"text",text:"UUID is required for edit operation"}]};return await K("logseq.Editor.editBlock",[G,H!==void 0?{pos:H}:void 0]),{isError:!1,content:[{type:"text",text:`Block ${G} is now in editing mode`}]}}else if(J==="open-sidebar"){let{uuid:G}=W;if(!G)return{isError:!0,content:[{type:"text",text:"UUID is required for open-sidebar operation"}]};return await K("logseq.Editor.openInRightSidebar",[G]),{isError:!1,content:[{type:"text",text:`Block ${G} opened in right sidebar successfully`}]}}else if(J==="scroll-to"){let{uuid:G,pageName:H}=W;if(!G||!H)return{isError:!0,content:[{type:"text",text:"UUID and pageName are required for scroll-to operation"}]};return await K("logseq.Editor.scrollToBlockInPage",[H,G]),{isError:!1,content:[{type:"text",text:`Scrolled to block ${G} in page ${H}`}]}}else if(J==="get-property"){let{uuid:G,propertyKey:H}=W;if(!G||!H)return{isError:!0,content:[{type:"text",text:"UUID and propertyKey are required for get-property operation"}]};return Y=await K("logseq.Editor.getBlockProperty",[G,H]),{isError:!1,content:[{type:"text",text:JSON.stringify(Y===void 0?null:Y,null,2)}]}}else if(J==="get-properties"){let{uuid:G}=W;if(!G)return{isError:!0,content:[{type:"text",text:"UUID is required for get-properties operation"}]};return Y=await K("logseq.Editor.getBlockProperties",[G]),{isError:!1,content:[{type:"text",text:JSON.stringify(Y,null,2)}]}}else if(J==="set-property"){let{uuid:G,propertyKey:H,propertyValue:w}=W;if(!G||!H)return{isError:!0,content:[{type:"text",text:"UUID and propertyKey are required for set-property operation"}]};return await K("logseq.Editor.upsertBlockProperty",[G,H,w]),{isError:!1,content:[{type:"text",text:`Property '${H}' set for block ${G} successfully`}]}}else if(J==="remove-property"){let{uuid:G,propertyKey:H}=W;if(!G||!H)return{isError:!0,content:[{type:"text",text:"UUID and propertyKey are required for remove-property operation"}]};return await K("logseq.Editor.removeBlockProperty",[G,H]),{isError:!1,content:[{type:"text",text:`Property '${H}' removed from block ${G} successfully`}]}}return{isError:!0,content:[{type:"text",text:`Invalid operation or missing required parameters for operation: ${J}`}]}}catch(Y){return console.error(`Error in block operation (${J}):`,Y),{isError:!0,content:[{type:"text",text:`Error in block operation (${J}): ${Y}`}]}}};return $.tool("block",`Perform operations on Logseq blocks - read, write, organize, and manage properties.
48
+ Please organize this content with all section headers at the same level (as siblings) and nest related content as children underneath them. Use the create-nested-blocks tool since it's specifically designed for hierarchical content. Use page properties for page metadata instead of creating an overall page header. Never use bullet points (dashes) at the beginning of blocks.`}}]}))}function oH($){aM($),eM($),sM($),$P($)}function vP($){$.prompt("organize-blocks",{pageOrBlockId:A.string(),criteria:A.string().optional()},(v)=>{let U="Organize the blocks";if(v.pageOrBlockId)U+=` in ${v.pageOrBlockId}`;if(v.criteria)U+=` by ${v.criteria}`;return U+=". First get the blocks, then analyze them, and finally create a structured hierarchy by moving blocks appropriately.",{messages:[{role:"user",content:{type:"text",text:U}}]}})}function UP($){$.prompt("organize-blocks-as-nested",{pageName:A.string(),structure:A.string().optional()},(v)=>{let U=`Analyze the page "${v.pageName}" and reorganize its content into a well-structured nested hierarchy of blocks.`;if(v.structure)U+=`
49
+
50
+ Use the following structure as a guide:
51
+ ${v.structure}`;return U+=`
52
+
53
+ Always use the create-nested-blocks tool which is specifically designed for hierarchical content. Keep all section headers at the same level (as siblings) and nest related content as children underneath these headers. Use page properties for page metadata instead of creating an overall page header. Never use bullet points (dashes) at the beginning of blocks.`,{messages:[{role:"user",content:{type:"text",text:U}}]}})}function JP(){return`
54
+
55
+ Please follow these guidelines:
56
+ 1. Use the get-full-page tool to retrieve all content from the page
57
+ 2. Analyze the content to identify logical hierarchy and grouping
58
+ 3. Keep all section headers at the same level (as siblings)
59
+ 4. Nest related content as children underneath these headers
60
+ 5. Use page properties for page metadata instead of creating an overall page header
61
+ 6. Break down long paragraphs into shorter, focused blocks
62
+ 7. Never use bullet points (dashes) at the beginning of blocks
63
+ 8. Always use the create-nested-blocks tool which is specifically designed for hierarchical content
64
+
65
+ Focus on creating a clear hierarchical structure that enhances readability and navigation.`}function XP($){$.prompt("convert-flat-to-nested",{pageName:A.string(),structureCriteria:A.string().optional()},(v)=>{let U=`Convert the flat content of page "${v.pageName}" into a proper nested structure.`;if(v.structureCriteria)U+=` Use ${v.structureCriteria} as the criteria for organizing the content.`;return U+=JP(),{messages:[{role:"user",content:{type:"text",text:U}}]}})}function pH($){vP($),UP($),XP($)}function dH($){$.prompt("query-tasks",{status:A.string().optional()},(v)=>({messages:[{role:"user",content:{type:"text",text:`Find all tasks with status ${v.status||"TODO"} in my Logseq graph. Here's the Datalog query to use:
66
+
67
+ \`\`\`clojure
68
+ {:title "Tasks with status ${v.status||"TODO"}"
69
+ :query [:find (pull ?b [*])
70
+ :where
71
+ (task ?b #{"${v.status||"TODO"}"})]
72
+ }
73
+ \`\`\``}}]})),$.prompt("extract-tasks",{source:A.string().optional(),status:A.string().optional()},(v)=>({messages:[{role:"user",content:{type:"text",text:`Extract all ${v.status||""} tasks from ${v.source||"my notes"} and organize them into a structured list. First search for task blocks, then analyze and group them by project, priority, or other relevant criteria.`}}]}))}function tH($){dH($),oH($),pH($)}import aH from"node:process";var WP=200,YP=2,zP=11,GP=36;function V0($,v){if(!$)return!1;let U=$.tags;if(Array.isArray(U))return U.includes(v);return!1}var QP=()=>{let $=aH.env.MOCK_LOGSEQ_API==="true";return X$(`Mock mode check: MOCK_LOGSEQ_API=${aH.env.MOCK_LOGSEQ_API}, isMockMode=${$}`),$};function jP($){if($.includes("getBlockProperty"))return!0;if($.includes("getProperty"))return!0;if($.includes("removeBlockProperty"))return!0;return!1}var r={pages:[{name:"MCP-Test-Page",uuid:"mock-page-1",properties:{"test-property":"test-value"}},{name:"Current-Test-Page",uuid:"mock-page-2",properties:{}},{name:"Reference-Test-Page",uuid:"mock-page-3",properties:{}},{name:"Recipe Page",uuid:"mock-page-4",properties:{tags:["recipe"]}},{name:"Tasks-Page",uuid:"mock-page-5",properties:{}}],blocks:[{uuid:"mock-block-uuid",content:"This is a test block created by MCP integration test",page:{id:"MCP-Test-Page"},parent:null},{uuid:"task-todo",content:"TODO This is a todo task",page:{id:"Tasks-Page"},parent:null},{uuid:"task-doing",content:"DOING This is a doing task",page:{id:"Tasks-Page"},parent:null},{uuid:"task-done",content:"DONE This is a done task",page:{id:"Tasks-Page"},parent:null},{uuid:"recipe-block",content:"This is a recipe block",page:{id:"Recipe Page"},properties:{tags:["recipe"]},parent:null}],currentPage:{name:"Current-Test-Page",uuid:"mock-page-2"}};async function C($,v=[]){if(QP())return hP($,v);X$(`Calling Logseq API: ${$} with args:`,JSON.stringify(v));let U=await fetch(rH,{method:"POST",headers:{Authorization:`Bearer ${iH}`,"Content-Type":"application/json"},body:JSON.stringify({method:$,args:v})});if(!U.ok)throw Error(`Logseq API error: ${U.status} ${U.statusText}`);let X=null;try{let J=await U.text();if(!J||J.trim()==="")return X$(`Empty response from Logseq API (${$})`),null;X=JSON.parse(J)}catch(J){let W;if(J instanceof Error)W=J.message;else W=String(J);if(X$(`JSON parse error for ${$}:`,J),jP($))return null;throw Error(`Failed to parse JSON response: ${W}`)}return X$("Logseq API response:",`${JSON.stringify(X).substring(0,WP)}...`),X}function wP($){let v=$[0],U=$[1]||{},X=$[2],J={name:v,uuid:`page-${Date.now()}`,properties:U};if(r.pages.push(J),X?.redirect)r.currentPage={name:v,uuid:J.uuid||"mock-page-2"};return{name:v,uuid:J.uuid||"mock-page-2",properties:U,id:Date.now()}}function HP($){let v=$[0],U=r.pages.find((X)=>X.name.toLowerCase()===v.toLowerCase());if(!U)return null;return{name:U.name.toLowerCase().replace(/\s/g,"-"),originalName:U.name,uuid:U.uuid||"mock-page-2",properties:U.properties,id:Date.now()}}function NP(){return{name:r.currentPage.name.toLowerCase().replace(/\s/g,"-"),originalName:r.currentPage.name,uuid:r.currentPage.uuid||"mock-page-2",id:Date.now()}}function IP(){return r.pages.map(($)=>({name:$.name.toLowerCase().replace(/\s/g,"-"),originalName:$.name,uuid:$.uuid||"mock-page-2",id:Date.now(),journal:!1}))}function OP($){let v=$[0];return r.blocks.filter((U)=>U.page.id.toLowerCase()===v.toLowerCase()||U.page.id.toLowerCase().replace(/\s/g,"-")===v.toLowerCase())}function DP($){return[{from:{name:"Another-Page",uuid:"mock-page-ref"},to:{name:$[0],uuid:"mock-page-target"},content:"Reference content"}]}function bP($){let v=$[0],U=$[1],X=$[2],J={uuid:`mock-block-${Date.now()}`,content:U,page:{id:v},properties:X?.properties||{},parent:null};return r.blocks.push(J),J}function VP($){let v=$[0],U=$[1],X=$[2],J=`mock-block-${Date.now()}`,W;if(typeof v==="string"&&!v.includes("-"))W=v;else W="MCP-Test-Page";let Y;if(typeof v==="string"&&v.includes("-"))Y=v;else Y=null;let z={uuid:J,content:U,page:{id:W},properties:X?.properties||{},parent:Y};return r.blocks.push(z),z}function KP($){let v=$[0],U=$[1],X=r.blocks.find((J)=>J.uuid===v);if(!X)return null;if(U?.includeChildren)return{...X,children:r.blocks.filter((J)=>J.parent===v)};return X}function BP($){let v=$[0],U=$[1],X=$[2],J=r.blocks.find((W)=>W.uuid===v);if(J){if(J.content=U,X?.properties)J.properties={...J.properties,...X.properties};return J}return null}function AP($){let v=$[0],U=r.blocks.findIndex((X)=>X.uuid===v);if(U>=0)return r.blocks.splice(U,1),{success:!0,uuid:v};return null}function SP($){let v=$[0],U=$[1],X=r.blocks.find((W)=>W.uuid===v);if(!X?.properties)return null;let J=X.properties[U];if(J!==void 0)return J;return null}function qP($){let v=$[0],U=r.blocks.find((X)=>X.uuid===v);if(!U)return null;return U.properties||{}}function LP($){let v=$[0],U=$[1],X=$[2],J=r.blocks.find((W)=>W.uuid===v);if(!J)return null;if(!J.properties)J.properties={};return J.properties[U]=X,!0}function FP($){let v=$[0],U=$[1],X=r.blocks.find((J)=>J.uuid===v);if(!X?.properties)return null;return delete X.properties[U],{success:!0}}function EP($){let v=$[0],U=$[1],X=[],J=(W,Y)=>W.map((z)=>{let G={uuid:`mock-block-${Date.now()}-${Math.random().toString(GP).substring(YP,zP)}`,content:z.content||"",page:{id:v},parent:Y,properties:z.properties||{}};if(r.blocks.push(G),X.push(G),z.children&&Array.isArray(z.children))G.children=J(z.children,G.uuid);return G});if(J(U,null),X[0])return X[0];return null}function MP($){let v=$[0],U=r.blocks.findIndex((X)=>X.uuid===v);if(U>=0&&U<r.blocks.length-1){let X=r.blocks[U];if(X)for(let J=U+1;J<r.blocks.length;J+=1){let W=r.blocks[J];if(W&&W.parent===X.parent)return W}}return null}function PP($){let v=$[0],U=$[1],X=$[2],J=r.blocks.find((W)=>W.uuid===v);if(J){if(X?.children)J.parent=U;else J.parent=null;return{success:!0,uuid:v}}return null}function RP(){if(r.blocks.length>0)return r.blocks[0];return null}function kP($){if($.includes("TODO"))return["TODO"];if($.includes("DOING"))return["DOING"];if($.includes("DONE"))return["DONE"];return["TODO","DOING","DONE"]}function CP($){if(!$.includes("This is a test block created by MCP integration test"))return null;let v=r.blocks.filter((U)=>U.content.includes("This is a test block created by MCP integration test"));if(v.length>0)return v.map((U)=>[U]);return null}function _P($){if(!$.includes("clojure.string/includes?"))return null;let v=$.match(/"(TODO|DOING|DONE|LATER|NOW|WAITING)"/g),U;if(v)U=v.map((X)=>X.replace(/"/g,""));else U=["TODO","DOING","DONE"];return r.blocks.filter((X)=>U.some((J)=>X.content.includes(J))).map((X)=>[X])}function ZP($){if(!$.includes(":block/marker"))return null;let v=kP($);return r.blocks.filter((U)=>{let X=U.content.split(" ")[0];if(!X)return!1;return v.includes(X)}).map((U)=>[U])}function TP($){if(!$.includes("recipe"))return null;let v=r.blocks.filter((U)=>V0(U.properties,"recipe")||U.content.includes("#recipe")||U.content.includes("recipe"));if(v.length>0)return v.map((U)=>[U]);return null}function xP($){let v=$[0];if(!v||typeof v!=="string")return[[{uuid:"mock-query-result",content:"Mock query result",properties:{}}]];let U=CP(v);if(U)return U;let X=_P(v);if(X)return X;let J=ZP(v);if(J)return J;let W=TP(v);if(W)return W;return[[{uuid:"mock-query-result",content:"Mock query result",properties:{}}]]}function gP($){let v=$[0];if(v&&typeof v==="string"){if(v.includes("This is a test block created by MCP integration test")){let X=r.blocks.find((J)=>J.content.includes("This is a test block created by MCP integration test"));if(X)return[[X]]}let U=r.blocks.filter((X)=>X.content.includes(v)).map((X)=>[X]);if(U.length>0)return U;return[[{uuid:"search-result",content:`Search result for: ${v}`,properties:{}}]]}return[[{uuid:"default-search-result",content:"Default search result",properties:{}}]]}function fP($){let v=$[0];if(v&&typeof v==="string"&&v.includes("block/marker"))return r.blocks.filter((U)=>U.content.startsWith("TODO")||U.content.startsWith("DOING")||U.content.startsWith("DONE")).map((U)=>[U.uuid,U.content.split(" ")[0]]);if(v&&typeof v==="string"&&v.includes(":block/content"))return r.blocks.map((U)=>[{uuid:U.uuid,content:U.content,":block/content":U.content,page:U.page}]);if(v&&typeof v==="string"&&v.includes(":block/_refs"))return[["mock-reference-uuid"]];if(v&&typeof v==="string"&&v.includes(":block/properties")&&v.includes("recipe"))return r.blocks.filter((U)=>V0(U.properties,"recipe")).map((U)=>[U.uuid]);if(v&&typeof v==="string"&&v.includes(":page/properties")&&v.includes("recipe"))return r.pages.filter((U)=>V0(U.properties,"recipe")).map((U)=>[U.name]);return r.blocks.map((U)=>[{uuid:U.uuid,content:U.content}])}function yP(){return{blocks:r.blocks.filter(($)=>V0($.properties,"recipe")).map(($)=>({uuid:$.uuid,content:$.content})),pages:r.pages.filter(($)=>V0($.properties,"recipe")).map(($)=>({name:$.name}))}}var uP={"logseq.Editor.createPage":wP,"logseq.Editor.getPage":HP,"logseq.Editor.getCurrentPage":()=>NP(),"logseq.Editor.getAllPages":()=>IP(),"logseq.Editor.getPageBlocksTree":OP,"logseq.Editor.getPageLinkedReferences":DP,"logseq.Editor.createBlock":bP,"logseq.Editor.insertBlock":VP,"logseq.Editor.getBlock":KP,"logseq.Editor.updateBlock":BP,"logseq.Editor.removeBlock":AP,"logseq.Editor.getBlockProperty":SP,"logseq.Editor.getBlockProperties":qP,"logseq.Editor.setBlockProperty":LP,"logseq.Editor.removeBlockProperty":FP,"logseq.Editor.insertBatchBlock":EP,"logseq.Editor.setBlockCollapsed":()=>null,"logseq.Editor.toggleBlockCollapsed":()=>null,"logseq.Editor.getNextSiblingBlock":MP,"logseq.Editor.moveBlock":PP,"logseq.Editor.selectBlock":()=>null,"logseq.Editor.editBlock":()=>null,"logseq.Editor.getCurrentBlock":()=>RP(),"logseq.DB.datascriptQuery":xP,"logseq.DB.q":gP,"logseq.Datascript.q":fP,"logseq.Datascript.qUpsert":()=>yP()};function hP($,v=[]){X$(`[MOCK] Calling Logseq API: ${$} with args:`,JSON.stringify(v));let U=uP[$];if(U)return U(v);return X$(`[MOCK] Unhandled method: ${$}`),null}function eH($){$.resource("blocks",new k4("logseq:block:{uuid}",{list:void 0}),async(v,{uuid:U})=>{try{let X=await C("logseq.Editor.getBlock",[U]);if(X)return{contents:[{uri:v.href,mimeType:"application/json",text:JSON.stringify(X,null,2)}]};return{contents:[]}}catch{return{contents:[]}}})}async function lP(){try{return{resources:(await C("logseq.Editor.getAllPages",[])).map((v)=>{let U=String(v.originalName||v.name||"Untitled");return{uri:`logseq:page:${encodeURIComponent(U)}`,name:U,description:`Page: ${U}`,mimeType:"application/json"}})}}catch{return{resources:[]}}}async function mP($,v){try{let U=decodeURIComponent(v.pageName);X$(`Reading page resource for: "${U}"`);let X=await C("logseq.Editor.getPage",[U]);if(!X)return X$(`Page not found: "${U}"`),nP($,U);return await cP($,U,X)}catch(U){return iP($,U)}}function nP($,v){return{contents:[{uri:$.href,mimeType:"text/plain",text:`Page "${v}" not found`}]}}async function cP($,v,U){X$(`Getting blocks for page: "${v}"`);let X=await C("logseq.Editor.getPageBlocksTree",[v]),J={...U,blocks:X};return X$(`Successfully retrieved page resource: "${v}"`),{contents:[{uri:$.href,mimeType:"application/json",text:JSON.stringify(J,null,2)}]}}function iP($,v){return{contents:[{uri:$.href,mimeType:"text/plain",text:`Error reading page: ${v}`}]}}function sH($){$.resource("pages",new k4("logseq:page:{pageName}",{list:lP}),mP)}function $N($){$.resource("query",new k4("logseq:query:{query}",{list:void 0}),async(v,{query:U})=>{try{let X=decodeURIComponent(U),J=await C("logseq.DB.q",[X]);return{contents:[{uri:v.href,mimeType:"application/json",text:JSON.stringify(J,null,2)}]}}catch(X){return console.error("Failed to execute query resource:",X),{contents:[]}}})}function vN($){sH($),eH($),$N($)}var rP=50,oP=100,pP=946684800000,dP=4102444800000,k$={filterInternalProps:A.boolean().optional().default(!0).describe("Filter out internal Logseq properties (e.g., :plugin.property.*, :logseq.property.*)"),fields:A.array(A.string()).optional().describe('Only return these fields. Example: ["uuid", "content", "createdAt"]'),expandRefs:A.boolean().optional().default(!1).describe("Expand reference IDs to include name/uuid (requires additional API calls)"),expandParent:A.boolean().optional().default(!1).describe("Expand parent ID to include uuid/content"),expandPage:A.boolean().optional().default(!1).describe("Expand page ID to include name/uuid"),timestampFormat:A.enum(["ms","iso"]).optional().default("ms").describe('Timestamp format: "ms" (milliseconds) or "iso" (ISO 8601)'),deduplicateFields:A.boolean().optional().default(!0).describe("Remove redundant fields (title/fullTitle when same as content)")},UN={filterInternalProps:!0,fields:[],expandRefs:!1,expandParent:!1,expandPage:!1,timestampFormat:"ms",deduplicateFields:!0},tP=[/^:plugin\.property\./,/^:logseq\.property\./,/^:block\//,/^:db\//,/^:logseq\.property\//],aP=["createdAt","updatedAt","scheduled","deadline"],eP=[{primary:"content",duplicates:["title","fullTitle"]}];function YW($){if(!$||typeof $!=="object")return $;let v={};for(let[U,X]of Object.entries($))if(!tP.some((W)=>W.test(U)))if(X&&typeof X==="object"&&!Array.isArray(X))v[U]=YW(X);else if(Array.isArray(X))v[U]=X.map((W)=>{if(W&&typeof W==="object")return YW(W);return W});else v[U]=X;return v}function sP($,v,U){let[X,...J]=U.split(".");if(!X||!(X in $))return;let W=$[X];if(!W||typeof W!=="object")return;if(!v[X])v[X]={};let Y=GG(W,[J.join(".")]);v[X]={...v[X],...Y}}function GG($,v){if(!$||typeof $!=="object")return $;if(!v||v.length===0)return $;let U={};for(let X of v)if(X.includes("."))sP($,U,X);else if(X in $)U[X]=$[X];return U}function $2($){return $>pP&&$<dP}function v2($){for(let v of aP){if(!(v in $))continue;if(typeof $[v]!=="number")continue;let U=$[v];if($2(U))$[v]=new Date(U).toISOString()}}function U2($,v){for(let[U,X]of Object.entries($))if(X&&typeof X==="object"&&!Array.isArray(X))$[U]=zW(X,v);else if(Array.isArray(X))$[U]=X.map((J)=>{if(J&&typeof J==="object")return zW(J,v);return J})}function zW($,v){if(!$||typeof $!=="object")return $;if(v==="ms")return $;let U={...$};return v2(U),U2(U,v),U}function J2($){for(let{primary:v,duplicates:U}of eP){if(!(v in $))continue;let X=$[v];for(let J of U)if(J in $&&$[J]===X)delete $[J]}delete $.order}function X2($){for(let[v,U]of Object.entries($))if(U&&typeof U==="object"&&!Array.isArray(U))$[v]=GW(U);else if(Array.isArray(U))$[v]=U.map((X)=>{if(X&&typeof X==="object")return GW(X);return X})}function GW($){if(!$||typeof $!=="object")return $;let v={...$};return J2(v),X2(v),v}async function W2($,v){if(!($&&Array.isArray($))||$.length===0)return[];return await Promise.all($.map(async(X)=>{let J;if(typeof X==="number")J=X;else J=X.id;try{let W=await v("logseq.Editor.getBlock",[J]);if(W?.uuid)return{id:J,uuid:W.uuid,content:(W.content||"").substring(0,rP),type:"block"}}catch{}try{let W=await v("logseq.Editor.getPage",[J]);if(W?.name)return{id:J,name:W.name,uuid:W.uuid,type:"page"}}catch{}return{id:J}}))}async function Y2($,v){if(!$)return;let U;if(typeof $==="number")U=$;else U=$.id;try{let X=await v("logseq.Editor.getBlock",[U]);if(X)return{id:U,uuid:X.uuid,content:(X.content||"").substring(0,oP)}}catch{}return{id:U}}async function z2($,v){if(!$)return;let U;if(typeof $==="number")U=$;else U=$.id;try{let X=await v("logseq.Editor.getPage",[U]);if(X)return{id:U,name:X.name||X.originalName,uuid:X.uuid}}catch{}return{id:U}}function G2($,v){let U=$;if(v.filterInternalProps)U=YW(U);if(v.deduplicateFields)U=GW(U);return U}async function Q2($,v,U){if(v.expandRefs&&$.refs)$.refs=await W2($.refs,U);if(v.expandParent&&$.parent)$.parent=await Y2($.parent,U);if(v.expandPage&&$.page)$.page=await z2($.page,U)}function j2($,v){let U=$;if(v.timestampFormat==="iso")U=zW(U,"iso");if(v.fields&&v.fields.length>0)U=GG(U,v.fields);return U}async function w2($,v,U){if($.children&&Array.isArray($.children))$.children=await Promise.all($.children.map((X)=>t$(X,v,U)));if($.blocks&&Array.isArray($.blocks))$.blocks=await Promise.all($.blocks.map((X)=>t$(X,v,U)))}async function t$($,v={},U){let X={...UN,...v};if(Array.isArray($))return await Promise.all($.map((Y)=>t$(Y,v,U)));if(!$||typeof $!=="object")return $;let J=G2({...$},X);if(U)await Q2(J,X,U);return J=j2(J,X),await w2(J,v,U),J}function d$($,v={}){let U={...UN,...v};if(Array.isArray($))return $.map((J)=>d$(J,v));if(!$||typeof $!=="object")return $;let X={...$};if(U.filterInternalProps)X=YW(X);if(U.deduplicateFields)X=GW(X);if(U.timestampFormat==="iso")X=zW(X,"iso");if(U.fields&&U.fields.length>0)X=GG(X,U.fields);if(X.children&&Array.isArray(X.children))X.children=X.children.map((J)=>d$(J,v));if(X.blocks&&Array.isArray(X.blocks))X.blocks=X.blocks.map((J)=>d$(J,v));return X}function E6($){return Boolean($.expandRefs||$.expandParent||$.expandPage)}var H2=/^\s*-\s+/;function QG($,v=!0){if(!v)return $;return $.split(`
74
+ `).map((U)=>U.replace(H2,"")).join(`
75
+ `)}function JN($,v=!0){return $.map((U)=>{if(typeof U==="string")return{content:QG(U,v)};if(U&&typeof U==="object"){let X={...U};if(U.content)X.content=QG(U.content,v);if("children"in U&&Array.isArray(U.children)&&U.children.length>0)X.children=JN(U.children,v);return X}return U})}function C4($){return{filterInternalProps:$.filterInternalProps??!0,fields:$.fields,expandRefs:$.expandRefs??!1,expandParent:$.expandParent??!1,expandPage:$.expandPage??!1,timestampFormat:$.timestampFormat??"ms",deduplicateFields:$.deduplicateFields??!0}}async function _4($,v){if(E6(v))return await t$($,v,C);return d$($,v)}function w4($){return{isError:!1,content:[{type:"text",text:JSON.stringify($,null,2)}]}}function M6($){return{isError:!1,content:[{type:"text",text:$}]}}function U$($){return{isError:!0,content:[{type:"text",text:$}]}}async function N2($){let{uuid:v,includeChildren:U=!0}=$;if(!v)return U$("UUID is required for get operation");let X=await C("logseq.Editor.getBlock",[v,{includeChildren:U}]);if(!X)return U$(`Block with UUID "${v}" not found`);let J=C4($),W=await _4(X,J);return w4(W)}async function I2($){let v=await C("logseq.Editor.getCurrentBlock",[]);if(!v)return U$("No block is currently focused");let U=C4($),X=await _4(v,U);return w4(X)}async function O2($){let v=await C("logseq.Editor.getSelectedBlocks",[]);if(!(v&&Array.isArray(v))||v.length===0)return U$("No blocks are currently selected");let U=C4($),X=await _4(v,U);return w4(X)}async function D2($){let{uuid:v,direction:U="next"}=$;if(!v)return U$("UUID is required for get-siblings operation");let X;if(U==="previous")X="logseq.Editor.getPreviousSiblingBlock";else X="logseq.Editor.getNextSiblingBlock";let J=await C(X,[v]);if(!J)return U$(`No ${U} sibling found for block "${v}"`);let W=C4($),Y=await _4(J,W);return w4(Y)}async function b2($,v,U,X,J){let W=JN(v,X);return await C("logseq.Editor.insertBatchBlock",[$,W,{sibling:U==="before"||U==="after",before:U==="before",keepId:J}])}async function V2($,v,U,X,J){let W=QG(v,X);if(U==="first")return await C("logseq.Editor.insertBlock",[$,W,{isPageBlock:!0,keepId:J}]);return await C("logseq.Editor.insertBlock",[$,W,{before:U==="before",sibling:U==="before"||U==="after",isPageBlock:U==="child",keepId:J}])}async function K2($){let{target:v,content:U,blocks:X,position:J="child",stripLeadingHyphen:W=!0,keepUUID:Y=!1}=$;if(!v)return U$("Target (page name or block UUID) is required for create operation");if(!(U||X))return U$("Content or blocks array is required for create operation");let z;if(X)z=await b2(v,X,J,W,Y);else if(U)z=await V2(v,U,J,W,Y);if(!z)return U$("Failed to create block");let G=C4($),Q=await _4(z,G);return w4(Q)}async function B2($){let{uuid:v,content:U,properties:X}=$;if(!v)return U$("UUID is required for update operation");if(!(U||X))return U$("Content or properties is required for update operation");let J;if(U)J=await C("logseq.Editor.updateBlock",[v,U]);else if(X)J=await C("logseq.Editor.setBlockProperties",[v,X]);if(!J)return U$(`Failed to update block "${v}"`);let W=C4($),Y=await _4(J,W);return w4(Y)}async function A2($){let{uuid:v,target:U,position:X="child"}=$;if(!v)return U$("UUID is required for move operation");if(!U)return U$("Target is required for move operation");if(!await C("logseq.Editor.moveBlock",[v,U,{before:X==="before",children:X==="child"}]))return U$(`Failed to move block "${v}" to "${U}"`);return M6(`Block "${v}" moved successfully`)}async function S2($){let{uuid:v,uuids:U}=$;if(!(v||U))return U$("UUID or uuids array is required for remove operation");if(U&&Array.isArray(U))return await q2(U);if(!await C("logseq.Editor.removeBlock",[v]))return U$(`Failed to remove block "${v}"`);return M6(`Block "${v}" removed successfully`)}async function q2($){let v=await Promise.all($.map(async(J)=>{try{return await C("logseq.Editor.removeBlock",[J]),{uuid:J,success:!0}}catch(W){return{uuid:J,success:!1,error:W}}})),U=v.filter((J)=>J.success).length,X=v.filter((J)=>!J.success);if(X.length===0)return M6(`Successfully removed ${U} blocks`);return U$(`Removed ${U} blocks, failed to remove ${X.length}: ${X.map((J)=>J.uuid).join(", ")}`)}async function L2($){let{uuid:v,collapsed:U}=$;if(!v)return U$("UUID is required for toggle-collapse operation");if(U==="toggle")await C("logseq.Editor.toggleBlockCollapsed",[v]);else await C("logseq.Editor.setBlockCollapsed",[v,U]);return M6(`Block "${v}" collapse state toggled successfully`)}async function F2($){let{uuid:v}=$;if(!v)return U$("UUID is required for select operation");return await C("logseq.Editor.selectBlock",[v]),M6(`Block "${v}" selected successfully`)}async function E2($){let{uuid:v,pos:U}=$;if(!v)return U$("UUID is required for edit operation");return await C("logseq.Editor.editBlock",[v,U]),M6(`Block "${v}" is now in edit mode`)}async function M2($){let{uuid:v}=$;if(!v)return U$("UUID is required for open-sidebar operation");return await C("logseq.Editor.openInRightSidebar",[v]),M6(`Block "${v}" opened in right sidebar`)}async function P2($){let{uuid:v,pageName:U}=$;if(!v)return U$("UUID is required for scroll-to operation");await C("logseq.Editor.scrollToBlockInPage",[U||null,v]);let X=`Scrolled to block "${v}"`;if(U)X+=` in page "${U}"`;return M6(X)}async function R2($){let{uuid:v,propertyKey:U}=$;if(!v)return U$("UUID is required for get-property operation");if(!U)return U$("Property key is required for get-property operation");let X=await C("logseq.Editor.getBlockProperty",[v,U]);return w4(X)}async function k2($){let{uuid:v}=$;if(!v)return U$("UUID is required for get-properties operation");let U=await C("logseq.Editor.getBlockProperties",[v]),X=C4($),J=await _4(U,X);return w4(J)}async function C2($){let{uuid:v,propertyKey:U,propertyValue:X}=$;if(!v)return U$("UUID is required for set-property operation");if(!U)return U$("Property key is required for set-property operation");if(!await C("logseq.Editor.setBlockProperty",[v,U,X]))return U$(`Failed to set property "${U}" for block "${v}"`);return M6(`Property "${U}" set successfully for block "${v}"`)}async function _2($){let{uuid:v,propertyKey:U}=$;if(!v)return U$("UUID is required for remove-property operation");if(!U)return U$("Property key is required for remove-property operation");if(!await C("logseq.Editor.removeBlockProperty",[v,U]))return U$(`Failed to remove property "${U}" from block "${v}"`);return M6(`Property "${U}" removed successfully from block "${v}"`)}async function Z2($){switch($.operation){case"get":return await N2($);case"get-current":return await I2($);case"get-selected":return await O2($);case"get-siblings":return await D2($);default:return null}}async function T2($){switch($.operation){case"create":return await K2($);case"update":return await B2($);case"move":return await A2($);case"remove":return await S2($);default:return null}}async function x2($){switch($.operation){case"toggle-collapse":return await L2($);case"select":return await F2($);case"edit":return await E2($);case"open-sidebar":return await M2($);case"scroll-to":return await P2($);default:return null}}async function g2($){switch($.operation){case"get-property":return await R2($);case"get-properties":return await k2($);case"set-property":return await C2($);case"remove-property":return await _2($);default:return null}}var f2=async($)=>{let v=$.operation;try{let U=await Z2($);if(U)return U;let X=await T2($);if(X)return X;let J=await x2($);if(J)return J;let W=await g2($);if(W)return W;return U$(`Unknown operation: ${v}`)}catch(U){return U$(`Error in block operation (${v}): ${U}`)}},y2={operation:A.enum(["get","get-current","get-selected","get-siblings","create","update","move","remove","toggle-collapse","select","edit","open-sidebar","scroll-to","get-property","get-properties","set-property","remove-property"]).describe("Operation to perform on blocks"),uuid:A.string().optional().describe("UUID of the block for operations requiring a specific block"),includeChildren:A.boolean().optional().default(!0).describe("Whether to include child blocks in results"),direction:A.enum(["previous","next"]).optional().default("next").describe("Direction for sibling operations"),content:A.string().optional().describe("Content for create/update operations"),properties:A.record(A.string(),A.any()).optional().describe("Block properties as a key-value object"),target:A.string().optional().describe("Target block UUID or page name for create/move operations"),position:A.enum(["child","before","after","first","last"]).optional().default("child").describe("Position for create/move operations"),preventAutoFormat:A.boolean().optional().default(!0).describe("Prevent Logseq from auto-formatting blocks"),stripLeadingHyphen:A.boolean().optional().default(!0).describe("Remove leading hyphens from content"),blocks:A.array(A.any()).optional().describe("Array of blocks for batch operations with nesting"),keepUUID:A.boolean().optional().default(!1).describe("Keep custom UUIDs if specified in properties"),collapsed:A.union([A.boolean(),A.literal("toggle")]).optional().describe("Collapsed state for toggle-collapse"),pageName:A.string().optional().describe("Page name for scroll-to operation"),pos:A.number().optional().describe("Position for edit operation"),propertyKey:A.string().optional().describe("Property key for property operations"),propertyValue:A.any().optional().describe("Value for set-property operation"),uuids:A.array(A.string()).optional().describe("Array of block UUIDs for batch operations"),...k$},u2=`Perform operations on Logseq blocks - read, write, organize, and manage properties.
43
76
 
44
77
  OPERATIONS:
45
78
  - get: Retrieve a block by UUID
@@ -87,7 +120,79 @@ EXAMPLES:
87
120
  - uuid: "block-uuid"
88
121
  - propertyKey: "status"
89
122
  - propertyValue: "DONE"
90
- `,{operation:Q.enum(["get","get-current","get-selected","get-siblings","create","update","move","remove","toggle-collapse","select","edit","open-sidebar","scroll-to","get-property","get-properties","set-property","remove-property"]).describe("Operation to perform on blocks"),uuid:Q.string().optional().describe("UUID of the block for operations requiring a specific block"),includeChildren:Q.boolean().optional().default(!0).describe("Whether to include child blocks in results"),direction:Q.enum(["previous","next"]).optional().default("next").describe("Direction for sibling operations"),content:Q.string().optional().describe("Content for create/update operations"),properties:Q.record(Q.string(),Q.any()).optional().describe("Block properties as a key-value object"),target:Q.string().optional().describe("Target block UUID or page name for create/move operations"),position:Q.enum(["child","before","after","first","last"]).optional().default("child").describe("Position for create/move operations"),preventAutoFormat:Q.boolean().optional().default(!0).describe("Prevent Logseq from auto-formatting blocks"),stripLeadingHyphen:Q.boolean().optional().default(!0).describe("Remove leading hyphens from content"),blocks:Q.array(Q.any()).optional().describe("Array of blocks for batch operations with nesting"),keepUUID:Q.boolean().optional().default(!1).describe("Keep custom UUIDs if specified in properties"),collapsed:Q.union([Q.boolean(),Q.literal("toggle")]).optional().describe("Collapsed state for toggle-collapse"),pageName:Q.string().optional().describe("Page name for scroll-to operation"),pos:Q.number().optional().describe("Position for edit operation"),propertyKey:Q.string().optional().describe("Property key for property operations"),propertyValue:Q.any().optional().describe("Value for set-property operation"),uuids:Q.array(Q.string()).optional().describe("Array of block UUIDs for batch operations")},X),X}function E3($,X){$.tool("block-read","Read operations for Logseq blocks",{operation:Q.enum(["get","get-current","get-selected","get-siblings"]).describe("Read operation to perform"),uuid:Q.string().optional().describe("UUID of the block"),includeChildren:Q.boolean().optional().default(!0).describe("Whether to include child blocks"),direction:Q.enum(["previous","next"]).optional().default("next").describe("Direction for sibling operations")},async(W)=>{return await X(W)}),$.tool("block-write","Write operations for Logseq blocks",{operation:Q.enum(["create","update"]).describe("Write operation to perform"),uuid:Q.string().optional().describe("UUID of the block for update"),content:Q.string().optional().describe("Content for the block"),target:Q.string().optional().describe("Target block UUID or page name for create"),position:Q.enum(["child","before","after","first","last"]).optional().default("child").describe("Position for create"),properties:Q.record(Q.string(),Q.any()).optional().describe("Block properties"),preventAutoFormat:Q.boolean().optional().default(!0).describe("Prevent auto-formatting"),stripLeadingHyphen:Q.boolean().optional().default(!0).describe("Remove leading hyphens"),blocks:Q.array(Q.any()).optional().describe("Array of blocks for batch operations"),keepUUID:Q.boolean().optional().default(!1).describe("Keep custom UUIDs")},async(W)=>{return await X(W)}),$.tool("block-organize","Organize operations for Logseq blocks",{operation:Q.enum(["move","remove"]).describe("Organize operation to perform"),uuid:Q.string().optional().describe("UUID of the block"),target:Q.string().optional().describe("Target for move operation"),position:Q.enum(["child","before","after"]).optional().default("child").describe("Position for move"),includeChildren:Q.boolean().optional().default(!0).describe("Whether to move children"),uuids:Q.array(Q.string()).optional().describe("Array of block UUIDs for batch removal")},async(W)=>{return await X(W)}),$.tool("block-ui","UI operations for Logseq blocks",{operation:Q.enum(["toggle-collapse","select","edit","open-sidebar","scroll-to"]).describe("UI operation to perform"),uuid:Q.string().optional().describe("UUID of the block"),collapsed:Q.union([Q.boolean(),Q.literal("toggle")]).optional().describe("Collapsed state"),pos:Q.number().optional().describe("Position for edit"),pageName:Q.string().optional().describe("Page name for scroll-to")},async(W)=>{return await X(W)}),$.tool("block-property","Property operations for Logseq blocks",{operation:Q.enum(["get-property","get-properties","set-property","remove-property"]).describe("Property operation to perform"),uuid:Q.string().optional().describe("UUID of the block"),propertyKey:Q.string().optional().describe("Property key"),propertyValue:Q.any().optional().describe("Property value for set")},async(W)=>{return await X(W)})}function L4($){$.tool("page",`Create, retrieve, and manage pages in Logseq. Pages are the top-level organization unit in Logseq that contain blocks.
123
+ `,h2={operation:A.enum(["get","get-current","get-selected","get-siblings"]).describe("Read operation to perform"),uuid:A.string().optional().describe("UUID of the block"),includeChildren:A.boolean().optional().default(!0).describe("Whether to include child blocks"),direction:A.enum(["previous","next"]).optional().default("next").describe("Direction for sibling operations"),...k$},l2={operation:A.enum(["create","update","move","remove"]).describe("Write operation to perform"),content:A.string().optional().describe("Block content"),target:A.string().optional().describe("Target location or UUID"),position:A.enum(["before","after","first","last","child"]).default("child").describe("Position for move"),preventAutoFormat:A.boolean().optional().default(!0).describe("Prevent auto-formatting"),stripLeadingHyphen:A.boolean().optional().default(!0).describe("Remove leading hyphens"),blocks:A.array(A.any()).optional().describe("Array of blocks for batch operations"),keepUUID:A.boolean().optional().default(!1).describe("Keep custom UUIDs"),...k$},m2={operation:A.enum(["create-nested-blocks","get-structure","flatten"]).describe("Organization operation to perform"),blocks:A.array(A.any()).optional().describe("Array of blocks to organize"),pageOrBlockId:A.string().optional().describe("Parent page or block ID"),...k$},n2={uuid:A.string().describe("UUID of block to move"),target:A.string().describe("Target location"),position:A.enum(["before","after","first","last","child"]).default("child").describe("Position for move"),...k$},c2={uuid:A.string().describe("UUID of block to replace"),content:A.string().describe("New content"),...k$};function i2($,v){$.tool("block-read","Read operations for Logseq blocks",h2,async(U)=>await v(U)),$.tool("block-write","Write operations for Logseq blocks",l2,async(U)=>await v(U)),$.tool("block-organize","Organize blocks hierarchically",m2,async(U)=>await v(U)),$.tool("block-move","Move blocks within the graph",n2,async(U)=>await v(U)),$.tool("block-replace","Replace block content",c2,async(U)=>await v(U))}function XN($){let v=f2;$.tool("block",u2,y2,async(U)=>await v(U)),i2($,v)}import r2 from"node:process";function V$($){let v;if($===null)v="null";else if(typeof $==="string")v=$;else v=JSON.stringify($,null,2);return{isError:!1,content:[{type:"text",text:v}]}}function S$($,v,U){let X;if(v instanceof Error)X=v.message;else if(typeof v==="string")X=v;else X=String(v);let J=`Failed to ${$}: ${X}`;if(U)J+=`
124
+
125
+ Hint: ${U}`;return{isError:!0,content:[{type:"text",text:J}]}}function jG($,v){return{isError:!0,content:[{type:"text",text:`${$} "${v}" not found`}]}}function Z4($,v){return{isError:!0,content:[{type:"text",text:`${$} is required for ${v} operation`}]}}function QW($){if(Array.isArray($))return $[0];return $}function o2($){let v=QW($);if(typeof v==="string")return{name:v};return{name:v?.name||v?.["block/name"]||v,uuid:v?.uuid||v?.["block/uuid"],properties:v?.properties||v?.["block/properties"],extends:v?.["class/extends"]||v?.extends,classProperties:v?.["class/properties"]||v?.classProperties}}function p2($){let v=QW($);if(typeof v==="string")return{name:v};return{name:v?.name||v?.["block/name"]||v,uuid:v?.uuid||v?.["block/uuid"]}}function d2($){if(!Array.isArray($))return[{name:$}];return $.map((v)=>o2(v))}function t2($){if(!Array.isArray($))return[{name:$}];return $.map((v)=>p2(v))}function a2($){let v=QW($);if(typeof v==="string")return{name:v};return{name:v?.name||v?.["block/name"]||v,uuid:v?.uuid||v?.["block/uuid"],type:v?.["property/type"]||v?.type||"default",cardinality:v?.["property/cardinality"]||v?.cardinality||"one",classes:v?.["property/classes"]||v?.classes,description:v?.["property/description"]||v?.description}}function e2($){let v=QW($);if(typeof v==="string")return{name:v};return{name:v?.name||v?.["block/name"]||v,uuid:v?.uuid||v?.["block/uuid"]}}function s2($){if(!Array.isArray($))return[{name:$}];return $.map((v)=>a2(v))}function $R($){if(!Array.isArray($))return[{name:$}];return $.map((v)=>e2(v))}function WN($){vR($),WR($),QR($)}function vR($){$.tool("listTags",`List all tags in the Logseq graph.
126
+
127
+ Tags in Logseq are used to categorize and organize content. This tool retrieves all available tags.
128
+
129
+ EXAMPLES:
130
+ 1) Get all tags with basic info:
131
+ - expand: false
132
+
133
+ 2) Get all tags with full details (parents, properties):
134
+ - expand: true
135
+ `,{expand:A.boolean().optional().default(!1).describe("When true, returns additional details for each tag (parent tags, associated properties). When false, returns just tag names and IDs."),...k$},UR)}async function UR({expand:$=!1,filterInternalProps:v,fields:U,expandRefs:X,expandParent:J,expandPage:W,timestampFormat:Y,deduplicateFields:z}){try{let G=await JR();if(!G||Array.isArray(G)&&G.length===0){let w=V$("No tags found in the graph");return{content:w.content,isError:w.isError}}let Q=XR(G,$),j=YN({filterInternalProps:v,fields:U,expandRefs:X,expandParent:J,expandPage:W,timestampFormat:Y,deduplicateFields:z}),H=await zN(Q,j),N=V$(H);return{content:N.content,isError:N.isError}}catch(G){let Q=S$("list tags",G,"This may occur if the graph uses an older Logseq version without tag support.");return{content:Q.content,isError:Q.isError}}}async function JR(){let v=await C("logseq.DB.datascriptQuery",[`[:find (pull ?t [*])
136
+ :where
137
+ [?t :block/type "class"]]`]);if(!v||Array.isArray(v)&&v.length===0)v=await C("logseq.DB.datascriptQuery",[`[:find ?tag
138
+ :where
139
+ [?b :block/tags ?t]
140
+ [?t :block/name ?tag]]`]);return v}function XR($,v){if(v)return d2($);return t2($)}function YN($){return{filterInternalProps:$.filterInternalProps??!0,fields:$.fields,expandRefs:$.expandRefs,expandParent:$.expandParent,expandPage:$.expandPage,timestampFormat:$.timestampFormat,deduplicateFields:$.deduplicateFields??!0}}async function zN($,v){if(E6(v))return await t$($,v,C);return d$($,v)}function WR($){$.tool("listProperties",`List all properties defined in the Logseq graph.
141
+
142
+ Properties in Logseq are key-value pairs attached to blocks and pages. This tool retrieves all property definitions.
143
+
144
+ EXAMPLES:
145
+ 1) Get all properties with basic info:
146
+ - expand: false
147
+
148
+ 2) Get all properties with full details (type, cardinality):
149
+ - expand: true
150
+ `,{expand:A.boolean().optional().default(!1).describe("When true, returns additional details for each property (type, cardinality, allowed values). When false, returns just property names and IDs."),...k$},YR)}async function YR({expand:$=!1,filterInternalProps:v,fields:U,expandRefs:X,expandParent:J,expandPage:W,timestampFormat:Y,deduplicateFields:z}){try{let G=await zR();if(!G||Array.isArray(G)&&G.length===0){let w=V$("No properties found in the graph");return{content:w.content,isError:w.isError}}let Q=GR(G,$),j=YN({filterInternalProps:v,fields:U,expandRefs:X,expandParent:J,expandPage:W,timestampFormat:Y,deduplicateFields:z}),H=await zN(Q,j),N=V$(H);return{content:N.content,isError:N.isError}}catch(G){let Q=S$("list properties",G,"This may occur if the graph uses an older Logseq version.");return{content:Q.content,isError:Q.isError}}}async function zR(){let v=await C("logseq.DB.datascriptQuery",[`[:find (pull ?p [*])
151
+ :where
152
+ [?p :block/type "property"]]`]);if(!v||Array.isArray(v)&&v.length===0)v=await C("logseq.DB.datascriptQuery",[`[:find ?prop
153
+ :where
154
+ [?b :block/properties ?props]
155
+ [(keys ?props) ?ks]
156
+ [(first ?ks) ?prop]]`]);return v}function GR($,v){if(v)return s2($);return $R($)}function QR($){$.tool("readAPI",jR(),{type:A.enum(["blocks","pages","tasks","tags","properties","references","graph"]).describe("Type of data to read from the Logseq graph"),apiKey:A.string().describe("API key for authentication (from LOGSEQ_TOKEN environment variable)"),filter:A.array(A.string()).optional().describe("Optional filter to limit results (block UUIDs, task markers, etc.)"),includeContent:A.boolean().optional().default(!0).describe("Whether to include full content in the response"),limit:A.number().optional().describe("Maximum number of results to return")},wR)}function jR(){return`Read API - Comprehensive read-only access to Logseq graph data with API key authentication.
157
+
158
+ This tool provides a unified interface for reading various types of data from your Logseq graph.
159
+ It requires an API key for authentication (configured via LOGSEQ_TOKEN environment variable).
160
+
161
+ SUPPORTED READ TYPES:
162
+ - blocks: Get block content and metadata
163
+ - pages: Get page information and content
164
+ - tasks: Get task blocks (TODO, DOING, DONE)
165
+ - tags: Get all tags in the graph
166
+ - properties: Get all properties defined in the graph
167
+ - references: Get linked references between pages/blocks
168
+ - graph: Get general graph information
169
+
170
+ EXAMPLES:
171
+ 1) Read all pages:
172
+ - type: "pages"
173
+ - apiKey: "<your-api-key>"
174
+
175
+ 2) Read all tasks with specific markers:
176
+ - type: "tasks"
177
+ - apiKey: "<your-api-key>"
178
+ - filter: ["TODO", "DOING"]
179
+
180
+ 3) Read specific blocks by UUID:
181
+ - type: "blocks"
182
+ - apiKey: "<your-api-key>"
183
+ - filter: ["block-uuid-1", "block-uuid-2"]
184
+
185
+ 4) Read graph metadata:
186
+ - type: "graph"
187
+ - apiKey: "<your-api-key>"
188
+ `}async function wR({type:$,apiKey:v,filter:U,includeContent:X=!0,limit:J}){let W=r2.env.LOGSEQ_TOKEN;if(!W||v!==W){let Y=S$("read API",Error("Invalid API key"),"The provided API key is invalid. Ensure LOGSEQ_TOKEN environment variable is set correctly.");return{content:Y.content,isError:Y.isError}}try{let Y=await HR($,U,X);if(J&&Array.isArray(Y)&&Y.length>J)Y=Y.slice(0,J);let z=1;if(Array.isArray(Y))z=Y.length;let G=V$({type:$,data:Y,count:z,timestamp:new Date().toISOString()});return{content:G.content,isError:G.isError}}catch(Y){let z=S$("read API",Y,`Failed to read ${$} data. Ensure Logseq is running and the HTTP API is enabled.`);return{content:z.content,isError:z.isError}}}async function HR($,v,U){switch($){case"blocks":return await NR(v,U);case"pages":return await IR(v,U);case"tasks":return await OR(v);case"tags":return await DR();case"properties":return await bR();case"references":return await VR();case"graph":return await KR();default:throw Error(`Unsupported read type: ${$}`)}}async function NR($,v){if($&&$.length>0){let J=[];for(let W of $){let Y=await C("logseq.Editor.getBlock",[W,{includeChildren:v}]);if(Y)J.push(Y)}return J}let U=await C("logseq.Editor.getAllPages",[]),X=[];for(let J of U||[]){let W=await C("logseq.Editor.getPageBlocksTree",[J.name]);if(W)X.push(...W)}return X}async function IR($,v){if($&&$.length>0){let U=[];for(let X of $){let J=await C("logseq.Editor.getPage",[X]);if(J){let W=[];if(v)W=await C("logseq.Editor.getPageBlocksTree",[X])||[];U.push({...J,blocks:W})}}return U}return await C("logseq.Editor.getAllPages",[])}async function OR($){let v;if($&&$.length>0)v=$;else v=["TODO","DOING","DONE","LATER","NOW","WAITING"];let U=`[:find (pull ?b [*])
189
+ :where
190
+ [?b :block/marker ?marker]
191
+ [(contains? #{${v.map((X)=>`"${X}"`).join(" ")}} ?marker)]]`;return await C("logseq.DB.datascriptQuery",[U])}async function DR(){return await C("logseq.DB.datascriptQuery",[`[:find (pull ?t [*])
192
+ :where
193
+ [?t :block/type "class"]]`])}async function bR(){return await C("logseq.DB.datascriptQuery",[`[:find (pull ?p [*])
194
+ :where
195
+ [?p :block/type "property"]]`])}async function VR(){let $=await C("logseq.Editor.getAllPages",[]),v=[];for(let U of $||[]){let X=await C("logseq.Editor.getPageLinkedReferences",[U.name]);if(X&&X.length>0)v.push({page:U.name,references:X})}return v}async function KR(){let v=await C("logseq.Editor.getAllPages",[]),U=v?.length||0,X="unknown",J="unknown";if(v&&v.length>0){let W=v[0];if(W?.uuid?.includes("-"))X="0.10.x";if(W)J=W.name||"Logseq Graph"}return{info:{version:X,graphName:J},totalPages:U,version:X,graphName:J}}function K$($){return{content:$.content,isError:$.isError}}function K0($){return{filterInternalProps:$.filterInternalProps??!0,fields:$.fields,expandRefs:$.expandRefs,expandParent:$.expandParent,expandPage:$.expandPage,timestampFormat:$.timestampFormat,deduplicateFields:$.deduplicateFields??!0}}async function B0($,v){if(E6(v))return await t$($,v,C);return d$($,v)}async function BR($){let{pageName:v,properties:U,redirect:X=!1}=$;if(!v)return K$(Z4("pageName","create"));try{return await C("logseq.Editor.createPage",[v,U||{},{redirect:X}]),K$(V$(`Page "${v}" created successfully`))}catch(J){return K$(S$("create page",J,"Check if the page name is valid and not already in use"))}}async function AR($){let{pageName:v,includeChildren:U=!0}=$;if(!v)return K$(Z4("pageName","get"));try{let X=await C("logseq.Editor.getPage",[v]);if(!X)return K$(jG("Page",v));let J={...X};if(U){let z=await C("logseq.Editor.getPageBlocksTree",[v]);J.blocks=z}let W=K0($),Y=await B0(J,W);return K$(V$(Y))}catch(X){return K$(S$("get page",X))}}async function SR($){let{includeChildren:v=!0}=$;try{let U=await C("logseq.Editor.getCurrentPage",[]);if(!U)return K$(S$("get current page",Error("No active page found")));let X=U,J={...X};if(v){let z=await C("logseq.Editor.getPageBlocksTree",[X.name]);J.blocks=z}let W=K0($),Y=await B0(J,W);return K$(V$(Y))}catch(U){return K$(S$("get current page",U))}}async function qR($){let{includeProperties:v=!0,limit:U}=$;try{let X=await C("logseq.Editor.getAllPages",[]);if(U&&U>0&&Array.isArray(X)&&X.length>U)X=X.slice(0,U);if(v&&Array.isArray(X))X=await Promise.all(X.map(async(z)=>{try{let G=await C("logseq.Editor.getPage",[z.name]);if(G)return G;return z}catch{return z}}));let J=K0($),W=await B0(X,J);return K$(V$(W))}catch(X){return K$(S$("get all pages",X))}}async function LR($){let{pageName:v}=$;if(!v)return K$(Z4("pageName","get-blocks"));try{if(!await C("logseq.Editor.getPage",[v]))return K$(jG("Page",v));let X=await C("logseq.Editor.getPageBlocksTree",[v]),J=K0($),W=await B0(X,J);return K$(V$(W))}catch(U){return K$(S$("get page blocks",U))}}async function FR($){let{pageName:v}=$;if(!v)return K$(Z4("pageName","get-linked-references"));try{let U=await C("logseq.Editor.getPageLinkedReferences",[v]);if(!U||Array.isArray(U)&&U.length===0)return K$(V$(`No linked references found for page "${v}"`));let X=K0($),J=await B0(U,X);return K$(V$(J))}catch(U){return K$(S$("get page linked references",U))}}async function ER($){let{operation:v}=$;switch(v){case"create":return await BR($);case"get":return await AR($);case"get-current":return await SR($);case"get-all":return await qR($);case"get-blocks":return await LR($);case"get-linked-references":return await FR($);default:{let U="perform page operation";if(v)U=`perform page operation "${v}"`;return K$(S$(U,Error("Invalid operation or missing required parameters")))}}}var MR=`Create, retrieve, and manage pages in Logseq. Pages are the top-level organization unit in Logseq that contain blocks.
91
196
 
92
197
  IMPORTANT USAGE NOTES:
93
198
  - Pages can have properties that provide metadata
@@ -113,13 +218,47 @@ EXAMPLES:
113
218
  4) Get linked references to a page:
114
219
  - operation: "get-linked-references"
115
220
  - pageName: "Project Ideas"
116
- `,{operation:Q.enum(["create","get","get-current","get-all","get-blocks","get-linked-references"]).describe(`Operation to perform:
221
+ `,PR={operation:A.enum(["create","get","get-current","get-all","get-blocks","get-linked-references"]).describe(`Operation to perform:
117
222
  - create: Create a new page
118
223
  - get: Retrieve a specific page by name
119
224
  - get-current: Get the currently active page
120
225
  - get-all: Get a list of all pages
121
226
  - get-blocks: Get all blocks from a specific page
122
- - get-linked-references: Get references to a page from other pages`),pageName:Q.string().optional().describe('Name of the page. Required for page-specific operations like "get", "create", etc.'),properties:Q.record(Q.string(),Q.any()).optional().describe('Properties for page creation/update as a key-value object. Example: { "type": "project", "status": "active" }'),includeChildren:Q.boolean().optional().default(!0).describe("Whether to include page blocks in results. Set to false for better performance when blocks are not needed."),includeProperties:Q.boolean().optional().default(!0).describe("Whether to include page properties in results (for get-all). Set to false for faster performance."),limit:Q.number().optional().describe("Maximum number of pages to return (for get-all). Use this to avoid retrieving too many pages at once."),redirect:Q.boolean().optional().default(!1).describe("Whether to redirect to the page after creation. Typically set to true when you want to show the page to the user.")},async(X)=>{let{operation:W,pageName:J,properties:Y,includeChildren:G=!0,includeProperties:H=!0,limit:w,redirect:B=!1}=X;try{if(W==="create"){if(!J)return{isError:!0,content:[{type:"text",text:"Page name is required for create operation"}]};return await K("logseq.Editor.createPage",[J,Y||{},{redirect:B}]),{isError:!1,content:[{type:"text",text:`Page "${J}" created successfully`}]}}else if(W==="get"&&J){let D=await K("logseq.Editor.getPage",[J]);if(!D)return{isError:!0,content:[{type:"text",text:`Page "${J}" not found`}]};let j={...D};if(G){let R=await K("logseq.Editor.getPageBlocksTree",[J]);j.blocks=R}return{isError:!1,content:[{type:"text",text:JSON.stringify(j,null,2)}]}}else if(W==="get-current"){let D=await K("logseq.Editor.getCurrentPage",[]);if(!D)return{isError:!0,content:[{type:"text",text:"No active page found"}]};let j={...D};if(G){let R=await K("logseq.Editor.getPageBlocksTree",[D.name]);j.blocks=R}return{isError:!1,content:[{type:"text",text:JSON.stringify(j,null,2)}]}}else if(W==="get-all"){let D=await K("logseq.Editor.getAllPages",[]);if(w&&w>0&&Array.isArray(D)&&D.length>w)D=D.slice(0,w);if(H&&Array.isArray(D))D=await Promise.all(D.map(async(R)=>{try{return await K("logseq.Editor.getPage",[R.name])||R}catch(f){return R}}));return{isError:!1,content:[{type:"text",text:JSON.stringify(D,null,2)}]}}else if(W==="get-blocks"&&J){if(!await K("logseq.Editor.getPage",[J]))return{isError:!0,content:[{type:"text",text:`Page "${J}" not found`}]};let j=await K("logseq.Editor.getPageBlocksTree",[J]);return{isError:!1,content:[{type:"text",text:JSON.stringify(j,null,2)}]}}else if(W==="get-linked-references"&&J){let D=await K("logseq.Editor.getPageLinkedReferences",[J]);if(!D||Array.isArray(D)&&D.length===0)return{isError:!1,content:[{type:"text",text:`No linked references found for page "${J}"`}]};return{isError:!1,content:[{type:"text",text:JSON.stringify(D,null,2)}]}}return{isError:!0,content:[{type:"text",text:`Invalid operation or missing required parameters for operation: ${W}`}]}}catch(D){return console.error(`Error in page operation (${W}):`,D),{isError:!0,content:[{type:"text",text:`Error in page operation (${W}): ${D}`}]}}})}function _4($){$.tool("tasks",`Find and manage task blocks with specific markers (TODO, DOING, DONE, etc.) across the graph.
227
+ - get-linked-references: Get references to a page from other pages`),pageName:A.string().optional().describe('Name of the page. Required for page-specific operations like "get", "create", etc.'),properties:A.record(A.string(),A.any()).optional().describe('Properties for page creation/update as a key-value object. Example: { "type": "project", "status": "active" }'),includeChildren:A.boolean().optional().default(!0).describe("Whether to include page blocks in results. Set to false for better performance when blocks are not needed."),includeProperties:A.boolean().optional().default(!0).describe("Whether to include page properties in results (for get-all). Set to false for faster performance."),limit:A.number().optional().describe("Maximum number of pages to return (for get-all). Use this to avoid retrieving too many pages at once."),redirect:A.boolean().optional().default(!1).describe("Whether to redirect to the page after creation. Typically set to true when you want to show the page to the user."),...k$};async function RR($){try{return await ER($)}catch(v){let U=$.operation;return K$(S$(`perform page operation "${U}"`,v))}}function GN($){$.tool("page",MR,PR,RR)}function A0($){return{content:$.content,isError:$.isError}}function QN($){return{filterInternalProps:$.filterInternalProps??!0,fields:$.fields,expandRefs:$.expandRefs,expandParent:$.expandParent,expandPage:$.expandPage,timestampFormat:$.timestampFormat,deduplicateFields:$.deduplicateFields??!0}}async function jN($,v){if(E6(v))return await t$($,v,C);return d$($,v)}function wN($){if(Array.isArray($))return $;if($)return[$];return[]}function HN($,v){if(v&&v>0&&$.length>v)return $.slice(0,v);return $}function kR($){return $.some((v)=>{if(!v)return!1;if(v.uuid)return!0;if(Array.isArray(v)){if(v[0]?.uuid)return!0}return!1})}async function CR($){return await Promise.all($.map(async(U)=>{let X=U,J=null;if(X.uuid)J=X.uuid;else if(Array.isArray(U))J=U[0]?.uuid||null;if(!J)return U;try{let W=await C("logseq.Editor.getBlock",[J,{includeChildren:!0}]);if(W)return W;return U}catch{return U}}))}async function _R($){let{query:v,limit:U}=$,X=`[:find (pull ?b [*])
228
+ :where
229
+ [?b :block/content ?c]
230
+ [(clojure.string/includes? ?c "${v}")]]`,J=await C("logseq.DB.datascriptQuery",[X]),W=0;if(Array.isArray(J))W=J.length;else if(J)W=1;X$(`Search result count: ${W}`);let Y=wN(J);if(Y=HN(Y,U),Y.length===0)return A0(V$(`No results found for search: "${v}"`));let z=QN($),G=await jN(Y,z);return A0(V$(G))}async function ZR($){let{query:v,includeChildren:U=!0,limit:X}=$,J=await C("logseq.DB.datascriptQuery",[v]),W=wN(J);W=HN(W,X);let Y=kR(W);if(U&&Y&&W.length>0)W=await CR(W);if(X$(`Query result (processed): ${W.length} items`),W.length===0)return A0(V$("No results found for Datalog query"));let z=QN($),G=await jN(W,z);return A0(V$(G))}async function TR($){let{type:v,query:U}=$;if(X$(`Executing ${v} query: ${U}`),v==="search")return await _R($);return await ZR($)}function NN($){$.tool("query",`Search and query the Logseq graph using Datalog queries or text search. This is the most powerful way to retrieve specific information.
231
+
232
+ IMPORTANT USAGE NOTES:
233
+ - Datalog queries provide advanced filtering capabilities using Datalog syntax
234
+ - Text search is simpler and looks for content containing the specified text
235
+ - Results can include block children for context
236
+ - Large result sets can be limited to improve performance
237
+
238
+ EXAMPLES:
239
+ 1) Find all TODO blocks:
240
+ - type: "datalog"
241
+ - query: "[:find (pull ?b [*]) :where [?b :block/marker ?marker] [(= ?marker "TODO")]]"
242
+
243
+ 2) Search for blocks containing specific text:
244
+ - type: "search"
245
+ - query: "project meeting"
246
+ - limit: 5
247
+
248
+ 3) Find blocks with a specific property:
249
+ - type: "datalog"
250
+ - query: "[:find (pull ?b [*]) :where [?b :block/properties ?p] [(get ?p :priority) ?v] [(= ?v "A")]]"
251
+
252
+ 4) Find all journal pages:
253
+ - type: "datalog"
254
+ - query: "[:find (pull ?p [*]) :where [?p :block/journal? true]]"
255
+ `,{type:A.enum(["datalog","search"]).default("datalog").describe(`Query type:
256
+ - datalog: Advanced Datalog query using Logseq's Datalog syntax (more powerful)
257
+ - search: Simple text search to find blocks containing specific text (easier to use)`),query:A.string().describe("The query to execute - either a Datalog query string or a text search term"),includeChildren:A.boolean().optional().default(!0).describe("Whether to include child blocks in results. Provides context but may increase response size."),limit:A.number().optional().describe("Maximum number of results to return. Use this for large result sets to avoid performance issues."),...k$},async(v)=>{try{return await TR(v)}catch(U){return console.error("Query execution failed:",U),A0(S$("execute query",U,"Check your query syntax and ensure it follows Datalog format"))}})}function S0($){return{content:$.content,isError:$.isError}}function xR($){return{filterInternalProps:$.filterInternalProps??!0,fields:$.fields,expandRefs:$.expandRefs,expandParent:$.expandParent,expandPage:$.expandPage,timestampFormat:$.timestampFormat,deduplicateFields:$.deduplicateFields??!0}}async function gR($,v){if(E6(v))return await t$($,v,C);return d$($,v)}async function fR($,v){if($.length===0)return $;return await Promise.all($.map(async(X)=>{let J=X,W=null;if(J.uuid)W=J.uuid;else if(Array.isArray(X))W=X[0]?.uuid||null;if(!W)return X;try{let Y=await v("logseq.Editor.getBlock",[W,{includeChildren:!0}]);if(Y)return Y;return X}catch{return X}}))}async function yR($,v,U){let J=`[:find (pull ?b [*])
258
+ :where
259
+ [?b :block/content ?c]
260
+ (or ${$.map((G)=>`[(clojure.string/includes? ?c "${G}")]`).join(`
261
+ `)})]`;X$(`Executing task query: ${J}`);let W=await C("logseq.DB.datascriptQuery",[J]),Y=0;if(Array.isArray(W))Y=W.length;else if(W)Y=1;X$(`Task query result count: ${Y}`);let z=[];if(Array.isArray(W))z=W;else if(W)z=[W];if(v&&v>0&&z.length>v)z=z.slice(0,v);if(U)z=await fR(z,C);return z}async function uR($){let{markers:v,includeChildren:U=!0,limit:X}=$;if(!(v&&Array.isArray(v))||v.length===0)return S0(Z4("markers","get tasks"));X$(`Getting tasks with markers: ${v.join(", ")}`);let J=await yR(v,X,U);if(J.length===0)return S0(V$(`No tasks found with markers: ${v.join(", ")}`));let W=xR($),Y=await gR(J,W);return S0(V$(Y))}async function hR($){let{operation:v}=$;switch(v){case"get":return await uR($);default:return S0(S$("perform tasks operation",Error(`Invalid operation: ${v}`)))}}function IN($){$.tool("tasks",`Find and manage task blocks with specific markers (TODO, DOING, DONE, etc.) across the graph.
123
262
 
124
263
  IMPORTANT USAGE NOTES:
125
264
  - Tasks in Logseq are blocks with special markers like TODO, DOING, DONE
@@ -141,50 +280,10 @@ EXAMPLES:
141
280
  3) Find all task blocks regardless of status:
142
281
  - operation: "get"
143
282
  - markers: ["TODO", "DOING", "DONE", "LATER", "NOW", "WAITING"]
144
- `,{operation:Q.enum(["get"]).default("get").describe('Operation to perform on tasks. Currently only "get" is supported.'),markers:Q.array(Q.string()).describe(`Task markers to search for. Common examples:
283
+ `,{operation:A.enum(["get"]).default("get").describe('Operation to perform on tasks. Currently only "get" is supported.'),markers:A.array(A.string()).describe(`Task markers to search for. Common examples:
145
284
  - "TODO": Incomplete tasks
146
285
  - "DOING": In-progress tasks
147
286
  - "DONE": Completed tasks
148
287
  - "LATER": Postponed tasks
149
288
  - "NOW": Current tasks
150
- - "WAITING": Blocked tasks`),includeChildren:Q.boolean().optional().default(!0).describe("Whether to include child blocks in results. Useful for seeing subtasks or additional context."),limit:Q.number().optional().describe("Maximum number of tasks to return. Use this for better performance when you only need a subset of tasks.")},async(X)=>{let{operation:W,markers:J,includeChildren:Y=!0,limit:G}=X;try{if(W==="get"){if(!J||!Array.isArray(J)||J.length===0)return{isError:!0,content:[{type:"text",text:'At least one task marker must be specified (e.g., ["TODO"])'}]};C(`Getting tasks with markers: ${J.join(", ")}`);let w=`[:find (pull ?b [*])
151
- :where
152
- [?b :block/content ?c]
153
- (or ${J.map((j)=>`[(clojure.string/includes? ?c "${j}")]`).join(`
154
- `)})]`;C(`Executing task query: ${w}`);let B=await K("logseq.DB.datascriptQuery",[w]);C(`Task query result count: ${Array.isArray(B)?B.length:B?1:0}`);let D=Array.isArray(B)?B:B?[B]:[];if(G&&G>0&&D.length>G)D=D.slice(0,G);if(Y&&D.length>0)D=await Promise.all(D.map(async(R)=>{let f=R.uuid||(Array.isArray(R)?R[0]?.uuid:null);if(!f)return R;try{return await K("logseq.Editor.getBlock",[f,{includeChildren:!0}])||R}catch(b){return R}}));if(D.length===0)return{isError:!1,content:[{type:"text",text:`No tasks found with markers: ${J.join(", ")}`}]};return{isError:!1,content:[{type:"text",text:JSON.stringify(D,null,2)}]}}return{isError:!0,content:[{type:"text",text:`Invalid operation for tasks: ${W}`}]}}catch(H){return console.error(`Error in tasks operation (${W}):`,H),{isError:!0,content:[{type:"text",text:`Error in tasks operation (${W}): ${H}`}]}}})}function E4($){N4($),R4($),L4($),_4($)}function f4($){$.resource("pages",new S0("logseq:page:{pageName}",{list:async()=>{try{return{resources:(await K("logseq.Editor.getAllPages",[])).map((W)=>({uri:`logseq:page:${encodeURIComponent(W.originalName||W.name)}`,name:W.originalName||W.name,description:`Page: ${W.originalName||W.name}`,mimeType:"application/json",uriTemplate:"logseq:page:{pageName}"}))}}catch(X){return console.error("Error listing resources:",X),{resources:[]}}}}),async(X,{pageName:W})=>{try{let J=decodeURIComponent(W);C(`Reading page resource for: "${J}"`);let Y=await K("logseq.Editor.getPage",[J]);if(!Y)return C(`Page not found: "${J}"`),{contents:[{uri:X.href,mimeType:"text/plain",text:`Page "${J}" not found`}]};C(`Getting blocks for page: "${J}"`);let G=await K("logseq.Editor.getPageBlocksTree",[J]),H={...Y,blocks:G};return C(`Successfully retrieved page resource: "${J}"`),{contents:[{uri:X.href,mimeType:"application/json",text:JSON.stringify(H,null,2)}]}}catch(J){return console.error(`Error reading page resource (${X}):`,J),{contents:[{uri:X.href,mimeType:"text/plain",text:`Error reading page: ${J}`}]}}})}function C4($){$.resource("blocks",new S0("logseq:block:{uuid}",{list:void 0}),async(X,{uuid:W})=>{try{let J=await K("logseq.Editor.getBlock",[W]);if(J)return{contents:[{uri:X.href,mimeType:"application/json",text:JSON.stringify(J,null,2)}]};return{contents:[]}}catch(J){return console.error(`Error reading block resource (${X}):`,J),{contents:[]}}})}function I4($){$.resource("query",new S0("logseq:query:{query}",{list:void 0}),async(X,{query:W})=>{try{let J=decodeURIComponent(W),Y=await K("logseq.DB.q",[J]);return{contents:[{uri:X.href,mimeType:"application/json",text:JSON.stringify(Y,null,2)}]}}catch(J){return console.error(`Error executing query resource (${X}):`,J),{contents:[]}}})}function b4($){f4($),C4($),I4($)}function v4($){$.prompt("query-tasks",{status:Q.string().optional()},(X)=>({messages:[{role:"user",content:{type:"text",text:`Find all tasks with status ${X.status||"TODO"} in my Logseq graph. Here's the Datalog query to use:
155
-
156
- \`\`\`clojure
157
- {:title "Tasks with status ${X.status||"TODO"}"
158
- :query [:find (pull ?b [*])
159
- :where
160
- (task ?b #{"${X.status||"TODO"}"})]
161
- }
162
- \`\`\``}}]})),$.prompt("extract-tasks",{source:Q.string().optional(),status:Q.string().optional()},(X)=>({messages:[{role:"user",content:{type:"text",text:`Extract all ${X.status||""} tasks from ${X.source||"my notes"} and organize them into a structured list. First search for task blocks, then analyze and group them by project, priority, or other relevant criteria.`}}]}))}function P4($){$.prompt("create-daily-note",{sections:Q.string().optional()},(X)=>{return{messages:[{role:"user",content:{type:"text",text:`Create a daily note for today with the following sections:
163
-
164
- ${(X.sections||"Tasks,Notes,Journal").split(",").map((G)=>G.trim()).map((G)=>`## ${G}
165
-
166
- `).join("")}
167
- This will help me organize my day and keep track of important information.`}}]}}),$.prompt("search-knowledge",{query:Q.string().optional()},(X)=>({messages:[{role:"user",content:{type:"text",text:`Search my Logseq knowledge base for information about "${X.query||""}". Use the search-blocks tool with the query parameter set to "${X.query||""}" to find relevant blocks, then summarize the findings.`}}]})),$.prompt("summarize-page",{pageName:Q.string()},(X)=>({messages:[{role:"user",content:{type:"text",text:`Create a concise summary of the "${X.pageName}" page. First get the full page content, analyze it, and then generate a summary that captures the main points, key insights, and important details.`}}]})),$.prompt("create-nested-content",{pageName:Q.string(),content:Q.string()},(X)=>({messages:[{role:"user",content:{type:"text",text:`Create a well-structured nested hierarchy of blocks in page "${X.pageName}" from the following content:
168
-
169
- ${X.content}
170
-
171
- Please organize this content with all section headers at the same level (as siblings) and nest related content as children underneath them. Use the create-nested-blocks tool since it's specifically designed for hierarchical content. Use page properties for page metadata instead of creating an overall page header. Never use bullet points (dashes) at the beginning of blocks.`}}]}))}function T4($){$.prompt("organize-blocks",{pageOrBlockId:Q.string(),criteria:Q.string().optional()},(X)=>({messages:[{role:"user",content:{type:"text",text:`Organize the blocks${X.pageOrBlockId?` in ${X.pageOrBlockId}`:""} ${X.criteria?`by ${X.criteria}`:""}. First get the blocks, then analyze them, and finally create a structured hierarchy by moving blocks appropriately.`}}]})),$.prompt("organize-blocks-as-nested",{pageName:Q.string(),structure:Q.string().optional()},(X)=>({messages:[{role:"user",content:{type:"text",text:`Analyze the page "${X.pageName}" and reorganize its content into a well-structured nested hierarchy of blocks.${X.structure?`
172
-
173
- Use the following structure as a guide:
174
- ${X.structure}`:""}
175
-
176
- Always use the create-nested-blocks tool which is specifically designed for hierarchical content. Keep all section headers at the same level (as siblings) and nest related content as children underneath these headers. Use page properties for page metadata instead of creating an overall page header. Never use bullet points (dashes) at the beginning of blocks.`}}]})),$.prompt("convert-flat-to-nested",{pageName:Q.string(),structureCriteria:Q.string().optional()},(X)=>({messages:[{role:"user",content:{type:"text",text:`Convert the flat content of page "${X.pageName}" into a proper nested structure. ${X.structureCriteria?`Use ${X.structureCriteria} as the criteria for organizing the content.`:""}
177
-
178
- Please follow these guidelines:
179
- 1. Use the get-full-page tool to retrieve all content from the page
180
- 2. Analyze the content to identify logical hierarchy and grouping
181
- 3. Keep all section headers at the same level (as siblings)
182
- 4. Nest related content as children underneath these headers
183
- 5. Use page properties for page metadata instead of creating an overall page header
184
- 6. Break down long paragraphs into shorter, focused blocks
185
- 7. Never use bullet points (dashes) at the beginning of blocks
186
- 8. Always use the create-nested-blocks tool which is specifically designed for hierarchical content
187
-
188
- Focus on creating a clear hierarchical structure that enhances readability and navigation.`}}]}))}function k4($){v4($),P4($),T4($)}function f3(){let $=new r1({name:"logseq-mcp-server",version:"1.0.0"});return E4($),b4($),k4($),$}async function x4(){try{C("Checking Logseq API connection..."),await K("logseq.App.getInfo",[]),C("Successfully connected to Logseq API!")}catch(X){console.error("Failed to connect to Logseq API. Make sure Logseq is running with HTTP API enabled."),console.error("Error details:",X),console.error(`
189
- ====== TROUBLESHOOTING STEPS ======`),console.error("1. Ensure Logseq is running before starting this application"),console.error("2. Enable the Logseq HTTP API:"),console.error(" - Open Logseq"),console.error(" - Go to Settings (using the three dots in top-right)"),console.error(" - Navigate to 'Advanced'"),console.error(" - Enable 'Developer mode'"),console.error(" - Restart Logseq"),console.error(" - Go to Settings again"),console.error(" - Find and enable 'HTTP API server'"),console.error("3. Make sure the port isn't blocked by your firewall"),console.error("4. Check that your LOGSEQ_TOKEN is correct in your .env file"),console.error(`=====================================
190
- `),process.exit(1)}let $=f3();try{let X=new t1;await $.connect(X),C("Logseq MCP Server connected to stdio transport"),process.on("SIGINT",()=>{C("Received SIGINT signal, shutting down server..."),process.exit(0)}),C("Server running. Press Ctrl+C to exit.")}catch(X){console.error("Error connecting server to transport:",X),process.exit(1)}}async function C3(){try{await x4()}catch($){console.error("Fatal error:",$),process.exit(1)}}C3().catch(($)=>{console.error("Fatal error:",$),process.exit(1)});
289
+ - "WAITING": Blocked tasks`),includeChildren:A.boolean().optional().default(!0).describe("Whether to include child blocks in results. Useful for seeing subtasks or additional context."),limit:A.number().optional().describe("Maximum number of tasks to return. Use this for better performance when you only need a subset of tasks."),...k$},async(v)=>{try{return await hR(v)}catch(U){let X=v.operation;return S0(S$(`perform tasks operation "${X}"`,U))}})}function ON($){NN($),XN($),GN($),IN($),WN($)}function lR(){let $=new JG({name:"logseq-mcp-server",version:"1.0.0"});return ON($),vN($),tH($),$}async function DN(){try{X$("Checking Logseq API connection..."),X$(`Environment MOCK_LOGSEQ_API: ${c6.env.MOCK_LOGSEQ_API}`),X$("API URL: http://127.0.0.1:12315/api");let v=c6.env.LOGSEQ_TOKEN||c6.env.LOGSEQ_API_TOKEN||c6.env.LOGSEQ_MCP_TOKEN,U;if(v)U="yes";else U="no";X$(`Token present: ${U}`),await C("logseq.DB.datascriptQuery",["[:find (pull ?p [*]) :where [?p :block/name] :limit 1]"]),X$("Successfully connected to Logseq API!")}catch(v){if(c6.env.MOCK_LOGSEQ_API==="true")X$("In mock mode, continuing despite connection check failure");else console.error("Failed to connect to Logseq API:",v),c6.exit(1)}let $=lR();try{let v=new WG;await $.connect(v),X$("Logseq MCP Server connected to stdio transport"),c6.on("SIGINT",()=>{X$("Received SIGINT signal, shutting down server..."),c6.exit(0)}),X$("Server running. Press Ctrl+C to exit.")}catch(v){console.error("Failed to connect to stdio transport:",v),c6.exit(1)}}async function mR(){try{await DN()}catch($){console.error("Fatal error during server initialization:",$),bN.exit(1)}}mR().catch(($)=>{console.error("Uncaught error in main:",$),bN.exit(1)});