@perses-dev/histogram-chart-plugin 0.13.0-beta.2 → 0.13.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__mf/js/{HistogramChart.df5fff46.js → HistogramChart.e1912eda.js} +5 -5
- package/__mf/js/async/{121.27e8d4f8.js → 121.db4baaec.js} +2 -2
- package/__mf/js/async/{392.5ba26727.js → 392.499edcc0.js} +2 -2
- package/__mf/js/async/{470.2ea03b19.js → 470.3e0b7777.js} +2 -2
- package/__mf/js/async/659.7ed1095b.js +50 -0
- package/__mf/js/async/{887.bbc6e84a.js → 887.c095919a.js} +4 -4
- package/__mf/js/async/{888.85a51e69.js → 888.dc262bce.js} +1 -1
- package/__mf/js/async/{941.8421dbe6.js → 941.b983cd2a.js} +2 -2
- package/__mf/js/async/{953.bbe56839.js → 953.fe311d62.js} +2 -2
- package/__mf/js/async/{963.0a826f58.js → 963.7dc7c03f.js} +1 -1
- package/__mf/js/async/{__federation_expose_HistogramChart.a9992cd4.js → __federation_expose_HistogramChart.bb5f7535.js} +1 -1
- package/__mf/js/main.39390506.js +7 -0
- package/mf-manifest.json +16 -16
- package/mf-stats.json +16 -16
- package/package.json +4 -4
- package/__mf/js/async/362.fcbf1223.js +0 -1
- package/__mf/js/main.4a790b64.js +0 -7
- /package/__mf/js/async/{121.27e8d4f8.js.LICENSE.txt → 121.db4baaec.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.5ba26727.js.LICENSE.txt → 392.499edcc0.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{470.2ea03b19.js.LICENSE.txt → 470.3e0b7777.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{887.bbc6e84a.js.LICENSE.txt → 887.c095919a.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.8421dbe6.js.LICENSE.txt → 941.b983cd2a.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{953.bbe56839.js.LICENSE.txt → 953.fe311d62.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";(self.chunk_HistogramChart_0_13_0_beta_3=self.chunk_HistogramChart_0_13_0_beta_3||[]).push([["659"],{4734(e,t,n){let r,i,o,a,s,l,u,d,c,p;n.r(t),n.d(t,{ONE_WEEK_IN_MS:()=>$,querySpecSchema:()=>iw,annotationDisplaySchema:()=>ih,buildPanelSpecSchema:()=>i$,resolvePanelRef:()=>F,variableDefinitionSchema:()=>iD,variableTextSchema:()=>iI,isTimeSeriesValueTuple:()=>V,otlpresourcev1:()=>v,parseDurationString:()=>P,isValidQueryPluginType:()=>J,ONE_YEAR_IN_MS:()=>O,DURATION_REGEX:()=>x,createPanelRef:()=>U,getSuggestedStepMs:()=>R,otlpcommonv1:()=>g,variableListSpecSchema:()=>ij,variableDisplaySchema:()=>iP,DEFAULT_ALL_VALUE:()=>"$__all",ONE_HOUR_IN_MS:()=>k,convertTimeToDuration:()=>A,ONE_MINUTE_IN_MS:()=>6e4,intervalToDuration:()=>E,getPanelKeyFromRef:()=>C,isDurationString:()=>j,panelSpecSchema:()=>iS,buildVariableDefinitionSchema:()=>iR,otlptracev1:()=>_,annotationSpecSchema:()=>iy,buildDatasourceSpecSchema:()=>i_,panelDisplaySpec:()=>iz,panelDefinitionSchema:()=>iO,buildVariableListSchema:()=>iA,datasourceSpecSchema:()=>iv,buildVariableSpecSchema:()=>iN,isAbsoluteTimeRange:()=>I,ONE_SECOND_IN_MS:()=>1e3,displaySchema:()=>ig,variableListSchema:()=>iE,variableTextSpecSchema:()=>iZ,isValidTraceId:()=>L,roundStepInterval:()=>D,durationValidationSchema:()=>ib,toAbsoluteTimeRange:()=>M,buildVariableListSpecSchema:()=>iT,buildAnnotationSpecSchema:()=>im,buildPanelDefinitionSchema:()=>ix,isRelativeTimeRange:()=>Z,linkSchema:()=>ik,variableSpecSchema:()=>iM,formatDuration:()=>T,ONE_DAY_IN_MS:()=>S,pluginSchema:()=>ip,pluginDefinitionMetadataSchema:()=>ic});var f,h,m,y,g={};n.r(g);var v={};n.r(v);var _={};n.r(_),n.d(_,{StatusCodeError:()=>q,StatusCodeOk:()=>W,StatusCodeUnset:()=>K});var b=n(12015),z=n(65130),w=n(38086);let k=36e5,S=864e5,$=6048e5,O=31536e6,x=/^(?:(\d+)y)?(?:(\d+)w)?(?:(\d+)d)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?(?:(\d+)ms)?$/;function P(e){let t=x.exec(e);if(null===t)throw Error(`Invalid duration string '${e}'`);return{years:parseInt(t[1]??"0"),months:0,weeks:parseInt(t[2]??"0"),days:parseInt(t[3]??"0"),hours:parseInt(t[4]??"0"),minutes:parseInt(t[5]??"0"),seconds:parseInt(t[6]??"0")+parseInt(t[7]??"0")/1e3}}function j(e){return""!==e&&x.test(e)}function T(e){let t=[];if(e.years&&t.push(`${e.years}y`),e.weeks&&t.push(`${e.weeks}w`),e.days&&t.push(`${e.days}d`),e.hours&&t.push(`${e.hours}h`),e.minutes&&t.push(`${e.minutes}m`),e.seconds){let n=Math.trunc(e.seconds);n&&t.push(`${n}s`);let r=Math.round((e.seconds-n)*1e3);r&&t.push(`${r}ms`)}return t.join("")}function E(e){return A(e.end.valueOf()-e.start.valueOf())}function A(e){let t=Math.trunc(e/O);t>0&&(e-=t*O);let n=Math.trunc(e/$);n>0&&(e-=n*$);let r=Math.trunc(e/S);r>0&&(e-=r*S);let i=Math.trunc(e/k);i>0&&(e-=i*k);let o=Math.trunc(e/6e4);return o>0&&(e-=6e4*o),{years:t,months:0,weeks:n,days:r,hours:i,minutes:o,seconds:e/1e3}}function Z(e){return void 0!==e.pastDuration}function I(e){return void 0!==e.start&&void 0!==e.end}function M(e){let t=e.end??new Date;return{start:function(e,t){var n,r,i,o,a;let{years:s=0,months:l=0,weeks:u=0,days:d=0,hours:c=0,minutes:p=0,seconds:f=0}=t,h=(n=l+12*s,r=void 0,i=(0,w.P)(e,-n,r),o=d+7*u,a=void 0,(0,z.f)(i,-o,a));return(0,b.w)(e,h-1e3*(f+60*(p+60*c)))}(t,P(e.pastDuration)),end:t}}let N=[{maxMs:15,roundedStepMs:10,display:"0.01s"},{maxMs:35,roundedStepMs:20,display:"0.02s"},{maxMs:75,roundedStepMs:50,display:"0.05s"},{maxMs:150,roundedStepMs:100,display:"0.1s"},{maxMs:350,roundedStepMs:200,display:"0.2s"},{maxMs:750,roundedStepMs:500,display:"0.5s"},{maxMs:1500,roundedStepMs:1e3,display:"1s"},{maxMs:3500,roundedStepMs:2e3,display:"2s"},{maxMs:7500,roundedStepMs:5e3,display:"5s"},{maxMs:12500,roundedStepMs:1e4,display:"10s"},{maxMs:17500,roundedStepMs:15e3,display:"15s"},{maxMs:25e3,roundedStepMs:2e4,display:"20s"},{maxMs:45e3,roundedStepMs:3e4,display:"30s"},{maxMs:9e4,roundedStepMs:6e4,display:"1m"},{maxMs:21e4,roundedStepMs:12e4,display:"2m"},{maxMs:45e4,roundedStepMs:3e5,display:"5m"},{maxMs:75e4,roundedStepMs:6e5,display:"10m"},{maxMs:75e4,roundedStepMs:9e5,display:"15m"},{maxMs:15e5,roundedStepMs:12e5,display:"20m"},{maxMs:27e5,roundedStepMs:18e5,display:"30m"},{maxMs:54e5,roundedStepMs:36e5,display:"1h"},{maxMs:9e6,roundedStepMs:72e5,display:"2h"},{maxMs:162e5,roundedStepMs:108e5,display:"3h"},{maxMs:324e5,roundedStepMs:216e5,display:"6h"},{maxMs:864e5,roundedStepMs:432e5,display:"12h"},{maxMs:6048e5,roundedStepMs:864e5,display:"1d"},{maxMs:18144e5,roundedStepMs:6048e5,display:"1w"},{maxMs:36288e5,roundedStepMs:2592e6,display:"30d"},{maxMs:63072e6,roundedStepMs:31536e6,display:"1y"}];function D(e){for(let{maxMs:t,roundedStepMs:n}of N)if(e<t)return n;return 15e3}function R(e,t){return D(Math.floor((e.end.valueOf()-e.start.valueOf())/t))}function F(e,t){let n=C(t),r=e.panels[n];if(void 0===r)throw Error(`Could not resolve panels reference ${t.$ref}`);return r}function C(e){return e.$ref.substring(14)}function U(e){return{$ref:`#/spec/panels/${e}`}}function J(e){return["TimeSeriesQuery","TraceQuery","ProfileQuery","LogQuery","AlertsQuery","SilencesQuery","JsonQuery"].includes(e)}function V(e){return 2===e.length}function L(e){return/^[0-9a-fA-F]+$/.test(e)}let K="STATUS_CODE_UNSET",W="STATUS_CODE_OK",q="STATUS_CODE_ERROR";function B(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function Q(e,t="|"){return e.map(e=>ed(e)).join(t)}function H(e,t){return"bigint"==typeof t?t.toString():t}function G(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function X(e){let t=+!!e.startsWith("^"),n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Y(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ee(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}let et="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function en(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let er=G(()=>{if(eT.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function ei(e){if(!1===en(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let n=t.prototype;return!1!==en(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function eo(e){return ei(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let ea=new Set(["string","number","symbol"]);function es(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function el(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function eu(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function ed(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function ec(e,t,n,r="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let o=ee(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(r,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(let t of Reflect.ownKeys(r))i[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return Y(this,"shape",i),i},checks:[]});return el(t,o)}function ep(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ef(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function eh(e){return"string"==typeof e?e:e?.message}function em(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function ey(e,t,n){let r=e.inst?._zod?.traits;r?.has("$ZodType")&&(r.has("$ZodCheck")?e.schema??(e.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,o=e.message?e.message:eh(e.inst?._zod.def?.error?.(e))??eh(i?.(e))??eh(t?.error?.(e))??eh(n.customError?.(e))??eh(n.localeError?.(e))??"Invalid input",{inst:a,schema:s,continue:l,input:u,...d}=e;return d.path??(d.path=[]),d.message=o,t?.reportInput&&(d.input=u),d}let eg=/[\uD800-\uDBFF]/;function ev(e){let t=e.length;if(!eg.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(64512&e.charCodeAt(r))==55296&&(64512&e.charCodeAt(r+1))==56320&&(n--,r++);return n}function e_(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function eb(...e){let[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}function ez(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}let ew=!1,ek={configurable:!0,get(){ew=!0}};function eS(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&&r!==e._zod){r=void 0;return}r=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,ek);let e=ew;ew=!1;try{let r=n(this);return ew?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),ew=ew||e,r}catch(n){throw delete this[t],ew=ew||e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}let e$={value:void 0,enumerable:!1},eO="captureStackTrace"in Error?Error:null;function ex(e,t,n,r){function i(e){this.def=e,this.constr=u,this.traits=new Set}i.prototype={};let o=n&&new WeakSet;function a(r,a){if(!r._zod){e$.value=new i(a);try{Object.defineProperty(r,"_zod",e$)}finally{e$.value=void 0}}if(r._zod.traits.has(e))return;if(r._zod.traits.add(e),t(r,a),o){let e=Object.getPrototypeOf(r),t=r._zod.constr.prototype,i=e;for(;i&&i!==t;)i=Object.getPrototypeOf(i);let a=i??e;if(!o.has(a)){o.add(a);for(let e in n){let t=Object.getOwnPropertyDescriptor(n,e);t.get?Object.defineProperty(a,e,{...t,enumerable:!1}):function(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:ez(this,t,n.bind(this))},set(e){ez(this,t,e)}})}(a,e,t.value)}}}let s=u.prototype;for(let e in s)Object.prototype.hasOwnProperty.call(s,e)&&(e in r||(r[e]=s[e].bind(r)))}let s=r?.Parent??Object;class l extends s{}function u(e){let t=r?.Parent?function(e){let t=eO;if(t){let n=t.stackTraceLimit;if("number"==typeof n){try{t.stackTraceLimit=0}catch{return eO=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}(l):this;a(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(l,"name",{value:e}),Object.defineProperty(u,"init",{value:a}),Object.defineProperty(u,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class eP extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ej extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(m=globalThis).__zod_globalConfig??(m.__zod_globalConfig={});let eT=globalThis.__zod_globalConfig;function eE(e){return e&&Object.assign(eT,e),eT}class eA extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}let eZ="~memo",eI=[];function eM(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let eN=new WeakMap,eD=[],eR={alloc(e,t,n){let r=i;if(!r)return n;i=void 0;let o={value:n,issues:null};return r.set(t.value,o),eD.push(o),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{var r,i;let o;if("backward"!==n.direction&&(r=n,i=e.value,void 0!==(o=r[eZ]?.backEdges)&&null!==i&&"object"==typeof i&&o.has(i)))throw new eA;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r,o;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,a=(s,l)=>{let u;if(void 0===n&&!(n=function e(t,n){let r=eN.get(t);if(void 0!==r)return r;if(n.has(t))return!0;n.add(t);let i=!1,o=t=>{!i&&t?._zod&&e(t,n)&&(i=!0)},a=t._zod.def;switch(a.type){case"object":for(let e of Reflect.ownKeys(a.shape))o(a.shape[e]);o(a.catchall);break;case"array":o(a.element);break;case"tuple":for(let e of a.items)o(e);o(a.rest);break;case"record":case"map":o(a.keyType),o(a.valueType);break;case"set":o(a.valueType);break;case"union":for(let e of a.options)o(e);break;case"intersection":o(a.left),o(a.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":o(a.innerType);break;case"pipe":o(a.in),o(a.out);break;case"function":o(a.input),o(a.output);break;case"lazy":o(t._zod.innerType);break;case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let e in a){let t=Object.getOwnPropertyDescriptor(a,e);if(!t||t.get)continue;let n=t.value;if(n&&"object"==typeof n){if(n._zod)o(n);else if(Array.isArray(n))for(let e of n)o(e)}}}return n.delete(t),eN.set(t,i),i}(e,new Set)))return e._zod.parse=t,e._zod.run===a&&(e._zod.run=t),t(s,l);let d=s.value;if(null===d||"object"!=typeof d)return t(s,l);let c=l[eZ];if(c||(c={buckets:new Map,backEdges:void 0},l[eZ]=c),r===l)u=o;else{var p;let t;(t=(p=c).buckets.get(e))||(t=new Map,p.buckets.set(e,t)),u=t,r=l,o=u}let f=u.get(d);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...eM(f.issues)):(s.memo=!0,c.backEdges??(c.backEdges=new Set),c.backEdges.add(f.value)),s;i=u;let h=eD.length,m=t(s,l);i=void 0;let y=eD.length>h?eD.pop():void 0;return m instanceof Promise?m.then(e=>(y&&(y.issues=e.issues.length?eM(e.issues):eI),e)):(y&&(y.issues=m.issues.length?eM(m.issues):eI),m)};e._zod.parse=a,e._zod.run===t&&(e._zod.run=a)})}},eF=/^[cC][0-9a-z]{6,}$/,eC=/^[0-9a-z]+$/,eU=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,eJ=/^[0-9a-vA-V]{20}$/,eV=/^[A-Za-z0-9]{27}$/,eL=/^[a-zA-Z0-9_-]{21}$/,eK=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,eW=/^([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})$/,eq=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([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)$/,eB=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,eQ=/^(?:(?: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])$/,eH=/^(([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}|:))$/,eG=/^((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])$/,eX=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,eY=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,e0=/^[A-Za-z0-9_-]*$/,e1=/^https?$/,e4=/^\+[1-9]\d{6,14}$/,e2="(?:(?:\\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])))",e9=RegExp(`^${e2}$`);function e5(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let e6=/^-?\d+$/,e3=/^-?\d+(?:\.\d+)?$/,e7=/^(?:true|false)$/i,e8=/^[^A-Z]*$/,te=/^[^a-z]*$/,tt=ex("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),tn=e=>{let t=e.value;return null!=t&&void 0!==t.length},tr=ex("$ZodCheckMaxLength",(e,t)=>{var n;tt.init(e,t),(n=e._zod.def).when??(n.when=tn),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value,i=r.length;if(("string"==typeof r&&i>t.maximum?ev(r):i)<=t.maximum)return;let o=e_(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ti=ex("$ZodCheckMinLength",(e,t)=>{var n;tt.init(e,t),(n=e._zod.def).when??(n.when=tn),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value,i=r.length;if(("string"==typeof r&&i>=t.minimum&&i<2*t.minimum?ev(r):i)>=t.minimum)return;let o=e_(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),to=ex("$ZodCheckLengthEquals",(e,t)=>{var n;tt.init(e,t),(n=e._zod.def).when??(n.when=tn),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length,o="string"==typeof r&&i>=t.length&&i<=2*t.length?ev(r):i;if(o===t.length)return;let a=e_(r),s=o>t.length;n.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ta=ex("$ZodCheckStringFormat",(e,t)=>{var n,r;tt.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ts=ex("$ZodCheckRegex",(e,t)=>{ta.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),tl=ex("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=e8),ta.init(e,t)}),tu=ex("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=te),ta.init(e,t)}),td=ex("$ZodCheckIncludes",(e,t)=>{tt.init(e,t);let n=es(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),tc=ex("$ZodCheckStartsWith",(e,t)=>{tt.init(e,t);let n=RegExp(`^${es(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),tp=ex("$ZodCheckEndsWith",(e,t)=>{tt.init(e,t);let n=RegExp(`.*${es(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),tf=ex("$ZodCheckOverwrite",(e,t)=>{tt.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class th{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
2
|
+
${t.join("\n")}
|
|
3
|
+
};`)(...Object.values(this.closed))}}let tm={get:function(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,H,2)),e.message},set:function(e){this._zod.message=e},enumerable:!0,configurable:!0},ty={value:void 0,enumerable:!1},tg={value:void 0,enumerable:!1},tv=new WeakSet([Object.prototype,Error.prototype]),t_=(e,t)=>{e.name="$ZodError",ty.value=e._zod,Object.defineProperty(e,"_zod",ty),tg.value=t,Object.defineProperty(e,"issues",tg),ty.value=void 0,tg.value=void 0,Object.defineProperty(e,"message",tm);let n=Object.getPrototypeOf(e);tv.has(n)||(tv.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},tb=ex("$ZodError",t_),tz=ex("$ZodError",t_,void 0,{Parent:Error});function tw(e,t){return{callee:t?.callee??e,Err:t?.Err}}let tk=e=>{let t=(n,r,i,o)=>{let a=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},a);if(s instanceof Promise)throw new eP;if(s.issues.length){let n=new(o?.Err??e)(s.issues.map(e=>ey(e,a,eE())));throw et(n,o?.callee??t),n}return s.value};return t},tS=e=>{let t=async(n,r,i,o)=>{let a=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new(o?.Err??e)(s.issues.map(e=>ey(e,a,eE())));throw et(n,o?.callee??t),n}return s.value};return t},t$=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new eP;return o.issues.length?{success:!1,error:new(e??tb)(o.issues.map(e=>ey(e,i,eE())))}:{success:!0,data:o.value}},tO=t$(tz),tx=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>ey(e,i,eE())))}:{success:!0,data:o.value}},tP=tx(tz),tj={major:4,minor:5,patch:4},tT=ex("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tj;let r=e._zod.def.checks,i=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{let i;if(t.memo)return t;let o=ep(t);for(let a of n){if(a._zod.def.when){if(function(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}(t)||!a._zod.def.when(t))continue}else if(o)continue;let n=t.issues.length,s=a._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new eP;if(i||s instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(em(t.issues,n,e),o||(o=ep(t,n)))});else{if(t.issues.length===n)continue;em(t.issues,n,e),o||(o=ep(t,n))}}return i?i.then(()=>t):t},n=(n,r,o)=>{if(ep(n))return n.aborted=!0,n;let a=t(r,i,o);if(a instanceof Promise){if(!1===o.async)throw new eP;return a.then(t=>e._zod.parse(t,o))}return e._zod.parse(a,o)};e._zod.run=(r,o)=>{if(o.skipChecks)return e._zod.parse(r,o);if("backward"===o.direction){let t=e._zod.parse({value:r.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,o)):n(t,r,o)}let a=e._zod.parse(r,o);if(a instanceof Promise){if(!1===o.async)throw new eP;return a.then(e=>t(e,i,o))}return t(a,i,o)}}},{get"~standard"(){return ez(this,"~standard",tA(this),!1)},set"~standard"(value){ez(this,"~standard",value)}}),tE=e=>e.success?{value:e.data}:{issues:e.error?.issues};function tA(e){return{validate:t=>{try{return tE(tO(e,t))}catch(n){return tP(e,t).then(tE)}},vendor:"zod",version:1}}let tZ=ex("$ZodString",(e,t)=>{var n;let r;tT.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(r=(n=e._zod.bag)?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*",RegExp(`^${r}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(e){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),tI=ex("$ZodStringFormat",(e,t)=>{ta.init(e,t),tZ.init(e,t)}),tM=ex("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=eW),tI.init(e,t)}),tN=ex("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=eq(e))}else t.pattern??(t.pattern=eq());tI.init(e,t)}),tD=ex("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=eB),tI.init(e,t)}),tR=/[\t\n\r]/g,tF=ex("$ZodURL",(e,t)=>{tI.init(e,t),e._zod.check=n=>{try{var r,i;let o=n.value.trim(),a=function(e,t){if(!t.normalize&&t.protocol?.source===e1.source&&!/^https?:\/\//i.test(e))return 1;try{return new URL(e)}catch{return 2}}(o,t);if(1===a)return void n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});if(2===a)return void n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});t.hostname&&((r=t.hostname).lastIndex=0,!r.test(a.hostname))&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&((i=t.protocol).lastIndex=0,!i.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol))&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?a.href:o.replace(tR,"");return}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),tC=ex("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")),tI.init(e,t)}),tU=ex("$ZodNanoID",(e,t)=>{var n;if(void 0!==t.length&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=void 0===t.length?eL:(n=t.length,RegExp(`^[a-zA-Z0-9_-]{${n}}$`))),tI.init(e,t)}),tJ=ex("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=eF),tI.init(e,t)}),tV=ex("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=eC),tI.init(e,t)}),tL=ex("$ZodULID",(e,t)=>{t.pattern??(t.pattern=eU),tI.init(e,t)}),tK=ex("$ZodXID",(e,t)=>{t.pattern??(t.pattern=eJ),tI.init(e,t)}),tW=ex("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=eV),tI.init(e,t)}),tq=ex("$ZodISODateTime",(e,t)=>{let n,r,i;t.pattern??(n=["Z"],t.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"),r=`${e5({precision:t.precision,seconds:!0})}(?:${n.join("|")})`,i=t.local?`${r}|${e5({precision:t.precision})}`:r,t.pattern=RegExp(`^${e2}T(?:${i})$`)),tI.init(e,t),(t.local||-1===t.precision)&&(e._zod.bag.laxFormat=!0,e._zod.onattach.push(e=>{e._zod.bag.laxFormat=!0}))}),tB=ex("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=e9),tI.init(e,t)}),tQ=ex("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RegExp(`^${e5(t)}$`)),tI.init(e,t)}),tH=ex("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=eK),tI.init(e,t)}),tG=ex("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=eQ),tI.init(e,t),e._zod.bag.format="ipv4"}),tX=/^[0-9a-fA-F:.]+$/;function tY(e){if(!tX.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}let t0=ex("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=eH),tI.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{tY(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),t1=ex("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=eG),tI.init(e,t)}),t4=ex("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=eX),tI.init(e,t),e._zod.check=n=>{!function(e){let t=e.split("/");if(2!==t.length)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`===r&&!(i<0)&&!(i>128)&&tY(n)}(n.value)&&n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function t2(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let t9=ex("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=eY),tI.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{t2(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),t5=ex("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=e0),tI.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{!function(e){if(!e0.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return t2(t.padEnd(4*Math.ceil(t.length/4),"="))}(n.value)&&n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),t6=ex("$ZodE164",(e,t)=>{t.pattern??(t.pattern=e4),tI.init(e,t)}),t3=ex("$ZodJWT",(e,t)=>{tI.init(e,t),e._zod.check=n=>{!function(e,t=null){try{let n=e.split(".");if(3!==n.length)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}(n.value,t.alg)&&n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),t7=ex("$ZodBoolean",(e,t)=>{tT.init(e,t),e._zod.pattern=e7,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch(e){}let i=n.value;return"boolean"==typeof i||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),t8=ex("$ZodAny",(e,t)=>{tT.init(e,t),e._zod.parse=e=>e}),ne=ex("$ZodUnknown",(e,t)=>{tT.init(e,t),e._zod.parse=e=>e}),nt=ex("$ZodNever",(e,t)=>{tT.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function nn(e,t,n){e.issues.length&&t.issues.push(...ef(n,e.issues)),t.value[n]=e.value}let nr=ex("$ZodArray",(e,t)=>{tT.init(e,t);let n=eT.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=n?n.alloc(e,r,Array(o.length),i):Array(o.length);let a=[];for(let e=0;e<o.length;e++){let n=o[e],s=t.element._zod.run({value:n,issues:[]},i);s instanceof Promise?a.push(s.then(t=>nn(t,r,e))):nn(s,r,e)}return a.length?Promise.all(a).then(()=>r):r}});function ni(e,t,n,r,i,o){let a=n in r,s="optional"===o;if(a||!s||"optional"!==i){if(e.issues.length){if(void 0!==i&&s&&!a)return;t.issues.push(...ef(n,e.issues))}if(!a&&void 0===i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}void 0===e.value?a&&(t.value[n]=void 0):t.value[n]=e.value}}let no=[];function na(e){var t;let n=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),i=r.length?r:no,o=i.length?[...n,...i]:n;for(let t of o)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Object.keys(t=e.shape).filter(e=>void 0!==t[e]._zod.optin&&"optional"===t[e]._zod.optout);return{...e,allKeys:o,symbolKeys:i,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(a)}}function ns(e,t,n,r,i,o){let a=[],s=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,c=l.optout;for(let i in t){if(s.has(i))continue;if("__proto__"===i){"never"===u&&a.push(i);continue}if("never"===u){a.push(i);continue}let o=l.run({value:t[i],issues:[]},r);o instanceof Promise?e.push(o.then(e=>ni(e,n,i,t,d,c))):ni(o,n,i,t,d,c)}return(a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o,continue:!0}),e.length)?Promise.all(e).then(()=>n):n}let nl=new WeakMap,nu=ex("$ZodObject",(e,t)=>{let n;tT.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape");if(!r?.get){let e=t.shape;nl.set(t,e),Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),nl.set(t,n),n}})}let i=G(()=>na(t));eS(e,"propValues",e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){for(let t of(Object.prototype.hasOwnProperty.call(n,e)||Y(n,e,new Set),r.values))n[e].add(t);void 0!==r.optin&&n[e].add(void 0)}}return n});let o=t.catchall,a=eT.memoizer;a?.attach(e),e._zod.parse=(t,r)=>{n??(n=i.value);let s=t.value;if(!en(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value=a?a.alloc(e,t,{},r):{};let l=[],u=n.shape;for(let e of n.allKeys){if("__proto__"===e)continue;let n=u[e],i=n._zod.optin,o=n._zod.optout,a=n._zod.run({value:s[e],issues:[]},r);a instanceof Promise?l.push(a.then(n=>ni(n,t,e,s,i,o))):ni(a,t,e,s,i,o)}return o?ns(l,s,t,r,i.value,e):l.length?Promise.all(l).then(()=>t):t}}),nd=ex("$ZodObjectJIT",(e,t)=>{let n,r;nu.init(e,t);let i=e._zod.parse,o=G(()=>na(t)),a=eT.memoizer,s=!eT.jitless,l=s&&er.value,u=t.catchall;e._zod.parse=(d,c)=>{r??(r=o.value);let p=d.value;return en(p)?s&&l&&c?.async===!1&&!0!==c.jitless?(n||(n=(t=>{let n=o.value,r=n.symbolKeys,i=new th(["payload","ctx"],{shape:t,inst:e,memo:a,syms:r}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,l=(e,t)=>`
|
|
4
|
+
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
5
|
+
const iss = ${e}.issues[i];
|
|
6
|
+
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
7
|
+
payload.issues.push(iss);
|
|
8
|
+
}`;i.write("const input = payload.value;");let u=Object.create(null),d=0;for(let e of n.allKeys)u[e]=`key_${d++}`;for(let e of(i.write(a?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};"),n.allKeys)){if("__proto__"===e)continue;let n=u[e],o="symbol"==typeof e?`syms[${r.indexOf(e)}]`:JSON.stringify(e),a=`${o} in input`,d=t[e],c=d?._zod?.optin,p=void 0!==c,f=d?._zod?.optout==="optional";if(i.write(`const ${n} = ${s(o)};`),p&&f){let e="optional"===c?`${n}_present`:`${n}.value !== undefined || ${n}_present`;i.write(`
|
|
9
|
+
const ${n}_present = ${a};
|
|
10
|
+
if (!${n}.issues.length || ${n}_present) {
|
|
11
|
+
if (${n}.issues.length) {${l(n,o)}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (${e}) {
|
|
15
|
+
newResult[${o}] = ${n}.value;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
`)}else p?i.write(`
|
|
20
|
+
if (${n}.issues.length) {${l(n,o)}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (${n}.value === undefined) {
|
|
24
|
+
if (${a}) {
|
|
25
|
+
newResult[${o}] = undefined;
|
|
26
|
+
}
|
|
27
|
+
} else {
|
|
28
|
+
newResult[${o}] = ${n}.value;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
`):i.write(`
|
|
32
|
+
const ${n}_present = ${a};
|
|
33
|
+
if (${n}.issues.length) {${l(n,o)}
|
|
34
|
+
}
|
|
35
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
36
|
+
payload.issues.push({
|
|
37
|
+
code: "invalid_type",
|
|
38
|
+
expected: "nonoptional",
|
|
39
|
+
input: undefined,
|
|
40
|
+
path: [${o}]
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (${n}_present) {
|
|
45
|
+
newResult[${o}] = ${n}.value;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
`)}return i.write("payload.value = newResult;"),i.write("return payload;"),i.compile()})(t.shape)),d=n(d,c),u)?ns([],p,d,c,r,e):d:i(d,c):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}});function nc(e,t,n,r){for(let n of e)if(0===n.issues.length)return t.value=n.value,t;let i=e.filter(e=>!ep(e));return 1===i.length?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ey(e,r,eE())))}),t)}let np=ex("$ZodUnion",(e,t)=>{tT.init(e,t),eS(e,"optin",e=>e.def.options.some(e=>"defaulted"===e._zod.optin)?"defaulted":e.def.options.some(e=>void 0!==e._zod.optin)?"optional":void 0),eS(e,"optout",e=>e.def.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),eS(e,"values",e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),eS(e,"pattern",e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>X(e.source)).join("|")})$`)}});let n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let o=!1,a=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)a.push(t),o=!0;else{if(0===t.issues.length)return t;a.push(t)}}return o?Promise.all(a).then(t=>nc(t,r,e,i)):nc(a,r,e,i)}}),nf=ex("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,np.init(e,t);let n=e._zod.parse;eS(e,"propValues",e=>{let t={};for(let n of e.def.options){let r=n._zod.propValues;if(!r||0===Object.keys(r).length)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(n)}"`);for(let[e,n]of Object.entries(r))for(let r of(Object.prototype.hasOwnProperty.call(t,e)||Y(t,e,new Set),n))t[e].add(r)}return t}),t.options.forEach((e,n)=>{let r=nl.get(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=G(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,o)=>{let a=i.value;if(!en(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;let s=r.value.get(a?.[t.discriminator]);return s?s._zod.run(i,o):t.unionFallback||"backward"===o.direction?n(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()),input:a,path:[t.discriminator],inst:e}),i)}}),nh=ex("$ZodIntersection",(e,t)=>{tT.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),o=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([t,n])=>nm(e,t,n)):nm(e,i,o)}});function nm(e,t,n){let r,i=new Map,o=new Map,a=(e,t)=>{let n;if("unrecognized_keys"!==e.code||e.path?.length)if("invalid_key"!==e.code||"record"!==e.origin||e.path?.length!==1)return!1;else{let t=String(e.path[0]);o.has(t)||o.set(t,e),n=[t]}else r??(r=e),n=e.keys;for(let e of n)i.has(e)||i.set(e,{}),i.get(e)[t]=!0;return!0};for(let n of t.issues)a(n,"l")||e.issues.push(n);for(let t of n.issues)a(t,"r")||e.issues.push(t);let s=[...i].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=r?s.filter(e=>r.keys.includes(e)):[];for(let n of(t.length&&e.issues.push({...r,keys:t}),s))!t.includes(n)&&o.has(n)&&e.issues.push(o.get(n))}let l=function e(t,n){if(t===n||t instanceof Date&&n instanceof Date&&+t==+n)return{valid:!0,data:t};if(ei(t)&&ei(n)){let r=Object.keys(n),i=Object.keys(t).filter(e=>-1!==r.indexOf(e)),o={...t,...n};for(let r of(Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__,i)){if("__proto__"===r)continue;let i=e(t[r],n[r]);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};o[r]=i.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<t.length;i++){let o=e(t[i],n[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};r.push(o.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}(t.value,n.value);if(!l.valid){if(ep(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`)}return e.value=l.data,e}let ny=ex("$ZodRecord",(e,t)=>{tT.init(e,t);let n=eT.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let o=r.value;if(!ei(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let a=[],s=t.keyType._zod.values;if(s&&!t.partial){let l;r.value=n?n.alloc(e,r,{},i):{};let u=new Set;for(let n of s)if("string"==typeof n||"number"==typeof n||"symbol"==typeof n){if(u.add("number"==typeof n?n.toString():n),"__proto__"===n)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(s.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:s.issues.map(e=>ey(e,i,eE())),input:n,path:[n],inst:e});continue}let l=s.value;if("__proto__"===l)continue;let d=t.valueType._zod.run({value:o[n],issues:[]},i);d instanceof Promise?a.push(d.then(e=>{e.issues.length&&r.issues.push(...ef(n,e.issues)),r.value[l]=e.value})):(d.issues.length&&r.issues.push(...ef(n,d.issues)),r.value[l]=d.value)}for(let e in o)if(!u.has(e))if("loose"===t.mode){if("__proto__"===e)continue;r.value[e]=o[e]}else(l=l??[]).push(e);l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l,continue:!0})}else{let l;for(let u of(r.value=n?n.alloc(e,r,{},i):{},Reflect.ownKeys(o))){if("__proto__"===u||!Object.prototype.propertyIsEnumerable.call(o,u))continue;let n=t.keyType._zod.run({value:u,issues:[]},i);if(n instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof u&&e3.test(u)&&n.issues.length){let e=t.keyType._zod.run({value:Number(u),issues:[]},i);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(n=e)}if(n.issues.length){"loose"===t.mode?r.value[u]=o[u]:s?(l=l??[]).push(u):r.issues.push({code:"invalid_key",origin:"record",issues:n.issues.map(e=>ey(e,i,eE())),input:u,path:[u],inst:e});continue}let d=n.value;if("__proto__"===d)continue;let c=t.valueType._zod.run({value:o[u],issues:[]},i);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&r.issues.push(...ef(u,e.issues)),r.value[d]=e.value})):(c.issues.length&&r.issues.push(...ef(u,c.issues)),r.value[d]=c.value)}l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l,continue:!0})}return a.length?Promise.all(a).then(()=>r):r}}),ng=ex("$ZodEnum",(e,t)=>{tT.init(e,t);let n=B(t.entries),r=new Set(n);e._zod.values=r;let i=n.filter(e=>ea.has(typeof e));e._zod.pattern=new RegExp(i.length?`^(${i.map(e=>es(e.toString())).join("|")})$`:"^[^\\s\\S]$"),e._zod.parse=(t,i)=>{let o=t.value;return r.has(o)||t.issues.push({code:"invalid_value",values:n,input:o,inst:e}),t}}),nv=ex("$ZodLiteral",(e,t)=>{tT.init(e,t);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(t.values.length?`^(${t.values.map(e=>"string"==typeof e?es(e):e?es(e.toString()):String(e)).join("|")})$`:"^[^\\s\\S]$"),e._zod.parse=(r,i)=>{let o=r.value;return n.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),n_=ex("$ZodTransform",(e,t)=>{tT.init(e,t),e._zod.optin="optional",eT.memoizer?.guard(e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new ej(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new eP;return n.value=i,n}});function nb(e,t){return e.value=t.issues.length?void 0:t.value,e}let nz=ex("$ZodOptional",(e,t)=>{tT.init(e,t),eS(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),e._zod.optout="optional",eS(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),eS(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${X(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(void 0===e.value){if("defaulted"!==t.innerType._zod.optin)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>nb(e,t)):nb(e,r)}return t.innerType._zod.run(e,n)}}),nw=ex("$ZodExactOptional",(e,t)=>{nz.init(e,t),eS(e,"values",e=>e.def.innerType._zod.values),eS(e,"pattern",e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),nk=ex("$ZodNullable",(e,t)=>{tT.init(e,t),eS(e,"optin",e=>e.def.innerType._zod.optin),eS(e,"optout",e=>e.def.innerType._zod.optout),eS(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${X(t.source)}|null)$`):void 0}),eS(e,"values",e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),nS=ex("$ZodDefault",(e,t)=>{tT.init(e,t),e._zod.optin="defaulted",eS(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>n$(e,t)):n$(r,t)}});function n$(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let nO=ex("$ZodPrefault",(e,t)=>{tT.init(e,t),e._zod.optin="defaulted",eS(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),nx=ex("$ZodNonOptional",(e,t)=>{tT.init(e,t),eS(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>nP(t,e)):nP(i,e)}});function nP(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function nj(e,t,n,r){return t.issues.length?e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>ey(e,r,eE()))},input:e.value}):(e.value=t.value,t.memo&&(e.memo=!0)),e}let nT=ex("$ZodCatch",(e,t)=>{tT.init(e,t),eS(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),eS(e,"optout",e=>e.def.innerType._zod.optout),eS(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>nj(e,r,t,n)):nj(e,r,t,n)}}),nE=ex("$ZodPipe",(e,t)=>{tT.init(e,t),eS(e,"values",e=>e.def.in._zod.values),eS(e,"optin",e=>e.def.in._zod.optin),eS(e,"optout",e=>e.def.out._zod.optout),eS(e,"propValues",e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>nA(e,t.in,n)):nA(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>nA(e,t.out,n)):nA(r,t.out,n)}});function nA(e,t,n){return e.issues.some(e=>"unrecognized_keys"!==e.code)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}let nZ=ex("$ZodReadonly",(e,t)=>{tT.init(e,t),eS(e,"propValues",e=>e.def.innerType._zod.propValues),eS(e,"values",e=>e.def.innerType._zod.values),eS(e,"optin",e=>e.def.innerType?._zod?.optin),eS(e,"optout",e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(nI):nI(r)}});function nI(e){return e.memo||(e.value=Object.freeze(e.value)),e}let nM=ex("$ZodCustom",(e,t)=>{tt.init(e,t),tT.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>nN(t,n,r,e));nN(i,n,r,e)}});function nN(e,t,n,r){if(!e){let e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(eb(e))}}(y=globalThis).__zod_globalRegistry??(y.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let nD=globalThis.__zod_globalRegistry;function nR(e,t){return new tr({check:"max_length",...eu(t),maximum:e})}function nF(e,t){return new ti({check:"min_length",...eu(t),minimum:e})}function nC(e,t){return new to({check:"length_equals",...eu(t),length:e})}function nU(e){return new tf({check:"overwrite",tx:e})}function nJ(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Y(e,t,n[t]);return e}function nV(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??nD,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function nL(e,t,n,r,i){let o="function"==typeof t.unrepresentable?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if("any"===o)return!1;if(void 0===o||"throw"===o)throw Error(i);return Object.assign(n,o),!0}function nK(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;let a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,r);else{let n=a.schema,o=t.processors[i.type];if(!o)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);o(e,t,n,r)}let o=e._zod.parent;o&&(a.ref||(a.ref=o),nK(o,t,r),t.seen.get(o).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&nJ(a.schema,l),"input"===t.io&&function e(t,n){let r=n??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let i=t._zod.def;if("transform"===i.type)return!0;if("array"===i.type)return e(i.element,r);if("set"===i.type)return e(i.valueType,r);if("lazy"===i.type)return e(i.getter(),r);if("promise"===i.type||"optional"===i.type||"nonoptional"===i.type||"nullable"===i.type||"readonly"===i.type||"default"===i.type||"prefault"===i.type||"catch"===i.type)return e(i.innerType,r);if("intersection"===i.type)return e(i.left,r)||e(i.right,r);if("record"===i.type||"map"===i.type)return e(i.keyType,r)||e(i.valueType,r);if("pipe"===i.type)return!!t._zod.traits.has("$ZodCodec")||e(i.in,r)||e(i.out,r);if("object"===i.type){for(let t in i.shape)if(e(i.shape[t],r))return!0;return!1}if("union"===i.type){for(let t of i.options)if(e(t,r))return!0;return!1}if("tuple"===i.type){for(let t of i.items)if(e(t,r))return!0;if(i.rest&&e(i.rest,r))return!0}return!1}(e)&&(delete a.schema.examples,delete a.schema.default),"input"===t.io&&"_prefault"in a.schema&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function nW(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function nq(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{if(t[1].schema.$ref)return;let r=t[1],{ref:i,defId:o}=(t=>{let r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let o=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=o,{defId:o,ref:`${i("__shared")}#/${r}/${nW(o)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:"#"};let o=t[1].schema.id??`__schema${e.counter++}`;return{defId:o,ref:i+nW(o)}})(t);r.def={...r.schema},o&&(r.defId=o);let a=r.schema;for(let e in a)delete a[e];a.$ref=i};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
|
|
49
|
+
|
|
50
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){i(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){i(n);continue}}if(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&"ref"===e.reused){i(n);continue}}e.external&&(e.sharedDefsExtractedFor=e.external)}let nB=new Set(["type","properties","required","additionalProperties"]),nQ=["oneOf","anyOf"];function nH(e){let t=e.additionalProperties;return void 0===t||!1===t||"object"!=typeof t||null===t?null:Object.keys(t).length?t:null}function nG(e){let t=[];for(let n of e){if("object"!=typeof n||"object"!==n.type)return null;for(let e in n)if(!nB.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??nH(n);null!=t&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Y(n,r,1===e.length?e[0]:nG(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:"object",properties:n};if(r.size&&(i.required=[...r]),t.every(e=>!1===e.additionalProperties))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=nH(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}1===e.length?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function nX(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=t=>{let n=e.seen.get(t);if(null===n.ref)return;let i=n.def??n.schema,o={...i},a=n.ref;if(n.ref=null,a){r(a);let n=e.seen.get(a),s=n.schema;if(s.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(i.allOf=i.allOf??[],i.allOf.push(s)):nJ(i,s),nJ(i,o),t._zod.parent===a)for(let e in i)"$ref"!==e&&"allOf"!==e&&(e in o||delete i[e]);if(s.$ref&&n.def)for(let e in i)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==a){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if("openapi-3.0"!==e.target)for(let t of e.seen.entries())!function e(t){let n=t.anyOf;if(!Array.isArray(n)||0===n.length||void 0!==t.type)return;let r=[];for(let t of n){if(!t||"object"!=typeof t)return;e(t);let n=Object.keys(t);if(1!==n.length||"type"!==n[0])return;let i=t.type;for(let e of Array.isArray(i)?i:[i]){if("string"!=typeof e)return;r.includes(e)||r.push(e)}}delete t.anyOf,t.type=1===r.length?r[0]:r}(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])!function(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of nB)if(t in e)return;let n=t.filter(e=>nQ.some(t=>Array.isArray(e[t]))),r=null;if(n.length){let e=n[0],i=nQ.find(t=>Array.isArray(e[t]));if(1!==Object.keys(e).length)return;let o=t.filter(t=>t!==e),a=e[i].map(e=>nG([...o,e]));if(a.some(e=>!e))return;r={[i]:a}}else r=nG(t);r&&(delete e.allOf,nJ(e,r))}(e)}}let i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}nJ(i,n.defId?n.schema:n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;void 0!==o&&i.id===o&&delete i.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Y(a,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&("draft-2020-12"===e.target?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:nY(t,"input",e.processors),output:nY(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw Error("Error converting schema to JSON.")}}let nY=(e,t,n={})=>r=>{let{libraryOptions:i,target:o}=r??{},a=nV({...i??{},target:o,io:t,processors:n});return nK(e,a),nq(a,e),nX(a,e)},n0={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""};function n1(e){let t=e._zod.def;return"pipe"===t.type&&t.in._zod.traits.has("$ZodTransform")?n1(t.out):"catch"===t.type?n1(t.innerType):e._zod.optin}let n4=new WeakMap,n2=Symbol();function n9(e,t,n,r,i){let o=!1,a=JSON.stringify(e,(e,t)=>"bigint"!=typeof t?t:(o=!0,null));return o?(nL(t,n,r,i,"BigInt defaults cannot be represented in JSON Schema"),n2):JSON.parse(a)}let n5=(e,t,n,r)=>{let i=e._zod.def;nK(i.innerType,t,r),t.seen.get(e).ref=i.innerType},n6=new WeakSet([Object.prototype,Error.prototype]);function n3(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let n7=ex("ZodError",(e,t)=>{tb.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);n6.has(n)||(n6.add(n),n3(n,"format",e=>t=>(function(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>r({issues:e},[...i,...o.path]));else if("invalid_key"===o.code)r({issues:o.issues},[...i,...o.path]);else if("invalid_element"===o.code)r({issues:o.issues},[...i,...o.path]);else{let e=[...i,...o.path];if(0===e.length)n._errors.push(t(o));else{let r=n,i=0;for(;i<e.length;){let n=e[i],a=i===e.length-1;if("_errors"===n){a&&r._errors.push(t(o)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];a&&s._errors.push(t(o)),r=s,i++}}}};return r(e),n})(e,t)),n3(n,"flatten",e=>t=>(function(e,t=e=>e.message){let n={},r=[];for(let a of e.issues)if(a.path.length>0){var i,o;(i=a.path[0],o=()=>[],!Object.prototype.hasOwnProperty.call(n,i)&&("__proto__"===i?Object.defineProperty(n,i,{value:o(),writable:!0,enumerable:!0,configurable:!0}):n[i]=o()),n[i]).push(t(a))}else r.push(t(a));return{formErrors:r,fieldErrors:n}})(e,t)),n3(n,"addIssue",e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,H,2)}),n3(n,"addIssues",e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,H,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return 0===this.issues.length}}))},void 0,{Parent:Error}),n8=tk(n7),re=tS(n7),rt=t$(n7),rn=tx(n7),rr=(o=tk(n7),a=(e,t,n,r)=>o(e,t,n?{...n,direction:"backward"}:{direction:"backward"},tw(a,r))),ri=(s=tk(n7),l=(e,t,n,r)=>s(e,t,n,tw(l,r))),ro=(u=tS(n7),d=async(e,t,n,r)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return await u(e,t,i,tw(d,r))}),ra=(c=tS(n7),p=async(e,t,n,r)=>await c(e,t,n,tw(p,r))),rs=(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return t$(n7)(e,t,r)},rl=(e,t,n)=>t$(n7)(e,t,n),ru=async(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return tx(n7)(e,t,r)},rd=async(e,t,n)=>tx(n7)(e,t,n);function rc(){eT.memoizer||eE({memoizer:eR})}let rp=ex("ZodType",(e,t)=>(eT.localeError||eE({localeError:(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},t={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",credit_card:"credit card number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function r(e,t){return"number"!==e||"number"!=typeof t||Number.isFinite(t)?n[e]??e:String(t)}return n=>{switch(n.code){case"invalid_type":{let e=r(n.expected),t=r(function(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t}(n.input),n.input);return`Invalid input: expected ${e}, received ${t}`}case"invalid_value":if(1===n.values.length)return`Invalid input: expected ${ed(n.values[0])}`;return`Invalid option: expected one of ${Q(n.values,"|")}`;case"too_big":{let t=n.exact?"exactly ":n.inclusive?"<=":"<",r=e[n.origin]??null;if(r)return`Too big: expected ${n.origin??"value"} to have ${t}${n.maximum.toString()} ${r.unit??"elements"}`;return`Too big: expected ${n.origin??"value"} to be ${t}${n.maximum.toString()}`}case"too_small":{let t=n.exact?"exactly ":n.inclusive?">=":">",r=e[n.origin]??null;if(r)return`Too small: expected ${n.origin} to have ${t}${n.minimum.toString()} ${r.unit}`;return`Too small: expected ${n.origin} to be ${t}${n.minimum.toString()}`}case"invalid_format":if("starts_with"===n.format)return`Invalid string: must start with "${n.prefix}"`;if("ends_with"===n.format)return`Invalid string: must end with "${n.suffix}"`;if("includes"===n.format)return`Invalid string: must include "${n.includes}"`;if("regex"===n.format)return`Invalid string: must match pattern ${n.pattern}`;return`Invalid ${t[n.format]??n.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":if(n.options&&Array.isArray(n.options)&&n.options.length>0){let e=n.options.map(e=>`'${e}'`).join(" | ");return`Invalid discriminator value. Expected ${e}`}if(!1===n.inclusive)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}})()}),tT.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ee(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return el(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new id({type:"custom",check:"custom",fn:e,...eu(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var n;let r,i;return n=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(eb(e,t.value,r._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),"input"in e||(e.input=t.value),e.inst??(e.inst=r),e.continue??(e.continue=!r._zod.def.abort),t.issues.push(eb(e)))},e(t.value,t)),(i=new tt({check:"custom",...eu(t)}))._zod.check=n,r=i}(e,t))},overwrite(e){return this.check(nU(e))},optional(){return r7(this)},exactOptional(){var e;return e=this,new r8({type:"optional",innerType:e})},nullable(){return it(this)},nullish(){return r7(it(this))},nonoptional(e){var t;return t=this,new io({type:"nonoptional",innerType:t,...eu(e)})},array(){return rq(this)},or(e){return rG([this,e])},and(e){var t;return t=this,new r0({type:"intersection",left:t,right:e})},transform(e){return il(this,new r6({type:"transform",transform:e}))},default(e){var t,n;return t=this,n=e,new ir({type:"default",innerType:t,get defaultValue(){return"function"==typeof n?n():eo(n)}})},prefault(e){var t,n;return t=this,n=e,new ii({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof n?n():eo(n)}})},catch(e){return function(e,t){let n;return new ia({type:"catch",innerType:e,catchValue:"function"==typeof t?t:((n=()=>t)["~constantCatch"]=!0,n)})}(this,e)},pipe(e){return il(this,e)},readonly(){var e;return e=this,new iu({type:"readonly",innerType:e})},describe(e){let t=this.clone();return nD.add(t,{description:e}),t},meta(...e){if(0===e.length)return nD.get(this);let t=this.clone();return nD.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return 0===t.length?e(this):e(this,...t)},get"~standard"(){return ez(this,"~standard",{...tA(this),jsonSchema:{input:nY(this,"input"),output:nY(this,"output")}},!1)},set"~standard"(value){ez(this,"~standard",value)},parse:function e(t,n){return n8(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await re(this,t,n,{callee:e})},safeParse(e,t){return rt(this,e,t)},async safeParseAsync(e,t){return rn(this,e,t)},get spa(){return this?.safeParseAsync},set spa(value){ez(this,"spa",value)},encode:function e(t,n){return rr(this,t,n,{callee:e})},decode:function e(t,n){return ri(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await ro(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await ra(this,t,n,{callee:e})},safeEncode(e,t){return rs(this,e,t)},safeDecode(e,t){return rl(this,e,t)},async safeEncodeAsync(e,t){return ru(this,e,t)},async safeDecodeAsync(e,t){return rd(this,e,t)},toJSONSchema(e){return((e,t={})=>n=>{let r=nV({...n,processors:t});return nK(e,r),nq(r,e),nX(r,e)})(this,{})(e)},get description(){return nD.get(this)?.description},get _def(){return this._zod.def}}),rf=ex("_ZodString",(e,t)=>{tZ.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{n.type="string";let{minimum:r,maximum:i,format:o,patterns:a,contentEncoding:s,laxFormat:l}=e._zod.bag;if("number"==typeof r&&(n.minLength=r),"number"==typeof i&&(n.maxLength=i),o&&(n.format=n0[o]??o,""===n.format&&delete n.format,("time"===o||l)&&delete n.format),s&&(n.contentEncoding=s),a&&a.size>0){let e=[...a];1===e.length?n.pattern=e[0].source:e.length>1&&(n.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null},{regex(...e){return this.check(function(e,t){return new ts({check:"string_format",format:"regex",...eu(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new td({check:"string_format",format:"includes",...eu(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new tc({check:"string_format",format:"starts_with",...eu(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new tp({check:"string_format",format:"ends_with",...eu(t),suffix:e})}(...e))},min(...e){return this.check(nF(...e))},max(...e){return this.check(nR(...e))},length(...e){return this.check(nC(...e))},nonempty(...e){return this.check(nF(1,...e))},lowercase(e){return this.check(new tl({check:"string_format",format:"lowercase",...eu(e)}))},uppercase(e){return this.check(new tu({check:"string_format",format:"uppercase",...eu(e)}))},trim(){return this.check(nU(e=>e.trim()))},normalize(...e){return this.check(function(e){return nU(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(nU(e=>e.toLowerCase()))},toUpperCase(){return this.check(nU(e=>e.toUpperCase()))},slugify(){return this.check(nU(e=>e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")))}}),rh=ex("ZodString",(e,t)=>{tZ.init(e,t),rf.init(e,t)},{email(e){return this.check(new rz({type:"string",format:"email",check:"string_format",abort:!1,...eu(e)}))},url(e){return this.check(new rS({type:"string",format:"url",check:"string_format",abort:!1,...eu(e)}))},jwt(e){return this.check(new rF({type:"string",format:"jwt",check:"string_format",abort:!1,...eu(e)}))},emoji(e){return this.check(new r$({type:"string",format:"emoji",check:"string_format",abort:!1,...eu(e)}))},guid(e){return this.check(new rw({type:"string",format:"guid",check:"string_format",abort:!1,...eu(e)}))},uuid(e){return this.check(new rk({type:"string",format:"uuid",check:"string_format",abort:!1,...eu(e)}))},uuidv4(e){return this.check(new rk({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...eu(e)}))},uuidv6(e){return this.check(new rk({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...eu(e)}))},uuidv7(e){return this.check(new rk({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...eu(e)}))},nanoid(e){return this.check(new rO({type:"string",format:"nanoid",check:"string_format",abort:!1,...eu(e)}))},cuid(e){return this.check(new rx({type:"string",format:"cuid",check:"string_format",abort:!1,...eu(e)}))},cuid2(e){return this.check(new rP({type:"string",format:"cuid2",check:"string_format",abort:!1,...eu(e)}))},ulid(e){return this.check(new rj({type:"string",format:"ulid",check:"string_format",abort:!1,...eu(e)}))},base64(e){return this.check(new rN({type:"string",format:"base64",check:"string_format",abort:!1,...eu(e)}))},base64url(e){return this.check(new rD({type:"string",format:"base64url",check:"string_format",abort:!1,...eu(e)}))},xid(e){return this.check(new rT({type:"string",format:"xid",check:"string_format",abort:!1,...eu(e)}))},ksuid(e){return this.check(new rE({type:"string",format:"ksuid",check:"string_format",abort:!1,...eu(e)}))},ipv4(e){return this.check(new rA({type:"string",format:"ipv4",check:"string_format",abort:!1,...eu(e)}))},ipv6(e){return this.check(new rZ({type:"string",format:"ipv6",check:"string_format",abort:!1,...eu(e)}))},cidrv4(e){return this.check(new rI({type:"string",format:"cidrv4",check:"string_format",abort:!1,...eu(e)}))},cidrv6(e){return this.check(new rM({type:"string",format:"cidrv6",check:"string_format",abort:!1,...eu(e)}))},e164(e){return this.check(new rR({type:"string",format:"e164",check:"string_format",abort:!1,...eu(e)}))},datetime(e){return this.check(new rg({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...eu(e)}))},date(e){return this.check(new rv({type:"string",format:"date",check:"string_format",...eu(e)}))},time(e){return this.check(new r_({type:"string",format:"time",check:"string_format",precision:null,...eu(e)}))},duration(e){return this.check(new rb({type:"string",format:"duration",check:"string_format",...eu(e)}))}});function rm(e){return new rh({type:"string",...eu(e)})}let ry=ex("ZodStringFormat",(e,t)=>{tI.init(e,t),rf.init(e,t)}),rg=ex("ZodISODateTime",(e,t)=>{tq.init(e,t),ry.init(e,t)}),rv=ex("ZodISODate",(e,t)=>{tB.init(e,t),ry.init(e,t)}),r_=ex("ZodISOTime",(e,t)=>{tQ.init(e,t),ry.init(e,t)}),rb=ex("ZodISODuration",(e,t)=>{tH.init(e,t),ry.init(e,t)}),rz=ex("ZodEmail",(e,t)=>{tD.init(e,t),ry.init(e,t)}),rw=ex("ZodGUID",(e,t)=>{tM.init(e,t),ry.init(e,t)}),rk=ex("ZodUUID",(e,t)=>{tN.init(e,t),ry.init(e,t)}),rS=ex("ZodURL",(e,t)=>{tF.init(e,t),ry.init(e,t)}),r$=ex("ZodEmoji",(e,t)=>{tC.init(e,t),ry.init(e,t)}),rO=ex("ZodNanoID",(e,t)=>{tU.init(e,t),ry.init(e,t)}),rx=ex("ZodCUID",(e,t)=>{tJ.init(e,t),ry.init(e,t)}),rP=ex("ZodCUID2",(e,t)=>{tV.init(e,t),ry.init(e,t)}),rj=ex("ZodULID",(e,t)=>{tL.init(e,t),ry.init(e,t)}),rT=ex("ZodXID",(e,t)=>{tK.init(e,t),ry.init(e,t)}),rE=ex("ZodKSUID",(e,t)=>{tW.init(e,t),ry.init(e,t)}),rA=ex("ZodIPv4",(e,t)=>{tG.init(e,t),ry.init(e,t)}),rZ=ex("ZodIPv6",(e,t)=>{t0.init(e,t),ry.init(e,t)}),rI=ex("ZodCIDRv4",(e,t)=>{t1.init(e,t),ry.init(e,t)}),rM=ex("ZodCIDRv6",(e,t)=>{t4.init(e,t),ry.init(e,t)}),rN=ex("ZodBase64",(e,t)=>{t9.init(e,t),ry.init(e,t)}),rD=ex("ZodBase64URL",(e,t)=>{t5.init(e,t),ry.init(e,t)}),rR=ex("ZodE164",(e,t)=>{t6.init(e,t),ry.init(e,t)}),rF=ex("ZodJWT",(e,t)=>{t3.init(e,t),ry.init(e,t)}),rC=ex("ZodBoolean",(e,t)=>{t7.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.type="boolean"}});function rU(e){return new rC({type:"boolean",...eu(e)})}let rJ=ex("ZodAny",(e,t)=>{t8.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0}),rV=ex("ZodUnknown",(e,t)=>{ne.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function rL(){return new rV({type:"unknown"})}let rK=ex("ZodNever",(e,t)=>{nt.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.not={}}}),rW=ex("ZodArray",(e,t)=>{rc(),nr.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def,{minimum:o,maximum:a}=e._zod.bag;"number"==typeof o&&(n.minItems=o),"number"==typeof a&&(n.maxItems=a),n.type="array",n.items=nK(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element},{min(e,t){return this.check(nF(e,t))},nonempty(e){return this.check(nF(1,e))},max(e,t){return this.check(nR(e,t))},length(e,t){return this.check(nC(e,t))},unwrap(){return this.element}});function rq(e,t){return new rW({type:"array",element:e,...eu(t)})}let rB=ex("ZodObject",(e,t)=>{var n;let r,i;rc(),nd.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def,o=i.shape;if(Object.getOwnPropertySymbols(o).length&&nL(e,t,n,r,"Symbol keys cannot be represented in JSON Schema"))return;for(let e in n.type="object",n.properties={},o)Y(n.properties,e,nK(o[e],t,{...r,path:[...r.path,"properties",e]}));let a=new Set([...new Set(Object.keys(o))].filter(e=>{let n=i.shape[e];return"input"===t.io?void 0===n1(n):void 0===n._zod.optout}));a.size>0&&(n.required=Array.from(a)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=nK(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(n.additionalProperties=!1)})(e,t,n,r),n="shape",(i=n in(r=Object.getPrototypeOf(e))?void 0:r)&&Object.defineProperty(i,n,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:!1,value:void 0};return Object.defineProperty(this,n,e),e.value=(e=>e._zod.def.shape)(this),Object.defineProperty(this,n,e),e.value},set(e){Object.defineProperty(this,n,{configurable:!0,writable:!0,enumerable:!1,value:e})}})},{keyof(){return r2(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:rL()})},loose(){return this.clone({...this._zod.def,catchall:rL()})},strict(){return this.clone({...this._zod.def,catchall:new rK({type:"never",...eu(void 0)})})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return function(e,t){if(!ei(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e of Reflect.ownKeys(t))if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=ee(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Y(this,"shape",n),n}});return el(e,r)}(this,e)},safeExtend(e){var t=this;if(!ei(e))throw Error("Invalid input to safeExtend: expected a plain object");let n=ee(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return Y(this,"shape",n),n}});return el(t,n)},merge(e){var t=this;if(!e?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(t._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=ee(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return Y(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return el(t,n)},pick(e){return function(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i=ee(e._zod.def,{get shape(){let e={};for(let r of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,r))throw Error(`Unrecognized key: "${String(r)}"`);t[r]&&Y(e,r,n.shape[r])}return Y(this,"shape",e),e},checks:[]});return el(e,i)}(this,e)},omit(e){return function(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=ee(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,e))throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&delete r[e]}return Y(this,"shape",r),r},checks:[]});return el(e,i)}(this,e)},partial(...e){return ec(r3,this,e[0])},exactPartial(...e){return ec(r8,this,e[0],"exactPartial")},required(...e){var t,n;let r;return t=this,n=e[0],r=ee(t._zod.def,{get shape(){let e=t._zod.def.shape,r={...e};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(r,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(r[t]=new io({type:"nonoptional",innerType:e[t]}))}else for(let t of Reflect.ownKeys(e))r[t]=new io({type:"nonoptional",innerType:e[t]});return Y(this,"shape",r),r}}),el(t,r)}});function rQ(e,t){return new rB({type:"object",shape:e??{},...eu(t)})}let rH=ex("ZodUnion",(e,t)=>{np.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a;return o=!1===(i=e._zod.def).inclusive,a=i.options.map((e,n)=>nK(e,t,{...r,path:[...r.path,o?"oneOf":"anyOf",n]})),void(o?n.oneOf=a:n.anyOf=a)},e.options=t.options});function rG(e,t){return new rH({type:"union",options:e,...eu(t)})}let rX=ex("ZodDiscriminatedUnion",(e,t)=>{rH.init(e,t),nf.init(e,t)});function rY(e,t,n){return new rX({type:"union",options:t,discriminator:e,...eu(n)})}let r0=ex("ZodIntersection",(e,t)=>{nh.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a,s,l;return o=nK((i=e._zod.def).left,t,{...r,path:[...r.path,"allOf",0]}),a=nK(i.right,t,{...r,path:[...r.path,"allOf",1]}),void(n.allOf=l=[...(s=e=>"allOf"in e&&1===Object.keys(e).length)(o)?o.allOf:[o],...s(a)?a.allOf:[a]],t.intersections.push(l))}}),r1=ex("ZodRecord",(e,t)=>{rc(),ny.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;n.type="object";let o=i.keyType,a=o._zod.bag,s=a?.patterns;if("loose"===i.mode&&s&&s.size>0){let e=nK(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});for(let t of(n.patternProperties={},s))Y(n.patternProperties,t.source,e)}else{if("draft-07"===t.target||"draft-2020-12"===t.target){n.propertyNames=nK(i.keyType,t,{...r,path:[...r.path,"propertyNames"]});let o=n4.get(t);o||(o=[],n4.set(t,o),t.deferred.push(()=>(function(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of n4.get(e)??[]){let i=e.seen.get(r),o=(i?.def??i?.schema)?.propertyNames;if(!o||!0===o||n.has(o))continue;let a=function e(t,n,r){if(n.$ref){if(r.has(n))return n;r.add(n);let i=t.get(n)?.def;if(!i)return n;let o=e(t,i,r);return o===i?n:o}for(let i of["anyOf","oneOf"]){let o=n[i];if(!Array.isArray(o))continue;let a=o.map(n=>e(t,n,r));a.some((e,t)=>e!==o[t])&&(n={...n,[i]:a})}let i=Array.isArray(n.type)?n.type:[n.type],o=!i.includes("string")&&i.some(e=>"number"===e||"integer"===e),a=n.enum??(void 0!==n.const?[n.const]:void 0);if(!o&&!a?.some(e=>"number"==typeof e))return n;let{minimum:s,maximum:l,exclusiveMinimum:u,exclusiveMaximum:d,multipleOf:c,format:p,id:f,...h}=n;return h.enum?h.enum=h.enum.map(e=>"number"==typeof e?String(e):e):"number"==typeof h.const&&(h.const=String(h.const)),o&&(h.type="string",a||(h.pattern=(i.includes("number")?e3:e6).source)),h}(t,o,new Set);a!==o&&n.set(o,a)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}})(t))),o.push(e)}n.additionalProperties=nK(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let l=o._zod.values,u="input"===t.io&&void 0!==n1(i.valueType);if(l&&!i.partial&&!u){let e=[...l].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(n.required=e.map(String))}})(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType}),r4=ex("ZodEnum",(e,t)=>{ng.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t)=>{let n=B(e._zod.def.entries);if(0===n.length){t.not={};return}n.every(e=>"number"==typeof e)&&(t.type="number"),n.every(e=>"string"==typeof e)&&(t.type="string"),t.enum=n})(e,n),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new r4({...t,checks:[],...eu(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new r4({...t,checks:[],...eu(r),entries:i})}});function r2(e,t){return new r4({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...eu(t)})}let r9=ex("ZodLiteral",(e,t)=>{nv.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;if(0===i.values.length){n.not={};return}let o=[];for(let a of i.values)if(void 0===a){if(nL(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if("bigint"==typeof a){if(nL(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(a))}else o.push(a);if(0===o.length);else if(1===o.length){let e=o[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else o.every(e=>"number"==typeof e)&&(n.type="number"),o.every(e=>"string"==typeof e)&&(n.type="string"),o.every(e=>"boolean"==typeof e)&&(n.type="boolean"),o.every(e=>null===e)&&(n.type="null"),n.enum=o})(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function r5(e,t){return new r9({type:"literal",values:Array.isArray(e)?e:[e],...eu(t)})}let r6=ex("ZodTransform",(e,t)=>{rc(),n_.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{nL(e,t,n,r,"Transforms cannot be represented in JSON Schema")},e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new ej(e.constructor.name);n.addIssue=r=>{"string"==typeof r?n.issues.push(eb(r,n.value,t)):(r.fatal&&(r.continue=!1),r.code??(r.code="custom"),"input"in r||(r.input=n.value),r.inst??(r.inst=e),n.issues.push(eb(r)))};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}}),r3=ex("ZodOptional",(e,t)=>{nz.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>n5(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function r7(e){return new r3({type:"optional",innerType:e})}let r8=ex("ZodExactOptional",(e,t)=>{nw.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>n5(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),ie=ex("ZodNullable",(e,t)=>{nk.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a;return o=nK((i=e._zod.def).innerType,t,r),a=t.seen.get(e),void("openapi-3.0"===t.target?(a.ref=i.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function it(e){return new ie({type:"nullable",innerType:e})}let ir=ex("ZodDefault",(e,t)=>{nS.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o;return nK((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,void((o=n9(i.defaultValue,e,t,n,r))!==n2&&(n.default=o))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),ii=ex("ZodPrefault",(e,t)=>{nO.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;if(nK(i.innerType,t,r),t.seen.get(e).ref=i.innerType,"input"!==t.io)return;let o=n9(i.defaultValue,e,t,n,r);o!==n2&&(n._prefault=o)})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),io=ex("ZodNonOptional",(e,t)=>{nx.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;nK((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType},e.unwrap=()=>e._zod.def.innerType}),ia=ex("ZodCatch",(e,t)=>{nT.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i,o=e._zod.def;nK(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{i=o.catchValue(void 0)}catch{nL(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),is=ex("ZodPipe",(e,t)=>{nE.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a;return o=(i=e._zod.def).in._zod.traits.has("$ZodTransform"),void(nK(a="input"===t.io?o?i.out:i.in:i.out,t,r),t.seen.get(e).ref=a)},e.in=t.in,e.out=t.out});function il(e,t){return new is({type:"pipe",in:e,out:t})}let iu=ex("ZodReadonly",(e,t)=>{nZ.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;nK((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,n.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),id=ex("ZodCustom",(e,t)=>{nM.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{nL(e,t,n,r,"Custom types cannot be represented in JSON Schema")}}),ic=rQ({version:rm().optional(),registry:rm().optional()}),ip=rQ({kind:rm().min(1,"Required"),metadata:ic.optional(),spec:(f=rm(),new r1((h=new rJ({type:"any"}),h._zod)?{type:"record",keyType:f,valueType:h,...eu(void 0)}:{type:"record",keyType:rm(),valueType:f,...eu(h)}))}),ih=rQ({name:rm(),description:rm().optional(),hidden:rU().optional(),color:rm().optional()});function im(e){return rQ({display:ih,plugin:e})}let iy=rQ({display:ih,plugin:ip}),ig=rQ({name:rm().optional(),description:rm().optional()}),iv=rQ({display:ig.optional(),default:rU(),plugin:ip});function i_(e){return rQ({display:ig.optional(),default:rU(),plugin:e})}let ib=rm().min(1,"Required").regex(x,"Must be a valid duration string"),iz=rQ({name:rm().optional(),description:rm().optional()}),iw=rQ({kind:rm().min(1),spec:rQ({name:rm().optional(),plugin:ip})}),ik=rQ({name:rm().optional(),url:rm().min(1),tooltip:rm().optional(),renderVariables:rU().optional(),targetBlank:rU().optional()}),iS=rQ({display:iz.optional(),plugin:ip,queries:rq(iw).optional(),links:rq(ik).optional(),annotations:rq(iy).optional()});function i$(e){return rQ({display:iz.optional(),plugin:e,queries:rq(iw).optional(),links:rq(ik).optional(),annotations:rq(iy).optional()})}let iO=rQ({kind:r5("Panel"),spec:iS});function ix(e){return rQ({kind:r5("Panel"),spec:i$(e)})}let iP=rQ({name:rm().optional(),description:rm().optional(),hidden:rU().optional()}),ij=rQ({name:rm().min(1),display:iP.optional(),defaultValue:rm().or(rq(rm())).optional(),allowAllValue:rU(),allowMultiple:rU(),customAllValue:rm().optional(),capturingRegexp:rm().optional(),sort:r2(["none","alphabetical-asc","alphabetical-desc","numerical-asc","numerical-desc","alphabetical-ci-asc","alphabetical-ci-desc"]).optional(),plugin:ip});function iT(e){return rQ({name:rm().min(1),display:iP.optional(),defaultValue:rm().or(rq(rm())).optional(),allowAllValue:rU(),allowMultiple:rU(),customAllValue:rm().optional(),capturingRegexp:rm().optional(),sort:r2(["none","alphabetical-asc","alphabetical-desc","numerical-asc","numerical-desc","alphabetical-ci-asc","alphabetical-ci-desc"]).optional(),plugin:e})}let iE=rQ({kind:r5("ListVariable"),spec:ij});function iA(e){return rQ({kind:r5("ListVariable"),spec:iT(e)})}let iZ=rQ({name:rm().min(1),display:iP.optional(),value:rm(),constant:rU().optional()}),iI=rQ({kind:r5("TextVariable"),spec:iZ}),iM=rY("kind",[iI,iE]);function iN(e){return rG([iI,iA(e)])}let iD=iM;function iR(e){return rY("kind",[rQ({kind:r5("ListVariable"),spec:iT(e)}),rQ({kind:r5("TextVariable"),spec:iZ})])}}}]);
|