eve 0.11.4 → 0.11.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +1 -1
  3. package/dist/src/cli/banner.d.ts +0 -1
  4. package/dist/src/cli/banner.js +1 -1
  5. package/dist/src/cli/commands/init.js +1 -1
  6. package/dist/src/cli/dev/tui/agent-header.js +1 -1
  7. package/dist/src/compiled/.vendor-stamp.json +1 -1
  8. package/dist/src/compiled/@ai-sdk/anthropic/index.js +1 -1
  9. package/dist/src/compiled/@ai-sdk/google/index.js +1 -1
  10. package/dist/src/compiled/@ai-sdk/mcp/index.js +1 -1
  11. package/dist/src/compiled/@ai-sdk/openai/index.js +1 -1
  12. package/dist/src/compiled/@ai-sdk/otel/index.js +1 -1
  13. package/dist/src/compiled/@workflow/core/capabilities.d.ts +3 -0
  14. package/dist/src/compiled/@workflow/core/index.js +2 -2
  15. package/dist/src/compiled/@workflow/core/private.js +1 -1
  16. package/dist/src/compiled/@workflow/core/runtime/start.d.ts +11 -1
  17. package/dist/src/compiled/@workflow/core/runtime/step-executor.d.ts +6 -0
  18. package/dist/src/compiled/@workflow/core/runtime.js +19 -19
  19. package/dist/src/compiled/@workflow/core/serialization/codec.d.ts +16 -0
  20. package/dist/src/compiled/@workflow/core/serialization/compression.d.ts +104 -0
  21. package/dist/src/compiled/@workflow/core/serialization/index.d.ts +7 -6
  22. package/dist/src/compiled/@workflow/core/serialization/types.d.ts +4 -0
  23. package/dist/src/compiled/@workflow/core/serialization-format.d.ts +15 -0
  24. package/dist/src/compiled/@workflow/core/serialization.d.ts +8 -7
  25. package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +24 -0
  26. package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
  27. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  28. package/dist/src/compiled/@workflow/errors/index.js +1 -1
  29. package/dist/src/compiled/_chunks/workflow/{attribute-changes-Db-CKuLh.js → attribute-changes-Bi5DLT8S.js} +11 -11
  30. package/dist/src/compiled/_chunks/workflow/chunk-BHKSVoKr.js +1 -0
  31. package/dist/src/compiled/_chunks/workflow/coerce-B-Ro4Nfe.js +1 -0
  32. package/dist/src/compiled/_chunks/workflow/{compat-CG1hDp-3.js → compat-DLpWymPP.js} +1 -1
  33. package/dist/src/compiled/_chunks/workflow/{core-5Woff_dW.js → core-CXJbIkCL.js} +1 -1
  34. package/dist/src/compiled/_chunks/workflow/{dist-DhA2lbtB.js → dist-DTchiX0N.js} +1 -1
  35. package/dist/src/compiled/_chunks/workflow/{dist-DvHFhSJM.js → dist-Dxrjttr2.js} +1 -1
  36. package/dist/src/compiled/_chunks/workflow/{dist-aOKD_2KN.js → dist-FLIfyJ4Y.js} +1 -1
  37. package/dist/src/compiled/_chunks/workflow/{functions-DuPjIvMH.js → functions-CnVBREsg.js} +1 -1
  38. package/dist/src/compiled/_chunks/workflow/resume-hook-CKTw-lb5.js +1 -0
  39. package/dist/src/compiled/_chunks/workflow/run-XM8dTRAo.js +1 -0
  40. package/dist/src/compiled/_chunks/workflow/{schemas-DWOIBELG.js → schemas-iG9Z4s4o.js} +1 -1
  41. package/dist/src/compiled/_chunks/workflow/{sleep-BG6X2Bli.js → sleep-DPjVkRY-.js} +1 -1
  42. package/dist/src/compiled/_chunks/workflow/{src-B54rYDvB.js → src-CQuMexnO.js} +1 -1
  43. package/dist/src/compiled/_chunks/workflow/{token-CcaAeZHd.js → token-Bm-WLAUB.js} +1 -1
  44. package/dist/src/compiled/_chunks/workflow/{token-nK4u-N7w.js → token-J7YP0s9a.js} +1 -1
  45. package/dist/src/compiled/_chunks/workflow/wrapper-CQmdlFyy.js +6 -0
  46. package/dist/src/compiled/jose/index.js +1 -1
  47. package/dist/src/compiled/zod/index.js +1 -1
  48. package/dist/src/compiled/zod-validation-error/index.js +1 -1
  49. package/dist/src/execution/workflow-entry.js +1 -1
  50. package/dist/src/internal/application/package.js +1 -1
  51. package/dist/src/internal/nitro/host/start-development-server.js +2 -2
  52. package/dist/src/internal/nitro/host/vercel-build-prewarm.js +1 -1
  53. package/dist/src/public/channels/slack/defaults.js +1 -1
  54. package/dist/src/public/channels/slack/slackChannel.d.ts +9 -0
  55. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  56. package/dist/src/public/definitions/defineChannel.d.ts +2 -0
  57. package/dist/src/public/definitions/defineChannel.js +1 -1
  58. package/dist/src/setup/package-manager.d.ts +1 -1
  59. package/dist/src/setup/package-manager.js +1 -1
  60. package/dist/src/setup/scaffold/create/project.js +1 -1
  61. package/docs/agent-config.md +7 -1
  62. package/docs/channels/eve.mdx +1 -1
  63. package/docs/channels/slack.mdx +1 -1
  64. package/docs/concepts/execution-model-and-durability.md +6 -0
  65. package/docs/getting-started.mdx +2 -2
  66. package/docs/guides/auth-and-route-protection.md +5 -1
  67. package/docs/guides/deployment.md +84 -14
  68. package/docs/guides/instrumentation.md +7 -7
  69. package/docs/reference/cli.md +1 -1
  70. package/docs/sandbox.mdx +1 -1
  71. package/docs/schedules.mdx +7 -1
  72. package/docs/tutorial/first-agent.mdx +1 -1
  73. package/package.json +3 -3
  74. package/dist/src/compiled/_chunks/workflow/chunk-DSjMdhoD.js +0 -1
  75. package/dist/src/compiled/_chunks/workflow/coerce-BTuSKQr5.js +0 -1
  76. package/dist/src/compiled/_chunks/workflow/resume-hook-Uk1RAmYo.js +0 -1
  77. package/dist/src/compiled/_chunks/workflow/run-AA-FTD_U.js +0 -1
