sliccy 5.84.1 → 5.85.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui/assets/{account-store-Dg-88ChJ.js → account-store-Bk0b9NNs.js} +1 -1
- package/dist/ui/assets/{account-store-CIBUpBw2.js → account-store-CsBhRflH.js} +1 -1
- package/dist/ui/assets/{adobe-DAu9m3li.js → adobe-BGZkhFf2.js} +1 -1
- package/dist/ui/assets/{adobe-CVUX352o.js → adobe-Cx_KcqS7.js} +1 -1
- package/dist/ui/assets/{apps-xHXbN2GJ.js → apps-Cu97llYd.js} +1 -1
- package/dist/ui/assets/{azure-openai-BRzd21eO.js → azure-openai-BAm3cDne.js} +1 -1
- package/dist/ui/assets/{azure-openai-Cj6dde55.js → azure-openai-GFt6bSin.js} +1 -1
- package/dist/ui/assets/{bedrock-camp-CVignIdH.js → bedrock-camp-CJY4i7di.js} +1 -1
- package/dist/ui/assets/{bedrock-camp-BO4bvAKs.js → bedrock-camp-DS0ilb3O.js} +1 -1
- package/dist/ui/assets/{cdp-BvZO3XX0.js → cdp-BEmpfM7z.js} +3 -3
- package/dist/ui/assets/{cerebras-DEHTb-Jp.js → cerebras-BdTrAltR.js} +1 -1
- package/dist/ui/assets/{cerebras-CSw0virw.js → cerebras-u2VrvWCg.js} +1 -1
- package/dist/ui/assets/{compat-aVSWLlYQ.js → compat-CkpNnFQS.js} +2 -2
- package/dist/ui/assets/completionchunk-CP7I4h3f.js +65 -0
- package/dist/ui/assets/completionchunk-JDMithrI.js +65 -0
- package/dist/ui/assets/{connect-surface-B3wGdqfR.js → connect-surface-B96uOALu.js} +1 -1
- package/dist/ui/assets/{context-compaction-_UkD06XB.js → context-compaction-C3e7rcEG.js} +1 -1
- package/dist/ui/assets/{fs-VwSXMsmq.js → fs-BQWc6Z05.js} +1 -1
- package/dist/ui/assets/{fs-g_oZbQ21.js → fs-kONhSqSK.js} +2 -2
- package/dist/ui/assets/{github-CyRcWzgO.js → github-BI5DkpcT.js} +1 -1
- package/dist/ui/assets/{github-copilot-CdLypAPy.js → github-copilot-Cta-8OE1.js} +1 -1
- package/dist/ui/assets/{github-copilot-BsgIQbuu.js → github-copilot-Ph5jEo5J.js} +1 -1
- package/dist/ui/assets/{github-DjZvupYV.js → github-hk9FJt_e.js} +2 -2
- package/dist/ui/assets/{kernel-worker-O-LVJQ2M.js → kernel-worker-DEYYnmZR.js} +437 -434
- package/dist/ui/assets/{legacy-api-aliases-IllWZ-uu.js → legacy-api-aliases-BWm3gxUe.js} +1 -1
- package/dist/ui/assets/{legacy-api-aliases-sqlB2uHc.js → legacy-api-aliases-YuuBU-he.js} +1 -1
- package/dist/ui/assets/{local-llm-Bo1kGMdi.js → local-llm-DtW9XFUO.js} +1 -1
- package/dist/ui/assets/{local-llm-C0t8US-G.js → local-llm-MwQVvzDf.js} +1 -1
- package/dist/ui/assets/{main-DiIgQpU7.js → main-DOvIDR_a.js} +3 -3
- package/dist/ui/assets/{main-cherry-CQ53lnqT.js → main-cherry-DCIO_2RP.js} +1 -1
- package/dist/ui/assets/{mistral-conversations-C57IiFrP.js → mistral-conversations-CIMZoDT4.js} +2 -2
- package/dist/ui/assets/{mistral-conversations-CzEm7KNl.js → mistral-conversations-CKK59QJS.js} +1 -1
- package/dist/ui/assets/{mount-D3ittikV.js → mount-28699D0M.js} +1 -1
- package/dist/ui/assets/{mount-OjhGugIM.js → mount-DABeOJmG.js} +2 -2
- package/dist/ui/assets/{mount-recovery-xwx3blgR.js → mount-recovery-DltEGR2O.js} +1 -1
- package/dist/ui/assets/{new-session-CM_drdQb.js → new-session-VQsGUTpx.js} +2 -2
- package/dist/ui/assets/{oauth-bootstrap-CksCYB3j.js → oauth-bootstrap-E6pWsJ74.js} +2 -2
- package/dist/ui/assets/{openai-codex-CqUAR4bA.js → openai-codex-Bu3_z5H4.js} +1 -1
- package/dist/ui/assets/{openai-codex-BngX1JyO.js → openai-codex-E2ahulS6.js} +1 -1
- package/dist/ui/assets/{openrouter-BPw5Sadh.js → openrouter-Bcf97CqM.js} +1 -1
- package/dist/ui/assets/{openrouter-DuuXMYpn.js → openrouter-IR6bjwZs.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-BZGhluYu.js → openrouter-oauth-D2JDfVVh.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-D8PeRKGv.js → openrouter-oauth-r-JJqWWo.js} +1 -1
- package/dist/ui/assets/{otel-joHgpnL_.js → otel-BJT2f71U.js} +1 -1
- package/dist/ui/assets/{otel-C1NYdIbe.js → otel-DHVJhmnv.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-Bo8vrbSN.js → panel-rpc-handlers-BjQ7aZ4J.js} +2 -2
- package/dist/ui/assets/{provider-BGfZxYoy.js → provider-BIKweYVv.js} +1 -1
- package/dist/ui/assets/{provider-CE7DxoOs.js → provider-Ci-sMWNb.js} +2 -2
- package/dist/ui/assets/{provider-settings-DpKLVtWv.js → provider-settings-DMA4IYKn.js} +1 -1
- package/dist/ui/assets/{provider-settings-BlX2WDPs.js → provider-settings-onyoJBmZ.js} +1 -1
- package/dist/ui/assets/{provider-store-access-DMG7bO02.js → provider-store-access-CUma_NmZ.js} +2 -2
- package/dist/ui/assets/provider-store-access-D1zmsZC2.js +1 -0
- package/dist/ui/assets/{providers-Bf8LGL3R.js → providers-Bb9FFUf2.js} +1 -1
- package/dist/ui/assets/{providers-DtodZfUb.js → providers-DHt2mtgL.js} +2 -2
- package/dist/ui/assets/{quick-llm-CeEUNaq_.js → quick-llm-BNgArafa.js} +1 -1
- package/dist/ui/assets/{session-freezer-BWXlNuLZ.js → session-freezer-BxOqNgNy.js} +3 -3
- package/dist/ui/assets/{setup-standalone-prelude-B3IfFCKC.js → setup-standalone-prelude-BIyuLmhj.js} +2 -2
- package/dist/ui/assets/{setup-sudo-COdRfoNx.js → setup-sudo-kMkEApFT.js} +2 -2
- package/dist/ui/assets/{skills-C0KYnRNq.js → skills-Da4EzDso.js} +1 -1
- package/dist/ui/assets/{store-BkJEbwIV.js → store-F71gCibD.js} +1 -1
- package/dist/ui/assets/{sudo-C14xgLpR.js → sudo-BpkAFF9G.js} +1 -1
- package/dist/ui/assets/synthetic-cdp-transport-CtfKyiws.js +1 -0
- package/dist/ui/assets/{upgrade-detection-7iVU0rhN.js → upgrade-detection-CJ0TQg6r.js} +1 -1
- package/dist/ui/assets/{wc-extension-D51Vv0vp.js → wc-extension-OhzrnYpd.js} +2 -2
- package/dist/ui/assets/wc-floatbar-online-B6M0vf6K.js +5 -0
- package/dist/ui/assets/{wc-follower-c5fHMODp.js → wc-follower-DZUXv1tI.js} +3 -3
- package/dist/ui/assets/{wc-live-C9XjDjJF.js → wc-live-CvPOrtDy.js} +3 -3
- package/dist/ui/assets/{wc-nav-lsahpZ4D.js → wc-nav-v3ePVEaG.js} +2 -2
- package/dist/ui/assets/{wc-onboarding-Cv35SFqQ.js → wc-onboarding-CKqWd2Kf.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-CVW34MdT.js → wc-placeholder-O8hlZSYg.js} +2 -2
- package/dist/ui/assets/{wc-settings-hY2enRpj.js → wc-settings-BYnJ8pmJ.js} +2 -2
- package/dist/ui/assets/{wc-shell-sWdEFmce.js → wc-shell-BS2MhiHQ.js} +2 -2
- package/dist/ui/assets/{wc-sprinkles-eo_EqzP6.js → wc-sprinkles-BGz-e1Ll.js} +2 -2
- package/dist/ui/assets/wc-tray-DlDL4ryR.js +2 -0
- package/dist/ui/assets/{xai-grok-QqXg9_fn.js → xai-grok-D6oOTqN5.js} +1 -1
- package/dist/ui/assets/{xai-grok-Cx13gJC8.js → xai-grok-DC9ObfPf.js} +1 -1
- package/dist/ui/index.html +9 -9
- package/dist/ui/packages/webapp/index.html +9 -9
- package/package.json +1 -1
- package/dist/ui/assets/completionchunk-BsT4qCtf.js +0 -40
- package/dist/ui/assets/completionchunk-D8ek1SQ-.js +0 -40
- package/dist/ui/assets/provider-store-access-D5wBiefF.js +0 -1
- package/dist/ui/assets/synthetic-cdp-transport-DLIt5SkY.js +0 -1
- package/dist/ui/assets/wc-floatbar-online-0Dg_sFmu.js +0 -5
- package/dist/ui/assets/wc-tray-CIccOKgS.js +0 -2
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
function e(e){return{ok:!0,value:e}}function t(e){return{ok:!1,error:e}}async function n(e){let t=await e;if(!t.ok)throw t.error;return t.value}var r;const i=Object.freeze({status:`aborted`});function a(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}var o=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},s=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(r=globalThis).__zod_globalConfig??(r.__zod_globalConfig={});const c=globalThis.__zod_globalConfig;function l(e){return e&&Object.assign(c,e),c}function u(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 d(e,t){return typeof t==`bigint`?t.toString():t}function f(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function p(e){return e==null}function ee(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function te(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 ne=Symbol(`evaluating`);function m(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ne)return r===void 0&&(r=ne,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function h(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function g(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function re(e){return JSON.stringify(e)}function ie(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const ae=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function oe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const se=f(()=>{if(c.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function _(e){if(oe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(oe(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ce(e){return _(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const le=new Set([`string`,`number`,`symbol`]);function v(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function y(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function b(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 ue(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const de={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function fe(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 y(e,g(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 h(this,`shape`,e),e},checks:[]}))}function pe(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 y(e,g(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 h(this,`shape`,r),r},checks:[]}))}function me(e,t){if(!_(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 y(e,g(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return h(this,`shape`,n),n}}))}function he(e,t){if(!_(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return y(e,g(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return h(this,`shape`,n),n}}))}function ge(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return y(e,g(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return h(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function _e(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 y(t,g(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 h(this,`shape`,i),i},checks:[]}))}function ve(e,t,n){return y(t,g(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 h(this,`shape`,i),i}}))}function x(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 ye(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 S(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function be(e){return typeof e==`string`?e:e?.message}function C(e,t,n){let r=e.message?e.message:be(e.inst?._zod.def?.error?.(e))??be(t?.error?.(e))??be(n.customError?.(e))??be(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 xe(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function w(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const Se=(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,d,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ce=a(`$ZodError`,Se),we=a(`$ZodError`,Se,{Parent:Error});function Te(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 Ee(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 De(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 Oe(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 ${De(e.path)}`);return t.join(`
|
|
2
|
+
`)}const ke=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},a);if(s instanceof Promise)throw new o;if(s.issues.length){let t=new((i?.Err)??e)(s.issues.map(e=>C(e,a,l())));throw ae(t,i?.callee),t}return s.value},Ae=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=>C(e,a,l())));throw ae(t,i?.callee),t}return o.value},T=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new o;return a.issues.length?{success:!1,error:new(e??Ce)(a.issues.map(e=>C(e,i,l())))}:{success:!0,data:a.value}},je=T(we),E=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=>C(e,i,l())))}:{success:!0,data:a.value}},Me=E(we),Ne=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ke(e)(t,n,i)},Pe=e=>(t,n,r)=>ke(e)(t,n,r),Fe=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ae(e)(t,n,i)},Ie=e=>async(t,n,r)=>Ae(e)(t,n,r),Le=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return T(e)(t,n,i)},Re=e=>(t,n,r)=>T(e)(t,n,r),ze=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return E(e)(t,n,i)},Be=e=>async(t,n,r)=>E(e)(t,n,r),Ve=/^[cC][0-9a-z]{6,}$/,He=/^[0-9a-z]+$/,Ue=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,We=/^[0-9a-vA-V]{20}$/,Ge=/^[A-Za-z0-9]{27}$/,Ke=/^[a-zA-Z0-9_-]{21}$/,qe=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Je=/^([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})$/,Ye=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)$/,Xe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function Ze(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const Qe=/^(?:(?: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])$/,$e=/^(([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}|:))$/,et=/^((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])$/,tt=/^(([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])$/,nt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,rt=/^[A-Za-z0-9_-]*$/,it=/^https?$/,at=/^\+[1-9]\d{6,14}$/,ot=`(?:(?:\\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])))`,st=RegExp(`^${ot}$`);function ct(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 lt(e){return RegExp(`^${ct(e)}$`)}function ut(e){let t=ct({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(`^${ot}T(?:${r})$`)}const dt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},ft=/^-?\d+$/,pt=/^-?\d+(?:\.\d+)?$/,mt=/^(?:true|false)$/i,ht=/^[^A-Z]*$/,gt=/^[^a-z]*$/,D=a(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),_t={number:`number`,bigint:`bigint`,object:`date`},vt=a(`$ZodCheckLessThan`,(e,t)=>{D.init(e,t);let n=_t[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})}}),yt=a(`$ZodCheckGreaterThan`,(e,t)=>{D.init(e,t);let n=_t[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})}}),bt=a(`$ZodCheckMultipleOf`,(e,t)=>{D.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):te(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})}}),xt=a(`$ZodCheckNumberFormat`,(e,t)=>{D.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=de[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=ft)}),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})}}),St=a(`$ZodCheckMaxLength`,(e,t)=>{var n;D.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!p(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=xe(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ct=a(`$ZodCheckMinLength`,(e,t)=>{var n;D.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!p(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=xe(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),wt=a(`$ZodCheckLengthEquals`,(e,t)=>{var n;D.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!p(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=xe(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})}}),O=a(`$ZodCheckStringFormat`,(e,t)=>{var n,r;D.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=()=>{})}),Tt=a(`$ZodCheckRegex`,(e,t)=>{O.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})}}),Et=a(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=ht,O.init(e,t)}),Dt=a(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=gt,O.init(e,t)}),Ot=a(`$ZodCheckIncludes`,(e,t)=>{D.init(e,t);let n=v(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})}}),kt=a(`$ZodCheckStartsWith`,(e,t)=>{D.init(e,t);let n=RegExp(`^${v(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})}}),At=a(`$ZodCheckEndsWith`,(e,t)=>{D.init(e,t);let n=RegExp(`.*${v(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})}}),jt=a(`$ZodCheckOverwrite`,(e,t)=>{D.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Mt=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
|
+
`).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
|
+
`))}};const Nt={major:4,minor:4,patch:3},k=a(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Nt;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=x(e),i;for(let a of t){if(a._zod.def.when){if(ye(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,s=a._zod.check(e);if(s instanceof Promise&&n?.async===!1)throw new o;if(i||s instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(r||=x(e,t))});else{if(e.issues.length===t)continue;r||=x(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(x(n))return n.aborted=!0,n;let s=t(i,r,a);if(s instanceof Promise){if(a.async===!1)throw new o;return s.then(t=>e._zod.parse(t,a))}return e._zod.parse(s,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let s=e._zod.parse(i,a);if(s instanceof Promise){if(a.async===!1)throw new o;return s.then(e=>t(e,r,a))}return t(s,r,a)}}m(e,`~standard`,()=>({validate:t=>{try{let n=je(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Me(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Pt=a(`$ZodString`,(e,t)=>{k.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??dt(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}}),A=a(`$ZodStringFormat`,(e,t)=>{O.init(e,t),Pt.init(e,t)}),Ft=a(`$ZodGUID`,(e,t)=>{t.pattern??=Je,A.init(e,t)}),It=a(`$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??=Ye(e)}else t.pattern??=Ye();A.init(e,t)}),Lt=a(`$ZodEmail`,(e,t)=>{t.pattern??=Xe,A.init(e,t)}),Rt=a(`$ZodURL`,(e,t)=>{A.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===it.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})}}}),zt=a(`$ZodEmoji`,(e,t)=>{t.pattern??=Ze(),A.init(e,t)}),Bt=a(`$ZodNanoID`,(e,t)=>{t.pattern??=Ke,A.init(e,t)}),Vt=a(`$ZodCUID`,(e,t)=>{t.pattern??=Ve,A.init(e,t)}),Ht=a(`$ZodCUID2`,(e,t)=>{t.pattern??=He,A.init(e,t)}),Ut=a(`$ZodULID`,(e,t)=>{t.pattern??=Ue,A.init(e,t)}),Wt=a(`$ZodXID`,(e,t)=>{t.pattern??=We,A.init(e,t)}),Gt=a(`$ZodKSUID`,(e,t)=>{t.pattern??=Ge,A.init(e,t)}),Kt=a(`$ZodISODateTime`,(e,t)=>{t.pattern??=ut(t),A.init(e,t)}),qt=a(`$ZodISODate`,(e,t)=>{t.pattern??=st,A.init(e,t)}),Jt=a(`$ZodISOTime`,(e,t)=>{t.pattern??=lt(t),A.init(e,t)}),Yt=a(`$ZodISODuration`,(e,t)=>{t.pattern??=qe,A.init(e,t)}),Xt=a(`$ZodIPv4`,(e,t)=>{t.pattern??=Qe,A.init(e,t),e._zod.bag.format=`ipv4`}),Zt=a(`$ZodIPv6`,(e,t)=>{t.pattern??=$e,A.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})}}}),Qt=a(`$ZodCIDRv4`,(e,t)=>{t.pattern??=et,A.init(e,t)}),$t=a(`$ZodCIDRv6`,(e,t)=>{t.pattern??=tt,A.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 en(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const tn=a(`$ZodBase64`,(e,t)=>{t.pattern??=nt,A.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{en(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function nn(e){if(!rt.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return en(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const rn=a(`$ZodBase64URL`,(e,t)=>{t.pattern??=rt,A.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{nn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),an=a(`$ZodE164`,(e,t)=>{t.pattern??=at,A.init(e,t)});function on(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 sn=a(`$ZodJWT`,(e,t)=>{A.init(e,t),e._zod.check=n=>{on(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),cn=a(`$ZodNumber`,(e,t)=>{k.init(e,t),e._zod.pattern=e._zod.bag.pattern??pt,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}}),ln=a(`$ZodNumberFormat`,(e,t)=>{xt.init(e,t),cn.init(e,t)}),un=a(`$ZodBoolean`,(e,t)=>{k.init(e,t),e._zod.pattern=mt,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}}),dn=a(`$ZodAny`,(e,t)=>{k.init(e,t),e._zod.parse=e=>e}),fn=a(`$ZodUnknown`,(e,t)=>{k.init(e,t),e._zod.parse=e=>e}),pn=a(`$ZodNever`,(e,t)=>{k.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),mn=a(`$ZodVoid`,(e,t)=>{k.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}}),hn=a(`$ZodDate`,(e,t)=>{k.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 gn(e,t,n){e.issues.length&&t.issues.push(...S(n,e.issues)),t.value[n]=e.value}const _n=a(`$ZodArray`,(e,t)=>{k.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=>gn(t,n,e))):gn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function j(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...S(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 vn(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=ue(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function yn(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=>j(e,n,i,t,u,d))):j(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 bn=a(`$ZodObject`,(e,t)=>{if(k.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=f(()=>vn(t));m(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=oe,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=>j(n,t,e,s,r,i))):j(a,t,e,s,r,i)}return i?yn(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),xn=a(`$ZodObjectJIT`,(e,t)=>{bn.init(e,t);let n=e._zod.parse,r=f(()=>vn(t)),i=e=>{let t=new Mt([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=re(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=re(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
5
|
+
if (${n}.issues.length) {
|
|
6
|
+
if (${o} in input) {
|
|
7
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
8
|
+
...iss,
|
|
9
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
10
|
+
})));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (${n}.value === undefined) {
|
|
15
|
+
if (${o} in input) {
|
|
16
|
+
newResult[${o}] = undefined;
|
|
17
|
+
}
|
|
18
|
+
} else {
|
|
19
|
+
newResult[${o}] = ${n}.value;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
`):c?t.write(`
|
|
23
|
+
if (${n}.issues.length) {
|
|
24
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
25
|
+
...iss,
|
|
26
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
27
|
+
})));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (${n}.value === undefined) {
|
|
31
|
+
if (${o} in input) {
|
|
32
|
+
newResult[${o}] = undefined;
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
newResult[${o}] = ${n}.value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
`):t.write(`
|
|
39
|
+
const ${n}_present = ${o} in input;
|
|
40
|
+
if (${n}.issues.length) {
|
|
41
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
42
|
+
...iss,
|
|
43
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
44
|
+
})));
|
|
45
|
+
}
|
|
46
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
47
|
+
payload.issues.push({
|
|
48
|
+
code: "invalid_type",
|
|
49
|
+
expected: "nonoptional",
|
|
50
|
+
input: undefined,
|
|
51
|
+
path: [${o}]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (${n}_present) {
|
|
56
|
+
if (${n}.value === undefined) {
|
|
57
|
+
newResult[${o}] = undefined;
|
|
58
|
+
} else {
|
|
59
|
+
newResult[${o}] = ${n}.value;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=oe,s=!c.jitless,l=s&&se.value,u=t.catchall,d;e._zod.parse=(c,f)=>{d??=r.value;let p=c.value;return o(p)?s&&l&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),c=a(c,f),u?yn([],p,c,f,d,e):c):n(c,f):(c.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),c)}});function Sn(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!x(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>C(e,r,l())))}),t)}const Cn=a(`$ZodUnion`,(e,t)=>{k.init(e,t),m(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),m(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),m(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),m(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>ee(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Sn(t,r,e,i)):Sn(o,r,e,i)}}),wn=a(`$ZodIntersection`,(e,t)=>{k.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>En(e,t,n)):En(e,i,a)}});function Tn(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(_(e)&&_(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Tn(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Tn(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function En(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),x(e))return e;let o=Tn(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const Dn=a(`$ZodRecord`,(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!_(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>C(e,r,l())),input:c,path:[c],inst:e});continue}let u=o.value,d=t.valueType._zod.run({value:i[c],issues:[]},r);d instanceof Promise?a.push(d.then(e=>{e.issues.length&&n.issues.push(...S(c,e.issues)),n.value[u]=e.value})):(d.issues.length&&n.issues.push(...S(c,d.issues)),n.value[u]=d.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&pt.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>C(e,r,l())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...S(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...S(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),On=a(`$ZodEnum`,(e,t)=>{k.init(e,t);let n=u(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>le.has(typeof e)).map(e=>typeof e==`string`?v(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),kn=a(`$ZodLiteral`,(e,t)=>{if(k.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?v(e):e?v(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),An=a(`$ZodTransform`,(e,t)=>{k.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new s(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new o;return n.value=i,n.fallback=!0,n}});function jn(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Mn=a(`$ZodOptional`,(e,t)=>{k.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,m(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),m(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ee(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>jn(e,r)):jn(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Nn=a(`$ZodExactOptional`,(e,t)=>{Mn.init(e,t),m(e._zod,`values`,()=>t.innerType._zod.values),m(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Pn=a(`$ZodNullable`,(e,t)=>{k.init(e,t),m(e._zod,`optin`,()=>t.innerType._zod.optin),m(e._zod,`optout`,()=>t.innerType._zod.optout),m(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ee(e.source)}|null)$`):void 0}),m(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Fn=a(`$ZodDefault`,(e,t)=>{k.init(e,t),e._zod.optin=`optional`,m(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>In(e,t)):In(r,t)}});function In(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ln=a(`$ZodPrefault`,(e,t)=>{k.init(e,t),e._zod.optin=`optional`,m(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Rn=a(`$ZodNonOptional`,(e,t)=>{k.init(e,t),m(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>zn(t,e)):zn(i,e)}});function zn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const Bn=a(`$ZodCatch`,(e,t)=>{k.init(e,t),e._zod.optin=`optional`,m(e._zod,`optout`,()=>t.innerType._zod.optout),m(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>C(e,n,l()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>C(e,n,l()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Vn=a(`$ZodPipe`,(e,t)=>{k.init(e,t),m(e._zod,`values`,()=>t.in._zod.values),m(e._zod,`optin`,()=>t.in._zod.optin),m(e._zod,`optout`,()=>t.out._zod.optout),m(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Hn(e,t.in,n)):Hn(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Hn(e,t.out,n)):Hn(r,t.out,n)}});function Hn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const Un=a(`$ZodReadonly`,(e,t)=>{k.init(e,t),m(e._zod,`propValues`,()=>t.innerType._zod.propValues),m(e._zod,`values`,()=>t.innerType._zod.values),m(e._zod,`optin`,()=>t.innerType?._zod?.optin),m(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Wn):Wn(r)}});function Wn(e){return e.value=Object.freeze(e.value),e}const Gn=a(`$ZodLazy`,(e,t)=>{k.init(e,t),m(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),m(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),m(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),m(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),m(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Kn=a(`$ZodCustom`,(e,t)=>{D.init(e,t),k.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>qn(t,n,r,e));qn(i,n,r,e)}});function qn(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(w(e))}}var Jn,Yn=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Xn(){return new Yn}(Jn=globalThis).__zod_globalRegistry??(Jn.__zod_globalRegistry=Xn());const M=globalThis.__zod_globalRegistry;function Zn(e,t){return new e({type:`string`,...b(t)})}function Qn(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...b(t)})}function $n(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...b(t)})}function er(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...b(t)})}function tr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...b(t)})}function nr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...b(t)})}function rr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...b(t)})}function ir(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...b(t)})}function ar(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...b(t)})}function or(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...b(t)})}function sr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...b(t)})}function cr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...b(t)})}function lr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...b(t)})}function ur(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...b(t)})}function dr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...b(t)})}function fr(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...b(t)})}function pr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...b(t)})}function mr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...b(t)})}function hr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...b(t)})}function gr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...b(t)})}function _r(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...b(t)})}function vr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...b(t)})}function yr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...b(t)})}function br(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...b(t)})}function xr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...b(t)})}function Sr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...b(t)})}function Cr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...b(t)})}function wr(e,t){return new e({type:`number`,checks:[],...b(t)})}function Tr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...b(t)})}function Er(e,t){return new e({type:`boolean`,...b(t)})}function Dr(e,t){return new e({type:`boolean`,coerce:!0,...b(t)})}function Or(e){return new e({type:`any`})}function kr(e){return new e({type:`unknown`})}function Ar(e,t){return new e({type:`never`,...b(t)})}function jr(e,t){return new e({type:`void`,...b(t)})}function Mr(e,t){return new e({type:`date`,...b(t)})}function Nr(e,t){return new vt({check:`less_than`,...b(t),value:e,inclusive:!1})}function N(e,t){return new vt({check:`less_than`,...b(t),value:e,inclusive:!0})}function Pr(e,t){return new yt({check:`greater_than`,...b(t),value:e,inclusive:!1})}function Fr(e,t){return new yt({check:`greater_than`,...b(t),value:e,inclusive:!0})}function Ir(e,t){return new bt({check:`multiple_of`,...b(t),value:e})}function Lr(e,t){return new St({check:`max_length`,...b(t),maximum:e})}function Rr(e,t){return new Ct({check:`min_length`,...b(t),minimum:e})}function zr(e,t){return new wt({check:`length_equals`,...b(t),length:e})}function Br(e,t){return new Tt({check:`string_format`,format:`regex`,...b(t),pattern:e})}function Vr(e){return new Et({check:`string_format`,format:`lowercase`,...b(e)})}function Hr(e){return new Dt({check:`string_format`,format:`uppercase`,...b(e)})}function Ur(e,t){return new Ot({check:`string_format`,format:`includes`,...b(t),includes:e})}function Wr(e,t){return new kt({check:`string_format`,format:`starts_with`,...b(t),prefix:e})}function Gr(e,t){return new At({check:`string_format`,format:`ends_with`,...b(t),suffix:e})}function P(e){return new jt({check:`overwrite`,tx:e})}function Kr(e){return P(t=>t.normalize(e))}function qr(){return P(e=>e.trim())}function Jr(){return P(e=>e.toLowerCase())}function Yr(){return P(e=>e.toUpperCase())}function Xr(){return P(e=>ie(e))}function Zr(e,t,n){return new e({type:`array`,element:t,...b(n)})}function Qr(e,t,n){let r=b(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function $r(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...b(n)})}function ei(e,t){let n=ti(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(w(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(w(r))}},e(t.value,t)),t);return n}function ti(e,t){let n=new D({check:`custom`,...b(t)});return n._zod.check=e,n}function ni(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??M,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function F(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,F(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&I(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function ri(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
64
|
+
|
|
65
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function ii(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:oi(t,`input`,e.processors),output:oi(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function I(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return I(r.element,n);if(r.type===`set`)return I(r.valueType,n);if(r.type===`lazy`)return I(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return I(r.innerType,n);if(r.type===`intersection`)return I(r.left,n)||I(r.right,n);if(r.type===`record`||r.type===`map`)return I(r.keyType,n)||I(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:I(r.in,n)||I(r.out,n);if(r.type===`object`){for(let e in r.shape)if(I(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(I(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(I(e,n))return!0;return!!(r.rest&&I(r.rest,n))}return!1}const ai=(e,t={})=>n=>{let r=ni({...n,processors:t});return F(e,r),ri(r,e),ii(r,e)},oi=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ni({...i??{},target:a,io:t,processors:n});return F(e,o),ri(o,e),ii(o,e)},si={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ci=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=si[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},li=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},ui=(e,t,n,r)=>{n.type=`boolean`},di=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},fi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},pi=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},mi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},hi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},gi=(e,t,n,r)=>{n.not={}},_i=(e,t,n,r)=>{},vi=(e,t,n,r)=>{},yi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},bi=(e,t,n,r)=>{let i=e._zod.def,a=u(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},xi=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Si=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},Ci=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},wi=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},Ti=(e,t,n,r)=>{n.type=`boolean`},Ei=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Di=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},Oi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},ki=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},Ai=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},ji=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=F(a.element,t,{...r,path:[...r.path,`items`]})},Mi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=F(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=F(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ni=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>F(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Pi=(e,t,n,r)=>{let i=e._zod.def,a=F(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=F(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Fi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>F(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?F(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},Ii=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=F(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=F(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=F(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Li=(e,t,n,r)=>{let i=e._zod.def,a=F(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ri=(e,t,n,r)=>{let i=e._zod.def;F(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},zi=(e,t,n,r)=>{let i=e._zod.def;F(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Bi=(e,t,n,r)=>{let i=e._zod.def;F(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Vi=(e,t,n,r)=>{let i=e._zod.def;F(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Hi=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;F(o,t,r);let s=t.seen.get(e);s.ref=o},Ui=(e,t,n,r)=>{let i=e._zod.def;F(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Wi=(e,t,n,r)=>{let i=e._zod.def;F(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Gi=(e,t,n,r)=>{let i=e._zod.def;F(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ki=(e,t,n,r)=>{let i=e._zod.innerType;F(i,t,r);let a=t.seen.get(e);a.ref=i},qi={string:ci,number:li,boolean:ui,bigint:di,symbol:fi,null:pi,undefined:mi,void:hi,never:gi,any:_i,unknown:vi,date:yi,enum:bi,literal:xi,nan:Si,template_literal:Ci,file:wi,success:Ti,custom:Ei,function:Di,transform:Oi,map:ki,set:Ai,array:ji,object:Mi,union:Ni,intersection:Pi,tuple:Fi,record:Ii,nullable:Li,nonoptional:Ri,default:zi,prefault:Bi,catch:Vi,pipe:Hi,readonly:Ui,promise:Wi,optional:Gi,lazy:Ki};function Ji(e,t){if(`_idmap`in e){let n=e,r=ni({...t,processors:qi}),i={};for(let e of n._idmap.entries()){let[t,n]=e;F(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;ri(r,n),a[t]=ii(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=ni({...t,processors:qi});return F(e,n),ri(n,e),ii(n,e)}const Yi=a(`ZodISODateTime`,(e,t)=>{Kt.init(e,t),V.init(e,t)});function Xi(e){return br(Yi,e)}const Zi=a(`ZodISODate`,(e,t)=>{qt.init(e,t),V.init(e,t)});function Qi(e){return xr(Zi,e)}const $i=a(`ZodISOTime`,(e,t)=>{Jt.init(e,t),V.init(e,t)});function ea(e){return Sr($i,e)}const ta=a(`ZodISODuration`,(e,t)=>{Yt.init(e,t),V.init(e,t)});function na(e){return Cr(ta,e)}const L=a(`ZodError`,(e,t)=>{Ce.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Ee(e,t)},flatten:{value:t=>Te(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,d,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,d,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),ra=ke(L),ia=Ae(L),aa=T(L),oa=E(L),sa=Ne(L),ca=Pe(L),la=Fe(L),ua=Ie(L),da=Le(L),fa=Re(L),pa=ze(L),ma=Be(L),ha=new WeakMap;function R(e,t,n){let r=Object.getPrototypeOf(e),i=ha.get(r);if(i||(i=new Set,ha.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}const z=a(`ZodType`,(e,t)=>(k.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:oi(e,`input`),output:oi(e,`output`)}}),e.toJSONSchema=ai(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>ra(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>aa(e,t,n),e.parseAsync=async(t,n)=>ia(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>oa(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>sa(e,t,n),e.decode=(t,n)=>ca(e,t,n),e.encodeAsync=async(t,n)=>la(e,t,n),e.decodeAsync=async(t,n)=>ua(e,t,n),e.safeEncode=(t,n)=>da(e,t,n),e.safeDecode=(t,n)=>fa(e,t,n),e.safeEncodeAsync=async(t,n)=>pa(e,t,n),e.safeDecodeAsync=async(t,n)=>ma(e,t,n),R(e,`ZodType`,{check(...e){let t=this.def;return this.clone(g(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return y(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ao(e,t))},superRefine(e,t){return this.check(jo(e,t))},overwrite(e){return this.check(P(e))},optional(){return lo(this)},exactOptional(){return fo(this)},nullable(){return Y(this)},nullish(){return lo(Y(this))},nonoptional(e){return yo(this,e)},array(){return W(this)},or(e){return K([this,e])},and(e){return to(this,e)},transform(e){return Co(this,so(e))},default(e){return ho(this,e)},prefault(e){return _o(this,e)},catch(e){return xo(this,e)},pipe(e){return Co(this,e)},readonly(){return To(this)},describe(e){let t=this.clone();return M.add(t,{description:e}),t},meta(...e){if(e.length===0)return M.get(this);let t=this.clone();return M.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return M.get(e)?.description},configurable:!0}),e)),ga=a(`_ZodString`,(e,t)=>{Pt.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ci(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,R(e,`_ZodString`,{regex(...e){return this.check(Br(...e))},includes(...e){return this.check(Ur(...e))},startsWith(...e){return this.check(Wr(...e))},endsWith(...e){return this.check(Gr(...e))},min(...e){return this.check(Rr(...e))},max(...e){return this.check(Lr(...e))},length(...e){return this.check(zr(...e))},nonempty(...e){return this.check(Rr(1,...e))},lowercase(e){return this.check(Vr(e))},uppercase(e){return this.check(Hr(e))},trim(){return this.check(qr())},normalize(...e){return this.check(Kr(...e))},toLowerCase(){return this.check(Jr())},toUpperCase(){return this.check(Yr())},slugify(){return this.check(Xr())}})}),_a=a(`ZodString`,(e,t)=>{Pt.init(e,t),ga.init(e,t),e.email=t=>e.check(Qn(va,t)),e.url=t=>e.check(ir(xa,t)),e.jwt=t=>e.check(yr(Ia,t)),e.emoji=t=>e.check(ar(Sa,t)),e.guid=t=>e.check($n(ya,t)),e.uuid=t=>e.check(er(ba,t)),e.uuidv4=t=>e.check(tr(ba,t)),e.uuidv6=t=>e.check(nr(ba,t)),e.uuidv7=t=>e.check(rr(ba,t)),e.nanoid=t=>e.check(or(Ca,t)),e.guid=t=>e.check($n(ya,t)),e.cuid=t=>e.check(sr(wa,t)),e.cuid2=t=>e.check(cr(Ta,t)),e.ulid=t=>e.check(lr(Ea,t)),e.base64=t=>e.check(gr(Na,t)),e.base64url=t=>e.check(_r(Pa,t)),e.xid=t=>e.check(ur(Da,t)),e.ksuid=t=>e.check(dr(Oa,t)),e.ipv4=t=>e.check(fr(ka,t)),e.ipv6=t=>e.check(pr(Aa,t)),e.cidrv4=t=>e.check(mr(ja,t)),e.cidrv6=t=>e.check(hr(Ma,t)),e.e164=t=>e.check(vr(Fa,t)),e.datetime=t=>e.check(Xi(t)),e.date=t=>e.check(Qi(t)),e.time=t=>e.check(ea(t)),e.duration=t=>e.check(na(t))});function B(e){return Zn(_a,e)}const V=a(`ZodStringFormat`,(e,t)=>{A.init(e,t),ga.init(e,t)}),va=a(`ZodEmail`,(e,t)=>{Lt.init(e,t),V.init(e,t)}),ya=a(`ZodGUID`,(e,t)=>{Ft.init(e,t),V.init(e,t)}),ba=a(`ZodUUID`,(e,t)=>{It.init(e,t),V.init(e,t)}),xa=a(`ZodURL`,(e,t)=>{Rt.init(e,t),V.init(e,t)}),Sa=a(`ZodEmoji`,(e,t)=>{zt.init(e,t),V.init(e,t)}),Ca=a(`ZodNanoID`,(e,t)=>{Bt.init(e,t),V.init(e,t)}),wa=a(`ZodCUID`,(e,t)=>{Vt.init(e,t),V.init(e,t)}),Ta=a(`ZodCUID2`,(e,t)=>{Ht.init(e,t),V.init(e,t)}),Ea=a(`ZodULID`,(e,t)=>{Ut.init(e,t),V.init(e,t)}),Da=a(`ZodXID`,(e,t)=>{Wt.init(e,t),V.init(e,t)}),Oa=a(`ZodKSUID`,(e,t)=>{Gt.init(e,t),V.init(e,t)}),ka=a(`ZodIPv4`,(e,t)=>{Xt.init(e,t),V.init(e,t)}),Aa=a(`ZodIPv6`,(e,t)=>{Zt.init(e,t),V.init(e,t)}),ja=a(`ZodCIDRv4`,(e,t)=>{Qt.init(e,t),V.init(e,t)}),Ma=a(`ZodCIDRv6`,(e,t)=>{$t.init(e,t),V.init(e,t)}),Na=a(`ZodBase64`,(e,t)=>{tn.init(e,t),V.init(e,t)}),Pa=a(`ZodBase64URL`,(e,t)=>{rn.init(e,t),V.init(e,t)}),Fa=a(`ZodE164`,(e,t)=>{an.init(e,t),V.init(e,t)}),Ia=a(`ZodJWT`,(e,t)=>{sn.init(e,t),V.init(e,t)}),La=a(`ZodNumber`,(e,t)=>{cn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>li(e,t,n,r),R(e,`ZodNumber`,{gt(e,t){return this.check(Pr(e,t))},gte(e,t){return this.check(Fr(e,t))},min(e,t){return this.check(Fr(e,t))},lt(e,t){return this.check(Nr(e,t))},lte(e,t){return this.check(N(e,t))},max(e,t){return this.check(N(e,t))},int(e){return this.check(H(e))},safe(e){return this.check(H(e))},positive(e){return this.check(Pr(0,e))},nonnegative(e){return this.check(Fr(0,e))},negative(e){return this.check(Nr(0,e))},nonpositive(e){return this.check(N(0,e))},multipleOf(e,t){return this.check(Ir(e,t))},step(e,t){return this.check(Ir(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Ra(e){return wr(La,e)}const za=a(`ZodNumberFormat`,(e,t)=>{ln.init(e,t),La.init(e,t)});function H(e){return Tr(za,e)}const Ba=a(`ZodBoolean`,(e,t)=>{un.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ui(e,t,n,r)});function Va(e){return Er(Ba,e)}const Ha=a(`ZodAny`,(e,t)=>{dn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function U(){return Or(Ha)}const Ua=a(`ZodUnknown`,(e,t)=>{fn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Wa(){return kr(Ua)}const Ga=a(`ZodNever`,(e,t)=>{pn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r)});function Ka(e){return Ar(Ga,e)}const qa=a(`ZodVoid`,(e,t)=>{mn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r)});function Ja(e){return jr(qa,e)}const Ya=a(`ZodDate`,(e,t)=>{hn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r),e.min=(t,n)=>e.check(Fr(t,n)),e.max=(t,n)=>e.check(N(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function Xa(e){return Mr(Ya,e)}const Za=a(`ZodArray`,(e,t)=>{_n.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r),e.element=t.element,R(e,`ZodArray`,{min(e,t){return this.check(Rr(e,t))},nonempty(e){return this.check(Rr(1,e))},max(e,t){return this.check(Lr(e,t))},length(e,t){return this.check(zr(e,t))},unwrap(){return this.element}})});function W(e,t){return Zr(Za,e,t)}const Qa=a(`ZodObject`,(e,t)=>{xn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mi(e,t,n,r),m(e,`shape`,()=>t.shape),R(e,`ZodObject`,{keyof(){return io(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Wa()})},loose(){return this.clone({...this._zod.def,catchall:Wa()})},strict(){return this.clone({...this._zod.def,catchall:Ka()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return me(this,e)},safeExtend(e){return he(this,e)},merge(e){return ge(this,e)},pick(e){return fe(this,e)},omit(e){return pe(this,e)},partial(...e){return _e(co,this,e[0])},required(...e){return ve(vo,this,e[0])}})});function G(e,t){let n={type:`object`,shape:e??{},...b(t)};return new Qa(n)}const $a=a(`ZodUnion`,(e,t)=>{Cn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ni(e,t,n,r),e.options=t.options});function K(e,t){return new $a({type:`union`,options:e,...b(t)})}const eo=a(`ZodIntersection`,(e,t)=>{wn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pi(e,t,n,r)});function to(e,t){return new eo({type:`intersection`,left:e,right:t})}const no=a(`ZodRecord`,(e,t)=>{Dn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ii(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function q(e,t,n){return!t||!t._zod?new no({type:`record`,keyType:B(),valueType:e,...b(t)}):new no({type:`record`,keyType:e,valueType:t,...b(n)})}const ro=a(`ZodEnum`,(e,t)=>{On.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new ro({...t,checks:[],...b(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new ro({...t,checks:[],...b(r),entries:i})}});function io(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new ro({type:`enum`,entries:n,...b(t)})}const ao=a(`ZodLiteral`,(e,t)=>{kn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function J(e,t){return new ao({type:`literal`,values:Array.isArray(e)?e:[e],...b(t)})}const oo=a(`ZodTransform`,(e,t)=>{An.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new s(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(w(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(w(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function so(e){return new oo({type:`transform`,transform:e})}const co=a(`ZodOptional`,(e,t)=>{Mn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lo(e){return new co({type:`optional`,innerType:e})}const uo=a(`ZodExactOptional`,(e,t)=>{Nn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fo(e){return new uo({type:`optional`,innerType:e})}const po=a(`ZodNullable`,(e,t)=>{Pn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Li(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Y(e){return new po({type:`nullable`,innerType:e})}const mo=a(`ZodDefault`,(e,t)=>{Fn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ho(e,t){return new mo({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ce(t)}})}const go=a(`ZodPrefault`,(e,t)=>{Ln.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _o(e,t){return new go({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ce(t)}})}const vo=a(`ZodNonOptional`,(e,t)=>{Rn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ri(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function yo(e,t){return new vo({type:`nonoptional`,innerType:e,...b(t)})}const bo=a(`ZodCatch`,(e,t)=>{Bn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function xo(e,t){return new bo({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const So=a(`ZodPipe`,(e,t)=>{Vn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hi(e,t,n,r),e.in=t.in,e.out=t.out});function Co(e,t){return new So({type:`pipe`,in:e,out:t})}const wo=a(`ZodReadonly`,(e,t)=>{Un.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ui(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function To(e){return new wo({type:`readonly`,innerType:e})}const Eo=a(`ZodLazy`,(e,t)=>{Gn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ki(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Do(e){return new Eo({type:`lazy`,getter:e})}const Oo=a(`ZodCustom`,(e,t)=>{Kn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r)});function ko(e,t){return Qr(Oo,e??(()=>!0),t)}function Ao(e,t={}){return $r(Oo,e,t)}function jo(e,t){return ei(e,t)}var Mo=class extends Error{rawValue;rawMessage;static[Symbol.hasInstance](e){return!(!(e instanceof Error)||!(`rawValue`in e)||!(`rawMessage`in e)||!(`pretty`in e)||typeof e.pretty!=`function`)}constructor(e,t,n){super(`${e}: ${t}`),this.name=`SDKValidationError`,this.cause=t,this.rawValue=n,this.rawMessage=e}pretty(){return this.cause instanceof Ce?`${this.rawMessage}\n${No(this.cause)}`:this.toString()}};function No(e){return Oe(e)}function X(e,t){let n={};if(!Object.keys(t).length)return n=e,n;for(let[r,i]of Object.entries(e)){let e=t[r];e!==null&&(n[e??r]=i)}return n}function Po(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}function Fo(n,r,i){try{return e(r(n))}catch(e){return t(new Mo(i,e,n))}}function Io(e){return Z++,e}let Z=0,Lo=0;function Ro(){Lo++;let e=Z;return{end:t=>{let n=Z-e;return Z=e+(t??n),--Lo===0&&(Z=0),n}}}function zo(e){return K([...Object.values(e).map(e=>J(e)),B().transform(e=>Io(e))])}function Bo(e){return K([...Object.values(e).filter(e=>typeof e==`number`).map(e=>J(e)),H().transform(e=>Io(e))])}function Vo(e){return B()}function Ho(e){return H()}const Uo=Symbol(`UNKNOWN`);function Wo(e){return typeof e==`object`&&!!e&&Uo in e}function Go(e,t,n={}){let{unknownValue:r=`UNKNOWN`,outputPropertyName:i}=n;return Wa().transform(n=>{let a=Object.defineProperties({raw:n,[i??e]:r,isUnknown:!0},{[Uo]:{value:!0,enumerable:!1,configurable:!1}});if(!(typeof n==`object`&&n))return a;let o=n[e];if(typeof o!=`string`||!(o in t))return a;let s=t[o];if(!s)return a;let c=Ro(),l=s.safeParse(n);return l.success?(c.end(),i&&(l.data[i]=o),l.data):(c.end(0),a)})}const Ko=/^\d{4}-\d{2}-\d{2}$/;var qo=class e{serialized;static today(){return new e(new Date)}constructor(e){if(typeof e==`string`&&!Ko.test(e))throw RangeError(`RFCDate: date strings must be in the format YYYY-MM-DD: `+e);let t=new Date(e);if(isNaN(+t))throw RangeError(`RFCDate: invalid date provided: `+e);if(this.serialized=t.toISOString().slice(0,10),!Ko.test(this.serialized))throw TypeError(`RFCDate: failed to build valid date with given value: ${e} serialized to ${this.serialized}`)}toJSON(){return this.toString()}toString(){return this.serialized}};function Q(e){return Wa().transform((t,n)=>{let r=[],a=e.map(()=>[]),o=Ro();for(let[n,i]of e.entries()){let e=Ro(),o=i.safeParse(t),s=e.end();if(o.success){r.push({data:o.data,inexactCount:s,zeroDefaultCount:0,fieldCount:-1});continue}a[n].push(...o.error.issues)}if(r.length===0)return o.end(0),n.addIssue({input:t,code:`invalid_union`,errors:a}),i;let s=r[0];for(let e of r)r.length>1&&(e.fieldCount=Yo(e.data)),s=Jo(e,s);return o.end(s.inexactCount),s.data})}function Jo(e,t){let n=e.inexactCount===0;if(n!==(t.inexactCount===0))return n?e:t;let r=e.fieldCount-e.zeroDefaultCount,i=t.fieldCount-t.zeroDefaultCount;return r===i?e.inexactCount<t.inexactCount?e:t:r>i?e:t}function Yo(e){let t=0,n=[e],r=0;for(;r<n.length;){let e=n[r++];if(e===void 0||Wo(e))continue;let i=typeof e;if(e===null||i===`number`||i===`string`||i===`boolean`||i===`bigint`||e instanceof Date||e instanceof qo){t++;continue}if(Array.isArray(e)){n.push(...e);continue}i===`object`&&n.push(...Object.values(e))}return t}const Xo=G({type:J(`input_audio`),input_audio:B()}).transform(e=>X(e,{input_audio:`inputAudio`})),Zo=G({type:J(`input_audio`),inputAudio:B()}).transform(e=>X(e,{inputAudio:`input_audio`})),Qo=G({type:J(`document_url`).default(`document_url`),document_url:B(),document_name:Y(B()).optional()}).transform(e=>X(e,{document_url:`documentUrl`,document_name:`documentName`})),$o=G({type:J(`document_url`).default(`document_url`),documentUrl:B(),documentName:Y(B()).optional()}).transform(e=>X(e,{documentUrl:`document_url`,documentName:`document_name`})),es=G({type:J(`file`).default(`file`),file_id:B()}).transform(e=>X(e,{file_id:`fileId`})),ts=G({type:J(`file`).default(`file`),fileId:B()}).transform(e=>X(e,{fileId:`file_id`})),ns={Low:`low`,Auto:`auto`,High:`high`},rs=zo(ns),is=Vo(ns),as=G({url:B(),detail:Y(rs).optional()}),os=G({url:B(),detail:Y(is).optional()});Q([as,B()]),Q([os,B()]);const ss=G({type:J(`image_url`).default(`image_url`),image_url:Q([as,B()])}).transform(e=>X(e,{image_url:`imageUrl`})),cs=G({type:J(`image_url`).default(`image_url`),imageUrl:Q([os,B()])}).transform(e=>X(e,{imageUrl:`image_url`}));Q([H(),B()]),Q([H(),B()]);const ls=G({type:J(`reference`).default(`reference`),reference_ids:W(Q([H(),B()]))}).transform(e=>X(e,{reference_ids:`referenceIds`})),us=G({type:J(`reference`).default(`reference`),referenceIds:W(Q([H(),B()]))}).transform(e=>X(e,{referenceIds:`reference_ids`})),ds=G({type:J(`text`).default(`text`),text:B()}),$=G({type:J(`text`).default(`text`),text:B()}),fs={WebSearch:`web_search`,WebSearchPremium:`web_search_premium`,CodeInterpreter:`code_interpreter`,ImageGeneration:`image_generation`,DocumentLibrary:`document_library`},ps=zo(fs),ms=Vo(fs);Q([ps,B()]),Q([ms,B()]);const hs=G({type:J(`tool_reference`).default(`tool_reference`),tool:Q([ps,B()]),title:B(),url:Y(B()).optional(),favicon:Y(B()).optional(),description:Y(B()).optional()}),gs=G({type:J(`tool_reference`).default(`tool_reference`),tool:Q([ms,B()]),title:B(),url:Y(B()).optional(),favicon:Y(B()).optional(),description:Y(B()).optional()});Q([hs,ds,ls]),Q([gs,$,us]);const _s=G({type:J(`thinking`).default(`thinking`),thinking:W(Q([hs,ds,ls])),signature:Y(B()).optional(),closed:Va().optional()}),vs=G({type:J(`thinking`).default(`thinking`),thinking:W(Q([gs,$,us])),signature:Y(B()).optional(),closed:Va().optional()}),ys=Go(`type`,{image_url:ss.and(G({type:J(`image_url`)})),document_url:Qo.and(G({type:J(`document_url`)})),text:ds.and(G({type:J(`text`)})),reference:ls.and(G({type:J(`reference`)})),file:es.and(G({type:J(`file`)})),thinking:_s.and(G({type:J(`thinking`)})),input_audio:Xo}),bs=K([cs.and(G({type:J(`image_url`)})),$o.and(G({type:J(`document_url`)})),$.and(G({type:J(`text`)})),us.and(G({type:J(`reference`)})),ts.and(G({type:J(`file`)})),vs.and(G({type:J(`thinking`)})),Zo]);Q([q(B(),U()),B()]),Q([q(B(),U()),B()]);const xs=G({name:B(),arguments:Q([q(B(),U()),B()])}),Ss=G({name:B(),arguments:Q([q(B(),U()),B()])}),Cs=G({id:B().default(`null`),type:B().optional(),function:xs,index:H().default(0)}),ws=G({id:B().default(`null`),type:B().optional(),function:Ss,index:H().default(0)});Q([B(),W(ys)]);const Ts=G({role:Y(B()).optional(),content:Y(Q([B(),W(ys)])).optional(),tool_calls:Y(W(Cs)).optional(),tool_call_id:Y(B()).optional(),index:Y(H()).optional(),metadata:Y(q(B(),U())).optional()}).transform(e=>X(e,{tool_calls:`toolCalls`,tool_call_id:`toolCallId`})),Es=G({prompt_tokens:H().default(0),completion_tokens:H().default(0),total_tokens:H().default(0),prompt_audio_seconds:Y(H()).optional()}).catchall(U()).transform(e=>X(e,{prompt_tokens:`promptTokens`,completion_tokens:`completionTokens`,total_tokens:`totalTokens`,prompt_audio_seconds:`promptAudioSeconds`})),Ds=G({promptTokens:H().default(0),completionTokens:H().default(0),totalTokens:H().default(0),promptAudioSeconds:Y(H()).optional()}).catchall(U()).transform(e=>({...X(e,{promptTokens:`prompt_tokens`,completionTokens:`completion_tokens`,totalTokens:`total_tokens`,promptAudioSeconds:`prompt_audio_seconds`})})),Os=zo({Stop:`stop`,Length:`length`,Error:`error`,ToolCalls:`tool_calls`}),ks=G({index:H(),delta:Ts,finish_reason:Y(Os)}).transform(e=>X(e,{finish_reason:`finishReason`})),As=G({id:B(),object:B().optional(),created:H().optional(),model:B(),usage:Es.optional(),choices:W(ks)});function js(e){return Fo(e,e=>As.parse(JSON.parse(e)),`Failed to parse 'CompletionChunk' from JSON`)}export{Ce as $,Po as A,Xa as B,Q as C,Vo as D,Bo as E,Ja as F,Ra as G,Do as H,U as I,B as J,G as K,W as L,No as M,Ba as N,Ho as O,io as P,Dr as Q,Va as R,$o as S,zo as T,J as U,H as V,Y as W,Xi as X,K as Y,Ji as Z,$ as _,Ts as a,ts as b,ys as c,vs as d,i as et,hs as f,ds as g,ms as h,Ds as i,X as j,Fo as k,bs as l,ps as m,js as n,e as nt,Cs as o,gs as p,q,Es as r,n as rt,ws as s,As as t,t as tt,_s as u,ss as v,Go as w,Qo as x,cs as y,ko as z};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
function e(e){return{ok:!0,value:e}}function t(e){return{ok:!1,error:e}}async function n(e){let t=await e;if(!t.ok)throw t.error;return t.value}var r,i=Object.freeze({status:`aborted`});function a(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}var o=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},s=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(r=globalThis).__zod_globalConfig??(r.__zod_globalConfig={});var c=globalThis.__zod_globalConfig;function l(e){return e&&Object.assign(c,e),c}function u(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 d(e,t){return typeof t==`bigint`?t.toString():t}function f(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function p(e){return e==null}function ee(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function te(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}var ne=Symbol(`evaluating`);function m(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ne)return r===void 0&&(r=ne,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function h(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function g(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function re(e){return JSON.stringify(e)}function ie(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var ae=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function oe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var se=f(()=>{if(c.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function _(e){if(oe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(oe(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ce(e){return _(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var le=new Set([`string`,`number`,`symbol`]);function v(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function y(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function b(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 ue(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var de={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function fe(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 y(e,g(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 h(this,`shape`,e),e},checks:[]}))}function pe(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 y(e,g(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 h(this,`shape`,r),r},checks:[]}))}function me(e,t){if(!_(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 y(e,g(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return h(this,`shape`,n),n}}))}function he(e,t){if(!_(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return y(e,g(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return h(this,`shape`,n),n}}))}function ge(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return y(e,g(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return h(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function _e(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 y(t,g(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 h(this,`shape`,i),i},checks:[]}))}function ve(e,t,n){return y(t,g(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 h(this,`shape`,i),i}}))}function x(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 ye(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 S(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function C(e){return typeof e==`string`?e:e?.message}function w(e,t,n){let r=e.message?e.message:C(e.inst?._zod.def?.error?.(e))??C(t?.error?.(e))??C(n.customError?.(e))??C(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 be(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function T(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var xe=(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,d,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Se=a(`$ZodError`,xe),Ce=a(`$ZodError`,xe,{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 Te(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 Ee(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 De(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 ${Ee(e.path)}`);return t.join(`
|
|
2
|
+
`)}var Oe=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},a);if(s instanceof Promise)throw new o;if(s.issues.length){let t=new((i?.Err)??e)(s.issues.map(e=>w(e,a,l())));throw ae(t,i?.callee),t}return s.value},ke=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=>w(e,a,l())));throw ae(t,i?.callee),t}return o.value},E=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new o;return a.issues.length?{success:!1,error:new(e??Se)(a.issues.map(e=>w(e,i,l())))}:{success:!0,data:a.value}},Ae=E(Ce),D=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=>w(e,i,l())))}:{success:!0,data:a.value}},je=D(Ce),Me=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Oe(e)(t,n,i)},Ne=e=>(t,n,r)=>Oe(e)(t,n,r),Pe=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ke(e)(t,n,i)},Fe=e=>async(t,n,r)=>ke(e)(t,n,r),Ie=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return E(e)(t,n,i)},Le=e=>(t,n,r)=>E(e)(t,n,r),Re=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return D(e)(t,n,i)},ze=e=>async(t,n,r)=>D(e)(t,n,r),Be=/^[cC][0-9a-z]{6,}$/,Ve=/^[0-9a-z]+$/,He=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ue=/^[0-9a-vA-V]{20}$/,We=/^[A-Za-z0-9]{27}$/,Ge=/^[a-zA-Z0-9_-]{21}$/,Ke=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,qe=/^([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})$/,Je=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)$/,Ye=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Xe=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Ze(){return new RegExp(Xe,`u`)}var Qe=/^(?:(?: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])$/,$e=/^(([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}|:))$/,et=/^((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])$/,tt=/^(([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])$/,nt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,rt=/^[A-Za-z0-9_-]*$/,it=/^https?$/,at=/^\+[1-9]\d{6,14}$/,ot=`(?:(?:\\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])))`,st=RegExp(`^${ot}$`);function ct(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 lt(e){return RegExp(`^${ct(e)}$`)}function ut(e){let t=ct({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(`^${ot}T(?:${r})$`)}var dt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},ft=/^-?\d+$/,pt=/^-?\d+(?:\.\d+)?$/,mt=/^(?:true|false)$/i,ht=/^[^A-Z]*$/,gt=/^[^a-z]*$/,O=a(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),_t={number:`number`,bigint:`bigint`,object:`date`},vt=a(`$ZodCheckLessThan`,(e,t)=>{O.init(e,t);let n=_t[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})}}),yt=a(`$ZodCheckGreaterThan`,(e,t)=>{O.init(e,t);let n=_t[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})}}),bt=a(`$ZodCheckMultipleOf`,(e,t)=>{O.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):te(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})}}),xt=a(`$ZodCheckNumberFormat`,(e,t)=>{O.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=de[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=ft)}),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})}}),St=a(`$ZodCheckMaxLength`,(e,t)=>{var n;O.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!p(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=be(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ct=a(`$ZodCheckMinLength`,(e,t)=>{var n;O.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!p(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=be(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),wt=a(`$ZodCheckLengthEquals`,(e,t)=>{var n;O.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!p(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=be(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})}}),Tt=a(`$ZodCheckStringFormat`,(e,t)=>{var n,r;O.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=()=>{})}),Et=a(`$ZodCheckRegex`,(e,t)=>{Tt.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})}}),Dt=a(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=ht,Tt.init(e,t)}),Ot=a(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=gt,Tt.init(e,t)}),kt=a(`$ZodCheckIncludes`,(e,t)=>{O.init(e,t);let n=v(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})}}),At=a(`$ZodCheckStartsWith`,(e,t)=>{O.init(e,t);let n=RegExp(`^${v(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})}}),jt=a(`$ZodCheckEndsWith`,(e,t)=>{O.init(e,t);let n=RegExp(`.*${v(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})}}),Mt=a(`$ZodCheckOverwrite`,(e,t)=>{O.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Nt=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
|
+
`).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
|
+
`))}},Pt={major:4,minor:4,patch:3},k=a(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Pt;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=x(e),i;for(let a of t){if(a._zod.def.when){if(ye(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,s=a._zod.check(e);if(s instanceof Promise&&n?.async===!1)throw new o;if(i||s instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(r||=x(e,t))});else{if(e.issues.length===t)continue;r||=x(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(x(n))return n.aborted=!0,n;let s=t(i,r,a);if(s instanceof Promise){if(a.async===!1)throw new o;return s.then(t=>e._zod.parse(t,a))}return e._zod.parse(s,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let s=e._zod.parse(i,a);if(s instanceof Promise){if(a.async===!1)throw new o;return s.then(e=>t(e,r,a))}return t(s,r,a)}}m(e,`~standard`,()=>({validate:t=>{try{let n=Ae(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return je(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Ft=a(`$ZodString`,(e,t)=>{k.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??dt(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}}),A=a(`$ZodStringFormat`,(e,t)=>{Tt.init(e,t),Ft.init(e,t)}),It=a(`$ZodGUID`,(e,t)=>{t.pattern??=qe,A.init(e,t)}),Lt=a(`$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??=Je(e)}else t.pattern??=Je();A.init(e,t)}),Rt=a(`$ZodEmail`,(e,t)=>{t.pattern??=Ye,A.init(e,t)}),zt=a(`$ZodURL`,(e,t)=>{A.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===it.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})}}}),Bt=a(`$ZodEmoji`,(e,t)=>{t.pattern??=Ze(),A.init(e,t)}),Vt=a(`$ZodNanoID`,(e,t)=>{t.pattern??=Ge,A.init(e,t)}),Ht=a(`$ZodCUID`,(e,t)=>{t.pattern??=Be,A.init(e,t)}),Ut=a(`$ZodCUID2`,(e,t)=>{t.pattern??=Ve,A.init(e,t)}),Wt=a(`$ZodULID`,(e,t)=>{t.pattern??=He,A.init(e,t)}),Gt=a(`$ZodXID`,(e,t)=>{t.pattern??=Ue,A.init(e,t)}),Kt=a(`$ZodKSUID`,(e,t)=>{t.pattern??=We,A.init(e,t)}),qt=a(`$ZodISODateTime`,(e,t)=>{t.pattern??=ut(t),A.init(e,t)}),Jt=a(`$ZodISODate`,(e,t)=>{t.pattern??=st,A.init(e,t)}),Yt=a(`$ZodISOTime`,(e,t)=>{t.pattern??=lt(t),A.init(e,t)}),Xt=a(`$ZodISODuration`,(e,t)=>{t.pattern??=Ke,A.init(e,t)}),Zt=a(`$ZodIPv4`,(e,t)=>{t.pattern??=Qe,A.init(e,t),e._zod.bag.format=`ipv4`}),Qt=a(`$ZodIPv6`,(e,t)=>{t.pattern??=$e,A.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})}}}),$t=a(`$ZodCIDRv4`,(e,t)=>{t.pattern??=et,A.init(e,t)}),en=a(`$ZodCIDRv6`,(e,t)=>{t.pattern??=tt,A.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 tn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var nn=a(`$ZodBase64`,(e,t)=>{t.pattern??=nt,A.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{tn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function rn(e){if(!rt.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return tn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var an=a(`$ZodBase64URL`,(e,t)=>{t.pattern??=rt,A.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{rn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),on=a(`$ZodE164`,(e,t)=>{t.pattern??=at,A.init(e,t)});function sn(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}}var cn=a(`$ZodJWT`,(e,t)=>{A.init(e,t),e._zod.check=n=>{sn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),ln=a(`$ZodNumber`,(e,t)=>{k.init(e,t),e._zod.pattern=e._zod.bag.pattern??pt,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}}),un=a(`$ZodNumberFormat`,(e,t)=>{xt.init(e,t),ln.init(e,t)}),dn=a(`$ZodBoolean`,(e,t)=>{k.init(e,t),e._zod.pattern=mt,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}}),fn=a(`$ZodAny`,(e,t)=>{k.init(e,t),e._zod.parse=e=>e}),pn=a(`$ZodUnknown`,(e,t)=>{k.init(e,t),e._zod.parse=e=>e}),mn=a(`$ZodNever`,(e,t)=>{k.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),hn=a(`$ZodVoid`,(e,t)=>{k.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}}),gn=a(`$ZodDate`,(e,t)=>{k.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 _n(e,t,n){e.issues.length&&t.issues.push(...S(n,e.issues)),t.value[n]=e.value}var vn=a(`$ZodArray`,(e,t)=>{k.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=>_n(t,n,e))):_n(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function yn(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...S(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 bn(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=ue(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function xn(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=>yn(e,n,i,t,u,d))):yn(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}var Sn=a(`$ZodObject`,(e,t)=>{if(k.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=f(()=>bn(t));m(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=oe,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=>yn(n,t,e,s,r,i))):yn(a,t,e,s,r,i)}return i?xn(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Cn=a(`$ZodObjectJIT`,(e,t)=>{Sn.init(e,t);let n=e._zod.parse,r=f(()=>bn(t)),i=e=>{let t=new Nt([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=re(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=re(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
5
|
+
if (${n}.issues.length) {
|
|
6
|
+
if (${o} in input) {
|
|
7
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
8
|
+
...iss,
|
|
9
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
10
|
+
})));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (${n}.value === undefined) {
|
|
15
|
+
if (${o} in input) {
|
|
16
|
+
newResult[${o}] = undefined;
|
|
17
|
+
}
|
|
18
|
+
} else {
|
|
19
|
+
newResult[${o}] = ${n}.value;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
`):c?t.write(`
|
|
23
|
+
if (${n}.issues.length) {
|
|
24
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
25
|
+
...iss,
|
|
26
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
27
|
+
})));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (${n}.value === undefined) {
|
|
31
|
+
if (${o} in input) {
|
|
32
|
+
newResult[${o}] = undefined;
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
newResult[${o}] = ${n}.value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
`):t.write(`
|
|
39
|
+
const ${n}_present = ${o} in input;
|
|
40
|
+
if (${n}.issues.length) {
|
|
41
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
42
|
+
...iss,
|
|
43
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
44
|
+
})));
|
|
45
|
+
}
|
|
46
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
47
|
+
payload.issues.push({
|
|
48
|
+
code: "invalid_type",
|
|
49
|
+
expected: "nonoptional",
|
|
50
|
+
input: undefined,
|
|
51
|
+
path: [${o}]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (${n}_present) {
|
|
56
|
+
if (${n}.value === undefined) {
|
|
57
|
+
newResult[${o}] = undefined;
|
|
58
|
+
} else {
|
|
59
|
+
newResult[${o}] = ${n}.value;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=oe,s=!c.jitless,l=s&&se.value,u=t.catchall,d;e._zod.parse=(c,f)=>{d??=r.value;let p=c.value;return o(p)?s&&l&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),c=a(c,f),u?xn([],p,c,f,d,e):c):n(c,f):(c.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),c)}});function wn(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!x(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>w(e,r,l())))}),t)}var Tn=a(`$ZodUnion`,(e,t)=>{k.init(e,t),m(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),m(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),m(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),m(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>ee(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>wn(t,r,e,i)):wn(o,r,e,i)}}),En=a(`$ZodIntersection`,(e,t)=>{k.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>On(e,t,n)):On(e,i,a)}});function Dn(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(_(e)&&_(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Dn(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Dn(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function On(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),x(e))return e;let o=Dn(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var kn=a(`$ZodRecord`,(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!_(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>w(e,r,l())),input:c,path:[c],inst:e});continue}let u=o.value,d=t.valueType._zod.run({value:i[c],issues:[]},r);d instanceof Promise?a.push(d.then(e=>{e.issues.length&&n.issues.push(...S(c,e.issues)),n.value[u]=e.value})):(d.issues.length&&n.issues.push(...S(c,d.issues)),n.value[u]=d.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&pt.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>w(e,r,l())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...S(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...S(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),An=a(`$ZodEnum`,(e,t)=>{k.init(e,t);let n=u(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>le.has(typeof e)).map(e=>typeof e==`string`?v(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),jn=a(`$ZodLiteral`,(e,t)=>{if(k.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?v(e):e?v(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Mn=a(`$ZodTransform`,(e,t)=>{k.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new s(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new o;return n.value=i,n.fallback=!0,n}});function Nn(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Pn=a(`$ZodOptional`,(e,t)=>{k.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,m(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),m(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ee(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Nn(e,r)):Nn(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Fn=a(`$ZodExactOptional`,(e,t)=>{Pn.init(e,t),m(e._zod,`values`,()=>t.innerType._zod.values),m(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),In=a(`$ZodNullable`,(e,t)=>{k.init(e,t),m(e._zod,`optin`,()=>t.innerType._zod.optin),m(e._zod,`optout`,()=>t.innerType._zod.optout),m(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ee(e.source)}|null)$`):void 0}),m(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Ln=a(`$ZodDefault`,(e,t)=>{k.init(e,t),e._zod.optin=`optional`,m(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Rn(e,t)):Rn(r,t)}});function Rn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var zn=a(`$ZodPrefault`,(e,t)=>{k.init(e,t),e._zod.optin=`optional`,m(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Bn=a(`$ZodNonOptional`,(e,t)=>{k.init(e,t),m(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Vn(t,e)):Vn(i,e)}});function Vn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Hn=a(`$ZodCatch`,(e,t)=>{k.init(e,t),e._zod.optin=`optional`,m(e._zod,`optout`,()=>t.innerType._zod.optout),m(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>w(e,n,l()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>w(e,n,l()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Un=a(`$ZodPipe`,(e,t)=>{k.init(e,t),m(e._zod,`values`,()=>t.in._zod.values),m(e._zod,`optin`,()=>t.in._zod.optin),m(e._zod,`optout`,()=>t.out._zod.optout),m(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Wn(e,t.in,n)):Wn(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Wn(e,t.out,n)):Wn(r,t.out,n)}});function Wn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var Gn=a(`$ZodReadonly`,(e,t)=>{k.init(e,t),m(e._zod,`propValues`,()=>t.innerType._zod.propValues),m(e._zod,`values`,()=>t.innerType._zod.values),m(e._zod,`optin`,()=>t.innerType?._zod?.optin),m(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Kn):Kn(r)}});function Kn(e){return e.value=Object.freeze(e.value),e}var qn=a(`$ZodLazy`,(e,t)=>{k.init(e,t),m(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),m(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),m(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),m(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),m(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Jn=a(`$ZodCustom`,(e,t)=>{O.init(e,t),k.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Yn(t,n,r,e));Yn(i,n,r,e)}});function Yn(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(T(e))}}var Xn,Zn=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Qn(){return new Zn}(Xn=globalThis).__zod_globalRegistry??(Xn.__zod_globalRegistry=Qn());var j=globalThis.__zod_globalRegistry;function $n(e,t){return new e({type:`string`,...b(t)})}function er(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...b(t)})}function tr(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...b(t)})}function nr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...b(t)})}function rr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...b(t)})}function ir(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...b(t)})}function ar(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...b(t)})}function or(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...b(t)})}function sr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...b(t)})}function cr(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...b(t)})}function lr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...b(t)})}function ur(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...b(t)})}function dr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...b(t)})}function fr(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...b(t)})}function pr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...b(t)})}function mr(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...b(t)})}function hr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...b(t)})}function gr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...b(t)})}function _r(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...b(t)})}function vr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...b(t)})}function yr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...b(t)})}function br(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...b(t)})}function xr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...b(t)})}function Sr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...b(t)})}function Cr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...b(t)})}function wr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...b(t)})}function Tr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...b(t)})}function Er(e,t){return new e({type:`number`,checks:[],...b(t)})}function Dr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...b(t)})}function Or(e,t){return new e({type:`boolean`,...b(t)})}function kr(e,t){return new e({type:`boolean`,coerce:!0,...b(t)})}function Ar(e){return new e({type:`any`})}function jr(e){return new e({type:`unknown`})}function Mr(e,t){return new e({type:`never`,...b(t)})}function Nr(e,t){return new e({type:`void`,...b(t)})}function Pr(e,t){return new e({type:`date`,...b(t)})}function Fr(e,t){return new vt({check:`less_than`,...b(t),value:e,inclusive:!1})}function Ir(e,t){return new vt({check:`less_than`,...b(t),value:e,inclusive:!0})}function Lr(e,t){return new yt({check:`greater_than`,...b(t),value:e,inclusive:!1})}function Rr(e,t){return new yt({check:`greater_than`,...b(t),value:e,inclusive:!0})}function zr(e,t){return new bt({check:`multiple_of`,...b(t),value:e})}function Br(e,t){return new St({check:`max_length`,...b(t),maximum:e})}function Vr(e,t){return new Ct({check:`min_length`,...b(t),minimum:e})}function Hr(e,t){return new wt({check:`length_equals`,...b(t),length:e})}function Ur(e,t){return new Et({check:`string_format`,format:`regex`,...b(t),pattern:e})}function Wr(e){return new Dt({check:`string_format`,format:`lowercase`,...b(e)})}function Gr(e){return new Ot({check:`string_format`,format:`uppercase`,...b(e)})}function Kr(e,t){return new kt({check:`string_format`,format:`includes`,...b(t),includes:e})}function qr(e,t){return new At({check:`string_format`,format:`starts_with`,...b(t),prefix:e})}function Jr(e,t){return new jt({check:`string_format`,format:`ends_with`,...b(t),suffix:e})}function M(e){return new Mt({check:`overwrite`,tx:e})}function Yr(e){return M(t=>t.normalize(e))}function Xr(){return M(e=>e.trim())}function Zr(){return M(e=>e.toLowerCase())}function Qr(){return M(e=>e.toUpperCase())}function $r(){return M(e=>ie(e))}function ei(e,t,n){return new e({type:`array`,element:t,...b(n)})}function ti(e,t,n){let r=b(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function ni(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...b(n)})}function ri(e,t){let n=ii(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(T(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(T(r))}},e(t.value,t)),t);return n}function ii(e,t){let n=new O({check:`custom`,...b(t)});return n._zod.check=e,n}function ai(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??j,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function N(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,N(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&F(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function oi(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
64
|
+
|
|
65
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function P(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:I(t,`input`,e.processors),output:I(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function F(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return F(r.element,n);if(r.type===`set`)return F(r.valueType,n);if(r.type===`lazy`)return F(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return F(r.innerType,n);if(r.type===`intersection`)return F(r.left,n)||F(r.right,n);if(r.type===`record`||r.type===`map`)return F(r.keyType,n)||F(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:F(r.in,n)||F(r.out,n);if(r.type===`object`){for(let e in r.shape)if(F(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(F(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(F(e,n))return!0;return!!(r.rest&&F(r.rest,n))}return!1}var si=(e,t={})=>n=>{let r=ai({...n,processors:t});return N(e,r),oi(r,e),P(r,e)},I=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ai({...i??{},target:a,io:t,processors:n});return N(e,o),oi(o,e),P(o,e)},ci={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},li=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ci[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},ui=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},di=(e,t,n,r)=>{n.type=`boolean`},fi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},pi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},mi=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},hi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},gi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},_i=(e,t,n,r)=>{n.not={}},vi=(e,t,n,r)=>{},yi=(e,t,n,r)=>{},bi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},xi=(e,t,n,r)=>{let i=e._zod.def,a=u(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Si=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Ci=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},wi=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},Ti=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},Ei=(e,t,n,r)=>{n.type=`boolean`},Di=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Oi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},ki=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Ai=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},ji=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},Mi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=N(a.element,t,{...r,path:[...r.path,`items`]})},Ni=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=N(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=N(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Pi=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>N(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Fi=(e,t,n,r)=>{let i=e._zod.def,a=N(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=N(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Ii=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>N(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?N(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},Li=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=N(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=N(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=N(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Ri=(e,t,n,r)=>{let i=e._zod.def,a=N(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},zi=(e,t,n,r)=>{let i=e._zod.def;N(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Bi=(e,t,n,r)=>{let i=e._zod.def;N(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Vi=(e,t,n,r)=>{let i=e._zod.def;N(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Hi=(e,t,n,r)=>{let i=e._zod.def;N(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Ui=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;N(o,t,r);let s=t.seen.get(e);s.ref=o},Wi=(e,t,n,r)=>{let i=e._zod.def;N(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Gi=(e,t,n,r)=>{let i=e._zod.def;N(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ki=(e,t,n,r)=>{let i=e._zod.def;N(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},qi=(e,t,n,r)=>{let i=e._zod.innerType;N(i,t,r);let a=t.seen.get(e);a.ref=i},Ji={string:li,number:ui,boolean:di,bigint:fi,symbol:pi,null:mi,undefined:hi,void:gi,never:_i,any:vi,unknown:yi,date:bi,enum:xi,literal:Si,nan:Ci,template_literal:wi,file:Ti,success:Ei,custom:Di,function:Oi,transform:ki,map:Ai,set:ji,array:Mi,object:Ni,union:Pi,intersection:Fi,tuple:Ii,record:Li,nullable:Ri,nonoptional:zi,default:Bi,prefault:Vi,catch:Hi,pipe:Ui,readonly:Wi,promise:Gi,optional:Ki,lazy:qi};function Yi(e,t){if(`_idmap`in e){let n=e,r=ai({...t,processors:Ji}),i={};for(let e of n._idmap.entries()){let[t,n]=e;N(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;oi(r,n),a[t]=P(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=ai({...t,processors:Ji});return N(e,n),oi(n,e),P(n,e)}var Xi=a(`ZodISODateTime`,(e,t)=>{qt.init(e,t),V.init(e,t)});function Zi(e){return Sr(Xi,e)}var Qi=a(`ZodISODate`,(e,t)=>{Jt.init(e,t),V.init(e,t)});function $i(e){return Cr(Qi,e)}var ea=a(`ZodISOTime`,(e,t)=>{Yt.init(e,t),V.init(e,t)});function ta(e){return wr(ea,e)}var na=a(`ZodISODuration`,(e,t)=>{Xt.init(e,t),V.init(e,t)});function ra(e){return Tr(na,e)}var L=a(`ZodError`,(e,t)=>{Se.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Te(e,t)},flatten:{value:t=>we(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,d,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,d,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),ia=Oe(L),aa=ke(L),oa=E(L),sa=D(L),ca=Me(L),la=Ne(L),ua=Pe(L),da=Fe(L),fa=Ie(L),pa=Le(L),ma=Re(L),ha=ze(L),ga=new WeakMap;function R(e,t,n){let r=Object.getPrototypeOf(e),i=ga.get(r);if(i||(i=new Set,ga.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var z=a(`ZodType`,(e,t)=>(k.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:I(e,`input`),output:I(e,`output`)}}),e.toJSONSchema=si(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>ia(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>oa(e,t,n),e.parseAsync=async(t,n)=>aa(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>sa(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ca(e,t,n),e.decode=(t,n)=>la(e,t,n),e.encodeAsync=async(t,n)=>ua(e,t,n),e.decodeAsync=async(t,n)=>da(e,t,n),e.safeEncode=(t,n)=>fa(e,t,n),e.safeDecode=(t,n)=>pa(e,t,n),e.safeEncodeAsync=async(t,n)=>ma(e,t,n),e.safeDecodeAsync=async(t,n)=>ha(e,t,n),R(e,`ZodType`,{check(...e){let t=this.def;return this.clone(g(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return y(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(jo(e,t))},superRefine(e,t){return this.check(Mo(e,t))},overwrite(e){return this.check(M(e))},optional(){return uo(this)},exactOptional(){return po(this)},nullable(){return Y(this)},nullish(){return uo(Y(this))},nonoptional(e){return bo(this,e)},array(){return W(this)},or(e){return K([this,e])},and(e){return no(this,e)},transform(e){return wo(this,co(e))},default(e){return go(this,e)},prefault(e){return vo(this,e)},catch(e){return So(this,e)},pipe(e){return wo(this,e)},readonly(){return Eo(this)},describe(e){let t=this.clone();return j.add(t,{description:e}),t},meta(...e){if(e.length===0)return j.get(this);let t=this.clone();return j.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return j.get(e)?.description},configurable:!0}),e)),_a=a(`_ZodString`,(e,t)=>{Ft.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>li(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,R(e,`_ZodString`,{regex(...e){return this.check(Ur(...e))},includes(...e){return this.check(Kr(...e))},startsWith(...e){return this.check(qr(...e))},endsWith(...e){return this.check(Jr(...e))},min(...e){return this.check(Vr(...e))},max(...e){return this.check(Br(...e))},length(...e){return this.check(Hr(...e))},nonempty(...e){return this.check(Vr(1,...e))},lowercase(e){return this.check(Wr(e))},uppercase(e){return this.check(Gr(e))},trim(){return this.check(Xr())},normalize(...e){return this.check(Yr(...e))},toLowerCase(){return this.check(Zr())},toUpperCase(){return this.check(Qr())},slugify(){return this.check($r())}})}),va=a(`ZodString`,(e,t)=>{Ft.init(e,t),_a.init(e,t),e.email=t=>e.check(er(ya,t)),e.url=t=>e.check(or(Sa,t)),e.jwt=t=>e.check(xr(La,t)),e.emoji=t=>e.check(sr(Ca,t)),e.guid=t=>e.check(tr(ba,t)),e.uuid=t=>e.check(nr(xa,t)),e.uuidv4=t=>e.check(rr(xa,t)),e.uuidv6=t=>e.check(ir(xa,t)),e.uuidv7=t=>e.check(ar(xa,t)),e.nanoid=t=>e.check(cr(wa,t)),e.guid=t=>e.check(tr(ba,t)),e.cuid=t=>e.check(lr(Ta,t)),e.cuid2=t=>e.check(ur(Ea,t)),e.ulid=t=>e.check(dr(Da,t)),e.base64=t=>e.check(vr(Pa,t)),e.base64url=t=>e.check(yr(Fa,t)),e.xid=t=>e.check(fr(Oa,t)),e.ksuid=t=>e.check(pr(ka,t)),e.ipv4=t=>e.check(mr(Aa,t)),e.ipv6=t=>e.check(hr(ja,t)),e.cidrv4=t=>e.check(gr(Ma,t)),e.cidrv6=t=>e.check(_r(Na,t)),e.e164=t=>e.check(br(Ia,t)),e.datetime=t=>e.check(Zi(t)),e.date=t=>e.check($i(t)),e.time=t=>e.check(ta(t)),e.duration=t=>e.check(ra(t))});function B(e){return $n(va,e)}var V=a(`ZodStringFormat`,(e,t)=>{A.init(e,t),_a.init(e,t)}),ya=a(`ZodEmail`,(e,t)=>{Rt.init(e,t),V.init(e,t)}),ba=a(`ZodGUID`,(e,t)=>{It.init(e,t),V.init(e,t)}),xa=a(`ZodUUID`,(e,t)=>{Lt.init(e,t),V.init(e,t)}),Sa=a(`ZodURL`,(e,t)=>{zt.init(e,t),V.init(e,t)}),Ca=a(`ZodEmoji`,(e,t)=>{Bt.init(e,t),V.init(e,t)}),wa=a(`ZodNanoID`,(e,t)=>{Vt.init(e,t),V.init(e,t)}),Ta=a(`ZodCUID`,(e,t)=>{Ht.init(e,t),V.init(e,t)}),Ea=a(`ZodCUID2`,(e,t)=>{Ut.init(e,t),V.init(e,t)}),Da=a(`ZodULID`,(e,t)=>{Wt.init(e,t),V.init(e,t)}),Oa=a(`ZodXID`,(e,t)=>{Gt.init(e,t),V.init(e,t)}),ka=a(`ZodKSUID`,(e,t)=>{Kt.init(e,t),V.init(e,t)}),Aa=a(`ZodIPv4`,(e,t)=>{Zt.init(e,t),V.init(e,t)}),ja=a(`ZodIPv6`,(e,t)=>{Qt.init(e,t),V.init(e,t)}),Ma=a(`ZodCIDRv4`,(e,t)=>{$t.init(e,t),V.init(e,t)}),Na=a(`ZodCIDRv6`,(e,t)=>{en.init(e,t),V.init(e,t)}),Pa=a(`ZodBase64`,(e,t)=>{nn.init(e,t),V.init(e,t)}),Fa=a(`ZodBase64URL`,(e,t)=>{an.init(e,t),V.init(e,t)}),Ia=a(`ZodE164`,(e,t)=>{on.init(e,t),V.init(e,t)}),La=a(`ZodJWT`,(e,t)=>{cn.init(e,t),V.init(e,t)}),Ra=a(`ZodNumber`,(e,t)=>{ln.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ui(e,t,n,r),R(e,`ZodNumber`,{gt(e,t){return this.check(Lr(e,t))},gte(e,t){return this.check(Rr(e,t))},min(e,t){return this.check(Rr(e,t))},lt(e,t){return this.check(Fr(e,t))},lte(e,t){return this.check(Ir(e,t))},max(e,t){return this.check(Ir(e,t))},int(e){return this.check(H(e))},safe(e){return this.check(H(e))},positive(e){return this.check(Lr(0,e))},nonnegative(e){return this.check(Rr(0,e))},negative(e){return this.check(Fr(0,e))},nonpositive(e){return this.check(Ir(0,e))},multipleOf(e,t){return this.check(zr(e,t))},step(e,t){return this.check(zr(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function za(e){return Er(Ra,e)}var Ba=a(`ZodNumberFormat`,(e,t)=>{un.init(e,t),Ra.init(e,t)});function H(e){return Dr(Ba,e)}var Va=a(`ZodBoolean`,(e,t)=>{dn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>di(e,t,n,r)});function Ha(e){return Or(Va,e)}var Ua=a(`ZodAny`,(e,t)=>{fn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function U(){return Ar(Ua)}var Wa=a(`ZodUnknown`,(e,t)=>{pn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ga(){return jr(Wa)}var Ka=a(`ZodNever`,(e,t)=>{mn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r)});function qa(e){return Mr(Ka,e)}var Ja=a(`ZodVoid`,(e,t)=>{hn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r)});function Ya(e){return Nr(Ja,e)}var Xa=a(`ZodDate`,(e,t)=>{gn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),e.min=(t,n)=>e.check(Rr(t,n)),e.max=(t,n)=>e.check(Ir(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function Za(e){return Pr(Xa,e)}var Qa=a(`ZodArray`,(e,t)=>{vn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mi(e,t,n,r),e.element=t.element,R(e,`ZodArray`,{min(e,t){return this.check(Vr(e,t))},nonempty(e){return this.check(Vr(1,e))},max(e,t){return this.check(Br(e,t))},length(e,t){return this.check(Hr(e,t))},unwrap(){return this.element}})});function W(e,t){return ei(Qa,e,t)}var $a=a(`ZodObject`,(e,t)=>{Cn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ni(e,t,n,r),m(e,`shape`,()=>t.shape),R(e,`ZodObject`,{keyof(){return ao(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Ga()})},loose(){return this.clone({...this._zod.def,catchall:Ga()})},strict(){return this.clone({...this._zod.def,catchall:qa()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return me(this,e)},safeExtend(e){return he(this,e)},merge(e){return ge(this,e)},pick(e){return fe(this,e)},omit(e){return pe(this,e)},partial(...e){return _e(lo,this,e[0])},required(...e){return ve(yo,this,e[0])}})});function G(e,t){return new $a({type:`object`,shape:e??{},...b(t)})}var eo=a(`ZodUnion`,(e,t)=>{Tn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pi(e,t,n,r),e.options=t.options});function K(e,t){return new eo({type:`union`,options:e,...b(t)})}var to=a(`ZodIntersection`,(e,t)=>{En.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fi(e,t,n,r)});function no(e,t){return new to({type:`intersection`,left:e,right:t})}var ro=a(`ZodRecord`,(e,t)=>{kn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Li(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function q(e,t,n){return!t||!t._zod?new ro({type:`record`,keyType:B(),valueType:e,...b(t)}):new ro({type:`record`,keyType:e,valueType:t,...b(n)})}var io=a(`ZodEnum`,(e,t)=>{An.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new io({...t,checks:[],...b(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new io({...t,checks:[],...b(r),entries:i})}});function ao(e,t){return new io({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...b(t)})}var oo=a(`ZodLiteral`,(e,t)=>{jn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function J(e,t){return new oo({type:`literal`,values:Array.isArray(e)?e:[e],...b(t)})}var so=a(`ZodTransform`,(e,t)=>{Mn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new s(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(T(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(T(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function co(e){return new so({type:`transform`,transform:e})}var lo=a(`ZodOptional`,(e,t)=>{Pn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ki(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function uo(e){return new lo({type:`optional`,innerType:e})}var fo=a(`ZodExactOptional`,(e,t)=>{Fn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ki(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function po(e){return new fo({type:`optional`,innerType:e})}var mo=a(`ZodNullable`,(e,t)=>{In.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ri(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Y(e){return new mo({type:`nullable`,innerType:e})}var ho=a(`ZodDefault`,(e,t)=>{Ln.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function go(e,t){return new ho({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ce(t)}})}var _o=a(`ZodPrefault`,(e,t)=>{zn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vo(e,t){return new _o({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ce(t)}})}var yo=a(`ZodNonOptional`,(e,t)=>{Bn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bo(e,t){return new yo({type:`nonoptional`,innerType:e,...b(t)})}var xo=a(`ZodCatch`,(e,t)=>{Hn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function So(e,t){return new xo({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Co=a(`ZodPipe`,(e,t)=>{Un.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ui(e,t,n,r),e.in=t.in,e.out=t.out});function wo(e,t){return new Co({type:`pipe`,in:e,out:t})}var To=a(`ZodReadonly`,(e,t)=>{Gn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Eo(e){return new To({type:`readonly`,innerType:e})}var Do=a(`ZodLazy`,(e,t)=>{qn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qi(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Oo(e){return new Do({type:`lazy`,getter:e})}var ko=a(`ZodCustom`,(e,t)=>{Jn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Di(e,t,n,r)});function Ao(e,t){return ti(ko,e??(()=>!0),t)}function jo(e,t={}){return ni(ko,e,t)}function Mo(e,t){return ri(e,t)}var No=class extends Error{rawValue;rawMessage;static[Symbol.hasInstance](e){return!(!(e instanceof Error)||!(`rawValue`in e)||!(`rawMessage`in e)||!(`pretty`in e)||typeof e.pretty!=`function`)}constructor(e,t,n){super(`${e}: ${t}`),this.name=`SDKValidationError`,this.cause=t,this.rawValue=n,this.rawMessage=e}pretty(){return this.cause instanceof Se?`${this.rawMessage}\n${Po(this.cause)}`:this.toString()}};function Po(e){return De(e)}function X(e,t){let n={};if(!Object.keys(t).length)return n=e,n;for(let[r,i]of Object.entries(e)){let e=t[r];e!==null&&(n[e??r]=i)}return n}function Fo(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}function Io(n,r,i){try{return e(r(n))}catch(e){return t(new No(i,e,n))}}function Lo(e){return Z++,e}var Z=0,Ro=0;function zo(){Ro++;let e=Z;return{end:t=>{let n=Z-e;return Z=e+(t??n),--Ro===0&&(Z=0),n}}}function Q(e){return K([...Object.values(e).map(e=>J(e)),B().transform(e=>Lo(e))])}function Bo(e){return K([...Object.values(e).filter(e=>typeof e==`number`).map(e=>J(e)),H().transform(e=>Lo(e))])}function Vo(e){return B()}function Ho(e){return H()}var Uo=Symbol(`UNKNOWN`);function Wo(e){return typeof e==`object`&&!!e&&Uo in e}function Go(e,t,n={}){let{unknownValue:r=`UNKNOWN`,outputPropertyName:i}=n;return Ga().transform(n=>{let a=Object.defineProperties({raw:n,[i??e]:r,isUnknown:!0},{[Uo]:{value:!0,enumerable:!1,configurable:!1}});if(!(typeof n==`object`&&n))return a;let o=n[e];if(typeof o!=`string`||!(o in t))return a;let s=t[o];if(!s)return a;let c=zo(),l=s.safeParse(n);return l.success?(c.end(),i&&(l.data[i]=o),l.data):(c.end(0),a)})}var Ko=/^\d{4}-\d{2}-\d{2}$/,qo=class e{serialized;static today(){return new e(new Date)}constructor(e){if(typeof e==`string`&&!Ko.test(e))throw RangeError(`RFCDate: date strings must be in the format YYYY-MM-DD: `+e);let t=new Date(e);if(isNaN(+t))throw RangeError(`RFCDate: invalid date provided: `+e);if(this.serialized=t.toISOString().slice(0,10),!Ko.test(this.serialized))throw TypeError(`RFCDate: failed to build valid date with given value: ${e} serialized to ${this.serialized}`)}toJSON(){return this.toString()}toString(){return this.serialized}};function $(e){return Ga().transform((t,n)=>{let r=[],a=e.map(()=>[]),o=zo();for(let[n,i]of e.entries()){let e=zo(),o=i.safeParse(t),s=e.end();if(o.success){r.push({data:o.data,inexactCount:s,zeroDefaultCount:0,fieldCount:-1});continue}a[n].push(...o.error.issues)}if(r.length===0)return o.end(0),n.addIssue({input:t,code:`invalid_union`,errors:a}),i;let s=r[0];for(let e of r)r.length>1&&(e.fieldCount=Yo(e.data)),s=Jo(e,s);return o.end(s.inexactCount),s.data})}function Jo(e,t){let n=e.inexactCount===0;if(n!==(t.inexactCount===0))return n?e:t;let r=e.fieldCount-e.zeroDefaultCount,i=t.fieldCount-t.zeroDefaultCount;return r===i?e.inexactCount<t.inexactCount?e:t:r>i?e:t}function Yo(e){let t=0,n=[e],r=0;for(;r<n.length;){let e=n[r++];if(e===void 0||Wo(e))continue;let i=typeof e;if(e===null||i===`number`||i===`string`||i===`boolean`||i===`bigint`||e instanceof Date||e instanceof qo){t++;continue}if(Array.isArray(e)){n.push(...e);continue}i===`object`&&n.push(...Object.values(e))}return t}var Xo=G({type:J(`input_audio`),input_audio:B()}).transform(e=>X(e,{input_audio:`inputAudio`})),Zo=G({type:J(`input_audio`),inputAudio:B()}).transform(e=>X(e,{inputAudio:`input_audio`})),Qo=G({type:J(`document_url`).default(`document_url`),document_url:B(),document_name:Y(B()).optional()}).transform(e=>X(e,{document_url:`documentUrl`,document_name:`documentName`})),$o=G({type:J(`document_url`).default(`document_url`),documentUrl:B(),documentName:Y(B()).optional()}).transform(e=>X(e,{documentUrl:`document_url`,documentName:`document_name`})),es=G({type:J(`file`).default(`file`),file_id:B()}).transform(e=>X(e,{file_id:`fileId`})),ts=G({type:J(`file`).default(`file`),fileId:B()}).transform(e=>X(e,{fileId:`file_id`})),ns={Low:`low`,Auto:`auto`,High:`high`},rs=Q(ns),is=Vo(ns),as=G({url:B(),detail:Y(rs).optional()}),os=G({url:B(),detail:Y(is).optional()});$([as,B()]),$([os,B()]);var ss=G({type:J(`image_url`).default(`image_url`),image_url:$([as,B()])}).transform(e=>X(e,{image_url:`imageUrl`})),cs=G({type:J(`image_url`).default(`image_url`),imageUrl:$([os,B()])}).transform(e=>X(e,{imageUrl:`image_url`}));$([H(),B()]),$([H(),B()]);var ls=G({type:J(`reference`).default(`reference`),reference_ids:W($([H(),B()]))}).transform(e=>X(e,{reference_ids:`referenceIds`})),us=G({type:J(`reference`).default(`reference`),referenceIds:W($([H(),B()]))}).transform(e=>X(e,{referenceIds:`reference_ids`})),ds=G({type:J(`text`).default(`text`),text:B()}),fs=G({type:J(`text`).default(`text`),text:B()}),ps={WebSearch:`web_search`,WebSearchPremium:`web_search_premium`,CodeInterpreter:`code_interpreter`,ImageGeneration:`image_generation`,DocumentLibrary:`document_library`},ms=Q(ps),hs=Vo(ps);$([ms,B()]),$([hs,B()]);var gs=G({type:J(`tool_reference`).default(`tool_reference`),tool:$([ms,B()]),title:B(),url:Y(B()).optional(),favicon:Y(B()).optional(),description:Y(B()).optional()}),_s=G({type:J(`tool_reference`).default(`tool_reference`),tool:$([hs,B()]),title:B(),url:Y(B()).optional(),favicon:Y(B()).optional(),description:Y(B()).optional()});$([gs,ds,ls]),$([_s,fs,us]);var vs=G({type:J(`thinking`).default(`thinking`),thinking:W($([gs,ds,ls])),signature:Y(B()).optional(),closed:Ha().optional()}),ys=G({type:J(`thinking`).default(`thinking`),thinking:W($([_s,fs,us])),signature:Y(B()).optional(),closed:Ha().optional()}),bs=Go(`type`,{image_url:ss.and(G({type:J(`image_url`)})),document_url:Qo.and(G({type:J(`document_url`)})),text:ds.and(G({type:J(`text`)})),reference:ls.and(G({type:J(`reference`)})),file:es.and(G({type:J(`file`)})),thinking:vs.and(G({type:J(`thinking`)})),input_audio:Xo}),xs=K([cs.and(G({type:J(`image_url`)})),$o.and(G({type:J(`document_url`)})),fs.and(G({type:J(`text`)})),us.and(G({type:J(`reference`)})),ts.and(G({type:J(`file`)})),ys.and(G({type:J(`thinking`)})),Zo]);$([q(B(),U()),B()]),$([q(B(),U()),B()]);var Ss=G({name:B(),arguments:$([q(B(),U()),B()])}),Cs=G({name:B(),arguments:$([q(B(),U()),B()])}),ws=G({id:B().default(`null`),type:B().optional(),function:Ss,index:H().default(0)}),Ts=G({id:B().default(`null`),type:B().optional(),function:Cs,index:H().default(0)});$([B(),W(bs)]);var Es=G({role:Y(B()).optional(),content:Y($([B(),W(bs)])).optional(),tool_calls:Y(W(ws)).optional(),tool_call_id:Y(B()).optional(),index:Y(H()).optional(),metadata:Y(q(B(),U())).optional()}).transform(e=>X(e,{tool_calls:`toolCalls`,tool_call_id:`toolCallId`})),Ds=G({prompt_tokens:H().default(0),completion_tokens:H().default(0),total_tokens:H().default(0),prompt_audio_seconds:Y(H()).optional()}).catchall(U()).transform(e=>X(e,{prompt_tokens:`promptTokens`,completion_tokens:`completionTokens`,total_tokens:`totalTokens`,prompt_audio_seconds:`promptAudioSeconds`})),Os=G({promptTokens:H().default(0),completionTokens:H().default(0),totalTokens:H().default(0),promptAudioSeconds:Y(H()).optional()}).catchall(U()).transform(e=>({...X(e,{promptTokens:`prompt_tokens`,completionTokens:`completion_tokens`,totalTokens:`total_tokens`,promptAudioSeconds:`prompt_audio_seconds`})})),ks=Q({Stop:`stop`,Length:`length`,Error:`error`,ToolCalls:`tool_calls`}),As=G({index:H(),delta:Es,finish_reason:Y(ks)}).transform(e=>X(e,{finish_reason:`finishReason`})),js=G({id:B(),object:B().optional(),created:H().optional(),model:B(),usage:Ds.optional(),choices:W(As)});function Ms(e){return Io(e,e=>js.parse(JSON.parse(e)),`Failed to parse 'CompletionChunk' from JSON`)}export{Se as $,Fo as A,Za as B,$ as C,Vo as D,Bo as E,Ya as F,za as G,Oo as H,U as I,B as J,G as K,W as L,Po as M,Va as N,Ho as O,ao as P,kr as Q,Ha as R,$o as S,Q as T,J as U,H as V,Y as W,Zi as X,K as Y,Yi as Z,fs as _,Es as a,ts as b,bs as c,ys as d,i as et,gs as f,ds as g,hs as h,Os as i,X as j,Io as k,xs as l,ms as m,Ms as n,e as nt,ws as o,_s as p,q,Ds as r,n as rt,Ts as s,js as t,t as tt,vs as u,ss as v,Go as w,Qo as x,cs as y,Ao as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{C as e,P as t,d as n,f as r}from"./account-store-
|
|
1
|
+
import{C as e,P as t,d as n,f as r}from"./account-store-CsBhRflH.js";import{n as i}from"./provider-settings-onyoJBmZ.js";var a=`slicc_cloud_model_catalog`,o=`adobe`;function s(t){if(t===o)return!1;let n=e(t);return!(n.hidden||n.onOAuthLoginIntercepted)}function c(){try{let e=r().map(e=>({providerId:e.providerId,providerName:e.providerName,models:e.models.map(e=>({id:e.id,name:e.name}))}));localStorage.setItem(a,JSON.stringify(e))}catch{}}async function l(r){for(;r.firstChild;)r.removeChild(r.firstChild);r.className=`connect-surface`;let a=document.createElement(`h1`);a.className=`connect-surface__title`,a.textContent=`Connect providers`,r.appendChild(a);let l=document.createElement(`p`);l.className=`connect-surface__desc`,l.textContent=`Log in or add API keys for the providers your cone should use, then click Done to return to the dashboard.`,r.appendChild(l);let u=document.createElement(`div`);u.className=`connect-surface__accounts`,r.appendChild(u);function d(){for(;u.firstChild;)u.removeChild(u.firstChild);let r=n().filter(e=>e.providerId!==o);if(r.length===0){let e=document.createElement(`div`);e.className=`connect-surface__empty`,e.textContent=`No providers connected yet.`,u.appendChild(e)}else{let n=document.createElement(`div`);n.className=`connect-surface__accounts-list`;for(let i of r){let r=e(i.providerId),a=document.createElement(`div`);a.className=`connect-surface__account-row`;let o=document.createElement(`div`);o.className=`connect-surface__account-info`;let s=document.createElement(`div`);s.className=`connect-surface__account-name`,s.textContent=r.name,o.appendChild(s);let l=document.createElement(`div`);l.className=`connect-surface__account-detail`,i.userName?l.textContent=i.userName:i.accessToken?l.textContent=`Logged in`:l.textContent=i.apiKey?`API key set`:`No credentials`,o.appendChild(l),a.appendChild(o);let u=document.createElement(`button`);u.className=`connect-surface__remove-btn`,u.textContent=`Remove`,u.onclick=async()=>{await t(i.providerId),c(),d()},a.appendChild(u),n.appendChild(a)}u.appendChild(n)}let a=document.createElement(`button`);a.className=`connect-surface__add-btn`,a.textContent=r.length===0?`Add provider`:`Manage providers`,a.onclick=async()=>{await i({startInAddAccount:!0,providerFilter:s})&&(c(),d())},u.appendChild(a)}d(),c();let f=document.createElement(`div`);f.className=`connect-surface__footer`;let p=document.createElement(`button`);if(p.className=`connect-surface__done-btn`,p.textContent=`Done — return to dashboard`,p.onclick=()=>{c(),window.close()},f.appendChild(p),r.appendChild(f),!document.getElementById(`connect-surface-style`)){let e=document.createElement(`style`);e.id=`connect-surface-style`,e.textContent=`
|
|
2
2
|
.connect-surface {
|
|
3
3
|
padding: 2rem;
|
|
4
4
|
max-width: 560px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./compat-
|
|
1
|
+
import{t as e}from"./compat-CkpNnFQS.js";import{t}from"./logger-DDBAeTLF.js";t(`context-compaction`);function n(e){let t=[];for(let n of e){let e=n;switch(e.role){case`user`:t.push(`<user>\n${r(e.content)}\n</user>`);break;case`assistant`:t.push(`<assistant>\n${r(e.content)}\n</assistant>`);break;case`toolResult`:{let n=e.toolName??`tool`;t.push(`<tool-result name="${n}">\n${r(e.content)}\n</tool-result>`);break}case`bashExecution`:t.push(`<bash>\n$ ${e.command??``}\n${e.output??``}\n</bash>`);break;case`branchSummary`:case`compactionSummary`:t.push(`<prior-summary>\n${e.summary??``}\n</prior-summary>`);break;default:t.push(`<${e.role}>\n${r(e.content)}\n</${e.role}>`)}}return t.join(`
|
|
2
2
|
|
|
3
3
|
`)}function r(e){if(typeof e==`string`)return e;if(!Array.isArray(e))return``;let t=[];for(let n of e){let e=n;e.type===`text`&&e.text?t.push(e.text):e.type===`thinking`&&e.thinking?t.push(`[thinking] ${e.thinking}`):e.type===`toolCall`?t.push(`[tool-call ${e.name??`?`}] ${JSON.stringify(e.arguments??{})}`):e.type===`image`&&t.push(`[image]`)}return t.join(`
|
|
4
4
|
`)}var i=`From the conversation above, extract durable memories worth persisting to a global memory file shared across future sessions.
|