UNPKG

@microsoft/agents-copilotstudio-client

Version:

Microsoft Copilot Studio Client for JavaScript. Copilot Studio Client.

1 lines 145 kB
var Ss=Object.create;var co=Object.defineProperty;var As=Object.getOwnPropertyDescriptor;var Os=Object.getOwnPropertyNames;var Ps=Object.getPrototypeOf,Zs=Object.prototype.hasOwnProperty;var y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var js=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Os(e))!Zs.call(t,o)&&o!==r&&co(t,o,{get:()=>e[o],enumerable:!(n=As(e,o))||n.enumerable});return t};var Et=(t,e,r)=>(r=t!=null?Ss(Ps(t)):{},js(e||!t||!t.__esModule?co(r,"default",{value:t,enumerable:!0}):r,t));var ho=y((Xd,po)=>{var Ge=1e3,Ye=Ge*60,Xe=Ye*60,Te=Xe*24,zs=Te*7,Ls=Te*365.25;po.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Fs(t);if(r==="number"&&isFinite(t))return e.long?Vs(t):qs(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Fs(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Ls;case"weeks":case"week":case"w":return r*zs;case"days":case"day":case"d":return r*Te;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Xe;case"minutes":case"minute":case"mins":case"min":case"m":return r*Ye;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ge;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function qs(t){var e=Math.abs(t);return e>=Te?Math.round(t/Te)+"d":e>=Xe?Math.round(t/Xe)+"h":e>=Ye?Math.round(t/Ye)+"m":e>=Ge?Math.round(t/Ge)+"s":t+"ms"}function Vs(t){var e=Math.abs(t);return e>=Te?nr(t,e,Te,"day"):e>=Xe?nr(t,e,Xe,"hour"):e>=Ye?nr(t,e,Ye,"minute"):e>=Ge?nr(t,e,Ge,"second"):t+" ms"}function nr(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}});var yo=y((Qd,mo)=>{function $s(t){r.debug=r,r.default=r,r.coerce=d,r.disable=s,r.enable=o,r.enabled=a,r.humanize=ho(),r.destroy=l,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let m=0;for(let b=0;b<f.length;b++)m=(m<<5)-m+f.charCodeAt(b),m|=0;return r.colors[Math.abs(m)%r.colors.length]}r.selectColor=e;function r(f){let m,b=null,T,O;function g(...S){if(!g.enabled)return;let A=g,F=Number(new Date),te=F-(m||F);A.diff=te,A.prev=m,A.curr=F,m=F,S[0]=r.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let ye=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(re,Pt)=>{if(re==="%%")return"%";ye++;let Zt=r.formatters[Pt];if(typeof Zt=="function"){let Vr=S[ye];re=Zt.call(A,Vr),S.splice(ye,1),ye--}return re}),r.formatArgs.call(A,S),(A.log||r.log).apply(A,S)}return g.namespace=f,g.useColors=r.useColors(),g.color=r.selectColor(f),g.extend=n,g.destroy=r.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>b!==null?b:(T!==r.namespaces&&(T=r.namespaces,O=r.enabled(f)),O),set:S=>{b=S}}),typeof r.init=="function"&&r.init(g),g}function n(f,m){let b=r(this.namespace+(typeof m=="undefined"?":":m)+f);return b.log=this.log,b}function o(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let m=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let b of m)b[0]==="-"?r.skips.push(b.slice(1)):r.names.push(b)}function i(f,m){let b=0,T=0,O=-1,g=0;for(;b<f.length;)if(T<m.length&&(m[T]===f[b]||m[T]==="*"))m[T]==="*"?(O=T,g=b,T++):(b++,T++);else if(O!==-1)T=O+1,g++,b=g;else return!1;for(;T<m.length&&m[T]==="*";)T++;return T===m.length}function s(){let f=[...r.names,...r.skips.map(m=>"-"+m)].join(",");return r.enable(""),f}function a(f){for(let m of r.skips)if(i(f,m))return!1;for(let m of r.names)if(i(f,m))return!0;return!1}function d(f){return f instanceof Error?f.stack||f.message:f}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}mo.exports=$s});var vo=y((V,or)=>{V.formatArgs=Hs;V.save=Bs;V.load=Ks;V.useColors=Ws;V.storage=Js();V.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();V.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Ws(){if(typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Hs(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+or.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}V.log=console.debug||console.log||(()=>{});function Bs(t){try{t?V.storage.setItem("debug",t):V.storage.removeItem("debug")}catch{}}function Ks(){let t;try{t=V.storage.getItem("debug")||V.storage.getItem("DEBUG")}catch{}return!t&&typeof process!="undefined"&&"env"in process&&(t=process.env.DEBUG),t}function Js(){try{return localStorage}catch{}}or.exports=yo()(V);var{formatters:Gs}=or.exports;Gs.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Mt=y(Se=>{"use strict";var Ys=Se&&Se.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Se,"__esModule",{value:!0});Se.Logger=void 0;Se.debug=ea;var Xs=Ys(vo()),Qs=["info","warn","error","debug"],ir=class{constructor(e=""){this.loggers={},this.initializeLoggers(e)}initializeLoggers(e){for(let r of Qs){let n=(0,Xs.default)(`${e}:${r}`);n.color=this.getPlatformColor(r),this.loggers[r]=n}}getPlatformColor(e){return{node:{info:"2",warn:"3",error:"1",debug:"4"},browser:{info:"#33CC99",warn:"#CCCC33",error:"#CC3366",debug:"#0066FF"}}[typeof window!="undefined"?"browser":"node"][e]}info(e,...r){this.loggers.info(e,...r)}warn(e,...r){this.loggers.warn(e,...r)}error(e,...r){this.loggers.error(e,...r)}debug(e,...r){this.loggers.debug(e,...r)}};Se.Logger=ir;function ea(t){return new ir(t)}});var Dt=y(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.getParsedType=k.ZodParsedType=k.objectUtil=k.util=void 0;var Kr;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function r(o){throw new Error}t.assertNever=r,t.arrayToEnum=o=>{let i={};for(let s of o)i[s]=s;return i},t.getValidEnumValues=o=>{let i=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(let a of i)s[a]=o[a];return t.objectValues(s)},t.objectValues=o=>t.objectKeys(o).map(function(i){return o[i]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},t.find=(o,i)=>{for(let s of o)if(i(s))return s},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(Kr||(k.util=Kr={}));var xo;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(xo||(k.objectUtil=xo={}));k.ZodParsedType=Kr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);var oa=t=>{switch(typeof t){case"undefined":return k.ZodParsedType.undefined;case"string":return k.ZodParsedType.string;case"number":return Number.isNaN(t)?k.ZodParsedType.nan:k.ZodParsedType.number;case"boolean":return k.ZodParsedType.boolean;case"function":return k.ZodParsedType.function;case"bigint":return k.ZodParsedType.bigint;case"symbol":return k.ZodParsedType.symbol;case"object":return Array.isArray(t)?k.ZodParsedType.array:t===null?k.ZodParsedType.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?k.ZodParsedType.promise:typeof Map!="undefined"&&t instanceof Map?k.ZodParsedType.map:typeof Set!="undefined"&&t instanceof Set?k.ZodParsedType.set:typeof Date!="undefined"&&t instanceof Date?k.ZodParsedType.date:k.ZodParsedType.object;default:return k.ZodParsedType.unknown}};k.getParsedType=oa});var dr=y(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.ZodError=ve.quotelessJson=ve.ZodIssueCode=void 0;var wo=Dt();ve.ZodIssueCode=wo.util.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"]);var ia=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");ve.quotelessJson=ia;var zt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(i){return i.message},n={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,d=0;for(;d<s.path.length;){let l=s.path[d];d===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(r(s))):a[l]=a[l]||{_errors:[]},a=a[l],d++}}};return o(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,wo.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];r[i]=r[i]||[],r[i].push(e(o))}else n.push(e(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};ve.ZodError=zt;zt.create=t=>new zt(t)});var Gr=y(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});var M=dr(),Ae=Dt(),sa=(t,e)=>{let r;switch(t.code){case M.ZodIssueCode.invalid_type:t.received===Ae.ZodParsedType.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case M.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Ae.util.jsonStringifyReplacer)}`;break;case M.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ae.util.joinValues(t.keys,", ")}`;break;case M.ZodIssueCode.invalid_union:r="Invalid input";break;case M.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ae.util.joinValues(t.options)}`;break;case M.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${Ae.util.joinValues(t.options)}, received '${t.received}'`;break;case M.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case M.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case M.ZodIssueCode.invalid_date:r="Invalid date";break;case M.ZodIssueCode.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Ae.util.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case M.ZodIssueCode.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case M.ZodIssueCode.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case M.ZodIssueCode.custom:r="Invalid input";break;case M.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case M.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case M.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=e.defaultError,Ae.util.assertNever(t)}return{message:r}};Jr.default=sa});var lr=y(ge=>{"use strict";var aa=ge&&ge.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ge,"__esModule",{value:!0});ge.defaultErrorMap=void 0;ge.setErrorMap=ca;ge.getErrorMap=ua;var Co=aa(Gr());ge.defaultErrorMap=Co.default;var Io=Co.default;function ca(t){Io=t}function ua(){return Io}});var Xr=y(Z=>{"use strict";var da=Z&&Z.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Z,"__esModule",{value:!0});Z.isAsync=Z.isValid=Z.isDirty=Z.isAborted=Z.OK=Z.DIRTY=Z.INVALID=Z.ParseStatus=Z.EMPTY_PATH=Z.makeIssue=void 0;Z.addIssueToContext=pa;var la=lr(),To=da(Gr()),fa=t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,i=[...r,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="",d=n.filter(l=>!!l).slice().reverse();for(let l of d)a=l(s,{data:e,defaultError:a}).message;return{...o,path:i,message:a}};Z.makeIssue=fa;Z.EMPTY_PATH=[];function pa(t,e){let r=(0,la.getErrorMap)(),n=(0,Z.makeIssue)({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===To.default?void 0:To.default].filter(o=>!!o)});t.common.issues.push(n)}var Yr=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let o of r){if(o.status==="aborted")return Z.INVALID;o.status==="dirty"&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let o of r){let i=await o.key,s=await o.value;n.push({key:i,value:s})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return Z.INVALID;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value!="undefined"||o.alwaysSet)&&(n[i.value]=s.value)}return{status:e.value,value:n}}};Z.ParseStatus=Yr;Z.INVALID=Object.freeze({status:"aborted"});var ha=t=>({status:"dirty",value:t});Z.DIRTY=ha;var ma=t=>({status:"valid",value:t});Z.OK=ma;var ya=t=>t.status==="aborted";Z.isAborted=ya;var va=t=>t.status==="dirty";Z.isDirty=va;var ga=t=>t.status==="valid";Z.isValid=ga;var _a=t=>typeof Promise!="undefined"&&t instanceof Promise;Z.isAsync=_a});var Ao=y(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0})});var Po=y(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.errorUtil=void 0;var Oo;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Oo||(fr.errorUtil=Oo={}))});var Fo=y(c=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});c.discriminatedUnion=c.date=c.boolean=c.bigint=c.array=c.any=c.coerce=c.ZodFirstPartyTypeKind=c.late=c.ZodSchema=c.Schema=c.ZodReadonly=c.ZodPipeline=c.ZodBranded=c.BRAND=c.ZodNaN=c.ZodCatch=c.ZodDefault=c.ZodNullable=c.ZodOptional=c.ZodTransformer=c.ZodEffects=c.ZodPromise=c.ZodNativeEnum=c.ZodEnum=c.ZodLiteral=c.ZodLazy=c.ZodFunction=c.ZodSet=c.ZodMap=c.ZodRecord=c.ZodTuple=c.ZodIntersection=c.ZodDiscriminatedUnion=c.ZodUnion=c.ZodObject=c.ZodArray=c.ZodVoid=c.ZodNever=c.ZodUnknown=c.ZodAny=c.ZodNull=c.ZodUndefined=c.ZodSymbol=c.ZodDate=c.ZodBoolean=c.ZodBigInt=c.ZodNumber=c.ZodString=c.ZodType=void 0;c.NEVER=c.void=c.unknown=c.union=c.undefined=c.tuple=c.transformer=c.symbol=c.string=c.strictObject=c.set=c.record=c.promise=c.preprocess=c.pipeline=c.ostring=c.optional=c.onumber=c.oboolean=c.object=c.number=c.nullable=c.null=c.never=c.nativeEnum=c.nan=c.map=c.literal=c.lazy=c.intersection=c.instanceof=c.function=c.enum=c.effect=void 0;c.datetimeRegex=Uo;c.custom=Mo;var p=dr(),pr=lr(),v=Po(),u=Xr(),h=Dt(),K=class{constructor(e,r,n,o){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Zo=(t,e)=>{if((0,u.isValid)(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new p.ZodError(t.common.issues);return this._error=r,this._error}}};function C(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:o}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(s,a)=>{var l,f;let{message:d}=t;return s.code==="invalid_enum_value"?{message:d!=null?d:a.defaultError}:typeof a.data=="undefined"?{message:(l=d!=null?d:n)!=null?l:a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:(f=d!=null?d:r)!=null?f:a.defaultError}},description:o}}var I=class{get description(){return this._def.description}_getType(e){return(0,h.getParsedType)(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:(0,h.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new u.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,h.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if((0,u.isAsync)(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var i;let n={common:{issues:[],async:(i=r==null?void 0:r.async)!=null?i:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,h.getParsedType)(e)},o=this._parseSync({data:e,path:n.path,parent:n});return Zo(n,o)}"~validate"(e){var n,o;let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,h.getParsedType)(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:r});return(0,u.isValid)(i)?{value:i.value}:{issues:r.common.issues}}catch(i){(o=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&o.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(i=>(0,u.isValid)(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,h.getParsedType)(e)},o=this._parse({data:e,path:n.path,parent:n}),i=await((0,u.isAsync)(o)?o:Promise.resolve(o));return Zo(n,i)}refine(e,r){let n=o=>typeof r=="string"||typeof r=="undefined"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let s=e(o),a=()=>i.addIssue({code:p.ZodIssueCode.custom,...n(o)});return typeof Promise!="undefined"&&s instanceof Promise?s.then(d=>d?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,o)=>e(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(e){return new H({schema:this,typeName:x.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,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:r=>this["~validate"](r)}}optional(){return B.create(this,this._def)}nullable(){return se.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return le.create(this)}promise(){return xe.create(this,this._def)}or(e){return Ue.create([this,e],this._def)}and(e){return Re.create(this,e,this._def)}transform(e){return new H({...C(this._def),schema:this,typeName:x.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Le({...C(this._def),innerType:this,defaultValue:r,typeName:x.ZodDefault})}brand(){return new Lt({typeName:x.ZodBranded,type:this,...C(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Fe({...C(this._def),innerType:this,catchValue:r,typeName:x.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ft.create(this,e)}readonly(){return qe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};c.ZodType=I;c.Schema=I;c.ZodSchema=I;var ba=/^c[^\s-]{8,}$/i,xa=/^[0-9a-z]+$/,wa=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ca=/^[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,Ia=/^[a-z0-9_-]{21}$/i,Ta=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Sa=/^[-+]?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)?)??$/,Aa=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Oa="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Qr,Pa=/^(?:(?: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])$/,Za=/^(?:(?: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])$/,ja=/^(([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]))$/,ka=/^(([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])$/,Ea=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ua=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ko="((\\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])))",Ra=new RegExp(`^${ko}$`);function Eo(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function Ma(t){return new RegExp(`^${Eo(t)}$`)}function Uo(t){let e=`${ko}T${Eo(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Na(t,e){return!!((e==="v4"||!e)&&Pa.test(t)||(e==="v6"||!e)&&ja.test(t))}function Da(t,e){if(!Ta.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function za(t,e){return!!((e==="v4"||!e)&&Za.test(t)||(e==="v6"||!e)&&ka.test(t))}var _e=class t extends I{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==h.ZodParsedType.string){let i=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(i,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.string,received:i.parsedType}),u.INVALID}let n=new u.ParseStatus,o;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{code:p.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{code:p.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let s=e.data.length>i.value,a=e.data.length<i.value;(s||a)&&(o=this._getOrReturnCtx(e,o),s?(0,u.addIssueToContext)(o,{code:p.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&(0,u.addIssueToContext)(o,{code:p.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")Aa.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{validation:"email",code:p.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Qr||(Qr=new RegExp(Oa,"u")),Qr.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{validation:"emoji",code:p.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")Ca.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{validation:"uuid",code:p.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")Ia.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{validation:"nanoid",code:p.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")ba.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{validation:"cuid",code:p.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")xa.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{validation:"cuid2",code:p.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")wa.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{validation:"ulid",code:p.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{validation:"url",code:p.ZodIssueCode.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{validation:"regex",code:p.ZodIssueCode.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{code:p.ZodIssueCode.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{code:p.ZodIssueCode.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{code:p.ZodIssueCode.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Uo(i).test(e.data)||(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{code:p.ZodIssueCode.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?Ra.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{code:p.ZodIssueCode.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?Ma(i).test(e.data)||(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{code:p.ZodIssueCode.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?Sa.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{validation:"duration",code:p.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?Na(e.data,i.version)||(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{validation:"ip",code:p.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?Da(e.data,i.alg)||(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{validation:"jwt",code:p.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?za(e.data,i.version)||(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{validation:"cidr",code:p.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?Ea.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{validation:"base64",code:p.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?Ua.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{validation:"base64url",code:p.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):h.util.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(o=>e.test(o),{validation:r,code:p.ZodIssueCode.invalid_string,...v.errorUtil.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...v.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...v.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...v.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...v.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...v.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...v.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...v.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...v.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...v.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...v.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...v.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...v.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...v.errorUtil.errToObj(e)})}datetime(e){var r,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!=null?r:!1,local:(n=e==null?void 0:e.local)!=null?n:!1,...v.errorUtil.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,...v.errorUtil.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...v.errorUtil.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...v.errorUtil.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...v.errorUtil.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...v.errorUtil.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...v.errorUtil.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...v.errorUtil.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...v.errorUtil.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...v.errorUtil.errToObj(r)})}nonempty(e){return this.min(1,v.errorUtil.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};c.ZodString=_e;_e.create=t=>{var e;return new _e({checks:[],typeName:x.ZodString,coerce:(e=t==null?void 0:t.coerce)!=null?e:!1,...C(t)})};function La(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(t.toFixed(o).replace(".","")),s=Number.parseInt(e.toFixed(o).replace(".",""));return i%s/10**o}var Oe=class t extends I{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==h.ZodParsedType.number){let i=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(i,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.number,received:i.parsedType}),u.INVALID}let n,o=new u.ParseStatus;for(let i of this._def.checks)i.kind==="int"?h.util.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:p.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:p.ZodIssueCode.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:p.ZodIssueCode.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?La(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:p.ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:p.ZodIssueCode.not_finite,message:i.message}),o.dirty()):h.util.assertNever(i);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,v.errorUtil.toString(r))}gt(e,r){return this.setLimit("min",e,!1,v.errorUtil.toString(r))}lte(e,r){return this.setLimit("max",e,!0,v.errorUtil.toString(r))}lt(e,r){return this.setLimit("max",e,!1,v.errorUtil.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:v.errorUtil.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:v.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:v.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:v.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:v.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:v.errorUtil.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:v.errorUtil.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:v.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:v.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:v.errorUtil.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&h.util.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};c.ZodNumber=Oe;Oe.create=t=>new Oe({checks:[],typeName:x.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...C(t)});var Pe=class t extends I{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==h.ZodParsedType.bigint)return this._getInvalidInput(e);let n,o=new u.ParseStatus;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:p.ZodIssueCode.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:p.ZodIssueCode.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),(0,u.addIssueToContext)(n,{code:p.ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):h.util.assertNever(i);return{status:o.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(r,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.bigint,received:r.parsedType}),u.INVALID}gte(e,r){return this.setLimit("min",e,!0,v.errorUtil.toString(r))}gt(e,r){return this.setLimit("min",e,!1,v.errorUtil.toString(r))}lte(e,r){return this.setLimit("max",e,!0,v.errorUtil.toString(r))}lt(e,r){return this.setLimit("max",e,!1,v.errorUtil.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:v.errorUtil.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:v.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:v.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:v.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:v.errorUtil.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:v.errorUtil.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};c.ZodBigInt=Pe;Pe.create=t=>{var e;return new Pe({checks:[],typeName:x.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!=null?e:!1,...C(t)})};var Ze=class extends I{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==h.ZodParsedType.boolean){let n=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(n,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.boolean,received:n.parsedType}),u.INVALID}return(0,u.OK)(e.data)}};c.ZodBoolean=Ze;Ze.create=t=>new Ze({typeName:x.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...C(t)});var je=class t extends I{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==h.ZodParsedType.date){let i=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(i,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.date,received:i.parsedType}),u.INVALID}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(i,{code:p.ZodIssueCode.invalid_date}),u.INVALID}let n=new u.ParseStatus,o;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{code:p.ZodIssueCode.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(o=this._getOrReturnCtx(e,o),(0,u.addIssueToContext)(o,{code:p.ZodIssueCode.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):h.util.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:v.errorUtil.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:v.errorUtil.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};c.ZodDate=je;je.create=t=>new je({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:x.ZodDate,...C(t)});var tt=class extends I{_parse(e){if(this._getType(e)!==h.ZodParsedType.symbol){let n=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(n,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.symbol,received:n.parsedType}),u.INVALID}return(0,u.OK)(e.data)}};c.ZodSymbol=tt;tt.create=t=>new tt({typeName:x.ZodSymbol,...C(t)});var ke=class extends I{_parse(e){if(this._getType(e)!==h.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(n,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.undefined,received:n.parsedType}),u.INVALID}return(0,u.OK)(e.data)}};c.ZodUndefined=ke;ke.create=t=>new ke({typeName:x.ZodUndefined,...C(t)});var Ee=class extends I{_parse(e){if(this._getType(e)!==h.ZodParsedType.null){let n=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(n,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.null,received:n.parsedType}),u.INVALID}return(0,u.OK)(e.data)}};c.ZodNull=Ee;Ee.create=t=>new Ee({typeName:x.ZodNull,...C(t)});var be=class extends I{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,u.OK)(e.data)}};c.ZodAny=be;be.create=t=>new be({typeName:x.ZodAny,...C(t)});var de=class extends I{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,u.OK)(e.data)}};c.ZodUnknown=de;de.create=t=>new de({typeName:x.ZodUnknown,...C(t)});var X=class extends I{_parse(e){let r=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(r,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.never,received:r.parsedType}),u.INVALID}};c.ZodNever=X;X.create=t=>new X({typeName:x.ZodNever,...C(t)});var rt=class extends I{_parse(e){if(this._getType(e)!==h.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,u.addIssueToContext)(n,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.void,received:n.parsedType}),u.INVALID}return(0,u.OK)(e.data)}};c.ZodVoid=rt;rt.create=t=>new rt({typeName:x.ZodVoid,...C(t)});var le=class t extends I{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==h.ZodParsedType.array)return(0,u.addIssueToContext)(r,{code:p.ZodIssueCode.invalid_type,expected:h.ZodParsedType.array,received:r.parsedType}),u.INVALID;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&((0,u.addIssueToContext)(r,{code:s?p.ZodIssueCode.too_big:p.ZodIssueCode.too_small,minimum:a?o.exactLength.value:void 0,maximum:s?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&((0,u.addIssueToContext)(r,{code:p.ZodIssueCode.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&((0,u.addIssueToContext)(r,{code:p.ZodIssueCode.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>o.type._parseAsync(new K(r,s,r.path,a)))).then(s=>u.ParseStatus.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new K(r,s,r.path,a)));return u.ParseStatus.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:v.errorUtil.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:v.errorUtil.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:v.errorUtil.toString(r)}})}nonempty(e){return this.min(1,e)}};c.ZodArray=le;le.create=(t,e)=>new le({type:t,minLength:null,maxLength:null,exactLength:null,typeName:x.ZodArray,...C(e)});function et(t){if(t instanceof $){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=B.create(et(n))}return new $({...t._def,shape:()=>e})}else return t instanceof le?new