@@ -0,0 +1 @@
1
+ import{createRequire as e}from"node:module";var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(e&&(t=e(e=0)),t),c=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),l=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},u=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},d=(e,r,i)=>(i=e==null?{}:t(a(e)),u(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),f=e(import.meta.url);export{d as a,f as i,s as n,l as r,c as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-BHKSVoKr.js";import{$ as t,et as n,nt as r,rt as i,tt as a}from"./core-CXJbIkCL.js";import{$ as o,H as s,a as c,g as l,s as u}from"./schemas-iG9Z4s4o.js";var d=e({bigint:()=>h,boolean:()=>m,date:()=>g,number:()=>p,string:()=>f});function f(e){return i(o,e)}function p(e){return r(s,e)}function m(e){return n(u,e)}function h(e){return t(c,e)}function g(e){return a(l,e)}export{p as n,d as t};
@@ -1 +1 @@
1
- import{Vi as e}from"./core-5Woff_dW.js";const t={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`};function n(t){e({customError:t})}function r(){return e().customError}var i;i||={};export{n as i,t as n,r,i as t};
1
+ import{Vi as e}from"./core-CXJbIkCL.js";const t={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`};function n(t){e({customError:t})}function r(){return e().customError}var i;i||={};export{n as i,t as n,r,i as t};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./chunk-DSjMdhoD.js";var t;const n=Object.freeze({status:`aborted`});function r(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}const i=Symbol(`zod_brand`);var a=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},o=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(t=globalThis).__zod_globalConfig??(t.__zod_globalConfig={});const s=globalThis.__zod_globalConfig;function c(e){return e&&Object.assign(s,e),s}var l=e({BIGINT_FORMAT_RANGES:()=>Ce,Class:()=>Ve,NUMBER_FORMAT_RANGES:()=>Se,aborted:()=>E,allowsEval:()=>me,assert:()=>ee,assertEqual:()=>u,assertIs:()=>f,assertNever:()=>p,assertNotEqual:()=>d,assignProp:()=>v,base64ToUint8Array:()=>Fe,base64urlToUint8Array:()=>Le,cached:()=>h,captureStackTrace:()=>pe,cleanEnum:()=>Pe,cleanRegex:()=>re,clone:()=>C,cloneDef:()=>se,createTransparentProxy:()=>be,defineLazy:()=>_,esc:()=>de,escapeRegex:()=>S,explicitlyAborted:()=>je,extend:()=>Ee,finalizeIssue:()=>k,floatSafeRemainder:()=>ie,getElementAtPath:()=>ce,getEnumValues:()=>te,getLengthableOrigin:()=>Ne,getParsedType:()=>_e,getSizableOrigin:()=>Me,hexToUint8Array:()=>ze,isObject:()=>b,isPlainObject:()=>x,issue:()=>j,joinValues:()=>m,jsonStringifyReplacer:()=>ne,merge:()=>Oe,mergeDefs:()=>y,normalizeParams:()=>w,nullish:()=>g,numKeys:()=>ge,objectClone:()=>oe,omit:()=>Te,optionalKeys:()=>xe,parsedType:()=>A,partial:()=>ke,pick:()=>we,prefixIssues:()=>D,primitiveTypes:()=>ye,promiseAllObject:()=>le,propertyKeyTypes:()=>ve,randomString:()=>ue,required:()=>Ae,safeExtend:()=>De,shallowClone:()=>he,slugify:()=>fe,stringifyPrimitive:()=>T,uint8ArrayToBase64:()=>Ie,uint8ArrayToBase64url:()=>Re,uint8ArrayToHex:()=>Be,unwrapMessage:()=>O});function u(e){return e}function d(e){return e}function f(e){}function p(e){throw Error(`Unexpected value in exhaustive check`)}function ee(e){}function te(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function m(e,t=`|`){return e.map(e=>T(e)).join(t)}function ne(e,t){return typeof t==`bigint`?t.toString():t}function h(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function g(e){return e==null}function re(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ie(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}const ae=Symbol(`evaluating`);function _(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ae)return r===void 0&&(r=ae,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function oe(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function v(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function y(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function se(e){return y(e._zod.def)}function ce(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function le(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function ue(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function de(e){return JSON.stringify(e)}function fe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const pe=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function b(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const me=h(()=>{if(s.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function x(e){if(b(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(b(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function he(e){return x(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function ge(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}const _e=e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},ve=new Set([`string`,`number`,`symbol`]),ye=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function S(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function C(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function w(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function be(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function T(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function xe(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const Se={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Ce={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function we(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`);return C(e,y(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return v(this,`shape`,e),e},checks:[]}))}function Te(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`);return C(e,y(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return v(this,`shape`,r),r},checks:[]}))}function Ee(e,t){if(!x(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 in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return C(e,y(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return v(this,`shape`,n),n}}))}function De(e,t){if(!x(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return C(e,y(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return v(this,`shape`,n),n}}))}function Oe(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return C(e,y(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return v(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function ke(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return C(t,y(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return v(this,`shape`,i),i},checks:[]}))}function Ae(e,t,n){return C(t,y(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return v(this,`shape`,i),i}}))}function E(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function je(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function D(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function O(e){return typeof e==`string`?e:e?.message}function k(e,t,n){let r=e.message?e.message:O(e.inst?._zod.def?.error?.(e))??O(t?.error?.(e))??O(n.customError?.(e))??O(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function Me(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function Ne(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function A(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function j(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Pe(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Fe(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function Ie(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Le(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return Fe(t+`=`.repeat((4-t.length%4)%4))}function Re(e){return Ie(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function ze(e){let t=e.replace(/^0x/,``);if(t.length%2!=0)throw Error(`Invalid hex string length`);let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function Be(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var Ve=class{constructor(...e){}};const He=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ne,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ue=r(`$ZodError`,He),M=r(`$ZodError`,He,{Parent:Error});function We(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ge(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}function Ke(e,t=e=>e.message){let n={errors:[]},r=(e,i=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>r({issues:e},[...i,...s.path]));else if(s.code===`invalid_key`)r({issues:s.issues},[...i,...s.path]);else if(s.code===`invalid_element`)r({issues:s.issues},[...i,...s.path]);else{let e=[...i,...s.path];if(e.length===0){n.errors.push(t(s));continue}let r=n,c=0;for(;c<e.length;){let n=e[c],i=c===e.length-1;typeof n==`string`?(r.properties??={},(a=r.properties)[n]??(a[n]={errors:[]}),r=r.properties[n]):(r.items??=[],(o=r.items)[n]??(o[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(s)),c++}}};return r(e),n}function qe(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function Je(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${qe(e.path)}`);return t.join(`
1
+ import{r as e}from"./chunk-BHKSVoKr.js";var t;const n=Object.freeze({status:`aborted`});function r(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}const i=Symbol(`zod_brand`);var a=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},o=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(t=globalThis).__zod_globalConfig??(t.__zod_globalConfig={});const s=globalThis.__zod_globalConfig;function c(e){return e&&Object.assign(s,e),s}var l=e({BIGINT_FORMAT_RANGES:()=>Ce,Class:()=>Ve,NUMBER_FORMAT_RANGES:()=>Se,aborted:()=>E,allowsEval:()=>me,assert:()=>ee,assertEqual:()=>u,assertIs:()=>f,assertNever:()=>p,assertNotEqual:()=>d,assignProp:()=>v,base64ToUint8Array:()=>Fe,base64urlToUint8Array:()=>Le,cached:()=>h,captureStackTrace:()=>pe,cleanEnum:()=>Pe,cleanRegex:()=>re,clone:()=>C,cloneDef:()=>se,createTransparentProxy:()=>be,defineLazy:()=>_,esc:()=>de,escapeRegex:()=>S,explicitlyAborted:()=>je,extend:()=>Ee,finalizeIssue:()=>k,floatSafeRemainder:()=>ie,getElementAtPath:()=>ce,getEnumValues:()=>te,getLengthableOrigin:()=>Ne,getParsedType:()=>_e,getSizableOrigin:()=>Me,hexToUint8Array:()=>ze,isObject:()=>b,isPlainObject:()=>x,issue:()=>j,joinValues:()=>m,jsonStringifyReplacer:()=>ne,merge:()=>Oe,mergeDefs:()=>y,normalizeParams:()=>w,nullish:()=>g,numKeys:()=>ge,objectClone:()=>oe,omit:()=>Te,optionalKeys:()=>xe,parsedType:()=>A,partial:()=>ke,pick:()=>we,prefixIssues:()=>D,primitiveTypes:()=>ye,promiseAllObject:()=>le,propertyKeyTypes:()=>ve,randomString:()=>ue,required:()=>Ae,safeExtend:()=>De,shallowClone:()=>he,slugify:()=>fe,stringifyPrimitive:()=>T,uint8ArrayToBase64:()=>Ie,uint8ArrayToBase64url:()=>Re,uint8ArrayToHex:()=>Be,unwrapMessage:()=>O});function u(e){return e}function d(e){return e}function f(e){}function p(e){throw Error(`Unexpected value in exhaustive check`)}function ee(e){}function te(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function m(e,t=`|`){return e.map(e=>T(e)).join(t)}function ne(e,t){return typeof t==`bigint`?t.toString():t}function h(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function g(e){return e==null}function re(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ie(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}const ae=Symbol(`evaluating`);function _(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ae)return r===void 0&&(r=ae,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function oe(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function v(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function y(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function se(e){return y(e._zod.def)}function ce(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function le(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function ue(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function de(e){return JSON.stringify(e)}function fe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const pe=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function b(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const me=h(()=>{if(s.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function x(e){if(b(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(b(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function he(e){return x(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function ge(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}const _e=e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},ve=new Set([`string`,`number`,`symbol`]),ye=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function S(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function C(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function w(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function be(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function T(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function xe(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const Se={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Ce={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function we(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`);return C(e,y(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return v(this,`shape`,e),e},checks:[]}))}function Te(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`);return C(e,y(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return v(this,`shape`,r),r},checks:[]}))}function Ee(e,t){if(!x(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 in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return C(e,y(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return v(this,`shape`,n),n}}))}function De(e,t){if(!x(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return C(e,y(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return v(this,`shape`,n),n}}))}function Oe(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return C(e,y(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return v(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function ke(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return C(t,y(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return v(this,`shape`,i),i},checks:[]}))}function Ae(e,t,n){return C(t,y(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return v(this,`shape`,i),i}}))}function E(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function je(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function D(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function O(e){return typeof e==`string`?e:e?.message}function k(e,t,n){let r=e.message?e.message:O(e.inst?._zod.def?.error?.(e))??O(t?.error?.(e))??O(n.customError?.(e))??O(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function Me(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function Ne(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function A(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function j(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Pe(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Fe(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function Ie(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Le(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return Fe(t+`=`.repeat((4-t.length%4)%4))}function Re(e){return Ie(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function ze(e){let t=e.replace(/^0x/,``);if(t.length%2!=0)throw Error(`Invalid hex string length`);let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function Be(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var Ve=class{constructor(...e){}};const He=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ne,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ue=r(`$ZodError`,He),M=r(`$ZodError`,He,{Parent:Error});function We(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ge(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}function Ke(e,t=e=>e.message){let n={errors:[]},r=(e,i=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>r({issues:e},[...i,...s.path]));else if(s.code===`invalid_key`)r({issues:s.issues},[...i,...s.path]);else if(s.code===`invalid_element`)r({issues:s.issues},[...i,...s.path]);else{let e=[...i,...s.path];if(e.length===0){n.errors.push(t(s));continue}let r=n,c=0;for(;c<e.length;){let n=e[c],i=c===e.length-1;typeof n==`string`?(r.properties??={},(a=r.properties)[n]??(a[n]={errors:[]}),r=r.properties[n]):(r.items??=[],(o=r.items)[n]??(o[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(s)),c++}}};return r(e),n}function qe(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function Je(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${qe(e.path)}`);return t.join(`
2
2
  `)}const N=e=>(t,n,r,i)=>{let o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new a;if(s.issues.length){let t=new(i?.Err??e)(s.issues.map(e=>k(e,o,c())));throw pe(t,i?.callee),t}return s.value},Ye=N(M),P=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>k(e,a,c())));throw pe(t,i?.callee),t}return o.value},Xe=P(M),F=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 a;return o.issues.length?{success:!1,error:new(e??Ue)(o.issues.map(e=>k(e,i,c())))}:{success:!0,data:o.value}},Ze=F(M),I=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>k(e,i,c())))}:{success:!0,data:a.value}},Qe=I(M),$e=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return N(e)(t,n,i)},et=$e(M),tt=e=>(t,n,r)=>N(e)(t,n,r),nt=tt(M),rt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return P(e)(t,n,i)},it=rt(M),at=e=>async(t,n,r)=>P(e)(t,n,r),ot=at(M),st=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return F(e)(t,n,i)},ct=st(M),lt=e=>(t,n,r)=>F(e)(t,n,r),ut=lt(M),dt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return I(e)(t,n,i)},ft=dt(M),pt=e=>async(t,n,r)=>I(e)(t,n,r),mt=pt(M);var ht=e({base64:()=>Bt,base64url:()=>Vt,bigint:()=>Qt,boolean:()=>tn,browserEmail:()=>Nt,cidrv4:()=>Rt,cidrv6:()=>zt,cuid:()=>gt,cuid2:()=>_t,date:()=>qt,datetime:()=>Xt,domain:()=>Ut,duration:()=>St,e164:()=>Gt,email:()=>Ot,emoji:()=>Pt,extendedDuration:()=>Ct,guid:()=>wt,hex:()=>sn,hostname:()=>Ht,html5Email:()=>kt,httpProtocol:()=>Wt,idnEmail:()=>Mt,integer:()=>$t,ipv4:()=>Ft,ipv6:()=>It,ksuid:()=>bt,lowercase:()=>an,mac:()=>Lt,md5_base64:()=>ln,md5_base64url:()=>un,md5_hex:()=>cn,nanoid:()=>xt,null:()=>nn,number:()=>en,rfc5322Email:()=>At,sha1_base64:()=>fn,sha1_base64url:()=>pn,sha1_hex:()=>dn,sha256_base64:()=>hn,sha256_base64url:()=>gn,sha256_hex:()=>mn,sha384_base64:()=>vn,sha384_base64url:()=>yn,sha384_hex:()=>_n,sha512_base64:()=>xn,sha512_base64url:()=>Sn,sha512_hex:()=>bn,string:()=>Zt,time:()=>Yt,ulid:()=>vt,undefined:()=>rn,unicodeEmail:()=>jt,uppercase:()=>on,uuid:()=>L,uuid4:()=>Tt,uuid6:()=>Et,uuid7:()=>Dt,xid:()=>yt});const gt=/^[cC][0-9a-z]{6,}$/,_t=/^[0-9a-z]+$/,vt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,yt=/^[0-9a-vA-V]{20}$/,bt=/^[A-Za-z0-9]{27}$/,xt=/^[a-zA-Z0-9_-]{21}$/,St=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ct=/^[-+]?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)?)??$/,wt=/^([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})$/,L=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)$/,Tt=L(4),Et=L(6),Dt=L(7),Ot=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,kt=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,At=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,jt=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Mt=jt,Nt=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function Pt(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const Ft=/^(?:(?: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])$/,It=/^(([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}|:))$/,Lt=e=>{let t=S(e??`:`);return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Rt=/^((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])$/,zt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Bt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Vt=/^[A-Za-z0-9_-]*$/,Ht=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Ut=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Wt=/^https?$/,Gt=/^\+[1-9]\d{6,14}$/,Kt=`(?:(?:\\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])))`,qt=RegExp(`^${Kt}$`);function Jt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Yt(e){return RegExp(`^${Jt(e)}$`)}function Xt(e){let t=Jt({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Kt}T(?:${r})$`)}const Zt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Qt=/^-?\d+n?$/,$t=/^-?\d+$/,en=/^-?\d+(?:\.\d+)?$/,tn=/^(?:true|false)$/i,nn=/^null$/i,rn=/^undefined$/i,an=/^[^A-Z]*$/,on=/^[^a-z]*$/,sn=/^[0-9a-fA-F]*$/;function R(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function z(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const cn=/^[0-9a-fA-F]{32}$/,ln=R(22,`==`),un=z(22),dn=/^[0-9a-fA-F]{40}$/,fn=R(27,`=`),pn=z(27),mn=/^[0-9a-fA-F]{64}$/,hn=R(43,`=`),gn=z(43),_n=/^[0-9a-fA-F]{96}$/,vn=R(64,``),yn=z(64),bn=/^[0-9a-fA-F]{128}$/,xn=R(86,`==`),Sn=z(86),B=r(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Cn={number:`number`,bigint:`bigint`,object:`date`},wn=r(`$ZodCheckLessThan`,(e,t)=>{B.init(e,t);let n=Cn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Tn=r(`$ZodCheckGreaterThan`,(e,t)=>{B.init(e,t);let n=Cn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),En=r(`$ZodCheckMultipleOf`,(e,t)=>{B.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):ie(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Dn=r(`$ZodCheckNumberFormat`,(e,t)=>{B.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Se[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=$t)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),On=r(`$ZodCheckBigIntFormat`,(e,t)=>{B.init(e,t);let[n,r]=Ce[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:`bigint`,input:a,code:`too_small`,minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),kn=r(`$ZodCheckMaxSize`,(e,t)=>{var n;B.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!g(t)&&t.size!==void 0}),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;r.size<=t.maximum||n.issues.push({origin:Me(r),code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),An=r(`$ZodCheckMinSize`,(e,t)=>{var n;B.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!g(t)&&t.size!==void 0}),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;r.size>=t.minimum||n.issues.push({origin:Me(r),code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),jn=r(`$ZodCheckSizeEquals`,(e,t)=>{var n;B.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!g(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:Me(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Mn=r(`$ZodCheckMaxLength`,(e,t)=>{var n;B.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!g(t)&&t.length!==void 0}),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;if(r.length<=t.maximum)return;let i=Ne(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Nn=r(`$ZodCheckMinLength`,(e,t)=>{var n;B.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!g(t)&&t.length!==void 0}),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;if(r.length>=t.minimum)return;let i=Ne(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Pn=r(`$ZodCheckLengthEquals`,(e,t)=>{var n;B.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!g(t)&&t.length!==void 0}),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;if(i===t.length)return;let a=Ne(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),V=r(`$ZodCheckStringFormat`,(e,t)=>{var n,r;B.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(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=()=>{})}),Fn=r(`$ZodCheckRegex`,(e,t)=>{V.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})}}),In=r(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=an,V.init(e,t)}),Ln=r(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=on,V.init(e,t)}),Rn=r(`$ZodCheckIncludes`,(e,t)=>{B.init(e,t);let n=S(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;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})}}),zn=r(`$ZodCheckStartsWith`,(e,t)=>{B.init(e,t);let n=RegExp(`^${S(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;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})}}),Bn=r(`$ZodCheckEndsWith`,(e,t)=>{B.init(e,t);let n=RegExp(`.*${S(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;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})}});function Vn(e,t,n){e.issues.length&&t.issues.push(...D(n,e.issues))}const Hn=r(`$ZodCheckProperty`,(e,t)=>{B.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>Vn(n,e,t.property));Vn(n,e,t.property)}}),Un=r(`$ZodCheckMimeType`,(e,t)=>{B.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),Wn=r(`$ZodCheckOverwrite`,(e,t)=>{B.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Gn=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
3
3
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
4
4
  `))}};const Kn={major:4,minor:4,patch:3},H=r(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Kn;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=E(e),i;for(let o of t){if(o._zod.def.when){if(je(e)||!o._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,s=o._zod.check(e);if(s instanceof Promise&&n?.async===!1)throw new a;if(i||s instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(r||=E(e,t))});else{if(e.issues.length===t)continue;r||=E(e,t)}}return i?i.then(()=>e):e},n=(n,i,o)=>{if(E(n))return n.aborted=!0,n;let s=t(i,r,o);if(s instanceof Promise){if(o.async===!1)throw new a;return s.then(t=>e._zod.parse(t,o))}return e._zod.parse(s,o)};e._zod.run=(i,o)=>{if(o.skipChecks)return e._zod.parse(i,o);if(o.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,o)):n(t,i,o)}let s=e._zod.parse(i,o);if(s instanceof Promise){if(o.async===!1)throw new a;return s.then(e=>t(e,r,o))}return t(s,r,o)}}_(e,`~standard`,()=>({validate:t=>{try{let n=Ze(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Qe(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),U=r(`$ZodString`,(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Zt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),W=r(`$ZodStringFormat`,(e,t)=>{V.init(e,t),U.init(e,t)}),qn=r(`$ZodGUID`,(e,t)=>{t.pattern??=wt,W.init(e,t)}),Jn=r(`$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(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=L(e)}else t.pattern??=L();W.init(e,t)}),Yn=r(`$ZodEmail`,(e,t)=>{t.pattern??=Ot,W.init(e,t)}),Xn=r(`$ZodURL`,(e,t)=>{W.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===Wt.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.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&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Zn=r(`$ZodEmoji`,(e,t)=>{t.pattern??=Pt(),W.init(e,t)}),Qn=r(`$ZodNanoID`,(e,t)=>{t.pattern??=xt,W.init(e,t)}),$n=r(`$ZodCUID`,(e,t)=>{t.pattern??=gt,W.init(e,t)}),er=r(`$ZodCUID2`,(e,t)=>{t.pattern??=_t,W.init(e,t)}),tr=r(`$ZodULID`,(e,t)=>{t.pattern??=vt,W.init(e,t)}),nr=r(`$ZodXID`,(e,t)=>{t.pattern??=yt,W.init(e,t)}),rr=r(`$ZodKSUID`,(e,t)=>{t.pattern??=bt,W.init(e,t)}),ir=r(`$ZodISODateTime`,(e,t)=>{t.pattern??=Xt(t),W.init(e,t)}),ar=r(`$ZodISODate`,(e,t)=>{t.pattern??=qt,W.init(e,t)}),or=r(`$ZodISOTime`,(e,t)=>{t.pattern??=Yt(t),W.init(e,t)}),sr=r(`$ZodISODuration`,(e,t)=>{t.pattern??=St,W.init(e,t)}),cr=r(`$ZodIPv4`,(e,t)=>{t.pattern??=Ft,W.init(e,t),e._zod.bag.format=`ipv4`}),lr=r(`$ZodIPv6`,(e,t)=>{t.pattern??=It,W.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),ur=r(`$ZodMAC`,(e,t)=>{t.pattern??=Lt(t.delimiter),W.init(e,t),e._zod.bag.format=`mac`}),dr=r(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Rt,W.init(e,t)}),fr=r(`$ZodCIDRv6`,(e,t)=>{t.pattern??=zt,W.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function pr(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const mr=r(`$ZodBase64`,(e,t)=>{t.pattern??=Bt,W.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{pr(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function hr(e){if(!Vt.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return pr(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const gr=r(`$ZodBase64URL`,(e,t)=>{t.pattern??=Vt,W.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{hr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),_r=r(`$ZodE164`,(e,t)=>{t.pattern??=Gt,W.init(e,t)});function vr(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const yr=r(`$ZodJWT`,(e,t)=>{W.init(e,t),e._zod.check=n=>{vr(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),br=r(`$ZodCustomStringFormat`,(e,t)=>{W.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:`invalid_format`,format:t.format,input:n.value,inst:e,continue:!t.abort})}}),xr=r(`$ZodNumber`,(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??en,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Sr=r(`$ZodNumberFormat`,(e,t)=>{Dn.init(e,t),xr.init(e,t)}),Cr=r(`$ZodBoolean`,(e,t)=>{H.init(e,t),e._zod.pattern=tn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),wr=r(`$ZodBigInt`,(e,t)=>{H.init(e,t),e._zod.pattern=Qt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value==`bigint`||n.issues.push({expected:`bigint`,code:`invalid_type`,input:n.value,inst:e}),n}}),Tr=r(`$ZodBigIntFormat`,(e,t)=>{On.init(e,t),wr.init(e,t)}),Er=r(`$ZodSymbol`,(e,t)=>{H.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),Dr=r(`$ZodUndefined`,(e,t)=>{H.init(e,t),e._zod.pattern=rn,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),Or=r(`$ZodNull`,(e,t)=>{H.init(e,t),e._zod.pattern=nn,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),kr=r(`$ZodAny`,(e,t)=>{H.init(e,t),e._zod.parse=e=>e}),Ar=r(`$ZodUnknown`,(e,t)=>{H.init(e,t),e._zod.parse=e=>e}),jr=r(`$ZodNever`,(e,t)=>{H.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),Mr=r(`$ZodVoid`,(e,t)=>{H.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),Nr=r(`$ZodDate`,(e,t)=>{H.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}});function Pr(e,t,n){e.issues.length&&t.issues.push(...D(n,e.issues)),t.value[n]=e.value}const Fr=r(`$ZodArray`,(e,t)=>{H.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Pr(t,n,e))):Pr(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Ir(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...D(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Lr(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=xe(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Rr(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Ir(e,n,i,t,u,d))):Ir(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const zr=r(`$ZodObject`,(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=h(()=>Lr(t));_(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=b,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>Ir(n,t,e,s,r,i))):Ir(a,t,e,s,r,i)}return i?Rr(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Br=r(`$ZodObjectJIT`,(e,t)=>{zr.init(e,t);let n=e._zod.parse,r=h(()=>Lr(t)),i=e=>{let t=new Gn([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=de(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=de(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
@@ -1,4 +1,4 @@
1
- import{AISDKError as e,APICallError as t,EmptyResponseBodyError as n,InvalidArgumentError as r,InvalidResponseDataError as i,JSONParseError as a,LoadAPIKeyError as o,NoSuchProviderReferenceError as s,TypeValidationError as c,UnsupportedFunctionalityError as l}from"../../@ai-sdk/provider/index.js";import{F as u}from"./core-5Woff_dW.js";import{gr as ee}from"./schemas-DWOIBELG.js";var d;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(d||={});var te;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(te||={});const f=d.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),p=e=>{switch(typeof e){case`undefined`:return f.undefined;case`string`:return f.string;case`number`:return Number.isNaN(e)?f.nan:f.number;case`boolean`:return f.boolean;case`function`:return f.function;case`bigint`:return f.bigint;case`symbol`:return f.symbol;case`object`:return Array.isArray(e)?f.array:e===null?f.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?f.promise:typeof Map<`u`&&e instanceof Map?f.map:typeof Set<`u`&&e instanceof Set?f.set:typeof Date<`u`&&e instanceof Date?f.date:f.object;default:return f.unknown}},m=d.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 h=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,d.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t=Object.create(null),n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};h.create=e=>new h(e);const g=(e,t)=>{let n;switch(e.code){case m.invalid_type:n=e.received===f.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case m.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,d.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:n=`Unrecognized key(s) in object: ${d.joinValues(e.keys,`, `)}`;break;case m.invalid_union:n=`Invalid input`;break;case m.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${d.joinValues(e.options)}`;break;case m.invalid_enum_value:n=`Invalid enum value. Expected ${d.joinValues(e.options)}, received '${e.received}'`;break;case m.invalid_arguments:n=`Invalid function arguments`;break;case m.invalid_return_type:n=`Invalid function return type`;break;case m.invalid_date:n=`Invalid date`;break;case m.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:d.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case m.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case m.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case m.custom:n=`Invalid input`;break;case m.invalid_intersection_types:n=`Intersection results could not be merged`;break;case m.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case m.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,d.assertNever(e)}return{message:n}};let ne=g;function re(){return ne}const ie=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function _(e,t){let n=re(),r=ie({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===g?void 0:g].filter(e=>!!e)});e.common.issues.push(r)}var v=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return y;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return y;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}};const y=Object.freeze({status:`aborted`}),ae=e=>({status:`dirty`,value:e}),b=e=>({status:`valid`,value:e}),oe=e=>e.status===`aborted`,se=e=>e.status===`dirty`,x=e=>e.status===`valid`,ce=e=>typeof Promise<`u`&&e instanceof Promise;var S;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(S||={});var C=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}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}};const le=(e,t)=>{if(x(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new h(e.common.issues);return this._error=t,this._error}}};function w(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var T=class{get description(){return this._def.description}_getType(e){return p(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:p(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new v,ctx:{common:e.parent.common,data:e.data,parsedType:p(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(ce(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:p(e)};return le(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:p(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return x(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>x(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:p(e)},r=this._parse({data:e,path:n.path,parent:n});return le(n,await(ce(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:m.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new I({schema:this,typeName:H.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:e=>this[`~validate`](e)}}optional(){return L.create(this,this._def)}nullable(){return R.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return O.create(this)}promise(){return F.create(this,this._def)}or(e){return We.create([this,e],this._def)}and(e){return M.create(this,e,this._def)}transform(e){return new I({...w(this._def),schema:this,typeName:H.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new z({...w(this._def),innerType:this,defaultValue:t,typeName:H.ZodDefault})}brand(){return new nt({typeName:H.ZodBranded,type:this,...w(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new B({...w(this._def),innerType:this,catchValue:t,typeName:H.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return rt.create(this,e)}readonly(){return V.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const ue=/^c[^\s-]{8,}$/i,de=/^[0-9a-z]+$/,fe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,pe=/^[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,me=/^[a-z0-9_-]{21}$/i,he=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ge=/^[-+]?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)?)??$/,_e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let ve;const ye=/^(?:(?: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])$/,be=/^(?:(?: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])$/,xe=/^(([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]))$/,Se=/^(([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])$/,Ce=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,we=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Te=`((\\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])))`,Ee=RegExp(`^${Te}$`);function De(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Oe(e){return RegExp(`^${De(e)}$`)}function ke(e){let t=`${Te}T${De(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Ae(e,t){return!!((t===`v4`||!t)&&ye.test(e)||(t===`v6`||!t)&&xe.test(e))}function je(e,t){if(!he.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Me(e,t){return!!((t===`v4`||!t)&&be.test(e)||(t===`v6`||!t)&&Se.test(e))}var Ne=class e extends T{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.string,received:t.parsedType}),y}let t=new v,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),_(n,{code:m.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),_(n,{code:m.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?_(n,{code:m.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&_(n,{code:m.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)_e.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`email`,code:m.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)ve||=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`),ve.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`emoji`,code:m.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)pe.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`uuid`,code:m.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)me.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`nanoid`,code:m.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)ue.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`cuid`,code:m.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)de.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`cuid2`,code:m.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)fe.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`ulid`,code:m.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),_(n,{validation:`url`,code:m.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`regex`,code:m.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),_(n,{code:m.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),_(n,{code:m.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),_(n,{code:m.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?ke(r).test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{code:m.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?Ee.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{code:m.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?Oe(r).test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{code:m.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?ge.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`duration`,code:m.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?Ae(e.data,r.version)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`ip`,code:m.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?je(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`jwt`,code:m.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?Me(e.data,r.version)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`cidr`,code:m.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?Ce.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`base64`,code:m.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?we.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`base64url`,code:m.invalid_string,message:r.message}),t.dirty()):d.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:m.invalid_string,...S.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...S.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...S.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...S.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...S.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...S.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...S.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...S.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...S.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...S.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...S.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...S.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...S.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...S.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...S.errToObj(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:e?.precision===void 0?null:e?.precision,...S.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...S.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...S.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...S.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...S.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...S.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...S.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...S.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...S.errToObj(t)})}nonempty(e){return this.min(1,S.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...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 t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Ne.create=e=>new Ne({checks:[],typeName:H.ZodString,coerce:e?.coerce??!1,...w(e)});function Pe(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var Fe=class e extends T{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)!==f.number){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.number,received:t.parsedType}),y}let t,n=new v;for(let r of this._def.checks)r.kind===`int`?d.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),_(t,{code:m.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),_(t,{code:m.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),_(t,{code:m.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?Pe(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),_(t,{code:m.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),_(t,{code:m.not_finite,message:r.message}),n.dirty()):d.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,S.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,S.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,S.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,S.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:S.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:S.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:S.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:S.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:S.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:S.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&d.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};Fe.create=e=>new Fe({checks:[],typeName:H.ZodNumber,coerce:e?.coerce||!1,...w(e)});var Ie=class e extends T{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)!==f.bigint)return this._getInvalidInput(e);let t,n=new v;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),_(t,{code:m.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),_(t,{code:m.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),_(t,{code:m.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):d.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.bigint,received:t.parsedType}),y}gte(e,t){return this.setLimit(`min`,e,!0,S.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,S.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,S.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,S.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:S.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:S.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Ie.create=e=>new Ie({checks:[],typeName:H.ZodBigInt,coerce:e?.coerce??!1,...w(e)});var Le=class extends T{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.boolean,received:t.parsedType}),y}return b(e.data)}};Le.create=e=>new Le({typeName:H.ZodBoolean,coerce:e?.coerce||!1,...w(e)});var Re=class e extends T{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.date,received:t.parsedType}),y}if(Number.isNaN(e.data.getTime()))return _(this._getOrReturnCtx(e),{code:m.invalid_date}),y;let t=new v,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),_(n,{code:m.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),_(n,{code:m.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):d.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:S.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:S.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};Re.create=e=>new Re({checks:[],coerce:e?.coerce||!1,typeName:H.ZodDate,...w(e)});var ze=class extends T{_parse(e){if(this._getType(e)!==f.symbol){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.symbol,received:t.parsedType}),y}return b(e.data)}};ze.create=e=>new ze({typeName:H.ZodSymbol,...w(e)});var Be=class extends T{_parse(e){if(this._getType(e)!==f.undefined){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.undefined,received:t.parsedType}),y}return b(e.data)}};Be.create=e=>new Be({typeName:H.ZodUndefined,...w(e)});var Ve=class extends T{_parse(e){if(this._getType(e)!==f.null){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.null,received:t.parsedType}),y}return b(e.data)}};Ve.create=e=>new Ve({typeName:H.ZodNull,...w(e)});var He=class extends T{constructor(){super(...arguments),this._any=!0}_parse(e){return b(e.data)}};He.create=e=>new He({typeName:H.ZodAny,...w(e)});var E=class extends T{constructor(){super(...arguments),this._unknown=!0}_parse(e){return b(e.data)}};E.create=e=>new E({typeName:H.ZodUnknown,...w(e)});var D=class extends T{_parse(e){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.never,received:t.parsedType}),y}};D.create=e=>new D({typeName:H.ZodNever,...w(e)});var Ue=class extends T{_parse(e){if(this._getType(e)!==f.undefined){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.void,received:t.parsedType}),y}return b(e.data)}};Ue.create=e=>new Ue({typeName:H.ZodVoid,...w(e)});var O=class e extends T{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==f.array)return _(t,{code:m.invalid_type,expected:f.array,received:t.parsedType}),y;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(_(t,{code:e?m.too_big:m.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(_(t,{code:m.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(_(t,{code:m.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new C(t,e,t.path,n)))).then(e=>v.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new C(t,e,t.path,n)));return v.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:S.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:S.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:S.toString(n)}})}nonempty(e){return this.min(1,e)}};O.create=(e,t)=>new O({type:e,minLength:null,maxLength:null,exactLength:null,typeName:H.ZodArray,...w(t)});function k(e){if(e instanceof A){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=L.create(k(r))}return new A({...e._def,shape:()=>t})}else if(e instanceof O)return new O({...e._def,type:k(e.element)});else if(e instanceof L)return L.create(k(e.unwrap()));else if(e instanceof R)return R.create(k(e.unwrap()));else if(e instanceof N)return N.create(e.items.map(e=>k(e)));else return e}var A=class e extends T{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=d.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==f.object){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.object,received:t.parsedType}),y}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof D&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new C(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof D){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(_(n,{code:m.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new C(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>v.mergeObjectSync(t,e)):v.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return S.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:S.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:H.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of d.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of d.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return k(this)}partial(t){let n={};for(let e of d.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of d.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof L;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return Qe(d.objectKeys(this.shape))}};A.create=(e,t)=>new A({shape:()=>e,unknownKeys:`strip`,catchall:D.create(),typeName:H.ZodObject,...w(t)}),A.strictCreate=(e,t)=>new A({shape:()=>e,unknownKeys:`strict`,catchall:D.create(),typeName:H.ZodObject,...w(t)}),A.lazycreate=(e,t)=>new A({shape:e,unknownKeys:`strip`,catchall:D.create(),typeName:H.ZodObject,...w(t)});var We=class extends T{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new h(e.ctx.common.issues));return _(t,{code:m.invalid_union,unionErrors:n}),y}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new h(e));return _(t,{code:m.invalid_union,unionErrors:i}),y}}get options(){return this._def.options}};We.create=(e,t)=>new We({options:e,typeName:H.ZodUnion,...w(t)});const j=e=>e instanceof P?j(e.schema):e instanceof I?j(e.innerType()):e instanceof Ze?[e.value]:e instanceof $e?e.options:e instanceof et?d.objectValues(e.enum):e instanceof z?j(e._def.innerType):e instanceof Be?[void 0]:e instanceof Ve?[null]:e instanceof L?[void 0,...j(e.unwrap())]:e instanceof R?[null,...j(e.unwrap())]:e instanceof nt||e instanceof V?j(e.unwrap()):e instanceof B?j(e._def.innerType):[];var Ge=class e extends T{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return _(t,{code:m.invalid_type,expected:f.object,received:t.parsedType}),y;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(_(t,{code:m.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=j(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:H.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...w(r)})}};function Ke(e,t){let n=p(e),r=p(t);if(e===t)return{valid:!0,data:e};if(n===f.object&&r===f.object){let n=d.objectKeys(t),r=d.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Ke(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===f.array&&r===f.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Ke(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===f.date&&r===f.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var M=class extends T{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(oe(e)||oe(r))return y;let i=Ke(e.value,r.value);return i.valid?((se(e)||se(r))&&t.dirty(),{status:t.value,value:i.data}):(_(n,{code:m.invalid_intersection_types}),y)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};M.create=(e,t,n)=>new M({left:e,right:t,typeName:H.ZodIntersection,...w(n)});var N=class e extends T{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.array)return _(n,{code:m.invalid_type,expected:f.array,received:n.parsedType}),y;if(n.data.length<this._def.items.length)return _(n,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),y;!this._def.rest&&n.data.length>this._def.items.length&&(_(n,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new C(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>v.mergeArray(t,e)):v.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};N.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new N({items:e,typeName:H.ZodTuple,rest:null,...w(t)})};var qe=class e extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.object)return _(n,{code:m.invalid_type,expected:f.object,received:n.parsedType}),y;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new C(n,e,n.path,e)),value:a._parse(new C(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?v.mergeObjectAsync(t,r):v.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof T?new e({keyType:t,valueType:n,typeName:H.ZodRecord,...w(r)}):new e({keyType:Ne.create(),valueType:t,typeName:H.ZodRecord,...w(n)})}},Je=class extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.map)return _(n,{code:m.invalid_type,expected:f.map,received:n.parsedType}),y;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new C(n,e,n.path,[a,`key`])),value:i._parse(new C(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return y;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return y;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};Je.create=(e,t,n)=>new Je({valueType:t,keyType:e,typeName:H.ZodMap,...w(n)});var Ye=class e extends T{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.set)return _(n,{code:m.invalid_type,expected:f.set,received:n.parsedType}),y;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(_(n,{code:m.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(_(n,{code:m.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return y;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new C(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:S.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:S.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Ye.create=(e,t)=>new Ye({valueType:e,minSize:null,maxSize:null,typeName:H.ZodSet,...w(t)});var Xe=class e extends T{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.function)return _(t,{code:m.invalid_type,expected:f.function,received:t.parsedType}),y;function n(e,n){return ie({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,re(),g].filter(e=>!!e),issueData:{code:m.invalid_arguments,argumentsError:n}})}function r(e,n){return ie({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,re(),g].filter(e=>!!e),issueData:{code:m.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof F){let e=this;return b(async function(...t){let o=new h([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return b(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new h([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new h([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:N.create(t).rest(E.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||N.create([]).rest(E.create()),returns:n||E.create(),typeName:H.ZodFunction,...w(r)})}},P=class extends T{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};P.create=(e,t)=>new P({getter:e,typeName:H.ZodLazy,...w(t)});var Ze=class extends T{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return _(t,{received:t.data,code:m.invalid_literal,expected:this._def.value}),y}return{status:`valid`,value:e.data}}get value(){return this._def.value}};Ze.create=(e,t)=>new Ze({value:e,typeName:H.ZodLiteral,...w(t)});function Qe(e,t){return new $e({values:e,typeName:H.ZodEnum,...w(t)})}var $e=class e extends T{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return _(t,{expected:d.joinValues(n),received:t.parsedType,code:m.invalid_type}),y}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return _(t,{received:t.data,code:m.invalid_enum_value,options:n}),y}return b(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};$e.create=Qe;var et=class extends T{_parse(e){let t=d.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==f.string&&n.parsedType!==f.number){let e=d.objectValues(t);return _(n,{expected:d.joinValues(e),received:n.parsedType,code:m.invalid_type}),y}if(this._cache||=new Set(d.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=d.objectValues(t);return _(n,{received:n.data,code:m.invalid_enum_value,options:e}),y}return b(e.data)}get enum(){return this._def.values}};et.create=(e,t)=>new et({values:e,typeName:H.ZodNativeEnum,...w(t)});var F=class extends T{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==f.promise&&t.common.async===!1?(_(t,{code:m.invalid_type,expected:f.promise,received:t.parsedType}),y):b((t.parsedType===f.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};F.create=(e,t)=>new F({type:e,typeName:H.ZodPromise,...w(t)});var I=class extends T{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===H.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{_(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return y;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?y:r.status===`dirty`||t.value===`dirty`?ae(r.value):r});{if(t.value===`aborted`)return y;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?y:r.status===`dirty`||t.value===`dirty`?ae(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?y:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?y:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!x(e))return y;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>x(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):y);d.assertNever(r)}};I.create=(e,t,n)=>new I({schema:e,typeName:H.ZodEffects,effect:t,...w(n)}),I.createWithPreprocess=(e,t,n)=>new I({schema:t,effect:{type:`preprocess`,transform:e},typeName:H.ZodEffects,...w(n)});var L=class extends T{_parse(e){return this._getType(e)===f.undefined?b(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};L.create=(e,t)=>new L({innerType:e,typeName:H.ZodOptional,...w(t)});var R=class extends T{_parse(e){return this._getType(e)===f.null?b(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};R.create=(e,t)=>new R({innerType:e,typeName:H.ZodNullable,...w(t)});var z=class extends T{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===f.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};z.create=(e,t)=>new z({innerType:e,typeName:H.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...w(t)});var B=class extends T{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ce(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new h(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new h(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};B.create=(e,t)=>new B({innerType:e,typeName:H.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...w(t)});var tt=class extends T{_parse(e){if(this._getType(e)!==f.nan){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.nan,received:t.parsedType}),y}return{status:`valid`,value:e.data}}};tt.create=e=>new tt({typeName:H.ZodNaN,...w(e)});var nt=class extends T{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},rt=class e extends T{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?y:e.status===`dirty`?(t.dirty(),ae(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?y:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:H.ZodPipeline})}},V=class extends T{_parse(e){let t=this._def.innerType._parse(e),n=e=>(x(e)&&(e.value=Object.freeze(e.value)),e);return ce(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};V.create=(e,t)=>new V({innerType:e,typeName:H.ZodReadonly,...w(t)}),A.lazycreate;var H;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(H||={}),Ne.create,Fe.create,tt.create,Ie.create,Le.create,Re.create,ze.create,Be.create,Ve.create,He.create,E.create,D.create,Ue.create,O.create,A.create,A.strictCreate,We.create,Ge.create,M.create,N.create,qe.create,Je.create,Ye.create,Xe.create,P.create,Ze.create,$e.create,et.create,F.create,I.create,L.create,R.create,I.createWithPreprocess,rt.create;var it=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}};function at(e){}function ot(e){if(typeof e==`function`)throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=at,onError:n=at,onRetry:r=at,onComment:i}=e,a=[],o=!0,s,c=``,l=0,u;function ee(e){if(o&&(o=!1,e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),a.length===0){let t=d(e);t!==``&&a.push(t);return}if(e.indexOf(`
1
+ import{AISDKError as e,APICallError as t,EmptyResponseBodyError as n,InvalidArgumentError as r,InvalidResponseDataError as i,JSONParseError as a,LoadAPIKeyError as o,NoSuchProviderReferenceError as s,TypeValidationError as c,UnsupportedFunctionalityError as l}from"../../@ai-sdk/provider/index.js";import{F as u}from"./core-CXJbIkCL.js";import{gr as ee}from"./schemas-iG9Z4s4o.js";var d;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(d||={});var te;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(te||={});const f=d.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),p=e=>{switch(typeof e){case`undefined`:return f.undefined;case`string`:return f.string;case`number`:return Number.isNaN(e)?f.nan:f.number;case`boolean`:return f.boolean;case`function`:return f.function;case`bigint`:return f.bigint;case`symbol`:return f.symbol;case`object`:return Array.isArray(e)?f.array:e===null?f.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?f.promise:typeof Map<`u`&&e instanceof Map?f.map:typeof Set<`u`&&e instanceof Set?f.set:typeof Date<`u`&&e instanceof Date?f.date:f.object;default:return f.unknown}},m=d.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 h=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,d.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t=Object.create(null),n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};h.create=e=>new h(e);const g=(e,t)=>{let n;switch(e.code){case m.invalid_type:n=e.received===f.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case m.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,d.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:n=`Unrecognized key(s) in object: ${d.joinValues(e.keys,`, `)}`;break;case m.invalid_union:n=`Invalid input`;break;case m.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${d.joinValues(e.options)}`;break;case m.invalid_enum_value:n=`Invalid enum value. Expected ${d.joinValues(e.options)}, received '${e.received}'`;break;case m.invalid_arguments:n=`Invalid function arguments`;break;case m.invalid_return_type:n=`Invalid function return type`;break;case m.invalid_date:n=`Invalid date`;break;case m.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:d.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case m.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case m.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case m.custom:n=`Invalid input`;break;case m.invalid_intersection_types:n=`Intersection results could not be merged`;break;case m.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case m.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,d.assertNever(e)}return{message:n}};let ne=g;function re(){return ne}const ie=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function _(e,t){let n=re(),r=ie({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===g?void 0:g].filter(e=>!!e)});e.common.issues.push(r)}var v=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return y;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return y;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}};const y=Object.freeze({status:`aborted`}),ae=e=>({status:`dirty`,value:e}),b=e=>({status:`valid`,value:e}),oe=e=>e.status===`aborted`,se=e=>e.status===`dirty`,x=e=>e.status===`valid`,ce=e=>typeof Promise<`u`&&e instanceof Promise;var S;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(S||={});var C=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}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}};const le=(e,t)=>{if(x(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new h(e.common.issues);return this._error=t,this._error}}};function w(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var T=class{get description(){return this._def.description}_getType(e){return p(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:p(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new v,ctx:{common:e.parent.common,data:e.data,parsedType:p(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(ce(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:p(e)};return le(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:p(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return x(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>x(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:p(e)},r=this._parse({data:e,path:n.path,parent:n});return le(n,await(ce(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:m.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new I({schema:this,typeName:H.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:e=>this[`~validate`](e)}}optional(){return L.create(this,this._def)}nullable(){return R.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return O.create(this)}promise(){return F.create(this,this._def)}or(e){return We.create([this,e],this._def)}and(e){return M.create(this,e,this._def)}transform(e){return new I({...w(this._def),schema:this,typeName:H.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new z({...w(this._def),innerType:this,defaultValue:t,typeName:H.ZodDefault})}brand(){return new nt({typeName:H.ZodBranded,type:this,...w(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new B({...w(this._def),innerType:this,catchValue:t,typeName:H.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return rt.create(this,e)}readonly(){return V.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const ue=/^c[^\s-]{8,}$/i,de=/^[0-9a-z]+$/,fe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,pe=/^[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,me=/^[a-z0-9_-]{21}$/i,he=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ge=/^[-+]?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)?)??$/,_e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let ve;const ye=/^(?:(?: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])$/,be=/^(?:(?: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])$/,xe=/^(([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]))$/,Se=/^(([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])$/,Ce=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,we=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Te=`((\\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])))`,Ee=RegExp(`^${Te}$`);function De(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Oe(e){return RegExp(`^${De(e)}$`)}function ke(e){let t=`${Te}T${De(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Ae(e,t){return!!((t===`v4`||!t)&&ye.test(e)||(t===`v6`||!t)&&xe.test(e))}function je(e,t){if(!he.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Me(e,t){return!!((t===`v4`||!t)&&be.test(e)||(t===`v6`||!t)&&Se.test(e))}var Ne=class e extends T{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.string,received:t.parsedType}),y}let t=new v,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),_(n,{code:m.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),_(n,{code:m.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?_(n,{code:m.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&_(n,{code:m.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)_e.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`email`,code:m.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)ve||=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`),ve.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`emoji`,code:m.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)pe.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`uuid`,code:m.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)me.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`nanoid`,code:m.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)ue.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`cuid`,code:m.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)de.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`cuid2`,code:m.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)fe.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`ulid`,code:m.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),_(n,{validation:`url`,code:m.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`regex`,code:m.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),_(n,{code:m.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),_(n,{code:m.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),_(n,{code:m.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?ke(r).test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{code:m.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?Ee.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{code:m.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?Oe(r).test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{code:m.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?ge.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`duration`,code:m.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?Ae(e.data,r.version)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`ip`,code:m.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?je(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`jwt`,code:m.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?Me(e.data,r.version)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`cidr`,code:m.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?Ce.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`base64`,code:m.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?we.test(e.data)||(n=this._getOrReturnCtx(e,n),_(n,{validation:`base64url`,code:m.invalid_string,message:r.message}),t.dirty()):d.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:m.invalid_string,...S.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...S.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...S.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...S.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...S.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...S.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...S.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...S.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...S.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...S.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...S.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...S.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...S.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...S.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...S.errToObj(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:e?.precision===void 0?null:e?.precision,...S.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...S.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...S.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...S.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...S.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...S.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...S.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...S.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...S.errToObj(t)})}nonempty(e){return this.min(1,S.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...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 t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Ne.create=e=>new Ne({checks:[],typeName:H.ZodString,coerce:e?.coerce??!1,...w(e)});function Pe(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var Fe=class e extends T{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)!==f.number){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.number,received:t.parsedType}),y}let t,n=new v;for(let r of this._def.checks)r.kind===`int`?d.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),_(t,{code:m.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),_(t,{code:m.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),_(t,{code:m.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?Pe(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),_(t,{code:m.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),_(t,{code:m.not_finite,message:r.message}),n.dirty()):d.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,S.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,S.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,S.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,S.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:S.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:S.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:S.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:S.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:S.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:S.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&d.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};Fe.create=e=>new Fe({checks:[],typeName:H.ZodNumber,coerce:e?.coerce||!1,...w(e)});var Ie=class e extends T{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)!==f.bigint)return this._getInvalidInput(e);let t,n=new v;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),_(t,{code:m.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),_(t,{code:m.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),_(t,{code:m.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):d.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.bigint,received:t.parsedType}),y}gte(e,t){return this.setLimit(`min`,e,!0,S.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,S.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,S.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,S.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:S.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:S.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Ie.create=e=>new Ie({checks:[],typeName:H.ZodBigInt,coerce:e?.coerce??!1,...w(e)});var Le=class extends T{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.boolean,received:t.parsedType}),y}return b(e.data)}};Le.create=e=>new Le({typeName:H.ZodBoolean,coerce:e?.coerce||!1,...w(e)});var Re=class e extends T{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.date,received:t.parsedType}),y}if(Number.isNaN(e.data.getTime()))return _(this._getOrReturnCtx(e),{code:m.invalid_date}),y;let t=new v,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),_(n,{code:m.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),_(n,{code:m.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):d.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:S.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:S.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};Re.create=e=>new Re({checks:[],coerce:e?.coerce||!1,typeName:H.ZodDate,...w(e)});var ze=class extends T{_parse(e){if(this._getType(e)!==f.symbol){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.symbol,received:t.parsedType}),y}return b(e.data)}};ze.create=e=>new ze({typeName:H.ZodSymbol,...w(e)});var Be=class extends T{_parse(e){if(this._getType(e)!==f.undefined){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.undefined,received:t.parsedType}),y}return b(e.data)}};Be.create=e=>new Be({typeName:H.ZodUndefined,...w(e)});var Ve=class extends T{_parse(e){if(this._getType(e)!==f.null){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.null,received:t.parsedType}),y}return b(e.data)}};Ve.create=e=>new Ve({typeName:H.ZodNull,...w(e)});var He=class extends T{constructor(){super(...arguments),this._any=!0}_parse(e){return b(e.data)}};He.create=e=>new He({typeName:H.ZodAny,...w(e)});var E=class extends T{constructor(){super(...arguments),this._unknown=!0}_parse(e){return b(e.data)}};E.create=e=>new E({typeName:H.ZodUnknown,...w(e)});var D=class extends T{_parse(e){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.never,received:t.parsedType}),y}};D.create=e=>new D({typeName:H.ZodNever,...w(e)});var Ue=class extends T{_parse(e){if(this._getType(e)!==f.undefined){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.void,received:t.parsedType}),y}return b(e.data)}};Ue.create=e=>new Ue({typeName:H.ZodVoid,...w(e)});var O=class e extends T{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==f.array)return _(t,{code:m.invalid_type,expected:f.array,received:t.parsedType}),y;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(_(t,{code:e?m.too_big:m.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(_(t,{code:m.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(_(t,{code:m.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new C(t,e,t.path,n)))).then(e=>v.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new C(t,e,t.path,n)));return v.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:S.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:S.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:S.toString(n)}})}nonempty(e){return this.min(1,e)}};O.create=(e,t)=>new O({type:e,minLength:null,maxLength:null,exactLength:null,typeName:H.ZodArray,...w(t)});function k(e){if(e instanceof A){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=L.create(k(r))}return new A({...e._def,shape:()=>t})}else if(e instanceof O)return new O({...e._def,type:k(e.element)});else if(e instanceof L)return L.create(k(e.unwrap()));else if(e instanceof R)return R.create(k(e.unwrap()));else if(e instanceof N)return N.create(e.items.map(e=>k(e)));else return e}var A=class e extends T{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=d.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==f.object){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.object,received:t.parsedType}),y}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof D&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new C(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof D){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(_(n,{code:m.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new C(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>v.mergeObjectSync(t,e)):v.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return S.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:S.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:H.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of d.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of d.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return k(this)}partial(t){let n={};for(let e of d.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of d.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof L;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return Qe(d.objectKeys(this.shape))}};A.create=(e,t)=>new A({shape:()=>e,unknownKeys:`strip`,catchall:D.create(),typeName:H.ZodObject,...w(t)}),A.strictCreate=(e,t)=>new A({shape:()=>e,unknownKeys:`strict`,catchall:D.create(),typeName:H.ZodObject,...w(t)}),A.lazycreate=(e,t)=>new A({shape:e,unknownKeys:`strip`,catchall:D.create(),typeName:H.ZodObject,...w(t)});var We=class extends T{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new h(e.ctx.common.issues));return _(t,{code:m.invalid_union,unionErrors:n}),y}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new h(e));return _(t,{code:m.invalid_union,unionErrors:i}),y}}get options(){return this._def.options}};We.create=(e,t)=>new We({options:e,typeName:H.ZodUnion,...w(t)});const j=e=>e instanceof P?j(e.schema):e instanceof I?j(e.innerType()):e instanceof Ze?[e.value]:e instanceof $e?e.options:e instanceof et?d.objectValues(e.enum):e instanceof z?j(e._def.innerType):e instanceof Be?[void 0]:e instanceof Ve?[null]:e instanceof L?[void 0,...j(e.unwrap())]:e instanceof R?[null,...j(e.unwrap())]:e instanceof nt||e instanceof V?j(e.unwrap()):e instanceof B?j(e._def.innerType):[];var Ge=class e extends T{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return _(t,{code:m.invalid_type,expected:f.object,received:t.parsedType}),y;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(_(t,{code:m.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=j(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:H.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...w(r)})}};function Ke(e,t){let n=p(e),r=p(t);if(e===t)return{valid:!0,data:e};if(n===f.object&&r===f.object){let n=d.objectKeys(t),r=d.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Ke(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===f.array&&r===f.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Ke(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===f.date&&r===f.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var M=class extends T{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(oe(e)||oe(r))return y;let i=Ke(e.value,r.value);return i.valid?((se(e)||se(r))&&t.dirty(),{status:t.value,value:i.data}):(_(n,{code:m.invalid_intersection_types}),y)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};M.create=(e,t,n)=>new M({left:e,right:t,typeName:H.ZodIntersection,...w(n)});var N=class e extends T{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.array)return _(n,{code:m.invalid_type,expected:f.array,received:n.parsedType}),y;if(n.data.length<this._def.items.length)return _(n,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),y;!this._def.rest&&n.data.length>this._def.items.length&&(_(n,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new C(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>v.mergeArray(t,e)):v.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};N.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new N({items:e,typeName:H.ZodTuple,rest:null,...w(t)})};var qe=class e extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.object)return _(n,{code:m.invalid_type,expected:f.object,received:n.parsedType}),y;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new C(n,e,n.path,e)),value:a._parse(new C(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?v.mergeObjectAsync(t,r):v.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof T?new e({keyType:t,valueType:n,typeName:H.ZodRecord,...w(r)}):new e({keyType:Ne.create(),valueType:t,typeName:H.ZodRecord,...w(n)})}},Je=class extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.map)return _(n,{code:m.invalid_type,expected:f.map,received:n.parsedType}),y;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new C(n,e,n.path,[a,`key`])),value:i._parse(new C(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return y;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return y;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};Je.create=(e,t,n)=>new Je({valueType:t,keyType:e,typeName:H.ZodMap,...w(n)});var Ye=class e extends T{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.set)return _(n,{code:m.invalid_type,expected:f.set,received:n.parsedType}),y;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(_(n,{code:m.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(_(n,{code:m.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return y;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new C(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:S.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:S.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Ye.create=(e,t)=>new Ye({valueType:e,minSize:null,maxSize:null,typeName:H.ZodSet,...w(t)});var Xe=class e extends T{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.function)return _(t,{code:m.invalid_type,expected:f.function,received:t.parsedType}),y;function n(e,n){return ie({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,re(),g].filter(e=>!!e),issueData:{code:m.invalid_arguments,argumentsError:n}})}function r(e,n){return ie({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,re(),g].filter(e=>!!e),issueData:{code:m.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof F){let e=this;return b(async function(...t){let o=new h([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return b(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new h([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new h([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:N.create(t).rest(E.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||N.create([]).rest(E.create()),returns:n||E.create(),typeName:H.ZodFunction,...w(r)})}},P=class extends T{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};P.create=(e,t)=>new P({getter:e,typeName:H.ZodLazy,...w(t)});var Ze=class extends T{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return _(t,{received:t.data,code:m.invalid_literal,expected:this._def.value}),y}return{status:`valid`,value:e.data}}get value(){return this._def.value}};Ze.create=(e,t)=>new Ze({value:e,typeName:H.ZodLiteral,...w(t)});function Qe(e,t){return new $e({values:e,typeName:H.ZodEnum,...w(t)})}var $e=class e extends T{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return _(t,{expected:d.joinValues(n),received:t.parsedType,code:m.invalid_type}),y}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return _(t,{received:t.data,code:m.invalid_enum_value,options:n}),y}return b(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};$e.create=Qe;var et=class extends T{_parse(e){let t=d.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==f.string&&n.parsedType!==f.number){let e=d.objectValues(t);return _(n,{expected:d.joinValues(e),received:n.parsedType,code:m.invalid_type}),y}if(this._cache||=new Set(d.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=d.objectValues(t);return _(n,{received:n.data,code:m.invalid_enum_value,options:e}),y}return b(e.data)}get enum(){return this._def.values}};et.create=(e,t)=>new et({values:e,typeName:H.ZodNativeEnum,...w(t)});var F=class extends T{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==f.promise&&t.common.async===!1?(_(t,{code:m.invalid_type,expected:f.promise,received:t.parsedType}),y):b((t.parsedType===f.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};F.create=(e,t)=>new F({type:e,typeName:H.ZodPromise,...w(t)});var I=class extends T{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===H.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{_(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return y;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?y:r.status===`dirty`||t.value===`dirty`?ae(r.value):r});{if(t.value===`aborted`)return y;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?y:r.status===`dirty`||t.value===`dirty`?ae(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?y:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?y:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!x(e))return y;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>x(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):y);d.assertNever(r)}};I.create=(e,t,n)=>new I({schema:e,typeName:H.ZodEffects,effect:t,...w(n)}),I.createWithPreprocess=(e,t,n)=>new I({schema:t,effect:{type:`preprocess`,transform:e},typeName:H.ZodEffects,...w(n)});var L=class extends T{_parse(e){return this._getType(e)===f.undefined?b(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};L.create=(e,t)=>new L({innerType:e,typeName:H.ZodOptional,...w(t)});var R=class extends T{_parse(e){return this._getType(e)===f.null?b(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};R.create=(e,t)=>new R({innerType:e,typeName:H.ZodNullable,...w(t)});var z=class extends T{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===f.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};z.create=(e,t)=>new z({innerType:e,typeName:H.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...w(t)});var B=class extends T{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ce(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new h(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new h(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};B.create=(e,t)=>new B({innerType:e,typeName:H.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...w(t)});var tt=class extends T{_parse(e){if(this._getType(e)!==f.nan){let t=this._getOrReturnCtx(e);return _(t,{code:m.invalid_type,expected:f.nan,received:t.parsedType}),y}return{status:`valid`,value:e.data}}};tt.create=e=>new tt({typeName:H.ZodNaN,...w(e)});var nt=class extends T{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},rt=class e extends T{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?y:e.status===`dirty`?(t.dirty(),ae(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?y:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:H.ZodPipeline})}},V=class extends T{_parse(e){let t=this._def.innerType._parse(e),n=e=>(x(e)&&(e.value=Object.freeze(e.value)),e);return ce(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};V.create=(e,t)=>new V({innerType:e,typeName:H.ZodReadonly,...w(t)}),A.lazycreate;var H;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(H||={}),Ne.create,Fe.create,tt.create,Ie.create,Le.create,Re.create,ze.create,Be.create,Ve.create,He.create,E.create,D.create,Ue.create,O.create,A.create,A.strictCreate,We.create,Ge.create,M.create,N.create,qe.create,Je.create,Ye.create,Xe.create,P.create,Ze.create,$e.create,et.create,F.create,I.create,L.create,R.create,I.createWithPreprocess,rt.create;var it=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}};function at(e){}function ot(e){if(typeof e==`function`)throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=at,onError:n=at,onRetry:r=at,onComment:i}=e,a=[],o=!0,s,c=``,l=0,u;function ee(e){if(o&&(o=!1,e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),a.length===0){let t=d(e);t!==``&&a.push(t);return}if(e.indexOf(`
2
2
  `)===-1&&e.indexOf(`\r`)===-1){a.push(e);return}a.push(e);let t=a.join(``);a.length=0;let n=d(t);n!==``&&a.push(n)}function d(e){let n=0;if(e.indexOf(`\r`)===-1){let r=e.indexOf(`
3
3
  `,n);for(;r!==-1;){if(n===r){l>0&&t({id:s,event:u,data:c}),s=void 0,c=``,l=0,u=void 0,n=r+1,r=e.indexOf(`
4
4
  `,n);continue}let i=e.charCodeAt(n);if(st(e,n,i)){let i=e.charCodeAt(n+5)===32?n+6:n+5,a=e.slice(i,r);if(l===0&&e.charCodeAt(r+1)===10){t({id:s,event:u,data:a}),s=void 0,c=``,u=void 0,n=r+2,r=e.indexOf(`
@@ -1,3 +1,3 @@
1
- import{r as e}from"./dist-aOKD_2KN.js";const t={USER_ERROR:`USER_ERROR`,RUNTIME_ERROR:`RUNTIME_ERROR`,CORRUPTED_EVENT_LOG:`CORRUPTED_EVENT_LOG`,REPLAY_DIVERGENCE:`REPLAY_DIVERGENCE`,MAX_DELIVERIES_EXCEEDED:`MAX_DELIVERIES_EXCEEDED`,REPLAY_TIMEOUT:`REPLAY_TIMEOUT`,WORLD_CONTRACT_ERROR:`WORLD_CONTRACT_ERROR`};function n(e){return typeof e==`object`&&!!e&&`name`in e&&`message`in e}function r(e,t){if(t.length===0)return e;let n=[e];return t.forEach((e,r)=>{let i=r===t.length-1,a=i?`╰▶ `:`├▶ `,o=i?` `:`│ `;`${e.label}: ${e.value}`.split(`
1
+ import{r as e}from"./dist-FLIfyJ4Y.js";const t={USER_ERROR:`USER_ERROR`,RUNTIME_ERROR:`RUNTIME_ERROR`,CORRUPTED_EVENT_LOG:`CORRUPTED_EVENT_LOG`,REPLAY_DIVERGENCE:`REPLAY_DIVERGENCE`,MAX_DELIVERIES_EXCEEDED:`MAX_DELIVERIES_EXCEEDED`,REPLAY_TIMEOUT:`REPLAY_TIMEOUT`,WORLD_CONTRACT_ERROR:`WORLD_CONTRACT_ERROR`};function n(e){return typeof e==`object`&&!!e&&`name`in e&&`message`in e}function r(e,t){if(t.length===0)return e;let n=[e];return t.forEach((e,r)=>{let i=r===t.length-1,a=i?`╰▶ `:`├▶ `,o=i?` `:`│ `;`${e.label}: ${e.value}`.split(`
2
2
  `).forEach((e,t)=>n.push(`${t===0?a:o}${e}`))}),n.join(`
3
3
  `)}function i(e,t){let n=[];return e&&n.push({label:`hint`,value:e}),t&&n.push({label:`docs`,value:`https://workflow-sdk.dev/err/${t}`}),n}const a={NODE_JS_MODULE_IN_WORKFLOW:`node-js-module-in-workflow`,START_INVALID_WORKFLOW_FUNCTION:`start-invalid-workflow-function`,SERIALIZATION_FAILED:`serialization-failed`,WEBHOOK_INVALID_RESPOND_WITH_VALUE:`webhook-invalid-respond-with-value`,WEBHOOK_RESPONSE_NOT_SENT:`webhook-response-not-sent`,FETCH_IN_WORKFLOW_FUNCTION:`fetch-in-workflow`,TIMEOUT_FUNCTIONS_IN_WORKFLOW:`timeout-in-workflow`,HOOK_CONFLICT:`hook-conflict`,CORRUPTED_EVENT_LOG:`corrupted-event-log`,REPLAY_DIVERGENCE:`replay-divergence`,STEP_NOT_REGISTERED:`step-not-registered`,WORKFLOW_NOT_REGISTERED:`workflow-not-registered`,RUNTIME_DECRYPTION_FAILED:`runtime-decryption-failed`};var o=class extends Error{cause;constructor(e,t){let n=r(e,i(void 0,t?.slug));super(n,{cause:t?.cause}),t?.cause!==void 0&&(this.cause=t.cause),t?.cause instanceof Error&&(this.stack=`${this.stack}\nCaused by: ${t.cause.stack}`)}static is(e){return n(e)&&e.name===`WorkflowError`}},s=class extends o{status;code;url;retryAfter;constructor(e,t){super(e,{cause:t?.cause}),this.name=`WorkflowWorldError`,this.status=t?.status,this.code=t?.code,this.url=t?.url,this.retryAfter=t?.retryAfter}static is(e){return n(e)&&e.name===`WorkflowWorldError`}},c=class extends o{runId;errorCode;constructor(e,t,n={}){let r=t instanceof Error?t.message:typeof t==`string`?t:t&&typeof t==`object`&&`message`in t?String(t.message):`Unknown error`;super(`Workflow run "${e}" failed: ${r}`,{cause:t}),this.name=`WorkflowRunFailedError`,this.runId=e,n.errorCode!==void 0&&(this.errorCode=n.errorCode)}static is(e){return n(e)&&e.name===`WorkflowRunFailedError`}},l=class extends o{runId;status;constructor(e,t){super(`Workflow run "${e}" has not completed`,{}),this.name=`WorkflowRunNotCompletedError`,this.runId=e,this.status=t}static is(e){return n(e)&&e.name===`WorkflowRunNotCompletedError`}},u=class extends o{constructor(e,t){super(e,{...t}),this.name=`WorkflowRuntimeError`}static is(e){return n(e)&&e.name===`WorkflowRuntimeError`}},d=class extends u{constructor(e,t){super(e,{...t,slug:a.CORRUPTED_EVENT_LOG}),this.name=`CorruptedEventLogError`}static is(e){return n(e)&&e.name===`CorruptedEventLogError`}},f=class extends u{eventId;constructor(e,t){super(e,{...t,slug:a.REPLAY_DIVERGENCE}),this.name=`ReplayDivergenceError`,this.eventId=t.eventId}static is(e){return n(e)&&e.name===`ReplayDivergenceError`&&typeof e.eventId==`string`}},p=class extends u{context;constructor(e,t){super(e,{cause:t?.cause,slug:a.RUNTIME_DECRYPTION_FAILED}),this.name=`RuntimeDecryptionError`,t?.context!==void 0&&(this.context=t.context)}static is(e){return n(e)&&e.name===`RuntimeDecryptionError`}},m=class extends o{hint;constructor(e,t){let n=r(e,i(t?.hint,void 0));super(n,{cause:t?.cause}),this.name=`WorkflowBuildError`,this.hint=t?.hint}static is(e){return n(e)&&e.name===`WorkflowBuildError`}},h=class extends o{hint;fatal=!0;constructor(e,t){let n=r(e,i(t?.hint,void 0));super(n,{cause:t?.cause}),this.name=`SerializationError`,this.hint=t?.hint}static is(e){return n(e)&&e.name===`SerializationError`}},g=class extends u{stepName;constructor(e){super(`Step "${e}" is not registered in the current deployment. This usually indicates a build or bundling issue that caused the step to not be included in the deployment.`,{slug:a.STEP_NOT_REGISTERED}),this.name=`StepNotRegisteredError`,this.stepName=e}static is(e){return n(e)&&e.name===`StepNotRegisteredError`}},_=class extends u{workflowName;constructor(e){super(`Workflow "${e}" is not registered in the current deployment. This usually means a run was started against a deployment that does not have this workflow, or there was a build/bundling issue.`,{slug:a.WORKFLOW_NOT_REGISTERED}),this.name=`WorkflowNotRegisteredError`,this.workflowName=e}static is(e){return n(e)&&e.name===`WorkflowNotRegisteredError`}},v=class extends o{runId;constructor(e){super(`Workflow run "${e}" not found`,{}),this.name=`WorkflowRunNotFoundError`,this.runId=e}static is(e){return n(e)&&e.name===`WorkflowRunNotFoundError`}},y=class extends o{token;conflictingRunId;constructor(e,t){super(`Hook token "${e}" is already in use by another workflow${t?` (run "${t}")`:``}`,{slug:a.HOOK_CONFLICT}),this.name=`HookConflictError`,this.token=e,t!==void 0&&(this.conflictingRunId=t)}static is(e){return n(e)&&e.name===`HookConflictError`}},b=class extends o{token;constructor(e){super(`Hook not found`,{}),this.name=`HookNotFoundError`,this.token=e}static is(e){return n(e)&&e.name===`HookNotFoundError`}},x=class extends s{constructor(e){super(e),this.name=`EntityConflictError`}static is(e){return n(e)&&e.name===`EntityConflictError`}},S=class extends s{constructor(e){super(e),this.name=`RunExpiredError`}static is(e){return n(e)&&e.name===`RunExpiredError`}},C=class extends s{constructor(e,t){super(e,{retryAfter:t?.retryAfter}),this.name=`TooEarlyError`}static is(e){return n(e)&&e.name===`TooEarlyError`}},w=class extends s{retryAfter;constructor(e,t){super(e),this.name=`ThrottleError`,this.retryAfter=t?.retryAfter}static is(e){return n(e)&&e.name===`ThrottleError`}},T=class extends o{runId;constructor(e){super(`Workflow run "${e}" cancelled`,{}),this.name=`WorkflowRunCancelledError`,this.runId=e}static is(e){return n(e)&&e.name===`WorkflowRunCancelledError`}},E=class extends o{runSpecVersion;worldSpecVersion;constructor(e,t){super(`Run requires spec version ${e}, but world supports version ${t}. Please upgrade 'workflow' package.`),this.name=`RunNotSupportedError`,this.runSpecVersion=e,this.worldSpecVersion=t}static is(e){return n(e)&&e.name===`RunNotSupportedError`}},D=class extends Error{fatal=!0;constructor(e){super(e),this.name=`FatalError`}static is(e){return n(e)?e.name===`FatalError`?!0:e.fatal===!0:!1}},O=class extends Error{retryAfter;constructor(t,n={}){super(t),this.name=`RetryableError`,n.retryAfter===void 0?this.retryAfter=new Date(Date.now()+1e3):this.retryAfter=e(n.retryAfter)}static is(e){return n(e)&&e.name===`RetryableError`}};const k="Your current vercel account does not have access to this resource. Use `vercel login` or `vercel switch` to ensure you are linked to the right account.",A=Symbol.for(`@workflow/errors//FatalError`),j=Symbol.for(`@workflow/errors//RetryableError`),M=Symbol.for(`@workflow/errors//HookConflictError`),N=Symbol.for(`@workflow/errors//RuntimeDecryptionError`);typeof globalThis<`u`&&(Object.hasOwn(globalThis,A)||Object.defineProperty(globalThis,A,{value:D,writable:!1,enumerable:!1,configurable:!1}),Object.hasOwn(globalThis,j)||Object.defineProperty(globalThis,j,{value:O,writable:!1,enumerable:!1,configurable:!1}),Object.hasOwn(globalThis,M)||Object.defineProperty(globalThis,M,{value:y,writable:!1,enumerable:!1,configurable:!1}),Object.hasOwn(globalThis,N)||Object.defineProperty(globalThis,N,{value:p,writable:!1,enumerable:!1,configurable:!1}));export{v as C,t as E,l as S,s as T,m as _,y as a,T as b,O as c,p as d,h as f,k as g,C as h,D as i,S as l,w as m,a as n,b as o,g as p,x as r,f as s,d as t,E as u,o as v,u as w,c as x,_ as y};
@@ -1 +1 @@
1
- import{i as e,t}from"./chunk-DSjMdhoD.js";function n(e,t,n){return n===1?e:t}function r(e,t){if(typeof t!=`string`)return null;let[n,r,...i]=t.split(`//`);if(n!==e||!r||i.length===0)return null;let a=i.join(`//`),o=a.split(`/`).at(-1)??``,s=``;return s=r.startsWith(`./`)?r.split(`/`).at(-1)??``:(r.split(`@`).slice(0,-1).join(`@`)||r.split(`@`)[0])?.split(`/`).at(-1)??``,[`default`,`__default`].includes(o)&&s&&(o=s),{shortName:o,moduleSpecifier:r,functionName:a}}function i(e){return r(`workflow`,e)}function a(e){return r(`step`,e)}function o(e){return d(a(e),e)}function s(e){return d(i(e),e)}function c(e){return i(e)?.shortName??u(`workflow`,e)??e}function l(e){return a(e)?.shortName??u(`step`,e)??e}function u(e,t){if(!t.startsWith(`${e}--`))return null;let n=t.split(`--`).filter(Boolean),r=n.at(-1)?.split(`-`).filter(Boolean).at(-1)??``;if([`default`,`__default`].includes(r)){let t=n.at(-2)?.split(`-`).filter(Boolean).at(-1);t&&t!==e&&(r=t)}return r||null}function d(e,t){return e?`${e.shortName} (${e.moduleSpecifier})`:t}function f(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function p(e){let t={get value(){let n=e();return Object.defineProperty(t,"value",{value:n}),n}};return t}var m=e(t(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}}))(),1);function h(e){if(typeof e==`string`){let t=(0,m.default)(e);if(typeof t!=`number`||t<0)throw Error(`Invalid duration: "${e}". Expected a valid duration string like "1s", "1m", "1h", etc.`);return new Date(Date.now()+t)}else if(typeof e==`number`){if(e<0||!Number.isFinite(e))throw Error(`Invalid duration: ${e}. Expected a non-negative finite number of milliseconds.`);return new Date(Date.now()+e)}else if(e instanceof Date||e&&typeof e==`object`&&typeof e.getTime==`function`)return e instanceof Date?e:new Date(e.getTime());else throw Error(`Invalid duration parameter. Expected a duration string, number (milliseconds), or Date object.`)}function g(e=process.env){return e.WORKFLOW_TARGET_WORLD||(e.VERCEL_DEPLOYMENT_ID?`vercel`:`local`)}function _(e){return e===`vercel`||e===`@workflow/world-vercel`}export{f as a,a as c,c as d,n as f,p as i,i as l,g as n,o,h as r,s,_ as t,l as u};
1
+ import{a as e,t}from"./chunk-BHKSVoKr.js";function n(e,t,n){return n===1?e:t}function r(e,t){if(typeof t!=`string`)return null;let[n,r,...i]=t.split(`//`);if(n!==e||!r||i.length===0)return null;let a=i.join(`//`),o=a.split(`/`).at(-1)??``,s=``;return s=r.startsWith(`./`)?r.split(`/`).at(-1)??``:(r.split(`@`).slice(0,-1).join(`@`)||r.split(`@`)[0])?.split(`/`).at(-1)??``,[`default`,`__default`].includes(o)&&s&&(o=s),{shortName:o,moduleSpecifier:r,functionName:a}}function i(e){return r(`workflow`,e)}function a(e){return r(`step`,e)}function o(e){return d(a(e),e)}function s(e){return d(i(e),e)}function c(e){return i(e)?.shortName??u(`workflow`,e)??e}function l(e){return a(e)?.shortName??u(`step`,e)??e}function u(e,t){if(!t.startsWith(`${e}--`))return null;let n=t.split(`--`).filter(Boolean),r=n.at(-1)?.split(`-`).filter(Boolean).at(-1)??``;if([`default`,`__default`].includes(r)){let t=n.at(-2)?.split(`-`).filter(Boolean).at(-1);t&&t!==e&&(r=t)}return r||null}function d(e,t){return e?`${e.shortName} (${e.moduleSpecifier})`:t}function f(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function p(e){let t={get value(){let n=e();return Object.defineProperty(t,"value",{value:n}),n}};return t}var m=e(t(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}}))(),1);function h(e){if(typeof e==`string`){let t=(0,m.default)(e);if(typeof t!=`number`||t<0)throw Error(`Invalid duration: "${e}". Expected a valid duration string like "1s", "1m", "1h", etc.`);return new Date(Date.now()+t)}else if(typeof e==`number`){if(e<0||!Number.isFinite(e))throw Error(`Invalid duration: ${e}. Expected a non-negative finite number of milliseconds.`);return new Date(Date.now()+e)}else if(e instanceof Date||e&&typeof e==`object`&&typeof e.getTime==`function`)return e instanceof Date?e:new Date(e.getTime());else throw Error(`Invalid duration parameter. Expected a duration string, number (milliseconds), or Date object.`)}function g(e=process.env){return e.WORKFLOW_TARGET_WORLD||(e.VERCEL_DEPLOYMENT_ID?`vercel`:`local`)}function _(e){return e===`vercel`||e===`@workflow/world-vercel`}export{f as a,a as c,c as d,n as f,p as i,i as l,g as n,o,h as r,s,_ as t,l as u};
@@ -1 +1 @@
1
- import{t as e}from"./chunk-DSjMdhoD.js";var t=e(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{CITY_HEADER_NAME:()=>u,COUNTRY_HEADER_NAME:()=>d,EMOJI_FLAG_UNICODE_STARTING_POSITION:()=>v,IP_HEADER_NAME:()=>f,LATITUDE_HEADER_NAME:()=>p,LONGITUDE_HEADER_NAME:()=>m,POSTAL_CODE_HEADER_NAME:()=>g,REGION_HEADER_NAME:()=>h,REQUEST_ID_HEADER_NAME:()=>_,geolocation:()=>w,ipAddress:()=>S}),t.exports=c(l);let u=`x-vercel-ip-city`,d=`x-vercel-ip-country`,f=`x-real-ip`,p=`x-vercel-ip-latitude`,m=`x-vercel-ip-longitude`,h=`x-vercel-ip-country-region`,g=`x-vercel-ip-postal-code`,_=`x-vercel-id`,v=127397;function y(e,t){return e.get(t)??void 0}function b(e,t){let n=y(e.headers,t);return n?decodeURIComponent(n):void 0}function x(e){let t=RegExp(`^[A-Z]{2}$`).test(e);if(!(!e||!t))return String.fromCodePoint(...e.split(``).map(e=>v+e.charCodeAt(0)))}function S(e){return y(`headers`in e?e.headers:e,f)}function C(e){return e?e.split(`:`)[0]:`dev1`}function w(e){return{city:b(e,u),country:y(e.headers,d),flag:x(y(e.headers,d)),countryRegion:y(e.headers,h),region:C(y(e.headers,_)),latitude:y(e.headers,p),longitude:y(e.headers,m),postalCode:y(e.headers,g)}}0&&(t.exports={CITY_HEADER_NAME:u,COUNTRY_HEADER_NAME:d,EMOJI_FLAG_UNICODE_STARTING_POSITION:v,IP_HEADER_NAME:f,LATITUDE_HEADER_NAME:p,LONGITUDE_HEADER_NAME:m,POSTAL_CODE_HEADER_NAME:g,REGION_HEADER_NAME:h,REQUEST_ID_HEADER_NAME:_,geolocation:w,ipAddress:S})})),n=e(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{getEnv:()=>u}),t.exports=c(l);let u=(e=process.env)=>({VERCEL:d(e,`VERCEL`),CI:d(e,`CI`),VERCEL_ENV:d(e,`VERCEL_ENV`),VERCEL_URL:d(e,`VERCEL_URL`),VERCEL_BRANCH_URL:d(e,`VERCEL_BRANCH_URL`),VERCEL_PROJECT_PRODUCTION_URL:d(e,`VERCEL_PROJECT_PRODUCTION_URL`),VERCEL_REGION:d(e,`VERCEL_REGION`),VERCEL_DEPLOYMENT_ID:d(e,`VERCEL_DEPLOYMENT_ID`),VERCEL_SKEW_PROTECTION_ENABLED:d(e,`VERCEL_SKEW_PROTECTION_ENABLED`),VERCEL_AUTOMATION_BYPASS_SECRET:d(e,`VERCEL_AUTOMATION_BYPASS_SECRET`),VERCEL_GIT_PROVIDER:d(e,`VERCEL_GIT_PROVIDER`),VERCEL_GIT_REPO_SLUG:d(e,`VERCEL_GIT_REPO_SLUG`),VERCEL_GIT_REPO_OWNER:d(e,`VERCEL_GIT_REPO_OWNER`),VERCEL_GIT_REPO_ID:d(e,`VERCEL_GIT_REPO_ID`),VERCEL_GIT_COMMIT_REF:d(e,`VERCEL_GIT_COMMIT_REF`),VERCEL_GIT_COMMIT_SHA:d(e,`VERCEL_GIT_COMMIT_SHA`),VERCEL_GIT_COMMIT_MESSAGE:d(e,`VERCEL_GIT_COMMIT_MESSAGE`),VERCEL_GIT_COMMIT_AUTHOR_LOGIN:d(e,`VERCEL_GIT_COMMIT_AUTHOR_LOGIN`),VERCEL_GIT_COMMIT_AUTHOR_NAME:d(e,`VERCEL_GIT_COMMIT_AUTHOR_NAME`),VERCEL_GIT_PREVIOUS_SHA:d(e,`VERCEL_GIT_PREVIOUS_SHA`),VERCEL_GIT_PULL_REQUEST_ID:d(e,`VERCEL_GIT_PULL_REQUEST_ID`)}),d=(e,t)=>{let n=e[t];return n===``?void 0:n};0&&(t.exports={getEnv:u})})),r=e(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{SYMBOL_FOR_REQ_CONTEXT:()=>u,getContext:()=>d}),t.exports=c(l);let u=Symbol.for(`@vercel/request-context`);function d(){return globalThis[u]?.get?.()??{}}0&&(t.exports={SYMBOL_FOR_REQ_CONTEXT:u,getContext:d})})),i=e(((e,t)=>{var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,r,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==r&&n(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};s(u,{waitUntil:()=>f}),t.exports=l(u);var d=r();let f=e=>{if(typeof e!=`object`||!e||typeof e.then!=`function`)throw TypeError(`waitUntil can only be called with a Promise, got ${typeof e}`);return(0,d.getContext)().waitUntil?.(e)};0&&(t.exports={waitUntil:f})})),a=e(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{next:()=>f,rewrite:()=>d}),t.exports=c(l);function u(e,t){if(e?.request?.headers){if(!(e.request.headers instanceof Headers))throw Error(`request.headers must be an instance of Headers`);let n=[];for(let[r,i]of e.request.headers)t.set(`x-middleware-request-`+r,i),n.push(r);t.set(`x-middleware-override-headers`,n.join(`,`))}}function d(e,t){let n=new Headers(t?.headers??{});return n.set(`x-middleware-rewrite`,String(e)),u(t,n),new Response(null,{...t,headers:n})}function f(e){let t=new Headers(e?.headers??{});return t.set(`x-middleware-next`,`1`),u(e,t),new Response(null,{...e,headers:t})}0&&(t.exports={next:f,rewrite:d})})),o=e(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{InMemoryCache:()=>u}),t.exports=c(l);var u=class{constructor(){this.cache={}}async get(e){let t=this.cache[e];return t?t.ttl&&t.lastModified+t.ttl*1e3<Date.now()?(await this.delete(e),null):JSON.parse(t.value):null}async set(e,t,n){let r=JSON.stringify(t??null);this.cache[e]={value:r,lastModified:Date.now(),ttl:n?.ttl,tags:new Set(n?.tags||[])}}async delete(e){delete this.cache[e]}async expireTag(e){let t=Array.isArray(e)?e:[e];for(let e in this.cache)if(Object.prototype.hasOwnProperty.call(this.cache,e)){let n=this.cache[e];t.some(e=>n.tags.has(e))&&delete this.cache[e]}}};0&&(t.exports={InMemoryCache:u})})),s=e(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},l=e=>s(n({},`__esModule`,{value:!0}),e),u={};o(u,{BuildCache:()=>f}),t.exports=l(u);var d=c(),f=class{constructor({endpoint:e,headers:t,onError:n,timeout:r=500}){this.get=async e=>{let t=new AbortController,n=setTimeout(()=>t.abort(),this.timeout);try{let r=await fetch(`${this.endpoint}${e}`,{headers:this.headers,method:`GET`,signal:t.signal});if(r.status===404)return clearTimeout(n),null;if(r.status===200){if(r.headers.get(d.HEADERS_VERCEL_CACHE_STATE)!==d.PkgCacheState.Fresh)return r.body?.cancel?.(),clearTimeout(n),null;let e=await r.json();return clearTimeout(n),e}else throw clearTimeout(n),Error(`Failed to get cache: ${r.statusText}`)}catch(e){if(clearTimeout(n),e.name===`AbortError`){let t=Error(`Cache request timed out after ${this.timeout}ms`);t.stack=e.stack,this.onError?.(t)}else this.onError?.(e);return null}},this.set=async(e,t,n)=>{let r=new AbortController,i=setTimeout(()=>r.abort(),this.timeout);try{let a={};n?.ttl&&(a[d.HEADERS_VERCEL_REVALIDATE]=n.ttl.toString()),n?.tags&&n.tags.length>0&&(a[d.HEADERS_VERCEL_CACHE_TAGS]=n.tags.join(`,`)),n?.name&&(a[d.HEADERS_VERCEL_CACHE_ITEM_NAME]=n.name);let o=await fetch(`${this.endpoint}${e}`,{method:`POST`,headers:{...this.headers,...a},body:JSON.stringify(t),signal:r.signal});if(clearTimeout(i),o.status!==200)throw Error(`Failed to set cache: ${o.status} ${o.statusText}`)}catch(e){if(clearTimeout(i),e.name===`AbortError`){let t=Error(`Cache request timed out after ${this.timeout}ms`);t.stack=e.stack,this.onError?.(t)}else this.onError?.(e)}},this.delete=async e=>{let t=new AbortController,n=setTimeout(()=>t.abort(),this.timeout);try{let r=await fetch(`${this.endpoint}${e}`,{method:`DELETE`,headers:this.headers,signal:t.signal});if(clearTimeout(n),r.status!==200)throw Error(`Failed to delete cache: ${r.statusText}`)}catch(e){if(clearTimeout(n),e.name===`AbortError`){let t=Error(`Cache request timed out after ${this.timeout}ms`);t.stack=e.stack,this.onError?.(t)}else this.onError?.(e)}},this.expireTag=async e=>{let t=new AbortController,n=setTimeout(()=>t.abort(),this.timeout);try{Array.isArray(e)&&(e=e.join(`,`));let r=await fetch(`${this.endpoint}revalidate?tags=${e}`,{method:`POST`,headers:this.headers,signal:t.signal});if(clearTimeout(n),r.status!==200)throw Error(`Failed to revalidate tag: ${r.statusText}`)}catch(e){if(clearTimeout(n),e.name===`AbortError`){let t=Error(`Cache request timed out after ${this.timeout}ms`);t.stack=e.stack,this.onError?.(t)}else this.onError?.(e)}},this.endpoint=e,this.headers=t,this.onError=n,this.timeout=r}};0&&(t.exports={BuildCache:f})})),c=e(((e,t)=>{var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,c=Object.prototype.hasOwnProperty,l=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},u=(e,t,r,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let s of a(t))!c.call(e,s)&&s!==r&&n(e,s,{get:()=>t[s],enumerable:!(o=i(t,s))||o.enumerable});return e},d=e=>u(n({},`__esModule`,{value:!0}),e),f={};l(f,{HEADERS_VERCEL_CACHE_ITEM_NAME:()=>O,HEADERS_VERCEL_CACHE_STATE:()=>T,HEADERS_VERCEL_CACHE_TAGS:()=>D,HEADERS_VERCEL_REVALIDATE:()=>E,PkgCacheState:()=>w,getCache:()=>y}),t.exports=d(f);var p=r(),m=o(),h=s();let g=e=>{let t=5381;for(let n=0;n<e.length;n++)t=t*33^e.charCodeAt(n);return(t>>>0).toString(16)},_=null,v=null,y=e=>x(()=>{let e;return e=(0,p.getContext)().cache?(0,p.getContext)().cache:C(process.env.SUSPENSE_CACHE_DEBUG===`true`),e},b(e));function b(e){let t=e?.keyHashFunction||g;return n=>{if(!e?.namespace)return t(n);let r=e.namespaceSeparator||`$`;return`${e.namespace}${r}${t(n)}`}}function x(e,t){return{get:n=>e().get(t(n)),set:(n,r,i)=>e().set(t(n),r,{...i,name:i?.name??n}),delete:n=>e().delete(t(n)),expireTag:t=>e().expireTag(t)}}let S=!1;function C(e){if(_||=new m.InMemoryCache,process.env.RUNTIME_CACHE_DISABLE_BUILD_CACHE===`true`)return e&&console.log(`Using InMemoryCache as build cache is disabled`),_;let{RUNTIME_CACHE_ENDPOINT:t,RUNTIME_CACHE_HEADERS:n}=process.env;if(e&&console.log(`Runtime cache environment variables:`,{RUNTIME_CACHE_ENDPOINT:t,RUNTIME_CACHE_HEADERS:n}),!t||!n)return S||=(console.warn(`Runtime Cache unavailable in this environment. Falling back to in-memory cache.`),!0),_;if(!v){let e={};try{e=JSON.parse(n)}catch(e){return console.error(`Failed to parse RUNTIME_CACHE_HEADERS:`,e),_}let r=500;if(process.env.RUNTIME_CACHE_TIMEOUT){let e=parseInt(process.env.RUNTIME_CACHE_TIMEOUT,10);!isNaN(e)&&e>0?r=e:console.warn(`Invalid RUNTIME_CACHE_TIMEOUT value: "${process.env.RUNTIME_CACHE_TIMEOUT}". Using default: ${r}ms`)}v=new h.BuildCache({endpoint:t,headers:e,onError:e=>console.error(e),timeout:r})}return v}var w=(e=>(e.Fresh=`fresh`,e.Stale=`stale`,e.Expired=`expired`,e.NotFound=`notFound`,e.Error=`error`,e))(w||{});let T=`x-vercel-cache-state`,E=`x-vercel-revalidate`,D=`x-vercel-cache-tags`,O=`x-vercel-cache-item-name`;0&&(t.exports={HEADERS_VERCEL_CACHE_ITEM_NAME:O,HEADERS_VERCEL_CACHE_STATE:T,HEADERS_VERCEL_CACHE_TAGS:D,HEADERS_VERCEL_REVALIDATE:E,PkgCacheState:w,getCache:y})})),l=e(((e,t)=>{var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,r,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==r&&n(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};s(u,{attachDatabasePool:()=>v,experimental_attachDatabasePool:()=>y}),t.exports=l(u);var d=r();let f=!!process.env.DEBUG;function p(e){if(`options`in e&&e.options){if(`idleTimeoutMillis`in e.options)return typeof e.options.idleTimeoutMillis==`number`?e.options.idleTimeoutMillis:1e4;if(`maxIdleTimeMS`in e.options)return typeof e.options.maxIdleTimeMS==`number`?e.options.maxIdleTimeMS:0;if(`status`in e)return 5e3;if(`connect`in e&&`execute`in e)return 3e4}if(`config`in e&&e.config){if(`connectionConfig`in e.config&&e.config.connectionConfig)return e.config.connectionConfig.idleTimeout||6e4;if(`idleTimeout`in e.config)return typeof e.config.idleTimeout==`number`?e.config.idleTimeout:6e4}return`poolTimeout`in e?typeof e.poolTimeout==`number`?e.poolTimeout:6e4:`idleTimeout`in e?typeof e.idleTimeout==`number`?e.idleTimeout:0:1e4}let m=null,h=()=>{},g=Date.now();function _(e){if(!process.env.VERCEL_URL||!process.env.VERCEL_REGION)return;m&&(clearTimeout(m),h());let t=new Promise(e=>{h=e}),n=Math.min(p(e)+100,Math.max(100,899e3-(Date.now()-g)));m=setTimeout(()=>{h?.(),f&&console.log(`Database pool idle timeout reached. Releasing connections.`)},n);let r=(0,d.getContext)();r?.waitUntil?r.waitUntil(t):console.warn(`Pool release event triggered outside of request scope.`)}function v(e){if(m&&(h?.(),clearTimeout(m)),`on`in e&&e.on&&`options`in e&&`idleTimeoutMillis`in e.options){e.on(`release`,()=>{f&&console.log(`Client released from pool`),_(e)});return}else if(`on`in e&&e.on&&`config`in e&&e.config&&`connectionConfig`in e.config){e.on(`release`,()=>{f&&console.log(`MySQL client released from pool`),_(e)});return}else if(`on`in e&&e.on&&`config`in e&&e.config&&`idleTimeout`in e.config){e.on(`release`,()=>{f&&console.log(`MySQL2/MariaDB client released from pool`),_(e)});return}if(`on`in e&&e.on&&`options`in e&&e.options&&`maxIdleTimeMS`in e.options){e.on(`connectionCheckedOut`,()=>{f&&console.log(`MongoDB connection checked out`),_(e)});return}if(`on`in e&&e.on&&`options`in e&&e.options&&`socket`in e.options){e.on(`end`,()=>{f&&console.log(`Redis connection ended`),_(e)});return}throw Error(`Unsupported database pool type`)}let y=v;0&&(t.exports={attachDatabasePool:v,experimental_attachDatabasePool:y})})),u=e(((e,t)=>{var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,r,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==r&&n(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};s(u,{dangerouslyDeleteBySrcImage:()=>h,dangerouslyDeleteByTag:()=>p,invalidateBySrcImage:()=>m,invalidateByTag:()=>f}),t.exports=l(u);var d=r();let f=e=>{let t=(0,d.getContext)().purge;return t?t.invalidateByTag(e):Promise.resolve()},p=(e,t)=>{let n=(0,d.getContext)().purge;return n?n.dangerouslyDeleteByTag(e,t):Promise.resolve()},m=e=>{let t=(0,d.getContext)().purge;return t?t.invalidateBySrcImage(e):Promise.resolve()},h=(e,t)=>{let n=(0,d.getContext)().purge;return n?n.dangerouslyDeleteBySrcImage(e,t):Promise.resolve()};0&&(t.exports={dangerouslyDeleteBySrcImage:h,dangerouslyDeleteByTag:p,invalidateBySrcImage:m,invalidateByTag:f})})),d=e(((e,t)=>{var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,r,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==r&&n(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};s(u,{addCacheTag:()=>f}),t.exports=l(u);var d=r();let f=e=>{let t=(0,d.getContext)().addCacheTag;return t?t(e):Promise.resolve()};0&&(t.exports={addCacheTag:f})})),f=e(((e,r)=>{var o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,p=Object.prototype.hasOwnProperty,m=(e,t)=>{for(var n in t)o(e,n,{get:t[n],enumerable:!0})},h=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of f(t))!p.call(e,i)&&i!==n&&o(e,i,{get:()=>t[i],enumerable:!(r=s(t,i))||r.enumerable});return e},g=e=>h(o({},`__esModule`,{value:!0}),e),_={};m(_,{addCacheTag:()=>T.addCacheTag,attachDatabasePool:()=>C.attachDatabasePool,dangerouslyDeleteBySrcImage:()=>w.dangerouslyDeleteBySrcImage,dangerouslyDeleteByTag:()=>w.dangerouslyDeleteByTag,experimental_attachDatabasePool:()=>C.experimental_attachDatabasePool,geolocation:()=>v.geolocation,getCache:()=>S.getCache,getEnv:()=>y.getEnv,invalidateBySrcImage:()=>w.invalidateBySrcImage,invalidateByTag:()=>w.invalidateByTag,ipAddress:()=>v.ipAddress,next:()=>x.next,rewrite:()=>x.rewrite,waitUntil:()=>b.waitUntil}),r.exports=g(_);var v=t(),y=n(),b=i(),x=a(),S=c(),C=l(),w=u(),T=d();0&&(r.exports={addCacheTag,attachDatabasePool,dangerouslyDeleteBySrcImage,dangerouslyDeleteByTag,experimental_attachDatabasePool,geolocation,getCache,getEnv,invalidateBySrcImage,invalidateByTag,ipAddress,next,rewrite,waitUntil})}));export default f();export{};
1
+ import{t as e}from"./chunk-BHKSVoKr.js";var t=e(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{CITY_HEADER_NAME:()=>u,COUNTRY_HEADER_NAME:()=>d,EMOJI_FLAG_UNICODE_STARTING_POSITION:()=>v,IP_HEADER_NAME:()=>f,LATITUDE_HEADER_NAME:()=>p,LONGITUDE_HEADER_NAME:()=>m,POSTAL_CODE_HEADER_NAME:()=>g,REGION_HEADER_NAME:()=>h,REQUEST_ID_HEADER_NAME:()=>_,geolocation:()=>w,ipAddress:()=>S}),t.exports=c(l);let u=`x-vercel-ip-city`,d=`x-vercel-ip-country`,f=`x-real-ip`,p=`x-vercel-ip-latitude`,m=`x-vercel-ip-longitude`,h=`x-vercel-ip-country-region`,g=`x-vercel-ip-postal-code`,_=`x-vercel-id`,v=127397;function y(e,t){return e.get(t)??void 0}function b(e,t){let n=y(e.headers,t);return n?decodeURIComponent(n):void 0}function x(e){let t=RegExp(`^[A-Z]{2}$`).test(e);if(!(!e||!t))return String.fromCodePoint(...e.split(``).map(e=>v+e.charCodeAt(0)))}function S(e){return y(`headers`in e?e.headers:e,f)}function C(e){return e?e.split(`:`)[0]:`dev1`}function w(e){return{city:b(e,u),country:y(e.headers,d),flag:x(y(e.headers,d)),countryRegion:y(e.headers,h),region:C(y(e.headers,_)),latitude:y(e.headers,p),longitude:y(e.headers,m),postalCode:y(e.headers,g)}}0&&(t.exports={CITY_HEADER_NAME:u,COUNTRY_HEADER_NAME:d,EMOJI_FLAG_UNICODE_STARTING_POSITION:v,IP_HEADER_NAME:f,LATITUDE_HEADER_NAME:p,LONGITUDE_HEADER_NAME:m,POSTAL_CODE_HEADER_NAME:g,REGION_HEADER_NAME:h,REQUEST_ID_HEADER_NAME:_,geolocation:w,ipAddress:S})})),n=e(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{getEnv:()=>u}),t.exports=c(l);let u=(e=process.env)=>({VERCEL:d(e,`VERCEL`),CI:d(e,`CI`),VERCEL_ENV:d(e,`VERCEL_ENV`),VERCEL_URL:d(e,`VERCEL_URL`),VERCEL_BRANCH_URL:d(e,`VERCEL_BRANCH_URL`),VERCEL_PROJECT_PRODUCTION_URL:d(e,`VERCEL_PROJECT_PRODUCTION_URL`),VERCEL_REGION:d(e,`VERCEL_REGION`),VERCEL_DEPLOYMENT_ID:d(e,`VERCEL_DEPLOYMENT_ID`),VERCEL_SKEW_PROTECTION_ENABLED:d(e,`VERCEL_SKEW_PROTECTION_ENABLED`),VERCEL_AUTOMATION_BYPASS_SECRET:d(e,`VERCEL_AUTOMATION_BYPASS_SECRET`),VERCEL_GIT_PROVIDER:d(e,`VERCEL_GIT_PROVIDER`),VERCEL_GIT_REPO_SLUG:d(e,`VERCEL_GIT_REPO_SLUG`),VERCEL_GIT_REPO_OWNER:d(e,`VERCEL_GIT_REPO_OWNER`),VERCEL_GIT_REPO_ID:d(e,`VERCEL_GIT_REPO_ID`),VERCEL_GIT_COMMIT_REF:d(e,`VERCEL_GIT_COMMIT_REF`),VERCEL_GIT_COMMIT_SHA:d(e,`VERCEL_GIT_COMMIT_SHA`),VERCEL_GIT_COMMIT_MESSAGE:d(e,`VERCEL_GIT_COMMIT_MESSAGE`),VERCEL_GIT_COMMIT_AUTHOR_LOGIN:d(e,`VERCEL_GIT_COMMIT_AUTHOR_LOGIN`),VERCEL_GIT_COMMIT_AUTHOR_NAME:d(e,`VERCEL_GIT_COMMIT_AUTHOR_NAME`),VERCEL_GIT_PREVIOUS_SHA:d(e,`VERCEL_GIT_PREVIOUS_SHA`),VERCEL_GIT_PULL_REQUEST_ID:d(e,`VERCEL_GIT_PULL_REQUEST_ID`)}),d=(e,t)=>{let n=e[t];return n===``?void 0:n};0&&(t.exports={getEnv:u})})),r=e(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{SYMBOL_FOR_REQ_CONTEXT:()=>u,getContext:()=>d}),t.exports=c(l);let u=Symbol.for(`@vercel/request-context`);function d(){return globalThis[u]?.get?.()??{}}0&&(t.exports={SYMBOL_FOR_REQ_CONTEXT:u,getContext:d})})),i=e(((e,t)=>{var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,r,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==r&&n(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};s(u,{waitUntil:()=>f}),t.exports=l(u);var d=r();let f=e=>{if(typeof e!=`object`||!e||typeof e.then!=`function`)throw TypeError(`waitUntil can only be called with a Promise, got ${typeof e}`);return(0,d.getContext)().waitUntil?.(e)};0&&(t.exports={waitUntil:f})})),a=e(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{next:()=>f,rewrite:()=>d}),t.exports=c(l);function u(e,t){if(e?.request?.headers){if(!(e.request.headers instanceof Headers))throw Error(`request.headers must be an instance of Headers`);let n=[];for(let[r,i]of e.request.headers)t.set(`x-middleware-request-`+r,i),n.push(r);t.set(`x-middleware-override-headers`,n.join(`,`))}}function d(e,t){let n=new Headers(t?.headers??{});return n.set(`x-middleware-rewrite`,String(e)),u(t,n),new Response(null,{...t,headers:n})}function f(e){let t=new Headers(e?.headers??{});return t.set(`x-middleware-next`,`1`),u(e,t),new Response(null,{...e,headers:t})}0&&(t.exports={next:f,rewrite:d})})),o=e(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{InMemoryCache:()=>u}),t.exports=c(l);var u=class{constructor(){this.cache={}}async get(e){let t=this.cache[e];return t?t.ttl&&t.lastModified+t.ttl*1e3<Date.now()?(await this.delete(e),null):JSON.parse(t.value):null}async set(e,t,n){let r=JSON.stringify(t??null);this.cache[e]={value:r,lastModified:Date.now(),ttl:n?.ttl,tags:new Set(n?.tags||[])}}async delete(e){delete this.cache[e]}async expireTag(e){let t=Array.isArray(e)?e:[e];for(let e in this.cache)if(Object.prototype.hasOwnProperty.call(this.cache,e)){let n=this.cache[e];t.some(e=>n.tags.has(e))&&delete this.cache[e]}}};0&&(t.exports={InMemoryCache:u})})),s=e(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},l=e=>s(n({},`__esModule`,{value:!0}),e),u={};o(u,{BuildCache:()=>f}),t.exports=l(u);var d=c(),f=class{constructor({endpoint:e,headers:t,onError:n,timeout:r=500}){this.get=async e=>{let t=new AbortController,n=setTimeout(()=>t.abort(),this.timeout);try{let r=await fetch(`${this.endpoint}${e}`,{headers:this.headers,method:`GET`,signal:t.signal});if(r.status===404)return clearTimeout(n),null;if(r.status===200){if(r.headers.get(d.HEADERS_VERCEL_CACHE_STATE)!==d.PkgCacheState.Fresh)return r.body?.cancel?.(),clearTimeout(n),null;let e=await r.json();return clearTimeout(n),e}else throw clearTimeout(n),Error(`Failed to get cache: ${r.statusText}`)}catch(e){if(clearTimeout(n),e.name===`AbortError`){let t=Error(`Cache request timed out after ${this.timeout}ms`);t.stack=e.stack,this.onError?.(t)}else this.onError?.(e);return null}},this.set=async(e,t,n)=>{let r=new AbortController,i=setTimeout(()=>r.abort(),this.timeout);try{let a={};n?.ttl&&(a[d.HEADERS_VERCEL_REVALIDATE]=n.ttl.toString()),n?.tags&&n.tags.length>0&&(a[d.HEADERS_VERCEL_CACHE_TAGS]=n.tags.join(`,`)),n?.name&&(a[d.HEADERS_VERCEL_CACHE_ITEM_NAME]=n.name);let o=await fetch(`${this.endpoint}${e}`,{method:`POST`,headers:{...this.headers,...a},body:JSON.stringify(t),signal:r.signal});if(clearTimeout(i),o.status!==200)throw Error(`Failed to set cache: ${o.status} ${o.statusText}`)}catch(e){if(clearTimeout(i),e.name===`AbortError`){let t=Error(`Cache request timed out after ${this.timeout}ms`);t.stack=e.stack,this.onError?.(t)}else this.onError?.(e)}},this.delete=async e=>{let t=new AbortController,n=setTimeout(()=>t.abort(),this.timeout);try{let r=await fetch(`${this.endpoint}${e}`,{method:`DELETE`,headers:this.headers,signal:t.signal});if(clearTimeout(n),r.status!==200)throw Error(`Failed to delete cache: ${r.statusText}`)}catch(e){if(clearTimeout(n),e.name===`AbortError`){let t=Error(`Cache request timed out after ${this.timeout}ms`);t.stack=e.stack,this.onError?.(t)}else this.onError?.(e)}},this.expireTag=async e=>{let t=new AbortController,n=setTimeout(()=>t.abort(),this.timeout);try{Array.isArray(e)&&(e=e.join(`,`));let r=await fetch(`${this.endpoint}revalidate?tags=${e}`,{method:`POST`,headers:this.headers,signal:t.signal});if(clearTimeout(n),r.status!==200)throw Error(`Failed to revalidate tag: ${r.statusText}`)}catch(e){if(clearTimeout(n),e.name===`AbortError`){let t=Error(`Cache request timed out after ${this.timeout}ms`);t.stack=e.stack,this.onError?.(t)}else this.onError?.(e)}},this.endpoint=e,this.headers=t,this.onError=n,this.timeout=r}};0&&(t.exports={BuildCache:f})})),c=e(((e,t)=>{var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,c=Object.prototype.hasOwnProperty,l=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},u=(e,t,r,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let s of a(t))!c.call(e,s)&&s!==r&&n(e,s,{get:()=>t[s],enumerable:!(o=i(t,s))||o.enumerable});return e},d=e=>u(n({},`__esModule`,{value:!0}),e),f={};l(f,{HEADERS_VERCEL_CACHE_ITEM_NAME:()=>O,HEADERS_VERCEL_CACHE_STATE:()=>T,HEADERS_VERCEL_CACHE_TAGS:()=>D,HEADERS_VERCEL_REVALIDATE:()=>E,PkgCacheState:()=>w,getCache:()=>y}),t.exports=d(f);var p=r(),m=o(),h=s();let g=e=>{let t=5381;for(let n=0;n<e.length;n++)t=t*33^e.charCodeAt(n);return(t>>>0).toString(16)},_=null,v=null,y=e=>x(()=>{let e;return e=(0,p.getContext)().cache?(0,p.getContext)().cache:C(process.env.SUSPENSE_CACHE_DEBUG===`true`),e},b(e));function b(e){let t=e?.keyHashFunction||g;return n=>{if(!e?.namespace)return t(n);let r=e.namespaceSeparator||`$`;return`${e.namespace}${r}${t(n)}`}}function x(e,t){return{get:n=>e().get(t(n)),set:(n,r,i)=>e().set(t(n),r,{...i,name:i?.name??n}),delete:n=>e().delete(t(n)),expireTag:t=>e().expireTag(t)}}let S=!1;function C(e){if(_||=new m.InMemoryCache,process.env.RUNTIME_CACHE_DISABLE_BUILD_CACHE===`true`)return e&&console.log(`Using InMemoryCache as build cache is disabled`),_;let{RUNTIME_CACHE_ENDPOINT:t,RUNTIME_CACHE_HEADERS:n}=process.env;if(e&&console.log(`Runtime cache environment variables:`,{RUNTIME_CACHE_ENDPOINT:t,RUNTIME_CACHE_HEADERS:n}),!t||!n)return S||=(console.warn(`Runtime Cache unavailable in this environment. Falling back to in-memory cache.`),!0),_;if(!v){let e={};try{e=JSON.parse(n)}catch(e){return console.error(`Failed to parse RUNTIME_CACHE_HEADERS:`,e),_}let r=500;if(process.env.RUNTIME_CACHE_TIMEOUT){let e=parseInt(process.env.RUNTIME_CACHE_TIMEOUT,10);!isNaN(e)&&e>0?r=e:console.warn(`Invalid RUNTIME_CACHE_TIMEOUT value: "${process.env.RUNTIME_CACHE_TIMEOUT}". Using default: ${r}ms`)}v=new h.BuildCache({endpoint:t,headers:e,onError:e=>console.error(e),timeout:r})}return v}var w=(e=>(e.Fresh=`fresh`,e.Stale=`stale`,e.Expired=`expired`,e.NotFound=`notFound`,e.Error=`error`,e))(w||{});let T=`x-vercel-cache-state`,E=`x-vercel-revalidate`,D=`x-vercel-cache-tags`,O=`x-vercel-cache-item-name`;0&&(t.exports={HEADERS_VERCEL_CACHE_ITEM_NAME:O,HEADERS_VERCEL_CACHE_STATE:T,HEADERS_VERCEL_CACHE_TAGS:D,HEADERS_VERCEL_REVALIDATE:E,PkgCacheState:w,getCache:y})})),l=e(((e,t)=>{var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,r,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==r&&n(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};s(u,{attachDatabasePool:()=>v,experimental_attachDatabasePool:()=>y}),t.exports=l(u);var d=r();let f=!!process.env.DEBUG;function p(e){if(`options`in e&&e.options){if(`idleTimeoutMillis`in e.options)return typeof e.options.idleTimeoutMillis==`number`?e.options.idleTimeoutMillis:1e4;if(`maxIdleTimeMS`in e.options)return typeof e.options.maxIdleTimeMS==`number`?e.options.maxIdleTimeMS:0;if(`status`in e)return 5e3;if(`connect`in e&&`execute`in e)return 3e4}if(`config`in e&&e.config){if(`connectionConfig`in e.config&&e.config.connectionConfig)return e.config.connectionConfig.idleTimeout||6e4;if(`idleTimeout`in e.config)return typeof e.config.idleTimeout==`number`?e.config.idleTimeout:6e4}return`poolTimeout`in e?typeof e.poolTimeout==`number`?e.poolTimeout:6e4:`idleTimeout`in e?typeof e.idleTimeout==`number`?e.idleTimeout:0:1e4}let m=null,h=()=>{},g=Date.now();function _(e){if(!process.env.VERCEL_URL||!process.env.VERCEL_REGION)return;m&&(clearTimeout(m),h());let t=new Promise(e=>{h=e}),n=Math.min(p(e)+100,Math.max(100,899e3-(Date.now()-g)));m=setTimeout(()=>{h?.(),f&&console.log(`Database pool idle timeout reached. Releasing connections.`)},n);let r=(0,d.getContext)();r?.waitUntil?r.waitUntil(t):console.warn(`Pool release event triggered outside of request scope.`)}function v(e){if(m&&(h?.(),clearTimeout(m)),`on`in e&&e.on&&`options`in e&&`idleTimeoutMillis`in e.options){e.on(`release`,()=>{f&&console.log(`Client released from pool`),_(e)});return}else if(`on`in e&&e.on&&`config`in e&&e.config&&`connectionConfig`in e.config){e.on(`release`,()=>{f&&console.log(`MySQL client released from pool`),_(e)});return}else if(`on`in e&&e.on&&`config`in e&&e.config&&`idleTimeout`in e.config){e.on(`release`,()=>{f&&console.log(`MySQL2/MariaDB client released from pool`),_(e)});return}if(`on`in e&&e.on&&`options`in e&&e.options&&`maxIdleTimeMS`in e.options){e.on(`connectionCheckedOut`,()=>{f&&console.log(`MongoDB connection checked out`),_(e)});return}if(`on`in e&&e.on&&`options`in e&&e.options&&`socket`in e.options){e.on(`end`,()=>{f&&console.log(`Redis connection ended`),_(e)});return}throw Error(`Unsupported database pool type`)}let y=v;0&&(t.exports={attachDatabasePool:v,experimental_attachDatabasePool:y})})),u=e(((e,t)=>{var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,r,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==r&&n(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};s(u,{dangerouslyDeleteBySrcImage:()=>h,dangerouslyDeleteByTag:()=>p,invalidateBySrcImage:()=>m,invalidateByTag:()=>f}),t.exports=l(u);var d=r();let f=e=>{let t=(0,d.getContext)().purge;return t?t.invalidateByTag(e):Promise.resolve()},p=(e,t)=>{let n=(0,d.getContext)().purge;return n?n.dangerouslyDeleteByTag(e,t):Promise.resolve()},m=e=>{let t=(0,d.getContext)().purge;return t?t.invalidateBySrcImage(e):Promise.resolve()},h=(e,t)=>{let n=(0,d.getContext)().purge;return n?n.dangerouslyDeleteBySrcImage(e,t):Promise.resolve()};0&&(t.exports={dangerouslyDeleteBySrcImage:h,dangerouslyDeleteByTag:p,invalidateBySrcImage:m,invalidateByTag:f})})),d=e(((e,t)=>{var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,r,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==r&&n(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};s(u,{addCacheTag:()=>f}),t.exports=l(u);var d=r();let f=e=>{let t=(0,d.getContext)().addCacheTag;return t?t(e):Promise.resolve()};0&&(t.exports={addCacheTag:f})})),f=e(((e,t)=>{var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,r,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==r&&n(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};s(u,{experimental_upgradeWebSocket:()=>p}),t.exports=l(u);var d=r();async function f(){try{return(await import(`./wrapper-CQmdlFyy.js`)).WebSocketServer}catch{throw Error(`The "ws" package is required for experimental_upgradeWebSocket(). Install it with: npm install ws`)}}async function p(e){let t=(0,d.getContext)();if(typeof t.upgradeWebSocket!=`function`)throw Error(`experimental_upgradeWebSocket is not available in the current runtime environment. This feature requires a Vercel runtime that supports WebSocket upgrades.`);let n=await f(),{req:r,socket:i,head:a}=t.upgradeWebSocket(),o=new n({noServer:!0}),s=await new Promise((e,t)=>{let n=()=>{i.removeListener(`error`,l),i.removeListener(`close`,u)},s=e=>{if(n(),e instanceof Error){t(e);return}let r=Error(`WebSocket upgrade failed`);r.cause=e,t(r)},c=t=>{n(),e(t)},l=e=>s(e),u=()=>s(Error(`socket closed before the WebSocket upgrade completed`));i.once(`error`,l),i.once(`close`,u);try{o.handleUpgrade(r,i,a,c)}catch(e){s(e)}});try{await e(s)}catch(e){throw s.close(1011,`WebSocket handler failed`),e}return new Response(null,{status:204})}0&&(t.exports={experimental_upgradeWebSocket:p})})),p=e(((e,r)=>{var o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,h=(e,t)=>{for(var n in t)o(e,n,{get:t[n],enumerable:!0})},g=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of p(t))!m.call(e,i)&&i!==n&&o(e,i,{get:()=>t[i],enumerable:!(r=s(t,i))||r.enumerable});return e},_=e=>g(o({},`__esModule`,{value:!0}),e),v={};h(v,{addCacheTag:()=>E.addCacheTag,attachDatabasePool:()=>w.attachDatabasePool,dangerouslyDeleteBySrcImage:()=>T.dangerouslyDeleteBySrcImage,dangerouslyDeleteByTag:()=>T.dangerouslyDeleteByTag,experimental_attachDatabasePool:()=>w.experimental_attachDatabasePool,experimental_upgradeWebSocket:()=>D.experimental_upgradeWebSocket,geolocation:()=>y.geolocation,getCache:()=>C.getCache,getEnv:()=>b.getEnv,invalidateBySrcImage:()=>T.invalidateBySrcImage,invalidateByTag:()=>T.invalidateByTag,ipAddress:()=>y.ipAddress,next:()=>S.next,rewrite:()=>S.rewrite,waitUntil:()=>x.waitUntil}),r.exports=_(v);var y=t(),b=n(),x=i(),S=a(),C=c(),w=l(),T=u(),E=d(),D=f();0&&(r.exports={addCacheTag,attachDatabasePool,dangerouslyDeleteBySrcImage,dangerouslyDeleteByTag,experimental_attachDatabasePool,experimental_upgradeWebSocket,geolocation,getCache,getEnv,invalidateBySrcImage,invalidateByTag,ipAddress,next,rewrite,waitUntil})}));export default p();export{};
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-BHKSVoKr.js";import{n as t,o as n,w as r}from"./dist-Dxrjttr2.js";import{E as i,Gt as a,It as o,Nt as s,Y as c,a as l,cn as u,en as d,fn as f,it as p,m,n as h,nt as g,q as _,r as v,rt as y,y as b,yn as x,z as S}from"./attribute-changes-Bi5DLT8S.js";var C=e({getHookByToken:()=>T,resumeHook:()=>E,resumeWebhook:()=>D});async function w(e){let t=await u(),n=await t.hooks.getByToken(e),r=await t.runs.get(n.runId),a=await t.getEncryptionKeyForRun?.(r),o=a?await f(a):void 0;return n.metadata!==void 0&&(n.metadata=await i(n.metadata,n.runId,o)),{hook:n,run:r,encryptionKey:o}}async function T(e){let{hook:t}=await w(e);return t}async function E(e,t,n){return await v(()=>c(`hook.resume`,async r=>{let i=await u();try{let c,u,d;if(typeof e==`string`){let t=await w(e);c=t.hook,u=t.run,d=n??t.encryptionKey}else if(c=e,u=await i.runs.get(c.runId),n)d=n;else{let e=await i.getEncryptionKeyForRun?.(u);d=e?await f(e):void 0}r?.setAttributes({...p(c.token),...y(c.hookId),...o(c.runId)});let g=u.executionContext?.workflowCoreVersion,v=m(typeof g==`string`?g:void 0);v.supportedFormats.has(a.ENCRYPTED)||(d=void 0);let C=(u.specVersion??0)>=5&&v.supportedFormats.has(a.GZIP),T=[],E=x(c.specVersion),D=await b(t,c.runId,d,T,globalThis,E,v.framedByteStreams,C);h(Promise.all(T),e=>{e!==void 0&&S.warn(`Background flush of hook payload ops failed`,{workflowRunId:c.runId,hookId:c.hookId,error:e instanceof Error?e.message:String(e)})}),await i.events.create(c.runId,{eventType:`hook_received`,specVersion:5,correlationId:c.hookId,eventData:{...E?{}:{token:c.token},payload:D}},{v1Compat:E}),r?.setAttributes({...s(u.workflowName)});let O=await _(u.executionContext?.traceCarrier);return O&&r?.addLink?.(O),await i.queue(l(u.workflowName),{runId:c.runId,traceCarrier:u.executionContext?.traceCarrier??void 0},{deploymentId:u.deploymentId,specVersion:u.specVersion??1}),c}catch(t){throw r?.setAttributes({...p(typeof e==`string`?e:e.token),...g(!1)}),t}}))}async function D(e,i){let{hook:a,encryptionKey:o}=await w(e);if(a.isWebhook===!1)throw new n(e);let s,c;if(a.metadata&&typeof a.metadata==`object`&&`respondWith`in a.metadata)if(a.metadata.respondWith===`manual`){let{readable:e,writable:t}=new TransformStream;c=e,i[d]=t}else if(a.metadata.respondWith instanceof Response)s=a.metadata.respondWith;else throw new r(`Invalid \`respondWith\` value: ${a.metadata.respondWith}`,{slug:t.WEBHOOK_INVALID_RESPOND_WITH_VALUE});else s=new Response(null,{status:202});if(await E(a,i,o),c){let e=c.getReader(),t=await e.read();t.value&&(s=t.value),e.cancel()}if(!s)throw new r(`Workflow run did not send a response`,{slug:t.WEBHOOK_RESPONSE_NOT_SENT});return s}export{C as i,E as n,D as r,T as t};