@shumai-one/shumai 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/{chunk-adekdctx.css → chunk-0ccg9ddn.css} +1 -1
- package/bin/chunk-0e4wawpq.js +2 -0
- package/bin/chunk-185qefn1.js +2 -0
- package/bin/chunk-1kw2mbqb.js +1 -0
- package/bin/chunk-1wm6ptdx.js +1 -0
- package/bin/chunk-1yacmegc.js +2 -0
- package/bin/chunk-2291ehh5.js +3 -0
- package/bin/chunk-2520aq8j.js +2 -0
- package/bin/chunk-29zdp63z.js +3 -0
- package/bin/chunk-2yxj593j.js +2 -0
- package/bin/chunk-32pcmaqm.js +3 -0
- package/bin/chunk-3a13dcs1.js +1 -0
- package/bin/chunk-3cyrcgm5.js +13 -0
- package/bin/chunk-3swpwb9v.js +1 -0
- package/bin/chunk-3wmcx2bv.js +2 -0
- package/bin/chunk-4r81ghg8.js +2 -0
- package/bin/chunk-4v5n0ayb.js +2 -0
- package/bin/chunk-5a8nt4me.js +1 -0
- package/bin/chunk-66hsjnw6.js +2 -0
- package/bin/chunk-6bhn1p8v.js +211 -0
- package/bin/chunk-6gg1ymer.js +2 -0
- package/bin/chunk-70c3xrgd.js +2 -0
- package/bin/chunk-7esm0hqb.js +2 -0
- package/bin/chunk-7fst8kdw.js +12 -0
- package/bin/chunk-83e12sjg.js +3 -0
- package/bin/chunk-87zxtf66.js +3 -0
- package/bin/chunk-8fmy5jtp.js +2 -0
- package/bin/chunk-8zqgaxvv.js +1 -0
- package/bin/chunk-9t1ne8xr.js +2 -0
- package/bin/chunk-a32vreya.js +2 -0
- package/bin/chunk-a3dmtt2j.js +1 -0
- package/bin/chunk-abt0azmv.js +2 -0
- package/bin/chunk-ag6p3mbf.js +2 -0
- package/bin/chunk-aqbrzx9z.js +1 -0
- package/bin/chunk-av1a8fqp.js +3 -0
- package/bin/chunk-awfwk64v.js +2 -0
- package/bin/chunk-b235azv4.js +45 -0
- package/bin/chunk-b9yrw9et.js +10 -0
- package/bin/chunk-bay038pj.js +2 -0
- package/bin/chunk-c007p0t8.js +299 -0
- package/bin/chunk-cak32x57.js +2 -0
- package/bin/chunk-ce8m4zeg.js +3 -0
- package/bin/chunk-ck8azecb.js +12 -0
- package/bin/chunk-cnxwmycy.js +6 -0
- package/bin/chunk-cqb415s6.js +5 -0
- package/bin/chunk-e2mvmq2m.js +1 -0
- package/bin/chunk-e7mqtkzn.js +2 -0
- package/bin/chunk-e99dv20z.js +3 -0
- package/bin/chunk-ea79xnn3.js +2 -0
- package/bin/chunk-ehc9adfz.js +2 -0
- package/bin/chunk-ejbvfj4r.js +1 -0
- package/bin/chunk-ekfem7kf.js +1 -0
- package/bin/chunk-etwkk0xh.js +1 -0
- package/bin/chunk-evrdd32b.js +2 -0
- package/bin/chunk-f15qyp41.js +1 -0
- package/bin/chunk-f3ehv01n.js +54 -0
- package/bin/chunk-fm6p03ad.js +2 -0
- package/bin/chunk-fxswt9hc.js +3 -0
- package/bin/chunk-fyha3r13.js +2 -0
- package/bin/chunk-g0vs7k2x.js +1 -0
- package/bin/chunk-g84z2w7v.js +16 -0
- package/bin/chunk-gk3eqd50.js +2 -0
- package/bin/chunk-h3tbf521.js +2 -0
- package/bin/chunk-h837fyed.js +2 -0
- package/bin/chunk-hfh0c082.js +2 -0
- package/bin/chunk-j20e0qsw.js +7 -0
- package/bin/chunk-j8fxp8ej.js +2 -0
- package/bin/chunk-jje8nj8h.js +3 -0
- package/bin/chunk-jy006gcv.js +7 -0
- package/bin/chunk-k7hss0bd.js +4 -0
- package/bin/chunk-m7m9d4fb.js +2 -0
- package/bin/chunk-n1jwdb0a.js +1 -0
- package/bin/chunk-p5gf1zdm.js +4 -0
- package/bin/chunk-pb1zf0vb.js +2 -0
- package/bin/chunk-pfgxggaj.js +11 -0
- package/bin/chunk-q16490pv.js +2 -0
- package/bin/chunk-q2bvyv39.js +8 -0
- package/bin/chunk-qf24e71w.js +2 -0
- package/bin/chunk-qh81zhg1.js +1 -0
- package/bin/chunk-qwp3kwbz.js +2 -0
- package/bin/chunk-qwqvt9v6.js +2 -0
- package/bin/chunk-qydeqgyj.js +5 -0
- package/bin/chunk-r7dty1tg.js +2 -0
- package/bin/chunk-rbj4fad9.js +32 -0
- package/bin/chunk-rhdxwebf.js +2 -0
- package/bin/chunk-rhh716z0.js +42 -0
- package/bin/chunk-rpywcvg1.js +3 -0
- package/bin/chunk-rza4ae5z.js +3 -0
- package/bin/chunk-sfx2588q.js +3 -0
- package/bin/chunk-sk4e6rb1.js +1 -0
- package/bin/chunk-t2n1dbgx.js +4 -0
- package/bin/chunk-tf28796q.js +2 -0
- package/bin/chunk-twdxayky.js +3 -0
- package/bin/chunk-v9b3w8q5.js +3 -0
- package/bin/chunk-v9w25rp2.js +2 -0
- package/bin/chunk-vgn5zcpv.js +3 -0
- package/bin/chunk-wfzqnpc1.js +3 -0
- package/bin/chunk-wry2hvrq.js +24 -0
- package/bin/chunk-x8f4defx.js +3 -0
- package/bin/chunk-xp59apdb.js +2 -0
- package/bin/chunk-xtf3c29c.css +1 -0
- package/bin/chunk-z3gkt8w1.js +3 -0
- package/bin/chunk-zehyn6vd.js +2 -0
- package/bin/chunk-zh6fqq44.js +1 -0
- package/bin/chunk-zmv8cg4s.js +8 -0
- package/bin/chunk-zqv0zhfb.js +3 -0
- package/bin/{pdf.worker.min-szxdj13d.mjs → pdf.worker.min-vf48er29.mjs} +14423 -13889
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +626 -460
- package/package.json +18 -18
- package/prisma/migrations/20260904022457_add_agent_id_to_assets_and_audit_logs/migration.sql +17 -0
- package/prisma/migrations/20260906081230_default_denied_tools_delete_asset/migration.sql +15 -0
- package/prisma/schema.prisma +9 -0
- package/bin/chunk-07h4b77v.js +0 -2
- package/bin/chunk-0t4n4d5w.js +0 -4
- package/bin/chunk-1611z9jg.js +0 -2
- package/bin/chunk-1phqxp6z.js +0 -3
- package/bin/chunk-23hckrrz.js +0 -2
- package/bin/chunk-30z44j1g.js +0 -2
- package/bin/chunk-3j463k1g.js +0 -1
- package/bin/chunk-4181tdds.js +0 -14
- package/bin/chunk-480jtqng.js +0 -4
- package/bin/chunk-4c3g146q.js +0 -2
- package/bin/chunk-4ca0zt5e.js +0 -1
- package/bin/chunk-4d9bgmf2.js +0 -2
- package/bin/chunk-4ev56fss.js +0 -9
- package/bin/chunk-4gk52tjq.js +0 -45
- package/bin/chunk-4mdqkj4d.js +0 -1
- package/bin/chunk-4r91fggc.js +0 -2
- package/bin/chunk-50fb1x3w.js +0 -1
- package/bin/chunk-59gj1njz.js +0 -1
- package/bin/chunk-5pr0t7fb.js +0 -2
- package/bin/chunk-5vewxmz7.js +0 -3
- package/bin/chunk-62zx96pe.js +0 -2
- package/bin/chunk-63y0eb07.js +0 -2
- package/bin/chunk-6d5xrgfx.js +0 -2
- package/bin/chunk-6gbtz5bf.js +0 -67
- package/bin/chunk-6gjg5egq.js +0 -3
- package/bin/chunk-6m4jz9s1.js +0 -44
- package/bin/chunk-6s4x525w.js +0 -2
- package/bin/chunk-6w2wmvqs.js +0 -3
- package/bin/chunk-77d23vcn.js +0 -2
- package/bin/chunk-77m5p188.js +0 -2
- package/bin/chunk-7bvx087f.js +0 -1
- package/bin/chunk-7pfjfrjg.js +0 -5
- package/bin/chunk-7q10s127.js +0 -4
- package/bin/chunk-7thx8ctx.js +0 -3
- package/bin/chunk-8t4s91gh.js +0 -2
- package/bin/chunk-98ey5p2e.js +0 -3
- package/bin/chunk-9amndcyh.js +0 -6
- package/bin/chunk-9bk23g9x.js +0 -1
- package/bin/chunk-9mkcfy43.js +0 -1
- package/bin/chunk-9t3nsq5n.js +0 -2
- package/bin/chunk-9tjq99ds.js +0 -2
- package/bin/chunk-9wm9rwh1.js +0 -2
- package/bin/chunk-ab16fyg4.js +0 -4
- package/bin/chunk-arv0g2av.js +0 -1
- package/bin/chunk-aytj4zxg.js +0 -3
- package/bin/chunk-b1ypjqgp.js +0 -2
- package/bin/chunk-bdjv0ykq.js +0 -2
- package/bin/chunk-c1k86mfa.js +0 -10
- package/bin/chunk-caa96dgd.js +0 -2
- package/bin/chunk-ce4v2yjy.js +0 -1
- package/bin/chunk-cqh60y54.js +0 -3
- package/bin/chunk-cvq7zgw7.js +0 -1
- package/bin/chunk-d9mjbtp2.js +0 -2
- package/bin/chunk-dn7sbjws.js +0 -3
- package/bin/chunk-dxyq9h8n.js +0 -3
- package/bin/chunk-e3cabksx.js +0 -3
- package/bin/chunk-egcrbj94.js +0 -2
- package/bin/chunk-ev17v1mv.js +0 -2
- package/bin/chunk-evtpwg71.js +0 -2
- package/bin/chunk-f3e0nsv2.js +0 -2
- package/bin/chunk-f40gjqpq.js +0 -2
- package/bin/chunk-fe7822ak.js +0 -299
- package/bin/chunk-g8tkhw9j.js +0 -2
- package/bin/chunk-g9r0p4t8.js +0 -2
- package/bin/chunk-gbjyh9ms.js +0 -1
- package/bin/chunk-gtbsb39v.js +0 -3
- package/bin/chunk-gytz1q13.js +0 -13
- package/bin/chunk-h0fxysxs.js +0 -7
- package/bin/chunk-h8bdvsqt.js +0 -2
- package/bin/chunk-hag024w8.js +0 -2
- package/bin/chunk-hc6w5nw4.js +0 -7
- package/bin/chunk-j69dqc48.js +0 -2
- package/bin/chunk-jbtw1zym.js +0 -8
- package/bin/chunk-jc1vb7rj.js +0 -5
- package/bin/chunk-jdv78w9r.js +0 -2
- package/bin/chunk-jjs70y9v.js +0 -3
- package/bin/chunk-jmdar2gz.js +0 -2
- package/bin/chunk-jvwz10n4.js +0 -2
- package/bin/chunk-k47md1g4.js +0 -2
- package/bin/chunk-k4v0brcb.js +0 -2
- package/bin/chunk-k6n7c07e.js +0 -1
- package/bin/chunk-kk2cstsg.js +0 -2
- package/bin/chunk-knz4h56q.js +0 -12
- package/bin/chunk-kqqtt6bd.js +0 -3
- package/bin/chunk-kvyp1t4j.js +0 -7
- package/bin/chunk-kxskpgsq.js +0 -5
- package/bin/chunk-m6srbjcs.js +0 -2
- package/bin/chunk-mcc1scxs.js +0 -12
- package/bin/chunk-mq83a0kk.js +0 -2
- package/bin/chunk-mxm8g4q0.js +0 -1
- package/bin/chunk-nhpgdqq5.js +0 -2
- package/bin/chunk-nne496aa.js +0 -2
- package/bin/chunk-nqpb0r9h.js +0 -11
- package/bin/chunk-ns0zww9g.js +0 -2
- package/bin/chunk-ps4xfp23.js +0 -2
- package/bin/chunk-pz2ec6xt.js +0 -2
- package/bin/chunk-q163k309.js +0 -2
- package/bin/chunk-q1da61ps.js +0 -1
- package/bin/chunk-qrf0ady6.js +0 -68
- package/bin/chunk-qy28f25e.js +0 -2
- package/bin/chunk-r7s4ypw1.js +0 -2
- package/bin/chunk-ran23vm9.js +0 -1
- package/bin/chunk-rfvdc4n0.js +0 -2
- package/bin/chunk-rgthkvgx.js +0 -3
- package/bin/chunk-s39n3yw3.js +0 -2
- package/bin/chunk-s7wdd0g7.js +0 -8
- package/bin/chunk-s88ha5kx.js +0 -3
- package/bin/chunk-sf91bt9m.js +0 -2
- package/bin/chunk-sjwbjf9j.js +0 -2
- package/bin/chunk-t62076pv.js +0 -1
- package/bin/chunk-tbbwss3v.js +0 -3
- package/bin/chunk-tjcc7a6y.js +0 -24
- package/bin/chunk-tp6ab26e.js +0 -2
- package/bin/chunk-v2wxk9p5.js +0 -4
- package/bin/chunk-vbk6y4hk.js +0 -2
- package/bin/chunk-vfgfg5fk.js +0 -2
- package/bin/chunk-vm6c3xx9.js +0 -2
- package/bin/chunk-vsx96mt6.js +0 -3
- package/bin/chunk-wbyw1shz.js +0 -6
- package/bin/chunk-whh2vh50.css +0 -1
- package/bin/chunk-wjkcq65s.js +0 -2
- package/bin/chunk-wkefwkfp.js +0 -41
- package/bin/chunk-x7bsnk1e.js +0 -2
- package/bin/chunk-xbhw6bpz.js +0 -3
- package/bin/chunk-xg5yrcj5.js +0 -2
- package/bin/chunk-xg9xscqz.js +0 -1
- package/bin/chunk-xw2gpcsh.js +0 -3
- package/bin/chunk-ycq8ank7.js +0 -2
- package/bin/chunk-yp9hvkc5.js +0 -73
- package/bin/chunk-ytypyfkc.js +0 -65
- package/bin/chunk-z1kjmf60.js +0 -2
- package/bin/chunk-z36bx86r.js +0 -2
- package/bin/chunk-z7hdnecp.js +0 -3
- package/bin/chunk-zeby1cq7.js +0 -2
- package/bin/chunk-zs5e8z1w.js +0 -1
- package/bin/chunk-zxnyefg5.js +0 -2
- /package/bin/{chunk-24ke0th1.css → chunk-kegybs91.css} +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ne}from"./chunk-rza4ae5z.js";function Ue(t){let o=Object.values(t).filter((c)=>typeof c==="number");return Object.entries(t).filter(([c,u])=>o.indexOf(+c)===-1).map(([c,u])=>u)}function ft(t,o="|"){return t.map((n)=>gt(n)).join(o)}function ke(t,o){if(typeof o==="bigint")return o.toString();return o}function Ze(t){return{get value(){{let n=t();return Object.defineProperty(this,"value",{value:n}),n}throw Error("cached value already set")}}}function eo(t){return t===null||t===void 0}function Me(t){let o=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(o,n)}function to(t,o){let n=t/o,c=Math.round(n),u=4*Number.EPSILON*Math.max(Math.abs(n),1);if(Math.abs(n-c)<u)return 0;return n-c}var Qr=Symbol("evaluating");function oo(t,o,n){let c=void 0;Object.defineProperty(t,o,{get(){if(c===Qr)return;if(c===void 0)c=Qr,c=n();return c},set(u){Object.defineProperty(t,o,{value:u})},configurable:!0})}function F(t,o,n){Object.defineProperty(t,o,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ae(...t){let o={};for(let n of t){let c=Object.getOwnPropertyDescriptors(n);Object.assign(o,c)}return Object.defineProperties({},o)}function io(t){return JSON.stringify(t)}function so(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ht="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function ge(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)}var co=Ze(()=>{if(V.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(t){return!1}});function me(t){if(ge(t)===!1)return!1;let o=t.constructor;if(o===void 0)return!0;if(typeof o!=="function")return!0;let n=o.prototype;if(ge(n)===!1)return!1;if(Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)return!1;return!0}function _t(t){if(me(t))return{...t};if(Array.isArray(t))return[...t];if(t instanceof Map)return new Map(t);if(t instanceof Set)return new Set(t);return t}var uo=new Set(["string","number","symbol"]);function le(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function H(t,o,n){let c=new t._zod.constr(o??t._zod.def);if(!o||n?.parent)c._zod.parent=t;return c}function O(t){let o=t;if(!o)return{};if(typeof o==="string")return{error:()=>o};if(o?.message!==void 0){if(o?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");o.error=o.message}if(delete o.message,typeof o.error==="string")return{...o,error:()=>o.error};return o}function gt(t){if(typeof t==="bigint")return t.toString()+"n";if(typeof t==="string")return`"${t}"`;return`${t}`}function ao(t){return Object.keys(t).filter((o)=>t[o]._zod.optin!==void 0&&t[o]._zod.optout==="optional")}var lo=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))();function $c(t,o){let n=t._zod.def,c=n.checks;if(c&&c.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let p=ae(t._zod.def,{get shape(){let f={};for(let h of Reflect.ownKeys(o)){if(!Object.prototype.hasOwnProperty.call(n.shape,h))throw Error(`Unrecognized key: "${String(h)}"`);if(!o[h])continue;F(f,h,n.shape[h])}return F(this,"shape",f),f},checks:[]});return H(t,p)}function wc(t,o){let n=t._zod.def,c=n.checks;if(c&&c.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let p=ae(t._zod.def,{get shape(){let f={...t._zod.def.shape};for(let h of Reflect.ownKeys(o)){if(!Object.prototype.hasOwnProperty.call(n.shape,h))throw Error(`Unrecognized key: "${String(h)}"`);if(!o[h])continue;delete f[h]}return F(this,"shape",f),f},checks:[]});return H(t,p)}function kc(t,o){if(!me(o))throw Error("Invalid input to extend: expected a plain object");let n=t._zod.def.checks;if(n&&n.length>0){let p=t._zod.def.shape;for(let f of Reflect.ownKeys(o))if(Object.getOwnPropertyDescriptor(p,f)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let u=ae(t._zod.def,{get shape(){let p={...t._zod.def.shape,...o};return F(this,"shape",p),p}});return H(t,u)}function Zc(t,o){if(!me(o))throw Error("Invalid input to safeExtend: expected a plain object");let n=ae(t._zod.def,{get shape(){let c={...t._zod.def.shape,...o};return F(this,"shape",c),c}});return H(t,n)}function Pc(t,o){if(!o?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(t._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=ae(t._zod.def,{get shape(){let c={...t._zod.def.shape,...o._zod.def.shape};return F(this,"shape",c),c},get catchall(){return o._zod.def.catchall},checks:o._zod.def.checks??[]});return H(t,n)}function po(t,o,n,c="partial"){let p=o._zod.def.checks;if(p&&p.length>0)throw Error(`.${c}() cannot be used on object schemas containing refinements`);let h=ae(o._zod.def,{get shape(){let _=o._zod.def.shape,b={..._};if(n)for(let v of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(_,v))throw Error(`Unrecognized key: "${String(v)}"`);if(!n[v])continue;b[v]=t?new t({type:"optional",innerType:_[v]}):_[v]}else for(let v of Reflect.ownKeys(_))b[v]=t?new t({type:"optional",innerType:_[v]}):_[v];return F(this,"shape",b),b},checks:[]});return H(o,h)}function Sc(t,o,n){let c=ae(o._zod.def,{get shape(){let u=o._zod.def.shape,p={...u};if(n)for(let f of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(p,f))throw Error(`Unrecognized key: "${String(f)}"`);if(!n[f])continue;p[f]=new t({type:"nonoptional",innerType:u[f]})}else for(let f of Reflect.ownKeys(u))p[f]=new t({type:"nonoptional",innerType:u[f]});return F(this,"shape",p),p}});return H(o,c)}function he(t,o=0){if(t.aborted===!0)return!0;for(let n=o;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function fo(t,o=0){if(t.aborted===!0)return!0;for(let n=o;n<t.issues.length;n++)if(t.issues[n]?.continue===!1)return!0;return!1}function re(t,o){return o.map((n)=>{var c;return(c=n).path??(c.path=[]),n.path.unshift(t),n})}function we(t){return typeof t==="string"?t:t?.message}function xt(t,o,n){var c;for(let u=o;u<t.length;u++)(c=t[u]).schema??(c.schema=n)}function oe(t,o,n){var c;let u=t.inst?._zod?.traits;if(u?.has("$ZodType"))if(u.has("$ZodCheck"))(c=t).schema??(c.schema=t.inst);else t.schema=t.inst;let p=t.schema!==t.inst?t.schema?._zod.def?.error:void 0,f=t.message?t.message:we(t.inst?._zod.def?.error?.(t))??we(p?.(t))??we(o?.error?.(t))??we(n.customError?.(t))??we(n.localeError?.(t))??"Invalid input",{inst:h,schema:_,continue:b,input:v,...k}=t;if(k.path??(k.path=[]),k.message=f,o?.reportInput)k.input=v;return k}var Oc=/[\uD800-\uDBFF]/;function Je(t){let o=t.length;if(!Oc.test(t))return o;let n=o;for(let c=0;c<o-1;c++)if((t.charCodeAt(c)&64512)===55296&&(t.charCodeAt(c+1)&64512)===56320)n--,c++;return n}function Be(t){if(Array.isArray(t))return"array";if(typeof t==="string")return"string";return"unknown"}function mo(t){let o=typeof t;switch(o){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let n=t;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return o}function _e(...t){let[o,n,c]=t;if(typeof o==="string")return{message:o,code:"custom",input:n,inst:c};return{...o}}function ho(t,o){for(let n in o){let c=Object.getOwnPropertyDescriptor(o,n);if(c.get)Object.defineProperty(t,n,{...c,enumerable:!1});else Ic(t,n,c.value)}}function de(t,o,n,c=!0){return Object.defineProperty(t,o,{configurable:!0,writable:!0,enumerable:c,value:n}),n}function yt(t,o,n){return de(t,o,n,!1)}function Ic(t,o,n){Object.defineProperty(t,o,{configurable:!0,get(){return this==null?n:de(this,o,n.bind(this))},set(c){de(this,o,c)}})}function Ec(t,o){let n=Object.getPrototypeOf(t);return o in n?void 0:n}var pt,ue=!1,Tc={configurable:!0,get(){ue=!0;return}};function A(t,o,n){let c=Object.getPrototypeOf(t._zod);if(o in c&&pt!==t._zod){pt=void 0;return}pt=t._zod,Object.defineProperty(c,o,{configurable:!0,get(){Object.defineProperty(this,o,Tc);let u=ue;ue=!1;try{let p=n(this);if(ue)delete this[o];else Object.defineProperty(this,o,{configurable:!0,writable:!0,value:p});return ue=ue||u,p}catch(p){throw delete this[o],ue=ue||u,p}},set(u){Object.defineProperty(this,o,{configurable:!0,writable:!0,value:u})}})}function Ac(t,o,n,c){let u=Ec(t,o);if(!u)return;Object.defineProperty(u,o,{configurable:!0,get(){let p={configurable:!0,writable:!0,enumerable:c,value:void 0};return Object.defineProperty(this,o,p),p.value=n(this),Object.defineProperty(this,o,p),p.value},set(p){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:c,value:p})}})}var Nc="~constantCatch";function _o(t){let o=()=>t;return o[Nc]=!0,o}var go,Nr=Object.freeze({status:"aborted"}),bt={value:void 0,enumerable:!1},xo="captureStackTrace"in Error?Error:null;function Cc(t){let o=xo;if(o){let n=o.stackTraceLimit;if(typeof n==="number"){try{o.stackTraceLimit=0}catch{return xo=null,new t}try{return new t}finally{o.stackTraceLimit=n}}}return new t}function w(t,o,n,c){let u={};function p(Z){this.def=Z,this.constr=k,this.traits=new Set}p.prototype=u;let f=n,h=f&&new WeakSet;function _(Z,P){if(!Z._zod){bt.value=new p(P);try{Object.defineProperty(Z,"_zod",bt)}finally{bt.value=void 0}}if(Z._zod.traits.has(t))return;if(Z._zod.traits.add(t),o(Z,P),h){let E=Object.getPrototypeOf(Z),T=Z._zod.constr.prototype,B=E;while(B&&B!==T)B=Object.getPrototypeOf(B);let Y=B??E;if(!h.has(Y))h.add(Y),ho(Y,f)}let S=k.prototype;for(let E in S){if(!Object.prototype.hasOwnProperty.call(S,E))continue;if(!(E in Z))Z[E]=S[E].bind(Z)}}let b=c?.Parent??Object;class v extends b{}Object.defineProperty(v,"name",{value:t});function k(Z){let P=c?.Parent?Cc(v):this;_(P,Z);let S=P._zod.deferred;if(S){for(let T of S)T();P._zod.deferred=void 0}let E=globalThis.__zod_globalConfig?.postProcessor;if(E)E(P);return P}return Object.defineProperty(k,"init",{value:_}),Object.defineProperty(k,Symbol.hasInstance,{value:(Z)=>{if(c?.Parent&&Z instanceof c.Parent)return!0;return Z?._zod?.traits?.has(t)}}),Object.defineProperty(k,"name",{value:t}),k}class ie extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Pe extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`);this.name="ZodEncodeError"}}(go=globalThis).__zod_globalConfig??(go.__zod_globalConfig={});var V=globalThis.__zod_globalConfig;function G(t){if(t)Object.assign(V,t);return V}function jc(){let t=this._zod;return t.message??(t.message=JSON.stringify(t.def,ke,2)),t.message}function Rc(t){this._zod.message=t}var Dc={get:jc,set:Rc,enumerable:!0,configurable:!0},vt={value:void 0,enumerable:!1},$t={value:void 0,enumerable:!1},yo=new WeakSet([Object.prototype,Error.prototype]),bo=(t,o)=>{t.name="$ZodError",vt.value=t._zod,Object.defineProperty(t,"_zod",vt),$t.value=o,Object.defineProperty(t,"issues",$t),vt.value=void 0,$t.value=void 0,Object.defineProperty(t,"message",Dc);let n=Object.getPrototypeOf(t);if(!yo.has(n))yo.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let c=()=>this.message;return Object.defineProperty(this,"toString",{value:c,configurable:!0,writable:!0}),c},set(c){Object.defineProperty(this,"toString",{value:c,configurable:!0,writable:!0})}})},Da=w("$ZodError",bo),wt=w("$ZodError",bo,void 0,{Parent:Error});function Lc(t,o,n){if(!Object.prototype.hasOwnProperty.call(t,o))if(o==="__proto__")Object.defineProperty(t,o,{value:n(),writable:!0,enumerable:!0,configurable:!0});else t[o]=n();return t[o]}function kt(t,o=(n)=>n.message){let n={},c=[];for(let u of t.issues)if(u.path.length>0)Lc(n,u.path[0],()=>[]).push(o(u));else c.push(o(u));return{formErrors:c,fieldErrors:n}}function Zt(t,o=(n)=>n.message){let n={_errors:[]},c=(u,p=[])=>{for(let f of u.issues)if(f.code==="invalid_union"&&f.errors.length)f.errors.map((h)=>c({issues:h},[...p,...f.path]));else if(f.code==="invalid_key")c({issues:f.issues},[...p,...f.path]);else if(f.code==="invalid_element")c({issues:f.issues},[...p,...f.path]);else{let h=[...p,...f.path];if(h.length===0)n._errors.push(o(f));else{let _=n,b=0;while(b<h.length){let v=h[b],k=b===h.length-1;if(v==="_errors"){if(k)_._errors.push(o(f));b++;continue}if(!Object.prototype.hasOwnProperty.call(_,v))Object.defineProperty(_,v,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let Z=_[v];if(k)Z._errors.push(o(f));_=Z,b++}}}};return c(t),n}function Fc(t){let o=[],n=t.map((c)=>typeof c==="object"?c.key:c);for(let c of n)if(typeof c==="number")o.push(`[${c}]`);else if(typeof c==="symbol")o.push(`[${JSON.stringify(String(c))}]`);else if(/[^\w$]/.test(c))o.push(`[${JSON.stringify(c)}]`);else{if(o.length)o.push(".");o.push(c)}return o.join("")}function Zd(t){let o=[],n=[...t.issues].sort((c,u)=>(c.path??[]).length-(u.path??[]).length);for(let c of n)if(o.push(`\u2716 ${c.message}`),c.path?.length)o.push(` \u2192 at ${Fc(c.path)}`);return o.join(`
|
|
3
|
+
`)}function Ve(t,o){return{callee:o?.callee??t,Err:o?.Err}}var Ke=(t)=>{let o=(n,c,u,p)=>{let f=u?{...u,async:!1}:{async:!1},h=n._zod.run({value:c,issues:[]},f);if(h instanceof Promise)throw new ie;if(h.issues.length){let _=new(p?.Err??t)(h.issues.map((b)=>oe(b,f,G())));throw ht(_,p?.callee??o),_}return h.value};return o};var We=(t)=>{let o=async(n,c,u,p)=>{let f=u?{...u,async:!0}:{async:!0},h=n._zod.run({value:c,issues:[]},f);if(h instanceof Promise)h=await h;if(h.issues.length){let _=new(p?.Err??t)(h.issues.map((b)=>oe(b,f,G())));throw ht(_,p?.callee??o),_}return h.value};return o};var Se=(t)=>(o,n,c)=>{let u=c?{...c,async:!1}:{async:!1},p=o._zod.run({value:n,issues:[]},u);if(p instanceof Promise)throw new ie;return p.issues.length?{success:!1,error:new(t??Da)(p.issues.map((f)=>oe(f,u,G())))}:{success:!0,data:p.value}},zo=Se(wt),Oe=(t)=>async(o,n,c)=>{let u=c?{...c,async:!0}:{async:!0},p=o._zod.run({value:n,issues:[]},u);if(p instanceof Promise)p=await p;return p.issues.length?{success:!1,error:new t(p.issues.map((f)=>oe(f,u,G())))}:{success:!0,data:p.value}},vo=Oe(wt);var $o=(t)=>{let o=Ke(t),n=(c,u,p,f)=>{let h=p?{...p,direction:"backward"}:{direction:"backward"};return o(c,u,h,Ve(n,f))};return n};var wo=(t)=>{let o=Ke(t),n=(c,u,p,f)=>o(c,u,p,Ve(n,f));return n};var ko=(t)=>{let o=We(t),n=async(c,u,p,f)=>{let h=p?{...p,direction:"backward"}:{direction:"backward"};return await o(c,u,h,Ve(n,f))};return n};var Zo=(t)=>{let o=We(t),n=async(c,u,p,f)=>await o(c,u,p,Ve(n,f));return n};var Po=(t)=>(o,n,c)=>{let u=c?{...c,direction:"backward"}:{direction:"backward"};return Se(t)(o,n,u)};var So=(t)=>(o,n,c)=>Se(t)(o,n,c);var Oo=(t)=>async(o,n,c)=>{let u=c?{...c,direction:"backward"}:{direction:"backward"};return Oe(t)(o,n,u)};var Io=(t)=>async(o,n,c)=>Oe(t)(o,n,c);var Eo=/^[cC][0-9a-z]{6,}$/,To=/^[0-9a-z]+$/,Ao=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,No=/^[0-9a-vA-V]{20}$/,Co=/^[A-Za-z0-9]{27}$/,jo=/^[a-zA-Z0-9_-]{21}$/;function Ro(t){return new RegExp(`^[a-zA-Z0-9_-]{${t}}$`)}var Do=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Lo=/^([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})$/,St=(t)=>{if(!t)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var Fo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Mc="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Uo(){return new RegExp(Mc,"u")}var Mo=/^(?:(?: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])$/,Jo=/^(([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}|:))$/;var Bo=/^((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])$/,Vo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ko=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ot=/^[A-Za-z0-9_-]*$/;var Wo=/^https?$/,Go=/^\+[1-9]\d{6,14}$/;var qo="(?:(?:\\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])))";function Jc(t){return new RegExp(`^${t}$`)}var Yo=Jc(qo);function Pt(t){return typeof t.precision==="number"?t.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":t.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${t.precision}}`:t.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Xo(t){return new RegExp(`^${Pt(t)}$`)}function Ho(t){let o=["Z"];if(t.offset)o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${Pt({precision:t.precision,seconds:!0})}(?:${o.join("|")})`,c=t.local?`${n}|${Pt({precision:t.precision})}`:n;return new RegExp(`^${qo}T(?:${c})$`)}var Qo=(t)=>{let o=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${o}$`)},en=/^-?\d+n?$/,Ge=/^-?\d+$/,Ie=/^-?\d+(?:\.\d+)?$/,tn=/^(?:true|false)$/i,rn=/^null$/i;var on=/^[^A-Z]*$/,nn=/^[^a-z]*$/;var M=w("$ZodCheck",(t,o)=>{var n;t._zod??(t._zod={}),t._zod.def=o,(n=t._zod).onattach??(n.onattach=[])});var It=(t)=>{let o=t.value;return!eo(o)&&o.length!==void 0},qe={number:"number",bigint:"bigint",object:"date"},Et=w("$ZodCheckLessThan",(t,o)=>{M.init(t,o);let n=qe[typeof o.value];t._zod.onattach.push((c)=>{let u=c._zod.bag,p=(o.inclusive?u.maximum:u.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(o.value<p)if(o.inclusive)u.maximum=o.value;else u.exclusiveMaximum=o.value}),t._zod.check=(c)=>{if(o.inclusive?c.value<=o.value:c.value<o.value)return;c.issues.push({origin:qe[typeof c.value]??n,code:"too_big",maximum:typeof o.value==="object"?o.value.getTime():o.value,input:c.value,inclusive:o.inclusive,inst:t,continue:!o.abort})}}),Tt=w("$ZodCheckGreaterThan",(t,o)=>{M.init(t,o);let n=qe[typeof o.value];t._zod.onattach.push((c)=>{let u=c._zod.bag,p=(o.inclusive?u.minimum:u.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(o.value>p)if(o.inclusive)u.minimum=o.value;else u.exclusiveMinimum=o.value}),t._zod.check=(c)=>{if(o.inclusive?c.value>=o.value:c.value>o.value)return;c.issues.push({origin:qe[typeof c.value]??n,code:"too_small",minimum:typeof o.value==="object"?o.value.getTime():o.value,input:c.value,inclusive:o.inclusive,inst:t,continue:!o.abort})}}),sn=w("$ZodCheckMultipleOf",(t,o)=>{M.init(t,o),t._zod.onattach.push((n)=>{var c;(c=n._zod.bag).multipleOf??(c.multipleOf=o.value)}),t._zod.check=(n)=>{if(typeof n.value!==typeof o.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof n.value==="bigint"?o.value!==BigInt(0)&&n.value%o.value===BigInt(0):to(n.value,o.value)===0)return;n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:o.value,input:n.value,inst:t,continue:!o.abort})}}),cn=w("$ZodCheckNumberFormat",(t,o)=>{M.init(t,o),o.format=o.format||"float64";let n=o.format?.includes("int"),c=n?"int":"number",[u,p]=lo[o.format];t._zod.onattach.push((f)=>{let h=f._zod.bag;if(h.format=o.format,h.minimum=u,h.maximum=p,n)h.pattern=Ge}),t._zod.check=(f)=>{let h=f.value;if(n){if(!Number.isInteger(h)){f.issues.push({expected:c,format:o.format,code:"invalid_type",continue:!1,input:h,inst:t});return}if(!Number.isSafeInteger(h)){if(h>0)f.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:c,inclusive:!0,continue:!o.abort});else f.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:c,inclusive:!0,continue:!o.abort});return}}if(h<u)f.issues.push({origin:"number",input:h,code:"too_small",minimum:u,inclusive:!0,inst:t,continue:!o.abort});if(h>p)f.issues.push({origin:"number",input:h,code:"too_big",maximum:p,inclusive:!0,inst:t,continue:!o.abort})}});var un=w("$ZodCheckMaxLength",(t,o)=>{var n;M.init(t,o),(n=t._zod.def).when??(n.when=It),t._zod.onattach.push((c)=>{let u=c._zod.bag.maximum??Number.POSITIVE_INFINITY;if(o.maximum<u)c._zod.bag.maximum=o.maximum}),t._zod.check=(c)=>{let u=c.value,p=u.length;if((typeof u==="string"&&p>o.maximum?Je(u):p)<=o.maximum)return;let h=Be(u);c.issues.push({origin:h,code:"too_big",maximum:o.maximum,inclusive:!0,input:u,inst:t,continue:!o.abort})}}),an=w("$ZodCheckMinLength",(t,o)=>{var n;M.init(t,o),(n=t._zod.def).when??(n.when=It),t._zod.onattach.push((c)=>{let u=c._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(o.minimum>u)c._zod.bag.minimum=o.minimum}),t._zod.check=(c)=>{let u=c.value,p=u.length;if((typeof u==="string"&&p>=o.minimum&&p<o.minimum*2?Je(u):p)>=o.minimum)return;let h=Be(u);c.issues.push({origin:h,code:"too_small",minimum:o.minimum,inclusive:!0,input:u,inst:t,continue:!o.abort})}}),ln=w("$ZodCheckLengthEquals",(t,o)=>{var n;M.init(t,o),(n=t._zod.def).when??(n.when=It),t._zod.onattach.push((c)=>{let u=c._zod.bag;u.minimum=o.length,u.maximum=o.length,u.length=o.length}),t._zod.check=(c)=>{let u=c.value,p=u.length,f=typeof u==="string"&&p>=o.length&&p<=o.length*2?Je(u):p;if(f===o.length)return;let h=Be(u),_=f>o.length;c.issues.push({origin:h,..._?{code:"too_big",maximum:o.length}:{code:"too_small",minimum:o.length},inclusive:!0,exact:!0,input:c.value,inst:t,continue:!o.abort})}}),Ee=w("$ZodCheckStringFormat",(t,o)=>{var n,c;if(M.init(t,o),t._zod.onattach.push((u)=>{let p=u._zod.bag;if(p.format=o.format,o.pattern)p.patterns??(p.patterns=new Set),p.patterns.add(o.pattern)}),o.pattern)(n=t._zod).check??(n.check=(u)=>{if(o.pattern.lastIndex=0,o.pattern.test(u.value))return;u.issues.push({origin:"string",code:"invalid_format",format:o.format,input:u.value,...o.pattern?{pattern:o.pattern.toString()}:{},inst:t,continue:!o.abort})});else(c=t._zod).check??(c.check=()=>{})}),pn=w("$ZodCheckRegex",(t,o)=>{Ee.init(t,o),t._zod.check=(n)=>{if(o.pattern.lastIndex=0,o.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:o.pattern.toString(),inst:t,continue:!o.abort})}}),fn=w("$ZodCheckLowerCase",(t,o)=>{o.pattern??(o.pattern=on),Ee.init(t,o)}),dn=w("$ZodCheckUpperCase",(t,o)=>{o.pattern??(o.pattern=nn),Ee.init(t,o)}),mn=w("$ZodCheckIncludes",(t,o)=>{M.init(t,o);let n=le(o.includes),c=new RegExp(typeof o.position==="number"?`^.{${o.position},}${n}`:n);o.pattern=c,t._zod.onattach.push((u)=>{let p=u._zod.bag;p.patterns??(p.patterns=new Set),p.patterns.add(c)}),t._zod.check=(u)=>{if(u.value.includes(o.includes,o.position))return;u.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:o.includes,input:u.value,inst:t,continue:!o.abort})}}),hn=w("$ZodCheckStartsWith",(t,o)=>{M.init(t,o);let n=new RegExp(`^${le(o.prefix)}.*`);o.pattern??(o.pattern=n),t._zod.onattach.push((c)=>{let u=c._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(n)}),t._zod.check=(c)=>{if(c.value.startsWith(o.prefix))return;c.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:o.prefix,input:c.value,inst:t,continue:!o.abort})}}),_n=w("$ZodCheckEndsWith",(t,o)=>{M.init(t,o);let n=new RegExp(`.*${le(o.suffix)}$`);o.pattern??(o.pattern=n),t._zod.onattach.push((c)=>{let u=c._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(n)}),t._zod.check=(c)=>{if(c.value.endsWith(o.suffix))return;c.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:o.suffix,input:c.value,inst:t,continue:!o.abort})}});var gn=w("$ZodCheckOverwrite",(t,o)=>{M.init(t,o),t._zod.check=(n)=>{n.value=o.tx(n.value)}});class At{constructor(t=[],o={}){this.content=[],this.indent=0,this.args=t,this.closed=o}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t==="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
|
|
4
|
+
`).filter((p)=>p),c=Math.min(...n.map((p)=>p.length-p.trimStart().length)),u=n.map((p)=>p.slice(c)).map((p)=>" ".repeat(this.indent*2)+p);for(let p of u)this.content.push(p)}compile(){let t=Function,o=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
5
|
+
${o.join(`
|
|
6
|
+
`)}
|
|
7
|
+
};`)(...Object.values(this.closed))}}var yn={major:4,minor:5,patch:4};var N=w("$ZodType",(t,o)=>{var n;t??(t={}),t._zod.def=o,t._zod.bag=t._zod.bag||{},t._zod.version=yn;let c=t._zod.def.checks,u=t._zod.traits.has("$ZodCheck")?[t,...c??[]]:c?.length?[...c]:[];for(let p of u)for(let f of p._zod.onattach)f(t);if(u.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let p=(h,_,b)=>{if(h.memo)return h;let v=he(h),k;for(let Z of _){if(Z._zod.def.when){if(fo(h))continue;if(!Z._zod.def.when(h))continue}else if(v)continue;let P=h.issues.length,S=Z._zod.check(h);if(S instanceof Promise&&b?.async===!1)throw new ie;if(k||S instanceof Promise)k=(k??Promise.resolve()).then(async()=>{if(await S,h.issues.length===P)return;if(xt(h.issues,P,t),!v)v=he(h,P)});else{if(h.issues.length===P)continue;if(xt(h.issues,P,t),!v)v=he(h,P)}}if(k)return k.then(()=>h);return h},f=(h,_,b)=>{if(he(h))return h.aborted=!0,h;let v=p(_,u,b);if(v instanceof Promise){if(b.async===!1)throw new ie;return v.then((k)=>t._zod.parse(k,b))}return t._zod.parse(v,b)};t._zod.run=(h,_)=>{if(_.skipChecks)return t._zod.parse(h,_);if(_.direction==="backward"){let v=t._zod.parse({value:h.value,issues:[]},{..._,skipChecks:!0});if(v instanceof Promise)return v.then((k)=>f(k,h,_));return f(v,h,_)}let b=t._zod.parse(h,_);if(b instanceof Promise){if(_.async===!1)throw new ie;return b.then((v)=>p(v,u,_))}return p(b,u,_)}}},{get "~standard"(){return yt(this,"~standard",Rt(this))},set "~standard"(t){de(this,"~standard",t)}}),bn=(t)=>t.success?{value:t.data}:{issues:t.error?.issues};function Rt(t){return{validate:(o)=>{try{return bn(zo(t,o))}catch(n){return vo(t,o).then(bn)}},vendor:"zod",version:1}}var He=w("$ZodString",(t,o)=>{N.init(t,o),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Qo(t._zod.bag),t._zod.parse=(n,c)=>{if(o.coerce)try{n.value=String(n.value)}catch(u){}if(typeof n.value==="string")return n;return n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),R=w("$ZodStringFormat",(t,o)=>{Ee.init(t,o),He.init(t,o)}),An=w("$ZodGUID",(t,o)=>{o.pattern??(o.pattern=Lo),R.init(t,o)}),Nn=w("$ZodUUID",(t,o)=>{if(o.version){let c={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[o.version];if(c===void 0)throw Error(`Invalid UUID version: "${o.version}"`);o.pattern??(o.pattern=St(c))}else o.pattern??(o.pattern=St());R.init(t,o)}),Cn=w("$ZodEmail",(t,o)=>{o.pattern??(o.pattern=Fo),R.init(t,o)}),jn=1,Rn=2;function Bc(t,o){if(!o.normalize&&o.protocol?.source===Wo.source&&!/^https?:\/\//i.test(t))return jn;try{return new URL(t)}catch{return Rn}}var Vc=/[\t\n\r]/g;function Kc(t){return t.replace(Vc,"")}function Wc(t,o){return o.lastIndex=0,o.test(t.hostname)}function Gc(t,o){return o.lastIndex=0,o.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)}var Dn=w("$ZodURL",(t,o)=>{R.init(t,o),t._zod.check=(n)=>{try{let c=n.value.trim(),u=Bc(c,o);if(u===jn){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:t,continue:!o.abort});return}if(u===Rn){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!o.abort});return}if(o.hostname&&!Wc(u,o.hostname))n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:o.hostname.source,input:n.value,inst:t,continue:!o.abort});if(o.protocol&&!Gc(u,o.protocol))n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:o.protocol.source,input:n.value,inst:t,continue:!o.abort});n.value=o.normalize?u.href:Kc(c);return}catch(c){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!o.abort})}}}),Ln=w("$ZodEmoji",(t,o)=>{o.pattern??(o.pattern=Uo()),R.init(t,o)}),Fn=w("$ZodNanoID",(t,o)=>{if(o.length!==void 0&&(!Number.isInteger(o.length)||o.length<1))throw Error(`Invalid nanoid length: ${o.length}`);o.pattern??(o.pattern=o.length===void 0?jo:Ro(o.length)),R.init(t,o)}),Un=w("$ZodCUID",(t,o)=>{o.pattern??(o.pattern=Eo),R.init(t,o)}),Mn=w("$ZodCUID2",(t,o)=>{o.pattern??(o.pattern=To),R.init(t,o)}),Jn=w("$ZodULID",(t,o)=>{o.pattern??(o.pattern=Ao),R.init(t,o)}),Bn=w("$ZodXID",(t,o)=>{o.pattern??(o.pattern=No),R.init(t,o)}),Vn=w("$ZodKSUID",(t,o)=>{o.pattern??(o.pattern=Co),R.init(t,o)}),Kn=w("$ZodISODateTime",(t,o)=>{if(o.pattern??(o.pattern=Ho(o)),R.init(t,o),o.local||o.precision===-1)t._zod.bag.laxFormat=!0,t._zod.onattach.push((n)=>{n._zod.bag.laxFormat=!0})}),Wn=w("$ZodISODate",(t,o)=>{o.pattern??(o.pattern=Yo),R.init(t,o)}),Gn=w("$ZodISOTime",(t,o)=>{o.pattern??(o.pattern=Xo(o)),R.init(t,o)}),qn=w("$ZodISODuration",(t,o)=>{o.pattern??(o.pattern=Do),R.init(t,o)}),Yn=w("$ZodIPv4",(t,o)=>{o.pattern??(o.pattern=Mo),R.init(t,o),t._zod.bag.format="ipv4"}),qc=/^[0-9a-fA-F:.]+$/;function Xn(t){if(!qc.test(t))return!1;try{return new URL(`http://[${t}]`),!0}catch{return!1}}var Hn=w("$ZodIPv6",(t,o)=>{o.pattern??(o.pattern=Jo),R.init(t,o),t._zod.bag.format="ipv6",t._zod.check=(n)=>{if(!Xn(n.value))n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!o.abort})}});var Qn=w("$ZodCIDRv4",(t,o)=>{o.pattern??(o.pattern=Bo),R.init(t,o)});function Yc(t){let o=t.split("/");if(o.length!==2)return!1;let[n,c]=o;if(!c)return!1;let u=Number(c);if(`${u}`!==c)return!1;if(u<0||u>128)return!1;return Xn(n)}var oi=w("$ZodCIDRv6",(t,o)=>{o.pattern??(o.pattern=Vo),R.init(t,o),t._zod.check=(n)=>{if(!Yc(n.value))n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!o.abort})}});function ni(t){if(t==="")return!0;if(/\s/.test(t))return!1;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var ii=w("$ZodBase64",(t,o)=>{o.pattern??(o.pattern=Ko),R.init(t,o),t._zod.bag.contentEncoding="base64",t._zod.check=(n)=>{if(ni(n.value))return;n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!o.abort})}});function Xc(t){if(!Ot.test(t))return!1;let o=t.replace(/[-_]/g,(c)=>c==="-"?"+":"/"),n=o.padEnd(Math.ceil(o.length/4)*4,"=");return ni(n)}var si=w("$ZodBase64URL",(t,o)=>{o.pattern??(o.pattern=Ot),R.init(t,o),t._zod.bag.contentEncoding="base64url",t._zod.check=(n)=>{if(Xc(n.value))return;n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!o.abort})}}),ci=w("$ZodE164",(t,o)=>{o.pattern??(o.pattern=Go),R.init(t,o)});function Hc(t,o=null){try{let n=t.split(".");if(n.length!==3)return!1;let[c]=n;if(!c)return!1;let u=JSON.parse(atob(c));if("typ"in u&&u?.typ!=="JWT")return!1;if(!u.alg)return!1;if(o&&(!("alg"in u)||u.alg!==o))return!1;return!0}catch{return!1}}var ui=w("$ZodJWT",(t,o)=>{R.init(t,o),t._zod.check=(n)=>{if(Hc(n.value,o.alg))return;n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!o.abort})}});var Dt=w("$ZodNumber",(t,o)=>{N.init(t,o),t._zod.pattern=t._zod.bag.pattern??Ie,t._zod.parse=(n,c)=>{if(o.coerce)try{n.value=Number(n.value)}catch(f){}let u=n.value;if(typeof u==="number"&&!Number.isNaN(u)&&Number.isFinite(u))return n;let p=typeof u==="number"?Number.isNaN(u)?"NaN":!Number.isFinite(u)?String(u):void 0:void 0;return n.issues.push({expected:"number",code:"invalid_type",input:u,inst:t,...p?{received:p}:{}}),n}}),ai=w("$ZodNumberFormat",(t,o)=>{cn.init(t,o),Dt.init(t,o)}),li=w("$ZodBoolean",(t,o)=>{N.init(t,o),t._zod.pattern=tn,t._zod.parse=(n,c)=>{if(o.coerce)try{n.value=Boolean(n.value)}catch(p){}let u=n.value;if(typeof u==="boolean")return n;return n.issues.push({expected:"boolean",code:"invalid_type",input:u,inst:t}),n}}),pi=w("$ZodBigInt",(t,o)=>{N.init(t,o),t._zod.pattern=en,t._zod.parse=(n,c)=>{if(o.coerce)try{n.value=BigInt(n.value)}catch(u){}if(typeof n.value==="bigint")return n;return n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:t}),n}});var fi=w("$ZodNull",(t,o)=>{N.init(t,o),t._zod.pattern=rn,t._zod.values=new Set([null]),t._zod.parse=(n,c)=>{let u=n.value;if(u===null)return n;return n.issues.push({expected:"null",code:"invalid_type",input:u,inst:t}),n}}),di=w("$ZodAny",(t,o)=>{N.init(t,o),t._zod.parse=(n)=>n}),mi=w("$ZodUnknown",(t,o)=>{N.init(t,o),t._zod.parse=(n)=>n}),hi=w("$ZodNever",(t,o)=>{N.init(t,o),t._zod.parse=(n,c)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)}),_i=w("$ZodVoid",(t,o)=>{N.init(t,o),t._zod.parse=(n,c)=>{let u=n.value;if(typeof u>"u")return n;return n.issues.push({expected:"void",code:"invalid_type",input:u,inst:t}),n}}),gi=w("$ZodDate",(t,o)=>{N.init(t,o),t._zod.parse=(n,c)=>{if(o.coerce)try{n.value=new Date(n.value)}catch(h){}let u=n.value,p=u instanceof Date;if(p&&!Number.isNaN(u.getTime()))return n;return n.issues.push({expected:"date",code:"invalid_type",input:u,...p?{received:"Invalid Date"}:{},inst:t}),n}});function zn(t,o,n){if(t.issues.length)o.issues.push(...re(n,t.issues));o.value[n]=t.value}var xi=w("$ZodArray",(t,o)=>{N.init(t,o);let n=V.memoizer;n?.attach(t),t._zod.parse=(c,u)=>{let p=c.value;if(!Array.isArray(p))return c.issues.push({expected:"array",code:"invalid_type",input:p,inst:t}),c;c.value=n?n.alloc(t,c,Array(p.length),u):Array(p.length);let f=[];for(let h=0;h<p.length;h++){let _=p[h],b=o.element._zod.run({value:_,issues:[]},u);if(b instanceof Promise)f.push(b.then((v)=>zn(v,c,h)));else zn(b,c,h)}if(f.length)return Promise.all(f).then(()=>c);return c}});function Xe(t,o,n,c,u,p){let f=n in c,h=p==="optional";if(!f&&h&&u==="optional")return;if(t.issues.length){if(u!==void 0&&h&&!f)return;o.issues.push(...re(n,t.issues))}if(!f&&u===void 0){if(!t.issues.length)o.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}if(t.value===void 0){if(f)o.value[n]=void 0}else o.value[n]=t.value}var Qc=[];function yi(t){let o=Object.keys(t.shape),n=Object.getOwnPropertySymbols(t.shape),c=n.length?n:Qc,u=c.length?[...o,...c]:o;for(let f of u)if(!t.shape?.[f]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(f)}": expected a Zod schema`);let p=ao(t.shape);return{...t,allKeys:u,symbolKeys:c,keySet:new Set(o),numKeys:o.length,optionalKeys:new Set(p)}}function bi(t,o,n,c,u,p){let f=[],h=u.keySet,_=u.catchall._zod,b=_.def.type,{optin:v,optout:k}=_;for(let Z in o){if(h.has(Z))continue;if(Z==="__proto__"){if(b==="never")f.push(Z);continue}if(b==="never"){f.push(Z);continue}let P=_.run({value:o[Z],issues:[]},c);if(P instanceof Promise)t.push(P.then((S)=>Xe(S,n,Z,o,v,k)));else Xe(P,n,Z,o,v,k)}if(f.length)n.issues.push({code:"unrecognized_keys",keys:f,input:o,inst:p,continue:!0});if(!t.length)return n;return Promise.all(t).then(()=>n)}var Nt=new WeakMap,eu=w("$ZodObject",(t,o)=>{if(N.init(t,o),!Object.getOwnPropertyDescriptor(o,"shape")?.get){let _=o.shape;Nt.set(o,_),Object.defineProperty(o,"shape",{get:()=>{let b={..._};return Object.defineProperty(o,"shape",{value:b}),Nt.set(o,b),b}})}let c=Ze(()=>yi(o));A(t,"propValues",(_)=>{let b=_.def.shape,v={};for(let k in b){let Z=b[k]._zod;if(Z.values){if(!Object.prototype.hasOwnProperty.call(v,k))F(v,k,new Set);for(let P of Z.values)v[k].add(P);if(Z.optin!==void 0)v[k].add(void 0)}}return v});let u=ge,p=o.catchall,f,h=V.memoizer;h?.attach(t),t._zod.parse=(_,b)=>{f??(f=c.value);let v=_.value;if(!u(v))return _.issues.push({expected:"object",code:"invalid_type",input:v,inst:t}),_;_.value=h?h.alloc(t,_,{},b):{};let k=[],Z=f.shape;for(let P of f.allKeys){if(P==="__proto__")continue;let S=Z[P],E=S._zod.optin,T=S._zod.optout,B=S._zod.run({value:v[P],issues:[]},b);if(B instanceof Promise)k.push(B.then((Y)=>Xe(Y,_,P,v,E,T)));else Xe(B,_,P,v,E,T)}if(!p)return k.length?Promise.all(k).then(()=>_):_;return bi(k,v,_,b,c.value,t)}}),zi=w("$ZodObjectJIT",(t,o)=>{eu.init(t,o);let n=t._zod.parse,c=Ze(()=>yi(o)),u=V.memoizer,p=(P)=>{let S=c.value,E=S.symbolKeys,T=new At(["payload","ctx"],{shape:P,inst:t,memo:u,syms:E}),B=(W)=>`shape[${W}]._zod.run({ value: input[${W}], issues: [] }, ctx)`,Y=(W,D)=>`
|
|
8
|
+
for (let i = 0; i < ${W}.issues.length; i++) {
|
|
9
|
+
const iss = ${W}.issues[i];
|
|
10
|
+
iss.path = iss.path ? [${D}, ...iss.path] : [${D}];
|
|
11
|
+
payload.issues.push(iss);
|
|
12
|
+
}`;T.write("const input = payload.value;");let qr=Object.create(null),bc=0;for(let W of S.allKeys)qr[W]=`key_${bc++}`;T.write(u?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let W of S.allKeys){if(W==="__proto__")continue;let D=qr[W],te=typeof W==="symbol"?`syms[${E.indexOf(W)}]`:io(W),lt=`${te} in input`,Yr=P[W],Xr=Yr?._zod?.optin,Hr=Xr!==void 0,zc=Yr?._zod?.optout==="optional";if(T.write(`const ${D} = ${B(te)};`),Hr&&zc){let vc=Xr==="optional"?`${D}_present`:`${D}.value !== undefined || ${D}_present`;T.write(`
|
|
13
|
+
const ${D}_present = ${lt};
|
|
14
|
+
if (!${D}.issues.length || ${D}_present) {
|
|
15
|
+
if (${D}.issues.length) {${Y(D,te)}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (${vc}) {
|
|
19
|
+
newResult[${te}] = ${D}.value;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
`)}else if(!Hr)T.write(`
|
|
24
|
+
const ${D}_present = ${lt};
|
|
25
|
+
if (${D}.issues.length) {${Y(D,te)}
|
|
26
|
+
}
|
|
27
|
+
if (!${D}_present && !${D}.issues.length) {
|
|
28
|
+
payload.issues.push({
|
|
29
|
+
code: "invalid_type",
|
|
30
|
+
expected: "nonoptional",
|
|
31
|
+
input: undefined,
|
|
32
|
+
path: [${te}]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (${D}_present) {
|
|
37
|
+
newResult[${te}] = ${D}.value;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
`);else T.write(`
|
|
41
|
+
if (${D}.issues.length) {${Y(D,te)}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (${D}.value === undefined) {
|
|
45
|
+
if (${lt}) {
|
|
46
|
+
newResult[${te}] = undefined;
|
|
47
|
+
}
|
|
48
|
+
} else {
|
|
49
|
+
newResult[${te}] = ${D}.value;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
`)}return T.write("payload.value = newResult;"),T.write("return payload;"),T.compile()},f,h=ge,_=!V.jitless,v=_&&co.value,k=o.catchall,Z;t._zod.parse=(P,S)=>{Z??(Z=c.value);let E=P.value;if(!h(E))return P.issues.push({expected:"object",code:"invalid_type",input:E,inst:t}),P;if(_&&v&&S?.async===!1&&S.jitless!==!0){if(!f)f=p(o.shape);if(P=f(P,S),!k)return P;return bi([],E,P,S,Z,t)}return n(P,S)}});function vn(t,o,n,c){for(let p of t)if(p.issues.length===0)return o.value=p.value,o;let u=t.filter((p)=>!he(p));if(u.length===1)return o.value=u[0].value,u[0];return o.issues.push({code:"invalid_union",input:o.value,inst:n,errors:t.map((p)=>p.issues.map((f)=>oe(f,c,G())))}),o}var Lt=w("$ZodUnion",(t,o)=>{N.init(t,o),A(t,"optin",(c)=>c.def.options.some((u)=>u._zod.optin==="defaulted")?"defaulted":c.def.options.some((u)=>u._zod.optin!==void 0)?"optional":void 0),A(t,"optout",(c)=>c.def.options.some((u)=>u._zod.optout==="optional")?"optional":void 0),A(t,"values",(c)=>{if(c.def.options.every((u)=>u._zod.values))return new Set(c.def.options.flatMap((u)=>Array.from(u._zod.values)));return}),A(t,"pattern",(c)=>{if(c.def.options.every((u)=>u._zod.pattern)){let u=c.def.options.map((p)=>p._zod.pattern);return new RegExp(`^(${u.map((p)=>Me(p.source)).join("|")})$`)}return});let n=o.options.length===1?o.options[0]._zod.run:null;t._zod.parse=(c,u)=>{if(n)return n(c,u);let p=!1,f=[];for(let h of o.options){let _=h._zod.run({value:c.value,issues:[]},u);if(_ instanceof Promise)f.push(_),p=!0;else{if(_.issues.length===0)return _;f.push(_)}}if(!p)return vn(f,c,t,u);return Promise.all(f).then((h)=>vn(h,c,t,u))}});var vi=w("$ZodDiscriminatedUnion",(t,o)=>{o.inclusive=!1,Lt.init(t,o);let n=t._zod.parse;A(t,"propValues",(u)=>{let p={};for(let f of u.def.options){let h=f._zod.propValues;if(!h||Object.keys(h).length===0)throw Error(`Invalid discriminated union option at index "${u.def.options.indexOf(f)}"`);for(let[_,b]of Object.entries(h)){if(!Object.prototype.hasOwnProperty.call(p,_))F(p,_,new Set);for(let v of b)p[_].add(v)}}return p}),o.options.forEach((u,p)=>{let f=Nt.get(u._zod.def);if(f&&!Object.prototype.hasOwnProperty.call(f,o.discriminator))throw Error(`Invalid discriminated union option at index "${p}"`)});let c=Ze(()=>{let u=o.options,p=new Map;for(let f of u){let h=f._zod.propValues?.[o.discriminator];if(!h||h.size===0)throw Error(`Invalid discriminated union option at index "${o.options.indexOf(f)}"`);for(let _ of h){if(p.has(_))throw Error(`Duplicate discriminator value "${String(_)}"`);p.set(_,f)}}return p});t._zod.parse=(u,p)=>{let f=u.value;if(!ge(f))return u.issues.push({code:"invalid_type",expected:"object",input:f,inst:t}),u;let h=c.value.get(f?.[o.discriminator]);if(h)return h._zod.run(u,p);if(o.unionFallback||p.direction==="backward")return n(u,p);return u.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:o.discriminator,options:Array.from(c.value.keys()),input:f,path:[o.discriminator],inst:t}),u}}),$i=w("$ZodIntersection",(t,o)=>{N.init(t,o),t._zod.parse=(n,c)=>{let u=n.value,p=o.left._zod.run({value:u,issues:[]},c),f=o.right._zod.run({value:u,issues:[]},c);if(p instanceof Promise||f instanceof Promise)return Promise.all([p,f]).then(([_,b])=>$n(n,_,b));return $n(n,p,f)}});function jt(t,o){if(t===o)return{valid:!0,data:t};if(t instanceof Date&&o instanceof Date&&+t===+o)return{valid:!0,data:t};if(me(t)&&me(o)){let n=Object.keys(o),c=Object.keys(t).filter((p)=>n.indexOf(p)!==-1),u={...t,...o};if(Object.prototype.hasOwnProperty.call(u,"__proto__"))delete u.__proto__;for(let p of c){if(p==="__proto__")continue;let f=jt(t[p],o[p]);if(!f.valid)return{valid:!1,mergeErrorPath:[p,...f.mergeErrorPath]};u[p]=f.data}return{valid:!0,data:u}}if(Array.isArray(t)&&Array.isArray(o)){if(t.length!==o.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let c=0;c<t.length;c++){let u=t[c],p=o[c],f=jt(u,p);if(!f.valid)return{valid:!1,mergeErrorPath:[c,...f.mergeErrorPath]};n.push(f.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function $n(t,o,n){let c=new Map,u,p=new Map,f=(b,v)=>{let k;if(b.code==="unrecognized_keys"&&!b.path?.length)u??(u=b),k=b.keys;else if(b.code==="invalid_key"&&b.origin==="record"&&b.path?.length===1){let Z=String(b.path[0]);if(!p.has(Z))p.set(Z,b);k=[Z]}else return!1;for(let Z of k){if(!c.has(Z))c.set(Z,{});c.get(Z)[v]=!0}return!0};for(let b of o.issues)if(!f(b,"l"))t.issues.push(b);for(let b of n.issues)if(!f(b,"r"))t.issues.push(b);let h=[...c].filter(([,b])=>b.l&&b.r).map(([b])=>b);if(h.length){let b=u?h.filter((v)=>u.keys.includes(v)):[];if(b.length)t.issues.push({...u,keys:b});for(let v of h)if(!b.includes(v)&&p.has(v))t.issues.push(p.get(v))}let _=jt(o.value,n.value);if(!_.valid){if(he(t))return t;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(_.mergeErrorPath)}`)}return t.value=_.data,t}var wi=w("$ZodTuple",(t,o)=>{N.init(t,o);let n=o.items,c=V.memoizer;c?.attach(t),t._zod.parse=(u,p)=>{let f=u.value;if(!Array.isArray(f))return u.issues.push({input:f,inst:t,expected:"tuple",code:"invalid_type"}),u;u.value=c?c.alloc(t,u,[],p):[];let h=[],_=wn(n,"optin"),b=wn(n,"optout");if(!o.rest){if(f.length<_)return u.issues.push({code:"too_small",minimum:_,inclusive:!0,input:f,inst:t,origin:"array"}),u;if(f.length>n.length)u.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:f,inst:t,origin:"array"})}let v=Array(n.length);for(let k=0;k<n.length;k++){let Z=n[k]._zod.run({value:f[k],issues:[]},p);if(Z instanceof Promise)h.push(Z.then((P)=>{v[k]=P}));else v[k]=Z}if(o.rest){let k=n.length-1,Z=f.slice(n.length);for(let P of Z){k++;let S=o.rest._zod.run({value:P,issues:[]},p);if(S instanceof Promise)h.push(S.then((E)=>kn(E,u,k)));else kn(S,u,k)}}if(h.length)return Promise.all(h).then(()=>Zn(v,u,n,f,b));return Zn(v,u,n,f,b)}});function wn(t,o){for(let n=t.length-1;n>=0;n--)if(!(o==="optin"?t[n]._zod.optin!==void 0:t[n]._zod.optout==="optional"))return n+1;return 0}function kn(t,o,n){if(t.issues.length)o.issues.push(...re(n,t.issues));o.value[n]=t.value}function Zn(t,o,n,c,u){for(let p=0;p<n.length;p++){let f=t[p],h=p<c.length;if(!h&&p>=u&&n[p]._zod.optin==="optional"){o.value.length=p;break}if(f.issues.length){if(!h&&p>=u){o.value.length=p;break}o.issues.push(...re(p,f.issues))}o.value[p]=f.value}for(let p=o.value.length-1;p>=c.length;p--)if(n[p]._zod.optout==="optional"&&o.value[p]===void 0)o.value.length=p;else break;return o}var ki=w("$ZodRecord",(t,o)=>{N.init(t,o);let n=V.memoizer;n?.attach(t),t._zod.parse=(c,u)=>{let p=c.value;if(!me(p))return c.issues.push({expected:"record",code:"invalid_type",input:p,inst:t}),c;let f=[],h=o.keyType._zod.values;if(h&&!o.partial){c.value=n?n.alloc(t,c,{},u):{};let _=new Set;for(let v of h)if(typeof v==="string"||typeof v==="number"||typeof v==="symbol"){if(_.add(typeof v==="number"?v.toString():v),v==="__proto__")continue;let k=o.keyType._zod.run({value:v,issues:[]},u);if(k instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(k.issues.length){c.issues.push({code:"invalid_key",origin:"record",issues:k.issues.map((S)=>oe(S,u,G())),input:v,path:[v],inst:t});continue}let Z=k.value;if(Z==="__proto__")continue;let P=o.valueType._zod.run({value:p[v],issues:[]},u);if(P instanceof Promise)f.push(P.then((S)=>{if(S.issues.length)c.issues.push(...re(v,S.issues));c.value[Z]=S.value}));else{if(P.issues.length)c.issues.push(...re(v,P.issues));c.value[Z]=P.value}}let b;for(let v in p)if(!_.has(v))if(o.mode==="loose"){if(v==="__proto__")continue;c.value[v]=p[v]}else b=b??[],b.push(v);if(b&&b.length>0)c.issues.push({code:"unrecognized_keys",input:p,inst:t,keys:b,continue:!0})}else{c.value=n?n.alloc(t,c,{},u):{};let _;for(let b of Reflect.ownKeys(p)){if(b==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(p,b))continue;let v=o.keyType._zod.run({value:b,issues:[]},u);if(v instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof b==="string"&&Ie.test(b)&&v.issues.length){let S=o.keyType._zod.run({value:Number(b),issues:[]},u);if(S instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(S.issues.length===0)v=S}if(v.issues.length){if(o.mode==="loose")c.value[b]=p[b];else if(h)_=_??[],_.push(b);else c.issues.push({code:"invalid_key",origin:"record",issues:v.issues.map((S)=>oe(S,u,G())),input:b,path:[b],inst:t});continue}let Z=v.value;if(Z==="__proto__")continue;let P=o.valueType._zod.run({value:p[b],issues:[]},u);if(P instanceof Promise)f.push(P.then((S)=>{if(S.issues.length)c.issues.push(...re(b,S.issues));c.value[Z]=S.value}));else{if(P.issues.length)c.issues.push(...re(b,P.issues));c.value[Z]=P.value}}if(_&&_.length>0)c.issues.push({code:"unrecognized_keys",input:p,inst:t,keys:_,continue:!0})}if(f.length)return Promise.all(f).then(()=>c);return c}});var Zi=w("$ZodEnum",(t,o)=>{N.init(t,o);let n=Ue(o.entries),c=new Set(n);t._zod.values=c;let u=n.filter((p)=>uo.has(typeof p));t._zod.pattern=new RegExp(u.length?`^(${u.map((p)=>le(p.toString())).join("|")})$`:"^[^\\s\\S]$"),t._zod.parse=(p,f)=>{let h=p.value;if(c.has(h))return p;return p.issues.push({code:"invalid_value",values:n,input:h,inst:t}),p}}),Pi=w("$ZodLiteral",(t,o)=>{N.init(t,o);let n=new Set(o.values);t._zod.values=n,t._zod.pattern=new RegExp(o.values.length?`^(${o.values.map((c)=>typeof c==="string"?le(c):c?le(c.toString()):String(c)).join("|")})$`:"^[^\\s\\S]$"),t._zod.parse=(c,u)=>{let p=c.value;if(n.has(p))return c;return c.issues.push({code:"invalid_value",values:o.values,input:p,inst:t}),c}});var Si=w("$ZodTransform",(t,o)=>{N.init(t,o),t._zod.optin="optional",V.memoizer?.guard(t),t._zod.parse=(n,c)=>{if(c.direction==="backward")throw new Pe(t.constructor.name);let u=o.transform(n.value,n);if(c.async)return(u instanceof Promise?u:Promise.resolve(u)).then((f)=>(n.value=f,n));if(u instanceof Promise)throw new ie;return n.value=u,n}});function Pn(t,o){return t.value=o.issues.length?void 0:o.value,t}var Ft=w("$ZodOptional",(t,o)=>{N.init(t,o),A(t,"optin",(n)=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),t._zod.optout="optional",A(t,"values",(n)=>{let c=n.def.innerType._zod.values;return c?new Set([...c,void 0]):void 0}),A(t,"pattern",(n)=>{let c=n.def.innerType._zod.pattern;return c?new RegExp(`^(${Me(c.source)})?$`):void 0}),t._zod.parse=(n,c)=>{if(n.value===void 0){if(o.innerType._zod.optin!=="defaulted")return n;let u=o.innerType._zod.run({value:n.value,issues:[]},c);if(u instanceof Promise)return u.then((p)=>Pn(n,p));return Pn(n,u)}return o.innerType._zod.run(n,c)}}),Oi=w("$ZodExactOptional",(t,o)=>{Ft.init(t,o),A(t,"values",(n)=>n.def.innerType._zod.values),A(t,"pattern",(n)=>n.def.innerType._zod.pattern),t._zod.parse=(n,c)=>o.innerType._zod.run(n,c)}),Ii=w("$ZodNullable",(t,o)=>{N.init(t,o),A(t,"optin",(n)=>n.def.innerType._zod.optin),A(t,"optout",(n)=>n.def.innerType._zod.optout),A(t,"pattern",(n)=>{let c=n.def.innerType._zod.pattern;return c?new RegExp(`^(${Me(c.source)}|null)$`):void 0}),A(t,"values",(n)=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),t._zod.parse=(n,c)=>{if(n.value===null)return n;return o.innerType._zod.run(n,c)}}),Ei=w("$ZodDefault",(t,o)=>{N.init(t,o),t._zod.optin="defaulted",A(t,"values",(n)=>n.def.innerType._zod.values),t._zod.parse=(n,c)=>{if(c.direction==="backward")return o.innerType._zod.run(n,c);if(n.value===void 0)return n.value=o.defaultValue,n;let u=o.innerType._zod.run(n,c);if(u instanceof Promise)return u.then((p)=>Sn(p,o));return Sn(u,o)}});function Sn(t,o){if(t.value===void 0)t.value=o.defaultValue;return t}var Ti=w("$ZodPrefault",(t,o)=>{N.init(t,o),t._zod.optin="defaulted",A(t,"values",(n)=>n.def.innerType._zod.values),t._zod.parse=(n,c)=>{if(c.direction==="backward")return o.innerType._zod.run(n,c);if(n.value===void 0)n.value=o.defaultValue;return o.innerType._zod.run(n,c)}}),Ai=w("$ZodNonOptional",(t,o)=>{N.init(t,o),A(t,"values",(n)=>{let c=n.def.innerType._zod.values;return c?new Set([...c].filter((u)=>u!==void 0)):void 0}),t._zod.parse=(n,c)=>{let u=o.innerType._zod.run(n,c);if(u instanceof Promise)return u.then((p)=>On(p,t));return On(u,t)}});function On(t,o){if(!t.issues.length&&t.value===void 0)t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:o});return t}function In(t,o,n,c){if(!o.issues.length){if(t.value=o.value,o.memo)t.memo=!0;return t}return t.value=n.catchValue({...o,value:t.value,error:{issues:o.issues.map((u)=>oe(u,c,G()))},input:t.value}),t}var Ni=w("$ZodCatch",(t,o)=>{N.init(t,o),A(t,"optin",(n)=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),A(t,"optout",(n)=>n.def.innerType._zod.optout),A(t,"values",(n)=>n.def.innerType._zod.values),t._zod.parse=(n,c)=>{if(c.direction==="backward")return o.innerType._zod.run(n,c);let u=o.innerType._zod.run({value:n.value,issues:[]},c);if(u instanceof Promise)return u.then((p)=>In(n,p,o,c));return In(n,u,o,c)}});var Ut=w("$ZodPipe",(t,o)=>{N.init(t,o),A(t,"values",(n)=>n.def.in._zod.values),A(t,"optin",(n)=>n.def.in._zod.optin),A(t,"optout",(n)=>n.def.out._zod.optout),A(t,"propValues",(n)=>n.def.in._zod.propValues),t._zod.parse=(n,c)=>{if(c.direction==="backward"){let p=o.out._zod.run(n,c);if(p instanceof Promise)return p.then((f)=>Ye(f,o.in,c));return Ye(p,o.in,c)}let u=o.in._zod.run(n,c);if(u instanceof Promise)return u.then((p)=>Ye(p,o.out,c));return Ye(u,o.out,c)}});function Ye(t,o,n){if(t.issues.some((c)=>c.code!=="unrecognized_keys"))return t.aborted=!0,t;return o._zod.run({value:t.value,issues:t.issues},n)}var Ci=w("$ZodPreprocess",(t,o)=>{Ut.init(t,o)}),ji=w("$ZodReadonly",(t,o)=>{N.init(t,o),A(t,"propValues",(n)=>n.def.innerType._zod.propValues),A(t,"values",(n)=>n.def.innerType._zod.values),A(t,"optin",(n)=>n.def.innerType?._zod?.optin),A(t,"optout",(n)=>n.def.innerType?._zod?.optout),t._zod.parse=(n,c)=>{if(c.direction==="backward")return o.innerType._zod.run(n,c);let u=o.innerType._zod.run(n,c);if(u instanceof Promise)return u.then(En);return En(u)}});function En(t){if(!t.memo)t.value=Object.freeze(t.value);return t}var Ri=w("$ZodLazy",(t,o)=>{N.init(t,o),oo(t._zod,"innerType",()=>{let n=o;if(!n._cachedInner)n._cachedInner=o.getter();return n._cachedInner}),A(t,"pattern",(n)=>n.innerType?._zod?.pattern),A(t,"propValues",(n)=>n.innerType?._zod?.propValues),A(t,"optin",(n)=>n.innerType?._zod?.optin??void 0),A(t,"optout",(n)=>n.innerType?._zod?.optout??void 0),t._zod.parse=(n,c)=>t._zod.innerType._zod.run(n,c)}),Di=w("$ZodCustom",(t,o)=>{M.init(t,o),N.init(t,o),t._zod.parse=(n,c)=>n,t._zod.check=(n)=>{let c=n.value,u=o.fn(c);if(u instanceof Promise)return u.then((p)=>Tn(p,n,c,t));Tn(u,n,c,t);return}});function Tn(t,o,n,c){if(!t){let u={code:"custom",input:n,inst:c,path:[...c._zod.def.path??[]],continue:!c._zod.def.abort};if(c._zod.def.params)u.params=c._zod.def.params;o.issues.push(_e(u))}}class Ui extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var Bt="~memo",Li=[];function Mt(t){return t.map((o)=>o.path?{...o,path:o.path.slice()}:{...o})}var Fi=new WeakMap;function Mi(t,o){let n=Fi.get(t);if(n!==void 0)return n;if(o.has(t))return!0;o.add(t);let c=!1,u=(h)=>{if(!c&&h?._zod&&Mi(h,o))c=!0},p=t._zod.def,f=p.type;switch(f){case"object":{for(let h of Reflect.ownKeys(p.shape))u(p.shape[h]);u(p.catchall);break}case"array":u(p.element);break;case"tuple":for(let h of p.items)u(h);u(p.rest);break;case"record":case"map":u(p.keyType),u(p.valueType);break;case"set":u(p.valueType);break;case"union":for(let h of p.options)u(h);break;case"intersection":u(p.left),u(p.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":u(p.innerType);break;case"pipe":u(p.in),u(p.out);break;case"function":u(p.input),u(p.output);break;case"lazy":u(t._zod.innerType);break;case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let h in p){let _=Object.getOwnPropertyDescriptor(p,h);if(!_||_.get)continue;let b=_.value;if(!b||typeof b!=="object")continue;if(b._zod)u(b);else if(Array.isArray(b))for(let v of b)u(v)}}return o.delete(t),Fi.set(t,c),c}function tu(t,o){let n=t.buckets.get(o);if(!n)n=new Map,t.buckets.set(o,n);return n}var Qe,et=[],ru={alloc(t,o,n){let c=Qe;if(!c)return n;Qe=void 0;let u={value:n,issues:null};return c.set(o.value,u),et.push(u),n},guard(t){var o;(o=t._zod).deferred??(o.deferred=[]),t._zod.deferred.push(()=>{let n=t._zod.parse,c=(u,p)=>{if(p.direction!=="backward"&&ou(p,u.value))throw new Ui;return n(u,p)};if(t._zod.parse=c,t._zod.run===n)t._zod.run=c})},attach(t){var o;let n,c,u;(o=t._zod).deferred??(o.deferred=[]),t._zod.deferred.push(()=>{let p=t._zod.parse,f=(h,_)=>{if(n===void 0){if(n=Mi(t,new Set),!n){if(t._zod.parse=p,t._zod.run===f)t._zod.run=p;return p(h,_)}}let b=h.value;if(b===null||typeof b!=="object")return p(h,_);let v=_[Bt];if(!v)v={buckets:new Map,backEdges:void 0},_[Bt]=v;let k;if(c===_)k=u;else k=tu(v,t),c=_,u=k;let Z=k.get(b);if(Z){if(h.value=Z.value,Z.issues){if(Z.issues.length)h.issues.push(...Mt(Z.issues))}else h.memo=!0,v.backEdges??(v.backEdges=new Set),v.backEdges.add(Z.value);return h}Qe=k;let P=et.length,S=p(h,_);Qe=void 0;let E=et.length>P?et.pop():void 0;if(S instanceof Promise)return S.then((T)=>{if(E)E.issues=T.issues.length?Mt(T.issues):Li;return T});if(E)E.issues=S.issues.length?Mt(S.issues):Li;return S};if(t._zod.parse=f,t._zod.run===p)t._zod.run=f})}};function Vt(){return ru}function ou(t,o){let n=t[Bt]?.backEdges;return n!==void 0&&o!==null&&typeof o==="object"&&n.has(o)}var nu=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function o(p){return t[p]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"credit card number",jwt:"JWT",template_literal:"input"},c={nan:"NaN"};function u(p,f){if(p==="number"&&typeof f==="number"&&!Number.isFinite(f))return String(f);return c[p]??p}return(p)=>{switch(p.code){case"invalid_type":{let f=u(p.expected),h=mo(p.input),_=u(h,p.input);return`Invalid input: expected ${f}, received ${_}`}case"invalid_value":if(p.values.length===1)return`Invalid input: expected ${gt(p.values[0])}`;return`Invalid option: expected one of ${ft(p.values,"|")}`;case"too_big":{let f=p.exact?"exactly ":p.inclusive?"<=":"<",h=o(p.origin);if(h)return`Too big: expected ${p.origin??"value"} to have ${f}${p.maximum.toString()} ${h.unit??"elements"}`;return`Too big: expected ${p.origin??"value"} to be ${f}${p.maximum.toString()}`}case"too_small":{let f=p.exact?"exactly ":p.inclusive?">=":">",h=o(p.origin);if(h)return`Too small: expected ${p.origin} to have ${f}${p.minimum.toString()} ${h.unit}`;return`Too small: expected ${p.origin} to be ${f}${p.minimum.toString()}`}case"invalid_format":{let f=p;if(f.format==="starts_with")return`Invalid string: must start with "${f.prefix}"`;if(f.format==="ends_with")return`Invalid string: must end with "${f.suffix}"`;if(f.format==="includes")return`Invalid string: must include "${f.includes}"`;if(f.format==="regex")return`Invalid string: must match pattern ${f.pattern}`;return`Invalid ${n[f.format]??p.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${p.divisor}`;case"unrecognized_keys":return`Unrecognized key${p.keys.length>1?"s":""}: ${ft(p.keys,", ")}`;case"invalid_key":return`Invalid key in ${p.origin}`;case"invalid_union":if(p.options&&Array.isArray(p.options)&&p.options.length>0)return`Invalid discriminator value. Expected ${p.options.map((h)=>`'${h}'`).join(" | ")}`;if(p.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${p.origin}`;default:return"Invalid input"}}};function Kt(){return{localeError:nu()}}var Ji;class Bi{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...o){let n=o[0];if(this._map.set(t,n),n&&typeof n==="object"&&"id"in n)this._idmap.set(n.id,t);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let o=this._map.get(t);if(o&&typeof o==="object"&&"id"in o)this._idmap.delete(o.id);return this._map.delete(t),this}get(t){let o=t._zod.parent;if(o){let n={...this.get(o)??{}};delete n.id;let c={...n,...this._map.get(t)};return Object.keys(c).length?c:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Vi(){return new Bi}(Ji=globalThis).__zod_globalRegistry??(Ji.__zod_globalRegistry=Vi());var pe=globalThis.__zod_globalRegistry;function Ki(t,o){return new t({type:"string",...O(o)})}function Wi(t,o){return new t({type:"string",coerce:!0,...O(o)})}function Wt(t,o){return new t({type:"string",format:"email",check:"string_format",abort:!1,...O(o)})}function Gi(t,o){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...O(o)})}function qi(t,o){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...O(o)})}function Yi(t,o){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...O(o)})}function Xi(t,o){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...O(o)})}function Hi(t,o){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...O(o)})}function Gt(t,o){return new t({type:"string",format:"url",check:"string_format",abort:!1,...O(o)})}function Qi(t,o){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...O(o)})}function es(t,o){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...O(o)})}function ts(t,o){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...O(o)})}function rs(t,o){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...O(o)})}function os(t,o){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...O(o)})}function ns(t,o){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...O(o)})}function is(t,o){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...O(o)})}function qt(t,o){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...O(o)})}function Yt(t,o){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...O(o)})}function ss(t,o){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...O(o)})}function cs(t,o){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...O(o)})}function us(t,o){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...O(o)})}function as(t,o){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...O(o)})}function ls(t,o){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...O(o)})}function ps(t,o){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...O(o)})}function tt(t,o){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...O(o)})}function rt(t,o){return new t({type:"string",format:"date",check:"string_format",...O(o)})}function Xt(t,o){return new t({type:"string",format:"time",check:"string_format",precision:null,...O(o)})}function Ht(t,o){return new t({type:"string",format:"duration",check:"string_format",...O(o)})}function fs(t,o){return new t({type:"number",checks:[],...O(o)})}function ds(t,o){return new t({type:"number",coerce:!0,checks:[],...O(o)})}function ms(t,o){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...O(o)})}function hs(t,o){return new t({type:"boolean",...O(o)})}function _s(t,o){return new t({type:"boolean",coerce:!0,...O(o)})}function gs(t,o){return new t({type:"bigint",coerce:!0,...O(o)})}function xs(t,o){return new t({type:"null",...O(o)})}function ys(t){return new t({type:"any"})}function zs(t){return new t({type:"unknown"})}function vs(t,o){return new t({type:"never",...O(o)})}function $s(t,o){return new t({type:"void",...O(o)})}function ws(t,o){return new t({type:"date",...O(o)})}function ks(t,o){return new t({type:"date",coerce:!0,...O(o)})}function be(t,o){return new Et({check:"less_than",...O(o),value:t,inclusive:!1})}function se(t,o){return new Et({check:"less_than",...O(o),value:t,inclusive:!0})}function ze(t,o){return new Tt({check:"greater_than",...O(o),value:t,inclusive:!1})}function ce(t,o){return new Tt({check:"greater_than",...O(o),value:t,inclusive:!0})}function Te(t,o){return new sn({check:"multiple_of",...O(o),value:t})}function ot(t,o){return new un({check:"max_length",...O(o),maximum:t})}function ve(t,o){return new an({check:"min_length",...O(o),minimum:t})}function nt(t,o){return new ln({check:"length_equals",...O(o),length:t})}function Qt(t,o){return new pn({check:"string_format",format:"regex",...O(o),pattern:t})}function er(t){return new fn({check:"string_format",format:"lowercase",...O(t)})}function tr(t){return new dn({check:"string_format",format:"uppercase",...O(t)})}function rr(t,o){return new mn({check:"string_format",format:"includes",...O(o),includes:t})}function or(t,o){return new hn({check:"string_format",format:"starts_with",...O(o),prefix:t})}function nr(t,o){return new _n({check:"string_format",format:"ends_with",...O(o),suffix:t})}function fe(t){return new gn({check:"overwrite",tx:t})}function ir(t){return fe((o)=>o.normalize(t))}function sr(){return fe((t)=>t.trim())}function cr(){return fe((t)=>t.toLowerCase())}function ur(){return fe((t)=>t.toUpperCase())}function ar(){return fe((t)=>so(t))}function Zs(t,o,n){return new t({type:"array",element:o,...O(n)})}function Ps(t,o,n){let c=O(n);return c.abort??(c.abort=!0),new t({type:"custom",check:"custom",fn:o,...c})}function Ss(t,o,n){return new t({type:"custom",check:"custom",fn:o,...O(n)})}function Os(t,o){let n=su((c)=>(c.addIssue=(u)=>{if(typeof u==="string")c.issues.push(_e(u,c.value,n._zod.def));else{let p=u;if(p.fatal)p.continue=!1;if(p.code??(p.code="custom"),!("input"in p))p.input=c.value;p.inst??(p.inst=n),p.continue??(p.continue=!n._zod.def.abort),c.issues.push(_e(p))}},t(c.value,c)),o);return n}function su(t,o){let n=new M({check:"custom",...O(o)});return n._zod.check=t,n}function Ae(t,...o){for(let n of o)for(let c of Reflect.ownKeys(n))if(Object.prototype.propertyIsEnumerable.call(n,c))F(t,c,n[c]);return t}function je(t){let o=t?.target??"draft-2020-12";if(o==="draft-4")o="draft-04";if(o==="draft-7")o="draft-07";return{processors:t.processors??{},metadataRegistry:t?.metadata??pe,target:o,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:t?.cycles??"ref",reused:t?.reused??"inline",intersections:[],deferred:[],external:t?.external??void 0}}function U(t,o,n,c,u){let p=typeof o.unrepresentable==="function"?o.unrepresentable({zodSchema:t,path:c.path,message:u}):o.unrepresentable;if(p==="any")return!1;if(p===void 0||p==="throw")throw Error(u);return Object.assign(n,p),!0}function j(t,o,n={path:[],schemaPath:[]}){var c;let u=t._zod.def,p=o.seen.get(t);if(p){if(p.count++,n.schemaPath.includes(t))p.cycle=n.path;return p.schema}let f={schema:{},count:1,cycle:void 0,path:n.path};o.seen.set(t,f),o.sharedDefsExtractedFor=void 0,o.sharedEmitDoneFor=void 0;let h=t._zod.toJSONSchema?.();if(h)f.schema=h;else{let v={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(o,f.schema,v);else{let Z=f.schema,P=o.processors[u.type];if(!P)throw Error(`[toJSONSchema]: Non-representable type encountered: ${u.type}`);P(t,o,Z,v)}let k=t._zod.parent;if(k){if(!f.ref)f.ref=k;j(k,o,v),o.seen.get(k).isParent=!0}}let _=o.metadataRegistry.get(t);if(_)Ae(f.schema,_);if(o.io==="input"&&K(t))delete f.schema.examples,delete f.schema.default;if(o.io==="input"&&"_prefault"in f.schema)(c=f.schema).default??(c.default=f.schema._prefault);return delete f.schema._prefault,o.seen.get(t).schema}function Is(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function Re(t,o){let n=t.seen.get(o);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");if(t.external&&t.sharedDefsExtractedFor===t.external)return;let c=new Map;for(let f of t.seen.entries()){let h=t.metadataRegistry.get(f[0])?.id;if(h){let _=c.get(h);if(_&&_!==f[0])throw Error(`Duplicate schema id "${h}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);c.set(h,f[0])}}let u=(f)=>{let h=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let k=t.external.registry.get(f[0])?.id,Z=t.external.uri??((S)=>S);if(k)return{ref:Z(k)};let P=f[1].defId??f[1].schema.id??`schema${t.counter++}`;return f[1].defId=P,{defId:P,ref:`${Z("__shared")}#/${h}/${Is(P)}`}}let _="#",b=`${_}/${h}/`;if(f[1]===n&&!f[1].schema.id)return{ref:_};let v=f[1].schema.id??`__schema${t.counter++}`;return{defId:v,ref:b+Is(v)}},p=(f)=>{if(f[1].schema.$ref)return;let h=f[1],{ref:_,defId:b}=u(f);if(h.def={...h.schema},b)h.defId=b;let v=h.schema;for(let k in v)delete v[k];v.$ref=_};if(t.cycles==="throw")for(let f of t.seen.entries()){let h=f[1];if(h.cycle)throw Error(`Cycle detected: #/${h.cycle?.join("/")}/<root>
|
|
53
|
+
|
|
54
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let f of t.seen.entries()){let h=f[1];if(o===f[0]){p(f);continue}if(t.external){let b=t.external.registry.get(f[0])?.id;if(o!==f[0]&&b){p(f);continue}}if(t.metadataRegistry.get(f[0])?.id){p(f);continue}if(h.cycle){p(f);continue}if(h.count>1){if(t.reused==="ref"){p(f);continue}}}if(t.external)t.sharedDefsExtractedFor=t.external}function As(t){let o=t.anyOf;if(!Array.isArray(o)||o.length===0||t.type!==void 0)return;let n=[];for(let c of o){if(!c||typeof c!=="object")return;As(c);let u=Object.keys(c);if(u.length!==1||u[0]!=="type")return;let p=c.type;for(let f of Array.isArray(p)?p:[p]){if(typeof f!=="string")return;if(!n.includes(f))n.push(f)}}delete t.anyOf,t.type=n.length===1?n[0]:n}var Ns=new Set(["type","properties","required","additionalProperties"]),Es=["oneOf","anyOf"];function Ts(t){let o=t.additionalProperties;if(o===void 0||o===!1||typeof o!=="object"||o===null)return null;return Object.keys(o).length?o:null}function lr(t){let o=[];for(let p of t){if(typeof p!=="object"||p.type!=="object")return null;for(let f in p)if(!Ns.has(f))return null;o.push(p)}let n={},c=new Set;for(let p of o){for(let f in p.properties){if(Object.prototype.hasOwnProperty.call(n,f))continue;let h=[];for(let b of o){let v=b.properties?.[f]??Ts(b);if(v===null||v===void 0)continue;if(!h.some((k)=>JSON.stringify(k)===JSON.stringify(v)))h.push(v)}let _=h.length===1?h[0]:lr(h)??{allOf:h};F(n,f,_)}for(let f of p.required??[])c.add(f)}let u={type:"object",properties:n};if(c.size)u.required=[...c];if(o.every((p)=>p.additionalProperties===!1))u.additionalProperties=!1;else{let p=[];for(let f of o){let h=Ts(f);if(h&&!p.some((_)=>JSON.stringify(_)===JSON.stringify(h)))p.push(h)}if(p.length===1)u.additionalProperties=p[0];else if(p.length>1)u.additionalProperties={allOf:p}}return u}function uu(t){let o=t.allOf;if(!Array.isArray(o)||o.length<2)return;for(let u of Ns)if(u in t)return;let n=o.filter((u)=>Es.some((p)=>Array.isArray(u[p]))),c=null;if(!n.length)c=lr(o);else{let u=n[0],p=Es.find((_)=>Array.isArray(u[_]));if(Object.keys(u).length!==1)return;let f=o.filter((_)=>_!==u),h=u[p].map((_)=>lr([...f,_]));if(h.some((_)=>!_))return;c={[p]:h}}if(!c)return;delete t.allOf,Ae(t,c)}function De(t,o){let n=t.seen.get(o);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let c=(h)=>{let _=t.seen.get(h);if(_.ref===null)return;let b=_.def??_.schema,v={...b},k=_.ref;if(_.ref=null,k){c(k);let P=t.seen.get(k),S=P.schema;if(S.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"))b.allOf=b.allOf??[],b.allOf.push(S);else Ae(b,S);if(Ae(b,v),h._zod.parent===k)for(let T in b){if(T==="$ref"||T==="allOf")continue;if(!(T in v))delete b[T]}if(S.$ref&&P.def)for(let T in b){if(T==="$ref"||T==="allOf")continue;if(T in P.def&&JSON.stringify(b[T])===JSON.stringify(P.def[T]))delete b[T]}}let Z=h._zod.parent;if(Z&&Z!==k){c(Z);let P=t.seen.get(Z);if(P?.schema.$ref){if(b.$ref=P.schema.$ref,P.def)for(let S in b){if(S==="$ref"||S==="allOf")continue;if(S in P.def&&JSON.stringify(b[S])===JSON.stringify(P.def[S]))delete b[S]}}}t.override({zodSchema:h,jsonSchema:b,path:_.path??[]})};if(!t.external||t.sharedEmitDoneFor!==t.external){for(let h of[...t.seen.entries()].reverse())c(h[0]);if(t.target!=="openapi-3.0")for(let h of t.seen.entries())As(h[1].def??h[1].schema);for(let h of t.deferred)h();if(t.intersections.length){let h=new Map;for(let _ of t.seen.values())for(let b of[_.schema,_.def]){let v=b?.allOf;if(!Array.isArray(v))continue;let k=h.get(v);if(k)k.push(b);else h.set(v,[b])}for(let _ of t.intersections)for(let b of h.get(_)??[])uu(b)}}let u={};if(t.target==="draft-2020-12")u.$schema="https://json-schema.org/draft/2020-12/schema";else if(t.target==="draft-07")u.$schema="http://json-schema.org/draft-07/schema#";else if(t.target==="draft-04")u.$schema="http://json-schema.org/draft-04/schema#";else if(t.target==="openapi-3.0");if(t.external?.uri){let h=t.external.registry.get(o)?.id;if(!h)throw Error("Schema is missing an `id` property");u.$id=t.external.uri(h)}Ae(u,n.defId?n.schema:n.def??n.schema);let p=t.metadataRegistry.get(o)?.id;if(p!==void 0&&u.id===p)delete u.id;let f=t.external?.defs??{};if(!t.external||t.sharedEmitDoneFor!==t.external)for(let h of t.seen.entries()){let _=h[1];if(_.def&&_.defId){if(_.def.id===_.defId)delete _.def.id;F(f,_.defId,_.def)}}if(t.external)t.sharedEmitDoneFor=t.external;if(t.external);else if(Object.keys(f).length>0)if(t.target==="draft-2020-12")u.$defs=f;else u.definitions=f;try{let h=JSON.parse(JSON.stringify(u));return Object.defineProperty(h,"~standard",{value:{...o["~standard"],jsonSchema:{input:Ce(o,"input",t.processors),output:Ce(o,"output",t.processors)}},enumerable:!1,writable:!1}),h}catch(h){throw Error("Error converting schema to JSON.")}}function K(t,o){let n=o??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let c=t._zod.def;if(c.type==="transform")return!0;if(c.type==="array")return K(c.element,n);if(c.type==="set")return K(c.valueType,n);if(c.type==="lazy")return K(c.getter(),n);if(c.type==="promise"||c.type==="optional"||c.type==="nonoptional"||c.type==="nullable"||c.type==="readonly"||c.type==="default"||c.type==="prefault"||c.type==="catch")return K(c.innerType,n);if(c.type==="intersection")return K(c.left,n)||K(c.right,n);if(c.type==="record"||c.type==="map")return K(c.keyType,n)||K(c.valueType,n);if(c.type==="pipe"){if(t._zod.traits.has("$ZodCodec"))return!0;return K(c.in,n)||K(c.out,n)}if(c.type==="object"){for(let u in c.shape)if(K(c.shape[u],n))return!0;return!1}if(c.type==="union"){for(let u of c.options)if(K(u,n))return!0;return!1}if(c.type==="tuple"){for(let u of c.items)if(K(u,n))return!0;if(c.rest&&K(c.rest,n))return!0;return!1}return!1}var Cs=(t,o={})=>(n)=>{let c=je({...n,processors:o});return j(t,c),Re(c,t),De(c,t)},Ce=(t,o,n={})=>(c)=>{let{libraryOptions:u,target:p}=c??{},f=je({...u??{},target:p,io:o,processors:n});return j(t,f),Re(f,t),De(f,t)};var au={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},dr=(t,o,n,c)=>{let u=n;u.type="string";let{minimum:p,maximum:f,format:h,patterns:_,contentEncoding:b,laxFormat:v}=t._zod.bag;if(typeof p==="number")u.minLength=p;if(typeof f==="number")u.maxLength=f;if(h){if(u.format=au[h]??h,u.format==="")delete u.format;if(h==="time"||v)delete u.format}if(b)u.contentEncoding=b;if(_&&_.size>0){let k=[..._];if(k.length===1)u.pattern=k[0].source;else if(k.length>1)u.allOf=[...k.map((Z)=>({...o.target==="draft-07"||o.target==="draft-04"||o.target==="openapi-3.0"?{type:"string"}:{},pattern:Z.source}))]}},mr=(t,o,n,c)=>{let u=n,{minimum:p,maximum:f,format:h,multipleOf:_,exclusiveMaximum:b,exclusiveMinimum:v}=t._zod.bag;if(typeof h==="string"&&h.includes("int"))u.type="integer";else u.type="number";let k=typeof v==="number"&&v>=(p??Number.NEGATIVE_INFINITY),Z=typeof b==="number"&&b<=(f??Number.POSITIVE_INFINITY),P=o.target==="draft-04"||o.target==="openapi-3.0";if(k)if(P)u.minimum=v,u.exclusiveMinimum=!0;else u.exclusiveMinimum=v;else if(typeof p==="number")u.minimum=p;if(Z)if(P)u.maximum=b,u.exclusiveMaximum=!0;else u.exclusiveMaximum=b;else if(typeof f==="number")u.maximum=f;if(typeof _==="number")if(Number.isFinite(_)&&_!==0)u.multipleOf=Math.abs(_);else U(t,o,u,c,`A multipleOf divisor of ${_} cannot be represented in JSON Schema`)},hr=(t,o,n,c)=>{n.type="boolean"},_r=(t,o,n,c)=>{U(t,o,n,c,"BigInt cannot be represented in JSON Schema")},Rs=(t,o,n,c)=>{U(t,o,n,c,"Symbols cannot be represented in JSON Schema")},gr=(t,o,n,c)=>{if(o.target==="openapi-3.0")n.type="string",n.nullable=!0,n.enum=[null];else n.type="null"},Ds=(t,o,n,c)=>{U(t,o,n,c,"Undefined cannot be represented in JSON Schema")},xr=(t,o,n,c)=>{U(t,o,n,c,"Void cannot be represented in JSON Schema")},yr=(t,o,n,c)=>{n.not={}},br=(t,o,n,c)=>{},zr=(t,o,n,c)=>{},vr=(t,o,n,c)=>{U(t,o,n,c,"Date cannot be represented in JSON Schema")},$r=(t,o,n,c)=>{let u=t._zod.def,p=Ue(u.entries);if(p.length===0){n.not={};return}if(p.every((f)=>typeof f==="number"))n.type="number";if(p.every((f)=>typeof f==="string"))n.type="string";n.enum=p},wr=(t,o,n,c)=>{let u=t._zod.def;if(u.values.length===0){n.not={};return}let p=[];for(let f of u.values)if(f===void 0){if(U(t,o,n,c,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof f==="bigint"){if(U(t,o,n,c,"BigInt literals cannot be represented in JSON Schema"))return;p.push(Number(f))}else p.push(f);if(p.length===0);else if(p.length===1){let f=p[0];if(n.type=f===null?"null":typeof f,o.target==="draft-04"||o.target==="openapi-3.0")n.enum=[f];else n.const=f}else{if(p.every((f)=>typeof f==="number"))n.type="number";if(p.every((f)=>typeof f==="string"))n.type="string";if(p.every((f)=>typeof f==="boolean"))n.type="boolean";if(p.every((f)=>f===null))n.type="null";n.enum=p}},Ls=(t,o,n,c)=>{U(t,o,n,c,"NaN cannot be represented in JSON Schema")},Fs=(t,o,n,c)=>{let u=n,p=t._zod.pattern;if(!p)throw Error("Pattern not found in template literal");u.type="string",u.pattern=p.source},Us=(t,o,n,c)=>{let u=n,p={type:"string",format:"binary",contentEncoding:"binary"},{minimum:f,maximum:h,mime:_}=t._zod.bag;if(f!==void 0)p.minLength=f;if(h!==void 0)p.maxLength=h;if(_)if(_.length===1)p.contentMediaType=_[0],Object.assign(u,p);else Object.assign(u,p),u.anyOf=_.map((b)=>({contentMediaType:b}));else Object.assign(u,p)},Ms=(t,o,n,c)=>{n.type="boolean"},kr=(t,o,n,c)=>{U(t,o,n,c,"Custom types cannot be represented in JSON Schema")},Js=(t,o,n,c)=>{U(t,o,n,c,"Function types cannot be represented in JSON Schema")},Zr=(t,o,n,c)=>{U(t,o,n,c,"Transforms cannot be represented in JSON Schema")},Bs=(t,o,n,c)=>{U(t,o,n,c,"Map cannot be represented in JSON Schema")},Vs=(t,o,n,c)=>{U(t,o,n,c,"Set cannot be represented in JSON Schema")},Pr=(t,o,n,c)=>{let u=n,p=t._zod.def,{minimum:f,maximum:h}=t._zod.bag;if(typeof f==="number")u.minItems=f;if(typeof h==="number")u.maxItems=h;u.type="array",u.items=j(p.element,o,{...c,path:[...c.path,"items"]})};function Le(t){let o=t._zod.def;if(o.type==="pipe"&&o.in._zod.traits.has("$ZodTransform"))return Le(o.out);if(o.type==="catch")return Le(o.innerType);return t._zod.optin}var Sr=(t,o,n,c)=>{let u=n,p=t._zod.def,f=p.shape;if(Object.getOwnPropertySymbols(f).length&&U(t,o,u,c,"Symbol keys cannot be represented in JSON Schema"))return;u.type="object",u.properties={};for(let v in f)F(u.properties,v,j(f[v],o,{...c,path:[...c.path,"properties",v]}));let _=new Set(Object.keys(f)),b=new Set([..._].filter((v)=>{let k=p.shape[v];if(o.io==="input")return Le(k)===void 0;else return k._zod.optout===void 0}));if(b.size>0)u.required=Array.from(b);if(p.catchall?._zod.def.type==="never")u.additionalProperties=!1;else if(!p.catchall){if(o.io==="output")u.additionalProperties=!1}else if(p.catchall)u.additionalProperties=j(p.catchall,o,{...c,path:[...c.path,"additionalProperties"]})},Or=(t,o,n,c)=>{let u=t._zod.def,p=u.inclusive===!1,f=u.options.map((h,_)=>j(h,o,{...c,path:[...c.path,p?"oneOf":"anyOf",_]}));if(p)n.oneOf=f;else n.anyOf=f},Ir=(t,o,n,c)=>{let u=t._zod.def,p=j(u.left,o,{...c,path:[...c.path,"allOf",0]}),f=j(u.right,o,{...c,path:[...c.path,"allOf",1]}),h=(b)=>("allOf"in b)&&Object.keys(b).length===1,_=[...h(p)?p.allOf:[p],...h(f)?f.allOf:[f]];n.allOf=_,o.intersections.push(_)},Er=(t,o,n,c)=>{let u=n,p=t._zod.def;u.type="array";let f=o.target==="draft-2020-12"?"prefixItems":"items",h=o.target==="draft-2020-12"?"items":o.target==="openapi-3.0"?"items":"additionalItems",_=p.items.map((E,T)=>j(E,o,{...c,path:[...c.path,f,T]})),b=p.rest?j(p.rest,o,{...c,path:[...c.path,h,...o.target==="openapi-3.0"?[p.items.length]:[]]}):null,v=p.items.length;while(v>0){let E=p.items[v-1];if(!(o.io==="input"?Le(E)!==void 0:E._zod.optout==="optional"))break;v--}let k=p.items.length,Z=!p.rest;if(o.target==="draft-2020-12"){if(u.prefixItems=_,Z)u.items=!1;else if(b)u.items=b;if(v>0)u.minItems=v;if(Z)u.maxItems=k}else if(o.target==="openapi-3.0"){if(u.items={anyOf:_},b)u.items.anyOf.push(b);if(v>0)u.minItems=v;if(Z)u.maxItems=k}else{if(u.items=_,Z)u.additionalItems=!1;else if(b)u.additionalItems=b;if(v>0)u.minItems=v;if(Z)u.maxItems=k}let{minimum:P,maximum:S}=t._zod.bag;if(typeof P==="number")u.minItems=P;if(typeof S==="number")u.maxItems=S};function pr(t,o,n){if(o.$ref){if(n.has(o))return o;n.add(o);let S=t.get(o)?.def;if(!S)return o;let E=pr(t,S,n);return E===S?o:E}for(let S of["anyOf","oneOf"]){let E=o[S];if(!Array.isArray(E))continue;let T=E.map((B)=>pr(t,B,n));if(T.some((B,Y)=>B!==E[Y]))o={...o,[S]:T}}let c=Array.isArray(o.type)?o.type:[o.type],u=!c.includes("string")&&c.some((S)=>S==="number"||S==="integer"),p=o.enum??(o.const!==void 0?[o.const]:void 0);if(!u&&!p?.some((S)=>typeof S==="number"))return o;let{minimum:f,maximum:h,exclusiveMinimum:_,exclusiveMaximum:b,multipleOf:v,format:k,id:Z,...P}=o;if(P.enum)P.enum=P.enum.map((S)=>typeof S==="number"?String(S):S);else if(typeof P.const==="number")P.const=String(P.const);if(!u)return P;if(P.type="string",!p)P.pattern=(c.includes("number")?Ie:Ge).source;return P}var fr=new WeakMap;function pu(t){let o=new Map;for(let c of t.seen.values())if(c.def&&!o.has(c.schema))o.set(c.schema,c);let n=new Map;for(let c of fr.get(t)??[]){let u=t.seen.get(c),p=(u?.def??u?.schema)?.propertyNames;if(!p||p===!0||n.has(p))continue;let f=pr(o,p,new Set);if(f!==p)n.set(p,f)}if(!n.size)return;for(let c of t.seen.values())for(let u of[c.schema,c.def]){let p=u&&n.get(u.propertyNames);if(p)u.propertyNames=p}}var Tr=(t,o,n,c)=>{let u=n,p=t._zod.def;u.type="object";let f=p.keyType,_=f._zod.bag?.patterns;if(p.mode==="loose"&&_&&_.size>0){let k=j(p.valueType,o,{...c,path:[...c.path,"patternProperties","*"]});u.patternProperties={};for(let Z of _)F(u.patternProperties,Z.source,k)}else{if(o.target==="draft-07"||o.target==="draft-2020-12"){u.propertyNames=j(p.keyType,o,{...c,path:[...c.path,"propertyNames"]});let k=fr.get(o);if(!k)k=[],fr.set(o,k),o.deferred.push(()=>pu(o));k.push(t)}u.additionalProperties=j(p.valueType,o,{...c,path:[...c.path,"additionalProperties"]})}let b=f._zod.values,v=o.io==="input"&&Le(p.valueType)!==void 0;if(b&&!p.partial&&!v){let k=[...b].filter((Z)=>typeof Z==="string"||typeof Z==="number");if(k.length>0)u.required=k.map(String)}},Ar=(t,o,n,c)=>{let u=t._zod.def,p=j(u.innerType,o,c),f=o.seen.get(t);if(o.target==="openapi-3.0")f.ref=u.innerType,n.nullable=!0;else n.anyOf=[p,{type:"null"}]},Cr=(t,o,n,c)=>{let u=t._zod.def;j(u.innerType,o,c);let p=o.seen.get(t);p.ref=u.innerType},jr=Symbol();function Ks(t,o,n,c,u){let p=!1,f=JSON.stringify(t,(h,_)=>{if(typeof _!=="bigint")return _;return p=!0,null});if(!p)return JSON.parse(f);return U(o,n,c,u,"BigInt defaults cannot be represented in JSON Schema"),jr}var Rr=(t,o,n,c)=>{let u=t._zod.def;j(u.innerType,o,c);let p=o.seen.get(t);p.ref=u.innerType;let f=Ks(u.defaultValue,t,o,n,c);if(f!==jr)n.default=f},Dr=(t,o,n,c)=>{let u=t._zod.def;j(u.innerType,o,c);let p=o.seen.get(t);if(p.ref=u.innerType,o.io!=="input")return;let f=Ks(u.defaultValue,t,o,n,c);if(f!==jr)n._prefault=f},Lr=(t,o,n,c)=>{let u=t._zod.def;j(u.innerType,o,c);let p=o.seen.get(t);p.ref=u.innerType;let f;try{f=u.catchValue(void 0)}catch{U(t,o,n,c,"Dynamic catch values are not supported in JSON Schema");return}n.default=f},Fr=(t,o,n,c)=>{let u=t._zod.def,p=u.in._zod.traits.has("$ZodTransform"),f=o.io==="input"?p?u.out:u.in:u.out;j(f,o,c);let h=o.seen.get(t);h.ref=f},Ur=(t,o,n,c)=>{let u=t._zod.def;j(u.innerType,o,c);let p=o.seen.get(t);p.ref=u.innerType,n.readOnly=!0},Ws=(t,o,n,c)=>{let u=t._zod.def;j(u.innerType,o,c);let p=o.seen.get(t);p.ref=u.innerType},it=(t,o,n,c)=>{let u=t._zod.def;j(u.innerType,o,c);let p=o.seen.get(t);p.ref=u.innerType},Mr=(t,o,n,c)=>{let u=t._zod.innerType;j(u,o,c);let p=o.seen.get(t);p.ref=u},js={string:dr,number:mr,boolean:hr,bigint:_r,symbol:Rs,null:gr,undefined:Ds,void:xr,never:yr,any:br,unknown:zr,date:vr,enum:$r,literal:wr,nan:Ls,template_literal:Fs,file:Us,success:Ms,custom:kr,function:Js,transform:Zr,map:Bs,set:Vs,array:Pr,object:Sr,union:Or,intersection:Ir,tuple:Er,record:Tr,nullable:Ar,nonoptional:Cr,default:Rr,prefault:Dr,catch:Lr,pipe:Fr,readonly:Ur,promise:Ws,optional:it,lazy:Mr};function Za(t,o){if("_idmap"in t){let c=t,u=je({...o,processors:js}),p={};for(let _ of c._idmap.entries()){let[b,v]=_;j(v,u)}let f={},h={registry:c,uri:o?.uri,defs:p};u.external=h;for(let _ of c._idmap.entries()){let[b,v]=_;Re(u,v),F(f,b,De(u,v))}if(Object.keys(p).length>0){let _=u.target==="draft-2020-12"?"$defs":"definitions";f.__shared={[_]:p}}return{schemas:f}}let n=je({...o,processors:js});return j(t,n),Re(n,t),De(n,t)}var Gs=new WeakSet([Object.prototype,Error.prototype]);function st(t,o,n){Object.defineProperty(t,o,{configurable:!0,enumerable:!1,get(){let c=n(this);return Object.defineProperty(this,o,{value:c,configurable:!0,writable:!0}),c},set(c){Object.defineProperty(this,o,{value:c,configurable:!0,writable:!0})}})}var yu=(t,o)=>{Da.init(t,o),t.name="ZodError";let n=Object.getPrototypeOf(t);if(Gs.has(n))return;Gs.add(n),st(n,"format",(c)=>(u)=>Zt(c,u)),st(n,"flatten",(c)=>(u)=>kt(c,u)),st(n,"addIssue",(c)=>(u)=>{c.issues.push(u),c.message=JSON.stringify(c.issues,ke,2)}),st(n,"addIssues",(c)=>(u)=>{c.issues.push(...u),c.message=JSON.stringify(c.issues,ke,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var q=w("ZodError",yu,void 0,{Parent:Error});var qs=Ke(q),Ys=We(q),iu=Se(q),lu=Oe(q),Xs=$o(q),Hs=wo(q),Qs=ko(q),ec=Zo(q),tc=Po(q),rc=So(q),oc=Oo(q),nc=Io(q);function zu(){if(!V.localeError)G(Kt())}function Fe(){if(!V.memoizer)G({memoizer:Vt()})}var C=w("ZodType",(t,o)=>(zu(),N.init(t,o),t.def=o,t.type=o.type,t),{check(...t){let o=this.def;return this.clone(ae(o,{checks:[...o.checks??[],...t.map((n)=>typeof n==="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,o){return H(this,t,o)},brand(){return this},register(t,o){return t.add(this,o),this},refine(t,o){return this.check(ua(t,o))},superRefine(t,o){return this.check(aa(t,o))},overwrite(t){return this.check(fe(t))},optional(){return xe(this)},exactOptional(){return Gu(this)},nullable(){return a(this)},nullish(){return xe(a(this))},nonoptional(t){return ea(this,t)},array(){return s(this)},or(t){return I([this,t])},and(t){return ia(this,t)},transform(t){return sc(this,_c(t))},default(t){return Xu(this,t)},prefault(t){return Qu(this,t)},catch(t){return ra(this,t)},pipe(t){return sc(this,t)},readonly(){return sa(this)},describe(t){let o=this.clone();return pe.add(o,{description:t}),o},meta(...t){if(t.length===0)return pe.get(this);let o=this.clone();return pe.add(o,t[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t,...o){return o.length===0?t(this):t(this,...o)},get "~standard"(){return yt(this,"~standard",{...Rt(this),jsonSchema:{input:Ce(this,"input"),output:Ce(this,"output")}})},set "~standard"(t){de(this,"~standard",t)},parse:function t(o,n){return qs(this,o,n,{callee:t})},parseAsync:async function t(o,n){return await Ys(this,o,n,{callee:t})},safeParse(t,o){return iu(this,t,o)},async safeParseAsync(t,o){return lu(this,t,o)},get spa(){return this?.safeParseAsync},set spa(t){de(this,"spa",t)},encode:function t(o,n){return Xs(this,o,n,{callee:t})},decode:function t(o,n){return Hs(this,o,n,{callee:t})},encodeAsync:async function t(o,n){return await Qs(this,o,n,{callee:t})},decodeAsync:async function t(o,n){return await ec(this,o,n,{callee:t})},safeEncode(t,o){return tc(this,t,o)},safeDecode(t,o){return rc(this,t,o)},async safeEncodeAsync(t,o){return oc(this,t,o)},async safeDecodeAsync(t,o){return nc(this,t,o)},toJSONSchema(t){return Cs(this,{})(t)},get description(){return pe.get(this)?.description},get _def(){return this._zod.def}}),cc=w("_ZodString",(t,o)=>{He.init(t,o),C.init(t,o),t._zod.processJSONSchema=(c,u,p)=>dr(t,c,u,p);let n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null},{regex(...t){return this.check(Qt(...t))},includes(...t){return this.check(rr(...t))},startsWith(...t){return this.check(or(...t))},endsWith(...t){return this.check(nr(...t))},min(...t){return this.check(ve(...t))},max(...t){return this.check(ot(...t))},length(...t){return this.check(nt(...t))},nonempty(...t){return this.check(ve(1,...t))},lowercase(t){return this.check(er(t))},uppercase(t){return this.check(tr(t))},trim(){return this.check(sr())},normalize(...t){return this.check(ir(...t))},toLowerCase(){return this.check(cr())},toUpperCase(){return this.check(ur())},slugify(){return this.check(ar())}}),Jr=w("ZodString",(t,o)=>{He.init(t,o),cc.init(t,o)},{email(t){return this.check(Wt(lc,t))},url(t){return this.check(Gt(pc,t))},jwt(t){return this.check(ps(Cu,t))},emoji(t){return this.check(Qi($u,t))},guid(t){return this.check(Gi(vu,t))},uuid(t){return this.check(qi(ct,t))},uuidv4(t){return this.check(Yi(ct,t))},uuidv6(t){return this.check(Xi(ct,t))},uuidv7(t){return this.check(Hi(ct,t))},nanoid(t){return this.check(es(wu,t))},cuid(t){return this.check(ts(ku,t))},cuid2(t){return this.check(rs(Zu,t))},ulid(t){return this.check(os(Pu,t))},base64(t){return this.check(us(Tu,t))},base64url(t){return this.check(as(Au,t))},xid(t){return this.check(ns(Su,t))},ksuid(t){return this.check(is(Ou,t))},ipv4(t){return this.check(qt(fc,t))},ipv6(t){return this.check(Yt(dc,t))},cidrv4(t){return this.check(ss(Iu,t))},cidrv6(t){return this.check(cs(Eu,t))},e164(t){return this.check(ls(Nu,t))},datetime(t){return this.check(tt(Br,t))},date(t){return this.check(rt(Vr,t))},time(t){return this.check(Xt(uc,t))},duration(t){return this.check(Ht(ac,t))}});function e(t){return Ki(Jr,t)}var L=w("ZodStringFormat",(t,o)=>{R.init(t,o),cc.init(t,o)}),Br=w("ZodISODateTime",(t,o)=>{Kn.init(t,o),L.init(t,o)}),Vr=w("ZodISODate",(t,o)=>{Wn.init(t,o),L.init(t,o)}),uc=w("ZodISOTime",(t,o)=>{Gn.init(t,o),L.init(t,o)}),ac=w("ZodISODuration",(t,o)=>{qn.init(t,o),L.init(t,o)}),lc=w("ZodEmail",(t,o)=>{Cn.init(t,o),L.init(t,o)});function ro(t){return Wt(lc,t)}var vu=w("ZodGUID",(t,o)=>{An.init(t,o),L.init(t,o)});var ct=w("ZodUUID",(t,o)=>{Nn.init(t,o),L.init(t,o)});var pc=w("ZodURL",(t,o)=>{Dn.init(t,o),L.init(t,o)});function La(t){return Gt(pc,t)}var $u=w("ZodEmoji",(t,o)=>{Ln.init(t,o),L.init(t,o)});var wu=w("ZodNanoID",(t,o)=>{Fn.init(t,o),L.init(t,o)});var ku=w("ZodCUID",(t,o)=>{Un.init(t,o),L.init(t,o)});var Zu=w("ZodCUID2",(t,o)=>{Mn.init(t,o),L.init(t,o)});var Pu=w("ZodULID",(t,o)=>{Jn.init(t,o),L.init(t,o)});var Su=w("ZodXID",(t,o)=>{Bn.init(t,o),L.init(t,o)});var Ou=w("ZodKSUID",(t,o)=>{Vn.init(t,o),L.init(t,o)});var fc=w("ZodIPv4",(t,o)=>{Yn.init(t,o),L.init(t,o)});function jl(t){return qt(fc,t)}var dc=w("ZodIPv6",(t,o)=>{Hn.init(t,o),L.init(t,o)});function Ld(t){return Yt(dc,t)}var Iu=w("ZodCIDRv4",(t,o)=>{Qn.init(t,o),L.init(t,o)});var Eu=w("ZodCIDRv6",(t,o)=>{oi.init(t,o),L.init(t,o)});var Tu=w("ZodBase64",(t,o)=>{ii.init(t,o),L.init(t,o)});var Au=w("ZodBase64URL",(t,o)=>{si.init(t,o),L.init(t,o)});var Nu=w("ZodE164",(t,o)=>{ci.init(t,o),L.init(t,o)});var Cu=w("ZodJWT",(t,o)=>{ui.init(t,o),L.init(t,o)});var at=w("ZodNumber",(t,o)=>{Dt.init(t,o),C.init(t,o),t._zod.processJSONSchema=(c,u,p)=>mr(t,c,u,p);let n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??0.5),t.isFinite=!0,t.format=n.format??null},{gt(t,o){return this.check(ze(t,o))},gte(t,o){return this.check(ce(t,o))},min(t,o){return this.check(ce(t,o))},lt(t,o){return this.check(be(t,o))},lte(t,o){return this.check(se(t,o))},max(t,o){return this.check(se(t,o))},int(t){return this.check(m(t))},safe(t){return this.check(m(t))},positive(t){return this.check(ze(0,t))},nonnegative(t){return this.check(ce(0,t))},negative(t){return this.check(be(0,t))},nonpositive(t){return this.check(se(0,t))},multipleOf(t,o){return this.check(Te(t,o))},step(t,o){return this.check(Te(t,o))},finite(){return this}});function i(t){return fs(at,t)}var ju=w("ZodNumberFormat",(t,o)=>{ai.init(t,o),at.init(t,o)});function m(t){return ms(ju,t)}var Kr=w("ZodBoolean",(t,o)=>{li.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>hr(t,n,c,u)});function d(t){return hs(Kr,t)}var mc=w("ZodBigInt",(t,o)=>{pi.init(t,o),C.init(t,o),t._zod.processJSONSchema=(c,u,p)=>_r(t,c,u,p);let n=t._zod.bag;t.minValue=n.minimum??null,t.maxValue=n.maximum??null,t.format=n.format??null},{gte(t,o){return this.check(ce(t,o))},min(t,o){return this.check(ce(t,o))},gt(t,o){return this.check(ze(t,o))},lt(t,o){return this.check(be(t,o))},lte(t,o){return this.check(se(t,o))},max(t,o){return this.check(se(t,o))},positive(t){return this.check(ze(BigInt(0),t))},negative(t){return this.check(be(BigInt(0),t))},nonpositive(t){return this.check(se(BigInt(0),t))},nonnegative(t){return this.check(ce(BigInt(0),t))},multipleOf(t,o){return this.check(Te(t,o))}});var Ru=w("ZodNull",(t,o)=>{fi.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>gr(t,n,c,u)});function no(t){return xs(Ru,t)}var Du=w("ZodAny",(t,o)=>{di.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>br(t,n,c,u)});function x(){return ys(Du)}var Lu=w("ZodUnknown",(t,o)=>{mi.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>zr(t,n,c,u)});function z(){return zs(Lu)}var Fu=w("ZodNever",(t,o)=>{hi.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>yr(t,n,c,u)});function Bd(t){return vs(Fu,t)}var Uu=w("ZodVoid",(t,o)=>{_i.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>xr(t,n,c,u)});function Ct(t){return $s(Uu,t)}var Wr=w("ZodDate",(t,o)=>{gi.init(t,o),C.init(t,o),t._zod.processJSONSchema=(c,u,p)=>vr(t,c,u,p),t.min=(c,u)=>t.check(ce(c,u)),t.max=(c,u)=>t.check(se(c,u));let n=t._zod.bag;t.minDate=n.minimum?new Date(n.minimum):null,t.maxDate=n.maximum?new Date(n.maximum):null});function X(t){return ws(Wr,t)}var Mu=w("ZodArray",(t,o)=>{Fe(),xi.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Pr(t,n,c,u),t.element=o.element},{min(t,o){return this.check(ve(t,o))},nonempty(t){return this.check(ve(1,t))},max(t,o){return this.check(ot(t,o))},length(t,o){return this.check(nt(t,o))},unwrap(){return this.element}});function s(t,o){return Zs(Mu,t,o)}var ei=w("ZodObject",(t,o)=>{Fe(),zi.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Sr(t,n,c,u),Ac(t,"shape",(n)=>n._zod.def.shape,!1)},{keyof(){return g(Object.keys(this._zod.def.shape))},catchall(t){return this.clone({...this._zod.def,catchall:t})},passthrough(){return this.clone({...this._zod.def,catchall:z()})},loose(){return this.clone({...this._zod.def,catchall:z()})},strict(){return this.clone({...this._zod.def,catchall:Bd()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(t){return kc(this,t)},safeExtend(t){return Zc(this,t)},merge(t){return Pc(this,t)},pick(t){return $c(this,t)},omit(t){return wc(this,t)},partial(...t){return po(ti,this,t[0])},exactPartial(...t){return po(gc,this,t[0],"exactPartial")},required(...t){return Sc(xc,this,t[0])}});function r(t,o){let n={type:"object",shape:t??{},...O(o)};return new ei(n)}function ne(t,o){return new ei({type:"object",shape:t,catchall:z(),...O(o)})}var hc=w("ZodUnion",(t,o)=>{Lt.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Or(t,n,c,u),t.options=o.options});function I(t,o){return new hc({type:"union",options:t,...O(o)})}var Ju=w("ZodDiscriminatedUnion",(t,o)=>{hc.init(t,o),vi.init(t,o)});function ee(t,o,n){return new Ju({type:"union",options:o,discriminator:t,...O(n)})}var Bu=w("ZodIntersection",(t,o)=>{$i.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Ir(t,n,c,u)});function ia(t,o){return new Bu({type:"intersection",left:t,right:o})}var Vu=w("ZodTuple",(t,o)=>{Fe(),wi.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Er(t,n,c,u)},{rest(t){return this.clone({...this._zod.def,rest:t})},partial(){let t=this._zod.def;if(t.checks?.length)throw Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...t,items:t.items.map((o)=>new ti({type:"optional",innerType:o}))})}});function bs(t,o,n){let c=o instanceof N,u=c?n:o;return new Vu({type:"tuple",items:t,rest:c?o:null,...O(u)})}var ic=w("ZodRecord",(t,o)=>{Fe(),ki.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Tr(t,n,c,u),t.keyType=o.keyType,t.valueType=o.valueType});function y(t,o,n){if(!o||!o._zod)return new ic({type:"record",keyType:e(),valueType:t,...O(o)});return new ic({type:"record",keyType:t,valueType:o,...O(n)})}var ut=w("ZodEnum",(t,o)=>{Zi.init(t,o),C.init(t,o),t._zod.processJSONSchema=(c,u,p)=>$r(t,c,u,p),t.enum=o.entries,t.options=Object.values(o.entries);let n=new Set(Object.keys(o.entries));t.extract=(c,u)=>{let p={};for(let f of c)if(n.has(f))p[f]=o.entries[f];else throw Error(`Key ${f} not found in enum`);return new ut({...o,checks:[],...O(u),entries:p})},t.exclude=(c,u)=>{let p={...o.entries};for(let f of c)if(n.has(f))delete p[f];else throw Error(`Key ${f} not found in enum`);return new ut({...o,checks:[],...O(u),entries:p})}});function g(t,o){let n=Array.isArray(t)?Object.fromEntries(t.map((c)=>[c,c])):t;return new ut({type:"enum",entries:n,...O(o)})}function Jt(t,o){return new ut({type:"enum",entries:t,...O(o)})}var Ku=w("ZodLiteral",(t,o)=>{Pi.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>wr(t,n,c,u),t.values=new Set(o.values),Object.defineProperty(t,"value",{get(){if(o.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return o.values[0]}})});function l(t,o){return new Ku({type:"literal",values:Array.isArray(t)?t:[t],...O(o)})}var Wu=w("ZodTransform",(t,o)=>{Fe(),Si.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Zr(t,n,c,u),t._zod.parse=(n,c)=>{if(c.direction==="backward")throw new Pe(t.constructor.name);n.addIssue=(p)=>{if(typeof p==="string")n.issues.push(_e(p,n.value,o));else{let f=p;if(f.fatal)f.continue=!1;if(f.code??(f.code="custom"),!("input"in f))f.input=n.value;f.inst??(f.inst=t),n.issues.push(_e(f))}};let u=o.transform(n.value,n);if(u instanceof Promise)return u.then((p)=>(n.value=p,n));return n.value=u,n}});function _c(t){return new Wu({type:"transform",transform:t})}var ti=w("ZodOptional",(t,o)=>{Ft.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>it(t,n,c,u),t.unwrap=()=>t._zod.def.innerType});function xe(t){return new ti({type:"optional",innerType:t})}var gc=w("ZodExactOptional",(t,o)=>{Oi.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>it(t,n,c,u),t.unwrap=()=>t._zod.def.innerType});function Gu(t){return new gc({type:"optional",innerType:t})}var qu=w("ZodNullable",(t,o)=>{Ii.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Ar(t,n,c,u),t.unwrap=()=>t._zod.def.innerType});function a(t){return new qu({type:"nullable",innerType:t})}var Yu=w("ZodDefault",(t,o)=>{Ei.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Rr(t,n,c,u),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function Xu(t,o){return new Yu({type:"default",innerType:t,get defaultValue(){return typeof o==="function"?o():_t(o)}})}var Hu=w("ZodPrefault",(t,o)=>{Ti.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Dr(t,n,c,u),t.unwrap=()=>t._zod.def.innerType});function Qu(t,o){return new Hu({type:"prefault",innerType:t,get defaultValue(){return typeof o==="function"?o():_t(o)}})}var xc=w("ZodNonOptional",(t,o)=>{Ai.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Cr(t,n,c,u),t.unwrap=()=>t._zod.def.innerType});function ea(t,o){return new xc({type:"nonoptional",innerType:t,...O(o)})}var ta=w("ZodCatch",(t,o)=>{Ni.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Lr(t,n,c,u),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function ra(t,o){return new ta({type:"catch",innerType:t,catchValue:typeof o==="function"?o:_o(o)})}var yc=w("ZodPipe",(t,o)=>{Ut.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Fr(t,n,c,u),t.in=o.in,t.out=o.out});function sc(t,o){return new yc({type:"pipe",in:t,out:o})}var oa=w("ZodPreprocess",(t,o)=>{yc.init(t,o),Ci.init(t,o)}),na=w("ZodReadonly",(t,o)=>{ji.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Ur(t,n,c,u),t.unwrap=()=>t._zod.def.innerType});function sa(t){return new na({type:"readonly",innerType:t})}var ca=w("ZodLazy",(t,o)=>{Ri.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>Mr(t,n,c,u),t.unwrap=()=>t._zod.def.getter()});function mt(t){return new ca({type:"lazy",getter:t})}var Gr=w("ZodCustom",(t,o)=>{Di.init(t,o),C.init(t,o),t._zod.processJSONSchema=(n,c,u)=>kr(t,n,c,u)});function dt(t,o){return Ps(Gr,t??(()=>!0),o)}function ua(t,o={}){return Ss(Gr,t,o)}function aa(t,o){return Os(t,o)}function cu(t,o={}){let n=new Gr({type:"custom",check:"custom",fn:(c)=>c instanceof t,abort:!0,...O(o)});return n._zod.bag.Class=t,n._zod.check=(c)=>{if(!(c.value instanceof t))c.issues.push({code:"invalid_type",expected:t.name,input:c.value,inst:n,path:[...n._zod.def.path??[]]})},n}function Ba(t){let o=mt(()=>I([e(t),i(),d(),no(),s(o),y(e(),o)]));return o}function ri(t,o){return new oa({type:"pipe",in:_c(t),out:o})}var la={};Ne(la,{bigint:()=>fa,boolean:()=>ql,date:()=>da,number:()=>Lp,string:()=>Zp});function Zp(t){return Wi(Jr,t)}function Lp(t){return ds(at,t)}function ql(t){return _s(Kr,t)}function fa(t){return gs(mc,t)}function da(t){return ks(Wr,t)}function J(t){return tt(Br,t)}function Zg(t){return rt(Vr,t)}export{Nr,Da,Zd,Za,iu,lu,e,ro,La,jl,Ld,i,m,d,no,x,z,Bd,Ct,X,s,ei,r,ne,I,ee,ia,bs,y,g,Jt,l,ti,xe,a,mt,dt,cu,Ba,ri,J,Zg,Zp,Lp,ql,la};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var f=-1/0,e=0;function a(n){if(globalThis.crypto?.getRandomValues){globalThis.crypto.getRandomValues(n);return}for(let i=0;i<n.length;i++)n[i]=Math.floor(Math.random()*256)}function Zi(){let n=new Uint8Array(16);a(n);let i=Date.now();if(i>f)e=n[6]*16777216+n[7]*65536+n[8]*256+n[9],f=i;else if(e=e+1>>>0,e===0)f++;let t=new Uint8Array(16);t[0]=f/1099511627776&255,t[1]=f/4294967296&255,t[2]=f/16777216&255,t[3]=f/65536&255,t[4]=f/256&255,t[5]=f&255,t[6]=112|e>>>28&15,t[7]=e>>>20&255,t[8]=128|e>>>14&63,t[9]=e>>>6&255,t[10]=(e&63)<<2|n[10]&3,t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15];let o=Array.from(t,(x)=>x.toString(16).padStart(2,"0"));return`${o.slice(0,4).join("")}-${o.slice(4,6).join("")}-${o.slice(6,8).join("")}-${o.slice(8,10).join("")}-${o.slice(10,16).join("")}`}
|
|
3
|
+
export{Zi};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D,N,h,O,v,u,Fn,C,B,t,o,Q,pu,mu,cr,nc,Is,io,zt,Do,hu,gu,Au,yu,oc,_u,L,U,ct,Ue,A,T,gr,Z,bt,_e,ur,Lt,Oe,E,ut,me,K,Et,yr,Ot,oe,er,S,Ce,Ee,Ie,Lg,Bg,BA,jA,qA,$d,hy,ym,Re,Zs,xm,x0,pc,Im,ya,Ko,Um,zm,Ab,yb,Jm,ev,ew,tw,Nw,Cf,Ef,Qw,ax,bh,yc,Jx,Uh,yS,bS,Df,wS,CS,Fh,IS,TS,jh,MS,kS,od,ad,sd,al,Ff,US,zS,FS,jS,id,ba,aC,yC,vC,ZC,jC,HC,GC,$C,QC,ig,VC,fd,kE,DE,VE,bg,rn,lp,AI,yI,xc,We,Ye,Je,Xe,et,tt,rt,nt,q,Tt,R,yn,hp,be,ht,gt,At,dl,Mr,Cd,St,kt,Pt,Ft,Mt}from"./chunk-6bhn1p8v.js";import{go,lr}from"./chunk-ehc9adfz.js";import{Tl}from"./chunk-k7hss0bd.js";import{xa,Io,vl,$s,vi,rs,wl}from"./chunk-v9w25rp2.js";import{bn,vn,wn,hr,_t,pt}from"./chunk-66hsjnw6.js";import"./chunk-1yacmegc.js";import"./chunk-r7dty1tg.js";import{Ln,Xn}from"./chunk-2yxj593j.js";C();function te(a,e){let s=new Set(e);return a.filter((i)=>!s.has(i))}var ae=class extends io{#r;#e;#o;#a;#t;#s;#i;#n;#l;#d=[];constructor(a,e,s){super();this.#r=a,this.#a=s,this.#o=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){if(this.listeners.size===1)this.#t.forEach((a)=>{a.subscribe((e)=>{this.#p(a,e)})})}onUnsubscribe(){if(!this.listeners.size)this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach((a)=>{a.destroy()})}setQueries(a,e){this.#o=a,this.#a=e,zt.batch(()=>{let s=this.#t,i=this.#u(this.#o);i.forEach((c)=>c.observer.setOptions(c.defaultedQueryOptions));let m=i.map((c)=>c.observer),r=m.map((c)=>c.getCurrentResult()),p=s.length!==m.length,f=m.some((c,x)=>c!==s[x]),g=p||f,y=g?!0:r.some((c,x)=>{let w=this.#e[x];return!w||!Is(c,w)});if(!g&&!y)return;if(g)this.#d=i,this.#t=m;if(this.#e=r,!this.hasListeners())return;if(g)te(s,m).forEach((c)=>{c.destroy()}),te(m,s).forEach((c)=>{c.subscribe((x)=>{this.#p(c,x)})});this.#f()})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map((a)=>a.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(a,e){let s=this.#u(a),i=s.map((r)=>r.observer.getOptimisticResult(r.defaultedQueryOptions)),m=s.map((r)=>r.defaultedQueryOptions.queryHash);return[i,(r)=>this.#c(r??i,e,m),()=>this.#m(i,s)]}#m(a,e){let s=new Set;return e.map((i,m)=>{let r=a[m];return!i.defaultedQueryOptions.notifyOnChangeProps?i.observer.trackResult(r,(p)=>{if(!s.has(p))s.add(p),e.forEach((f)=>{f.observer.trackProp(p)})}):r})}#c(a,e,s){if(e){let i=this.#l,m=s!==void 0&&i!==void 0&&(i.length!==s.length||s.some((r,p)=>r!==i[p]));if(this.#e!==this.#n||m||e!==this.#i){if(this.#i=e,this.#n=this.#e,s!==void 0)this.#l=s;this.#s=nc(this.#s,e(a))}return this.#s}return a}#g(){return!this.#a?.combine||this.#t.some((a,e)=>a.options.suspense&&this.#e[e]?.data===void 0)}#u(a){let e=new Map;this.#t.forEach((i)=>{let m=i.options.queryHash;if(!m)return;let r=e.get(m);if(r)r.push(i);else e.set(m,[i])});let s=[];return a.forEach((i)=>{let m=this.#r.defaultQueryOptions(i),r=e.get(m.queryHash)?.shift()??new Do(this.#r,m);s.push({defaultedQueryOptions:m,observer:r})}),s}#p(a,e){let s=this.#t.indexOf(a);if(s!==-1)this.#e=this.#e.slice(),this.#e[s]=e,this.#f()}#f(){if(this.hasListeners()){let a=this.#g(),e=this.#s,s=a?e:this.#c(this.#m(this.#e,this.#d),this.#a?.combine);if(a||e!==s)zt.batch(()=>{this.listeners.forEach((i)=>{i(this.#e)})})}}};C();function se({queries:a,...e},s){let i=Q(s),m=pu(),r=mu(),p=e.subscribed!==!1,f=O(()=>a.map((d)=>{let b=i.defaultQueryOptions(d);return b._optimisticResults=m?"isRestoring":p?"optimistic":void 0,b}),[a,i,m,p]);f.forEach((d)=>{yu(d);let b=i.getQueryCache().get(d.queryHash);hu(d,r,b)}),gu(r);let[g]=u(()=>new ae(i,f,e)),[y,c,x]=g.getOptimisticResult(f,e.combine),w=!m&&p;Fn(N((d)=>w?g.subscribe(zt.batchCalls(d)):cr,[g,w]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),h(()=>{g.setQueries(f,e)},[f,e,g]);let n=y.some((d,b)=>oc(f[b],d))?y.flatMap((d,b)=>{let k=f[b];if(k&&oc(k,d)){let M=new Do(i,k);return _u(k,M,r)}return[]}):[];if(n.length>0)throw Promise.all(n);let _=y.find((d,b)=>{let k=f[b];return k&&Au({result:d,errorResetBoundary:r,throwOnError:k.throwOnError,query:i.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(_)throw _.error;return c(x())}C();C();var ve=Object.defineProperty,F=(a,e)=>ve(a,"name",{value:e,configurable:!0}),X="Collapsible",[Ne,Qt]=ut(X),[ye,J]=Ne(X),we=D(F(function(e,s){let{__scopeCollapsible:i,open:m,defaultOpen:r,disabled:p,onOpenChange:f,...g}=e,[y,c]=Ot({prop:m,defaultProp:r??!1,onChange:f,caller:X});return t(ye,{scope:i,disabled:p,contentId:yr(),open:y,onOpenToggle:N(()=>c((x)=>!x),[c]),children:t(oe.div,{"data-state":G(y),"data-disabled":p?"":void 0,...g,ref:s})})},"Collapsible")),Te="CollapsibleTrigger",ke=D(F(function(e,s){let{__scopeCollapsible:i,...m}=e,r=J(Te,i);return t(oe.button,{type:"button","aria-controls":r.open?r.contentId:void 0,"aria-expanded":r.open||!1,"data-state":G(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...m,ref:s,onClick:K(e.onClick,r.onOpenToggle)})},"CollapsibleTrigger")),re="CollapsibleContent",Ae=D(F(function(e,s){let{forceMount:i,...m}=e,r=J(re,e.__scopeCollapsible);return t(er,{present:i||r.open,children:({present:p})=>t(qe,{...m,ref:s,present:p})})},"CollapsibleContent")),qe=D(F(function(e,s){let{__scopeCollapsible:i,present:m,children:r,...p}=e,f=J(re,i),[g,y]=u(m),c=v(null),x=me(s,c),w=v(0),n=w.current,_=v(0),d=_.current,b=f.open||g,k=v(b),M=v(void 0);return h(()=>{let P=requestAnimationFrame(()=>k.current=!1);return()=>cancelAnimationFrame(P)},[]),Et(()=>{let P=c.current;if(P){M.current=M.current||{transitionDuration:P.style.transitionDuration,animationName:P.style.animationName},P.style.transitionDuration="0s",P.style.animationName="none";let z=P.getBoundingClientRect();if(w.current=z.height,_.current=z.width,!k.current)P.style.transitionDuration=M.current.transitionDuration,P.style.animationName=M.current.animationName;y(m)}},[f.open,m]),t(oe.div,{"data-state":G(f.open),"data-disabled":f.disabled?"":void 0,id:f.contentId,hidden:!b,...p,ref:x,style:{["--radix-collapsible-content-height"]:n?`${n}px`:void 0,["--radix-collapsible-content-width"]:d?`${d}px`:void 0,...e.style},children:b&&r})},"CollapsibleContentImpl"));function G(a){return a?"open":"closed"}F(G,"getState");var De=we;var Se=[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V3",key:"1lcnhd"}],["path",{d:"M19 21V9",key:"unv183"}]],ie=T("chart-no-axes-column",Se);var He=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Y=T("funnel",He);var Qe=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],j=T("messages-square",Qe);function ne({teamId:a}){let[e,s]=u("team"),[i,m]=u("1h"),{data:r,isLoading:p}=L({queryKey:["teams",a,"ai-usage",i,"team"],queryFn:async()=>{let d=await A.api.teams[":teamId"]["ai-usage"].$get({param:{teamId:a},query:{timeframe:i}});if(!d.ok)throw Error("Failed to fetch team AI usage");return await d.json()},enabled:!!a&&e==="team"}),{data:f,isLoading:g}=L({queryKey:["teams",a,"members"],queryFn:async()=>{let d=await A.api.teams[":teamId"].members.$get({param:{teamId:a},query:{}});if(!d.ok)throw Error("Failed to fetch team members");return await d.json()},enabled:!!a&&e==="members"}),y=se({queries:(f||[]).map((d)=>({queryKey:["teams",a,"ai-usage",i,d.id],queryFn:async()=>{let b=await A.api.teams[":teamId"]["ai-usage"].$get({param:{teamId:a},query:{timeframe:i,userId:d.id}});if(!b.ok)throw Error(`Failed to fetch AI usage for member ${d.id}`);return await b.json()},enabled:!!a&&e==="members"}))}),c=g||y.some((d)=>d.isLoading),x=(d)=>{if(!d)return"U";let b=d.split(" ");if(b.length>1)return`${b[0][0]}${b[b.length-1][0]}`.toUpperCase();return d.substring(0,2).toUpperCase()},w=(d)=>{if(!d)return"";switch(d.toLowerCase()){case"owner":return yc();case"editor":return ya();case"reviewer":return ba();default:return d}},n=(d)=>(d??0).toLocaleString(),_=(d)=>`$${(d??0).toFixed(6)}`;return o(St,{className:"border-border/60 shadow-sm",children:[o(kt,{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between pb-6",children:[o("div",{children:[t(Pt,{className:"text-xl font-semibold tracking-tight",children:jA()}),t(Ft,{className:"text-sm text-muted-foreground mt-1",children:qA()})]}),o("div",{className:"flex flex-wrap items-center gap-3",children:[o(go,{type:"single",value:e,onValueChange:(d)=>{if(d)s(d)},className:"border rounded-lg p-1 bg-muted/30",children:[t(lr,{value:"team",className:"px-3 py-1.5 text-xs font-medium",children:DE()}),t(lr,{value:"members",className:"px-3 py-1.5 text-xs font-medium",children:tw()})]}),o(go,{type:"single",value:i,onValueChange:(d)=>{if(d)m(d)},className:"border rounded-lg p-1 bg-muted/30",children:[t(lr,{value:"1h",className:"px-2.5 py-1.5 text-xs font-medium",children:"1h"}),t(lr,{value:"24h",className:"px-2.5 py-1.5 text-xs font-medium",children:"24h"}),t(lr,{value:"7d",className:"px-2.5 py-1.5 text-xs font-medium",children:"7d"}),t(lr,{value:"30d",className:"px-2.5 py-1.5 text-xs font-medium",children:"30d"})]})]})]}),t(Mt,{children:e==="team"?p?t("div",{className:"flex h-48 items-center justify-center",children:t(Z,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):t("div",{className:"rounded-md border",children:o(bn,{children:[t(vn,{children:o(hr,{children:[t(_t,{children:fd()}),t(_t,{className:"text-right",children:Jm()}),t(_t,{className:"text-right",children:bh()}),t(_t,{className:"text-right",children:ym()}),t(_t,{className:"text-right",children:bg()}),t(_t,{className:"text-right",children:xm()})]})}),t(wn,{children:o(hr,{children:[t(pt,{className:"font-medium",children:fd()}),t(pt,{className:"text-right",children:n(r?.team?.inputTokens)}),t(pt,{className:"text-right",children:n(r?.team?.outputTokens)}),t(pt,{className:"text-right",children:n(r?.team?.cacheReadTokens)}),t(pt,{className:"text-right font-medium",children:n(r?.team?.totalTokens)}),t(pt,{className:"text-right font-medium",children:_(r?.team?.cost)})]})})]})}):c?t("div",{className:"flex h-48 items-center justify-center",children:t(Z,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):t("div",{className:"rounded-md border",children:o(bn,{children:[t(vn,{children:o(hr,{children:[t(_t,{children:ew()}),t(_t,{children:aC()}),t(_t,{className:"text-right",children:Jm()}),t(_t,{className:"text-right",children:bh()}),t(_t,{className:"text-right",children:ym()}),t(_t,{className:"text-right",children:bg()}),t(_t,{className:"text-right",children:xm()})]})}),t(wn,{children:(f||[]).map((d,b)=>{let k=y[b]?.data?.member;return o(hr,{children:[t(pt,{children:o("div",{className:"flex items-center gap-3",children:[o(Ce,{className:"h-8 w-8 rounded-full",children:[d.image&&t(Ee,{src:d.image,alt:d.name,className:"object-cover"}),t(Ie,{className:"bg-primary/20 text-xs",children:x(d.name)})]}),o("div",{className:"flex flex-col",children:[t("span",{className:"text-sm font-medium leading-none",children:d.name}),t("span",{className:"text-xs text-muted-foreground mt-0.5",children:d.email})]})]})}),t(pt,{className:"text-xs text-muted-foreground",children:w(d.role)}),t(pt,{className:"text-right",children:n(k?.inputTokens)}),t(pt,{className:"text-right",children:n(k?.outputTokens)}),t(pt,{className:"text-right",children:n(k?.cacheReadTokens)}),t(pt,{className:"text-right font-medium",children:n(k?.totalTokens)}),t(pt,{className:"text-right font-medium",children:_(k?.cost)})]},d.id)})})]})})})]})}C();function le({teamId:a}){let[e,s]=u(null),{ref:i,inView:m}=Tt(),{data:r,isLoading:p,isError:f,fetchNextPage:g,hasNextPage:y,isFetchingNextPage:c}=ct({queryKey:["teams",a,"agent-sessions"],queryFn:async({pageParam:n})=>{let _=await A.api.teams[":teamId"]["agent-sessions"].$get({param:{teamId:a},query:{first:"20",after:n?String(n):void 0}});if(!_.ok)throw Error("Failed to fetch agent sessions");return await _.json()},initialPageParam:"",getNextPageParam:(n)=>n.pageInfo.cursor||void 0,enabled:!!a});h(()=>{if(m&&y&&!c)g()},[m,y,c,g]);let x=r?.pages.flatMap((n)=>n.data).filter((n)=>n.id!=="pending")||[],w=(n)=>{switch(n){case"comment":return t(be,{variant:"outline",className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20",children:$C()});case"chat":return t(be,{variant:"outline",className:"bg-violet-500/10 text-violet-600 dark:text-violet-400 border-violet-500/20",children:GC()});case"naming":return t(be,{variant:"outline",className:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",children:QC()});default:return t(be,{variant:"outline",className:"bg-muted text-muted-foreground border-border",children:n})}};return o("div",{className:"space-y-6",children:[o(St,{className:"border border-border/50 shadow-xs",children:[t(kt,{className:"pb-4",children:t("div",{className:"flex items-center justify-between",children:o("div",{children:[o(Pt,{className:"text-xl font-bold flex items-center gap-2",children:[t(j,{className:"w-5 h-5 text-violet-500"}),ig()]}),t(Ft,{className:"mt-1 text-sm text-muted-foreground",children:VC()})]})})}),t(Mt,{children:p?t("div",{className:"flex h-64 items-center justify-center",children:t(Z,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):f?t("div",{className:"flex h-64 items-center justify-center text-destructive",children:"Failed to load agent sessions."}):x.length===0?o("div",{className:"flex flex-col items-center justify-center py-12 text-center text-muted-foreground",children:[t(j,{className:"w-10 h-10 text-muted-foreground/40 mb-3"}),t("p",{className:"text-base font-medium",children:Qw()})]}):o("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[o(bn,{children:[t(vn,{className:"bg-muted/40",children:o(hr,{children:[t(_t,{children:jC()}),t(_t,{children:pc()}),t(_t,{children:HC()}),t(_t,{className:"text-right",children:x0()})]})}),t(wn,{children:x.map((n)=>o(hr,{onClick:()=>s(n.id),className:"cursor-pointer hover:bg-muted/50 transition-colors",children:[t(pt,{className:"font-medium",children:o("div",{className:"flex flex-col",children:[t("span",{className:"text-sm font-semibold text-foreground",children:n.name||lp()}),t("span",{className:"text-xs font-mono text-muted-foreground/70",children:n.id})]})}),t(pt,{children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{className:"h-6 w-6",children:[t(Ee,{src:n.creator?.image||void 0}),t(Ie,{className:"text-[10px]",children:n.creator?.name?.[0]?.toUpperCase()||"?"})]}),t("span",{className:"text-sm text-foreground/90",children:n.creator?.name||"System / Agent"})]})}),t(pt,{children:w(n.type)}),t(pt,{className:"text-right text-xs text-muted-foreground",children:yn(n.createdAt)})]},n.id))})]}),t("div",{ref:i,className:"py-4 flex justify-center",children:c&&t(Z,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})})]}),t(Tl,{sessionId:e,open:!!e,onOpenChange:(n)=>{if(!n)s(null)}})]})}C();function de({...a}){return t(De,{"data-slot":"collapsible",...a})}function ce({...a}){return t(ke,{"data-slot":"collapsible-trigger",...a})}function ue({...a}){return t(Ae,{"data-slot":"collapsible-content",...a})}function ee(a){switch(a.toLowerCase()){case"owner":return yc();case"editor":return ya();case"reviewer":return ba();default:return a}}function Le(a,e){if(typeof a==="object"&&a!==null&&"message"in a){let s=a.message;if(typeof s==="string")return s}return e}function Be({rule:a}){let e=a.resourceData??{};if(a.resource==="agent_mcp_call_count")return t("span",{children:zS({value:String(e.id??"")})});if(a.resource==="agent_bash_call_count")return t("span",{children:US({value:String(e.match??"*")})});if(a.resource==="agent_tool_call_count")return t("span",{children:FS({value:String(e.name??e.toolName??"*")})});return null}function Me({rule:a}){if(a.scopeMode==="all_members")return o(be,{variant:"secondary",className:"gap-1 text-xs",children:[t(Xn,{className:"h-3 w-3"}),o("span",{children:[od(),a.role?` (${ee(a.role)})`:` (${al()})`]})]});if(a.scopeMode==="each_member")return o(be,{variant:"secondary",className:"gap-1 text-xs",children:[t(Ln,{className:"h-3 w-3"}),o("span",{children:[ad(),a.role?` (${ee(a.role)})`:` (${al()})`]})]});return o(be,{variant:"secondary",className:"gap-1 text-xs",children:[t($s,{className:"h-3 w-3"}),o("span",{children:[sd()," (",a.userIds?.length||0,")"]})]})}function Fe({teamId:a,rule:e,record:s}){let i=Q(),[m,r]=u(!1),[p,f]=u(()=>new Date),g=vi[e.resource],y=e.scopeMode==="all_members",c=s.percent>=100,x=y?e.role?`${kS()}: ${ee(e.role)}`:jS():s.user?.name||s.userId||rn();h(()=>{if(!s.isWindowActive||!s.periodEnd)return;let n=window.setInterval(()=>f(new Date),60000);return()=>window.clearInterval(n)},[s.isWindowActive,s.periodEnd]);let w=U({mutationFn:async()=>{let n=await A.api.teams[":teamId"].quotas[":id"].records.reset.$post({param:{teamId:a,id:e.id},json:{userId:s.userId??null}});if(!n.ok){let _=await n.json().catch(()=>null);throw Error(Le(_,zm()))}return await n.json()},onSuccess:()=>{i.invalidateQueries({queryKey:["teams",a,"quotas",e.id,"records"]}),i.invalidateQueries({queryKey:["teams",a,"quotas"]}),r(!1),R.success(TS())},onError:(n)=>{let _=n instanceof Error?n.message:zm();r(!1),R.error(_)}});return o(B,{children:[o("div",{className:"space-y-3 rounded-xl border border-border/70 bg-card p-4 text-card-foreground shadow-2xs",children:[o("div",{className:"flex items-center justify-between gap-3",children:[o("div",{className:"flex min-w-0 items-center gap-3",children:[y?t("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t(Xn,{className:"h-5 w-5"})}):o(Ce,{className:"h-9 w-9 shrink-0 border border-border/50",children:[t(Ee,{src:s.user?.image||void 0}),t(Ie,{className:"text-xs font-semibold",children:s.user?.name?.[0]?.toUpperCase()||"U"})]}),o("div",{className:"min-w-0",children:[t("div",{className:"truncate text-sm font-semibold text-foreground",children:x}),!y&&s.user?.email&&t("div",{className:"truncate text-xs text-muted-foreground",children:s.user.email})]})]}),o("div",{className:"flex shrink-0 items-center gap-2",children:[s.isWindowActive&&s.periodEnd?o(be,{variant:"outline",className:"hidden gap-1 border-primary/30 bg-primary/5 text-xs text-primary sm:flex",children:[t(ur,{className:"h-3 w-3"}),t("span",{children:Fh({time:hp(s.periodEnd,p)})})]}):o(be,{variant:"secondary",className:"hidden gap-1 text-xs text-muted-foreground sm:flex",children:[t(gr,{className:"h-3 w-3 text-primary"}),t("span",{children:Uh()})]}),o(S,{type:"button",variant:"outline",size:"sm",className:"gap-1.5",onClick:()=>r(!0),disabled:w.isPending,children:[w.isPending?t(Z,{className:"h-3.5 w-3.5 animate-spin"}):t(xa,{className:"h-3.5 w-3.5"}),jh()]})]})]}),o("div",{className:"space-y-1.5 pt-1",children:[t(Cd,{value:Math.min(100,Math.max(0,s.percent)),className:"h-2"}),o("div",{className:"flex items-center justify-between gap-2 text-xs font-medium",children:[o("span",{className:c?"font-bold text-destructive":"text-foreground",children:[rs(e.resource,s.consumed)," /"," ",rs(e.resource,e.limit)," ",g?.unit]}),o("span",{className:c?"font-bold text-destructive":"text-muted-foreground",children:[s.percent,"%"]})]})]}),o("div",{className:"flex items-center justify-between gap-2 text-xs text-muted-foreground sm:hidden",children:[s.isWindowActive&&s.periodEnd?o("span",{className:"flex items-center gap-1 text-primary",children:[t(ur,{className:"h-3 w-3"}),Fh({time:hp(s.periodEnd,p)})]}):o("span",{className:"flex items-center gap-1",children:[t(gr,{className:"h-3 w-3 text-primary"}),Uh()]}),o("span",{children:[IS(),": ",rs(e.resource,s.remaining)," ",g?.unit]})]})]}),t(We,{open:m,onOpenChange:r,children:o(Ye,{children:[o(Je,{children:[t(et,{children:jh()}),t(tt,{children:MS({target:x})})]}),o(Xe,{children:[t(nt,{disabled:w.isPending,children:Re()}),o(rt,{onClick:(n)=>{n.preventDefault(),w.mutate()},disabled:w.isPending,children:[w.isPending&&t(Z,{className:"mr-2 h-4 w-4 animate-spin"}),Zs()]})]})]})})]})}function je({teamId:a,rule:e}){let[s,i]=u(!1),[m,r]=u(""),p=vi[e.resource],f=p?.icon||Io,{data:g,isLoading:y,isError:c}=L({queryKey:["teams",a,"quotas",e.id,"records"],queryFn:async()=>{let n=await A.api.teams[":teamId"].quotas[":id"].records.$get({param:{teamId:a,id:e.id}});if(!n.ok)throw Error(Um());return await n.json()},enabled:s,refetchInterval:s?1e4:!1}),x=g?.records??[],w=x.filter((n)=>{if(!m.trim())return!0;let _=m.toLowerCase();return n.user?.name.toLowerCase().includes(_)||n.user?.email.toLowerCase().includes(_)});return o(de,{open:s,onOpenChange:i,className:"rounded-xl border border-border/70",children:[t(ce,{asChild:!0,children:o("button",{type:"button","aria-label":s?yS():wS(),className:"flex w-full items-center justify-between gap-4 p-4 text-left transition-colors hover:bg-muted/40",children:[o("div",{className:"flex min-w-0 items-start gap-3",children:[t("div",{className:"mt-0.5 rounded-lg bg-primary/10 p-2 text-primary",children:t(f,{className:"h-5 w-5"})}),o("div",{className:"min-w-0",children:[o("div",{className:"flex flex-wrap items-center gap-2",children:[t("span",{className:"font-semibold text-foreground",children:p?.label()||e.resource}),!e.enabled&&t(be,{variant:"secondary",children:Df()})]}),o("div",{className:"mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground",children:[t(Me,{rule:e}),o(be,{variant:"outline",className:"gap-1 text-xs",children:[t(ur,{className:"h-3 w-3"}),rs(e.resource,e.limit)," ",p?.unit," /"," ",wl(e.period)]}),t(Be,{rule:e})]})]})]}),t(_e,{className:`h-5 w-5 shrink-0 text-muted-foreground transition-transform ${s?"rotate-180":""}`})]})}),t(ue,{children:o("div",{className:"space-y-3 border-t border-border/60 bg-muted/10 p-4",children:[e.scopeMode!=="all_members"&&x.length>3&&o("div",{className:"relative",children:[t(Lt,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),t(q,{value:m,onChange:(n)=>r(n.target.value),placeholder:Ff(),className:"h-9 pl-9 text-sm"})]}),y?t("div",{className:"flex justify-center py-10",children:t(Z,{className:"h-7 w-7 animate-spin text-primary"})}):c?t("div",{className:"py-8 text-center text-sm text-destructive",children:Um()}):w.length===0?t("div",{className:"py-8 text-center text-sm text-muted-foreground",children:CS()}):w.map((n,_)=>t(Fe,{teamId:a,rule:e,record:n},n.id||n.userId||`record-${_}`))]})})]})}function pe({teamId:a}){let{data:e,isLoading:s,isError:i}=L({queryKey:["teams",a,"quotas"],queryFn:async()=>{let r=await A.api.teams[":teamId"].quotas.$get({param:{teamId:a}});if(!r.ok)throw Error(Ko());return await r.json()},enabled:!!a}),m=e?.rules??[];return o(St,{className:"border-border/60 shadow-sm",children:[o(kt,{children:[o(Pt,{className:"flex items-center gap-2 text-xl font-semibold tracking-tight",children:[t(Io,{className:"h-5 w-5 text-primary"}),id()]}),t(Ft,{children:bS()})]}),t(Mt,{children:s?t("div",{className:"flex h-48 items-center justify-center",children:t(Z,{className:"h-7 w-7 animate-spin text-muted-foreground"})}):i?t("div",{className:"py-10 text-center text-sm text-destructive",children:Ko()}):m.length===0?o("div",{className:"flex flex-col items-center justify-center rounded-xl border-2 border-dashed border-border py-12 text-center",children:[t(Io,{className:"mb-3 h-10 w-10 text-muted-foreground/50"}),t("p",{className:"text-base font-medium text-foreground",children:Ef()}),t("p",{className:"mt-1 max-w-md text-sm text-muted-foreground",children:Cf()})]}):t("div",{className:"space-y-3",children:m.map((r)=>t(je,{teamId:a,rule:r},r.id))})})]})}C();var $e=Object.values(dl);function fe({teamId:a}){let[e,s]=u([]),[i,m]=u([]),[r,p]=u(""),{ref:f,inView:g}=Tt(),{data:y}=L({queryKey:["teams",a,"members"],queryFn:async()=>{let l=await A.api.teams[":teamId"].members.$get({param:{teamId:a},query:{}});if(!l.ok)return[];return await l.json()},enabled:!!a}),c=y||[],{data:x,isLoading:w,isError:n,fetchNextPage:_,hasNextPage:d,isFetchingNextPage:b}=ct({queryKey:["teams",a,"audit-logs",e,i,r],queryFn:async({pageParam:l})=>{let I=await A.api.teams[":teamId"]["audit-logs"].$get({param:{teamId:a},query:{first:"20",after:l?String(l):void 0,actions:e.length>0?e:void 0,userIds:i.length>0?i:void 0,itemId:r.trim()||void 0}});if(!I.ok)throw Error("Failed to fetch audit logs");return await I.json()},initialPageParam:"",getNextPageParam:(l)=>l.pageInfo.endCursor||void 0,enabled:!!a});h(()=>{if(g&&d&&!b)_()},[g,d,b,_]);let k=x?.pages.flatMap((l)=>l.nodes)||[],M=x?.pages[0]?.total??0,P=(l)=>{s((I)=>I.includes(l)?I.filter((H)=>H!==l):[...I,l])},z=(l)=>{m((I)=>I.includes(l)?I.filter((H)=>H!==l):[...I,l])},ge=(l)=>{if(l.includes("delete")||l.includes("remove")||l.includes("revoke"))return t(be,{variant:"outline",className:"bg-destructive/10 text-destructive border-destructive/20 font-mono text-xs",children:l});if(l.includes("create")||l.includes("add"))return t(be,{variant:"outline",className:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20 font-mono text-xs",children:l});if(l.includes("update")||l.includes("reparent")||l.includes("copy"))return t(be,{variant:"outline",className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20 font-mono text-xs",children:l});return t(be,{variant:"outline",className:"bg-muted text-muted-foreground border-border font-mono text-xs",children:l})},he=new Map(c.map((l)=>[l.userId||l.id,l]));return t("div",{className:"space-y-6",children:o(St,{className:"border border-border/50 shadow-xs",children:[o(kt,{className:"pb-4",children:[o("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[o("div",{children:[o(Pt,{className:"text-xl font-bold flex items-center gap-2",children:[t(xa,{className:"h-5 w-5 text-primary"}),$d()]}),t(Ft,{className:"mt-1",children:hy()})]}),M>0&&o(be,{variant:"secondary",className:"w-fit text-xs font-normal",children:[M," ",$d()]})]}),o("div",{className:"mt-4 flex flex-wrap items-center gap-3 pt-4 border-t border-border/40",children:[o(ht,{children:[t(gt,{asChild:!0,children:o(S,{variant:"outline",size:"sm",className:"h-9 gap-2 text-xs border-dashed",children:[t(Y,{className:"h-3.5 w-3.5"}),Ab(),e.length>0&&t(be,{variant:"secondary",className:"ml-1 px-1.5 py-0 text-[10px]",children:e.length})]})}),o(At,{className:"w-64 p-2",align:"start",children:[t("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1 mb-1",children:vC()}),t("div",{className:"max-h-60 overflow-y-auto space-y-1 pr-1",children:$e.map((l)=>o("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-accent rounded-md cursor-pointer text-xs",children:[t(Mr,{checked:e.includes(l),onCheckedChange:()=>P(l)}),t("span",{className:"font-mono",children:l})]},l))}),e.length>0&&t(S,{variant:"ghost",size:"sm",className:"w-full mt-2 h-7 text-xs text-muted-foreground hover:text-foreground",onClick:()=>s([]),children:"Clear Actions"})]})]}),o(ht,{children:[t(gt,{asChild:!0,children:o(S,{variant:"outline",size:"sm",className:"h-9 gap-2 text-xs border-dashed",children:[t(Y,{className:"h-3.5 w-3.5"}),yb(),i.length>0&&t(be,{variant:"secondary",className:"ml-1 px-1.5 py-0 text-[10px]",children:i.length})]})}),o(At,{className:"w-64 p-2",align:"start",children:[t("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1 mb-1",children:ZC()}),t("div",{className:"max-h-60 overflow-y-auto space-y-1 pr-1",children:c.map((l)=>{let I=l.userId||l.user?.id||l.id,H=l.user?.name||l.name||I,W=l.user?.image||l.image;return o("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-accent rounded-md cursor-pointer text-xs",children:[t(Mr,{checked:i.includes(I),onCheckedChange:()=>z(I)}),o(Ce,{className:"h-5 w-5",children:[t(Ee,{src:W||void 0}),t(Ie,{className:"text-[10px]",children:H.slice(0,2).toUpperCase()})]}),t("span",{className:"truncate",children:H})]},I)})}),i.length>0&&t(S,{variant:"ghost",size:"sm",className:"w-full mt-2 h-7 text-xs text-muted-foreground hover:text-foreground",onClick:()=>m([]),children:"Clear Users"})]})]}),o("div",{className:"relative flex-1 min-w-[200px] max-w-xs",children:[t(Lt,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),t(q,{type:"text",placeholder:yC(),value:r,onChange:(l)=>p(l.target.value),className:"pl-8 pr-8 h-9 text-xs"}),r&&t("button",{onClick:()=>p(""),className:"absolute right-2.5 top-2.5 text-muted-foreground hover:text-foreground",children:t(Oe,{className:"h-4 w-4"})})]}),(e.length>0||i.length>0||r)&&t(S,{variant:"ghost",size:"sm",className:"h-9 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>{s([]),m([]),p("")},children:"Clear all"})]})]}),o(Mt,{className:"p-0",children:[w?t("div",{className:"flex h-64 items-center justify-center",children:t(Z,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):n?t("div",{className:"p-8 text-center text-sm text-destructive",children:"Failed to load audit logs."}):k.length===0?t("div",{className:"p-12 text-center text-sm text-muted-foreground",children:Nw()}):o(bn,{children:[t(vn,{children:o(hr,{className:"hover:bg-transparent border-b border-border/50",children:[t(_t,{className:"w-[180px] text-xs font-semibold",children:Bg()}),t(_t,{className:"w-[200px] text-xs font-semibold",children:yI()}),t(_t,{className:"text-xs font-semibold",children:ev()}),t(_t,{className:"text-xs font-semibold",children:Jx()}),t(_t,{className:"w-[160px] text-right text-xs font-semibold",children:VE()})]})}),t(wn,{children:k.map((l)=>{let I=l.userId?he.get(l.userId):null,H=I?.user?.name||I?.name||l.userId||"System",W=I?.user?.image||I?.image;return o(hr,{className:"hover:bg-muted/40 transition-colors",children:[t(pt,{className:"py-3 font-medium",children:ge(l.action)}),t(pt,{className:"py-3",children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{className:"h-6 w-6",children:[t(Ee,{src:W||void 0}),t(Ie,{className:"text-[10px]",children:H.slice(0,2).toUpperCase()})]}),t("span",{className:"text-xs font-medium text-foreground truncate max-w-[160px]",children:l.agent?xc({user:H,agent:l.agent.name}):H}),l.agent&&t(bt,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"})]})}),t(pt,{className:"py-3 text-xs font-mono text-muted-foreground",children:l.itemId||"-"}),t(pt,{className:"py-3 text-xs font-mono text-muted-foreground",children:l.projectId||"-"}),t(pt,{className:"py-3 text-right text-xs text-muted-foreground",children:yn(l.createdAt)})]},l.id)})})]}),t("div",{ref:f,className:"py-4 flex justify-center",children:b&&t(Z,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})]})})}function ze(){let{teamId:a}=Ge.useParams(),[e,s]=u("audit-logs"),{data:i,isLoading:m}=L({queryKey:["teams",a,"me"],queryFn:async()=>{let r=await A.api.teams[":teamId"].me.$get({param:{teamId:a}});if(!r.ok)throw Error("Failed to fetch me");return await r.json()},enabled:!!a});if(m)return t("div",{className:"flex h-screen items-center justify-center",children:t(Z,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(i?.role?.toLowerCase()!=="owner")return o("div",{className:"flex h-full flex-col items-center justify-center p-8 text-center",children:[t(vl,{className:"h-12 w-12 text-destructive mb-4"}),t("h2",{className:"text-xl font-bold tracking-tight mb-2",children:Lg()}),t("p",{className:"text-sm text-muted-foreground max-w-md",children:ax()})]});return t("div",{className:"h-full bg-background font-sans selection:bg-primary/20 transition-colors duration-300",children:o("div",{className:"flex flex-col md:flex-row h-full",children:[t("div",{className:"w-full h-full md:w-72 bg-sidebar border-b md:border-b-0 md:border-r border-sidebar-border z-10 md:left-16 overflow-y-auto transition-colors duration-300",children:o("nav",{className:"p-4 space-y-1 mt-4",children:[t("div",{className:"mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider",children:Im()}),t("div",{className:"mt-4 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border",children:kE()}),o("button",{onClick:()=>s("audit-logs"),className:E("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",e==="audit-logs"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[t(xa,{className:"w-5 h-5"}),$d(),e==="audit-logs"&&t("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),o("button",{onClick:()=>s("quotas"),className:E("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",e==="quotas"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[t(Io,{className:"w-5 h-5"}),id(),e==="quotas"&&t("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),t("div",{className:"mt-4 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border",children:BA()}),o("button",{onClick:()=>s("ai-usage"),className:E("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",e==="ai-usage"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[t(ie,{className:"w-5 h-5"}),AI(),e==="ai-usage"&&t("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),o("button",{onClick:()=>s("ai-sessions"),className:E("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",e==="ai-sessions"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[t(j,{className:"w-5 h-5"}),ig(),e==="ai-sessions"&&t("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]})]})}),t("div",{className:"flex-1 overflow-y-auto p-4 md:p-8",children:o("div",{className:"max-w-6xl mx-auto space-y-8",children:[e==="audit-logs"&&t(fe,{teamId:a}),e==="ai-usage"&&t(ne,{teamId:a}),e==="ai-sessions"&&t(le,{teamId:a}),e==="quotas"&&t(pe,{teamId:a})]})})]})})}var Ge=Ue("/teams/$teamId/dashboard")({component:ze});export{Ge as Route};
|