@kaeawc/auto-mobile 0.0.92 → 0.0.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-info.json +12 -12
- package/dist/schemas/test-plan.schema.json +370 -52
- package/dist/src/{chunk-jhnbfj19.js → chunk-00167wan.js} +5 -5
- package/dist/src/chunk-0jrrsnc9.js +6 -0
- package/dist/src/chunk-0n6swkwg.js +5 -0
- package/dist/src/chunk-0qsy1qsx.js +57 -0
- package/dist/src/chunk-11m8wj8j.js +237 -0
- package/dist/src/{chunk-4pfftt07.js → chunk-1p7xf5kb.js} +3 -3
- package/dist/src/chunk-23p5f095.js +4 -0
- package/dist/src/{chunk-a4k9rt7z.js → chunk-26k317v5.js} +3 -3
- package/dist/src/chunk-284ptqa4.js +7 -0
- package/dist/src/chunk-28re4xrg.js +4 -0
- package/dist/src/chunk-2f9rkmhx.js +5 -0
- package/dist/src/chunk-2fxdh48t.js +4 -0
- package/dist/src/chunk-2tbdrbt6.js +4 -0
- package/dist/src/chunk-2tqzq5qh.js +971 -0
- package/dist/src/chunk-32gvv9b4.js +21 -0
- package/dist/src/chunk-3f3t1x97.js +8 -0
- package/dist/src/chunk-3fspkbc7.js +4 -0
- package/dist/src/chunk-3qwrzxh0.js +11 -0
- package/dist/src/chunk-3sy6ahhz.js +26 -0
- package/dist/src/chunk-3vg455e6.js +4 -0
- package/dist/src/chunk-3xkpk44w.js +5 -0
- package/dist/src/chunk-3y6eykz9.js +4 -0
- package/dist/src/chunk-49bsqdx3.js +4 -0
- package/dist/src/chunk-4hw3665t.js +42 -0
- package/dist/src/chunk-58wzr3mt.js +5 -0
- package/dist/src/chunk-5d2hft6c.js +5 -0
- package/dist/src/chunk-5snsn9cf.js +4 -0
- package/dist/src/chunk-5tm9mn47.js +54 -0
- package/dist/src/chunk-5zc77a5t.js +4 -0
- package/dist/src/chunk-64j0majr.js +19 -0
- package/dist/src/chunk-65y8v4td.js +17 -0
- package/dist/src/chunk-6awz7vhq.js +5 -0
- package/dist/src/{chunk-stfzjr9y.js → chunk-6bznss4t.js} +5 -5
- package/dist/src/chunk-6ep7f5ge.js +4 -0
- package/dist/src/{chunk-0dfnyfkh.js → chunk-6wt9rgjf.js} +3 -3
- package/dist/src/chunk-6xmss8er.js +8 -0
- package/dist/src/chunk-710rxz9y.js +5 -0
- package/dist/src/chunk-7cs2da62.js +5 -0
- package/dist/src/chunk-7g103b54.js +4 -0
- package/dist/src/chunk-7j5vj4pa.js +4 -0
- package/dist/src/chunk-7rz9898k.js +5 -0
- package/dist/src/chunk-7tw8x05v.js +4 -0
- package/dist/src/chunk-7zy586cb.js +4 -0
- package/dist/src/{chunk-r0f1q783.js → chunk-8037tzzj.js} +3 -3
- package/dist/src/chunk-84nanf8s.js +5 -0
- package/dist/src/{chunk-950qcq1e.js → chunk-8g1922rp.js} +4 -4
- package/dist/src/chunk-8gvwcv2p.js +4 -0
- package/dist/src/{chunk-sz1a7p43.js → chunk-8ph29g99.js} +1 -1
- package/dist/src/chunk-8thrmfat.js +4 -0
- package/dist/src/chunk-8zgzzs7k.js +78 -0
- package/dist/src/chunk-97b1zmaq.js +4 -0
- package/dist/src/chunk-9fth9ayh.js +4 -0
- package/dist/src/chunk-9j6anhjr.js +4 -0
- package/dist/src/{chunk-w7zsh13a.js → chunk-aabchzxk.js} +4 -4
- package/dist/src/{chunk-wry6skrm.js → chunk-ayp07wbb.js} +1 -1
- package/dist/src/chunk-bfjwqk8q.js +4 -0
- package/dist/src/{chunk-jdqvcq0a.js → chunk-bfw6125s.js} +3 -3
- package/dist/src/chunk-bnhscm2n.js +4 -0
- package/dist/src/chunk-bxmsax22.js +5 -0
- package/dist/src/chunk-c1vs4g1n.js +4 -0
- package/dist/src/chunk-ct3e7yng.js +4 -0
- package/dist/src/{chunk-8en08r7q.js → chunk-cyy71ggq.js} +3 -3
- package/dist/src/chunk-ddzkz92z.js +4 -0
- package/dist/src/chunk-dgrbdpb7.js +9 -0
- package/dist/src/chunk-drdz8hee.js +5 -0
- package/dist/src/chunk-e98dqnc9.js +145 -0
- package/dist/src/chunk-eersndy7.js +5 -0
- package/dist/src/chunk-eggq53ks.js +4 -0
- package/dist/src/chunk-f2dya7cs.js +4 -0
- package/dist/src/chunk-fbakd6cw.js +4 -0
- package/dist/src/chunk-fgb98zjj.js +5 -0
- package/dist/src/chunk-fmpad823.js +5 -0
- package/dist/src/{chunk-v90es00d.js → chunk-g04bwyj3.js} +2 -2
- package/dist/src/chunk-g0xr8zw0.js +4 -0
- package/dist/src/chunk-g3rjs80x.js +4 -0
- package/dist/src/chunk-g78rtrfv.js +4 -0
- package/dist/src/{chunk-r20pe1nv.js → chunk-g7tmjbkt.js} +3 -3
- package/dist/src/chunk-gabgv3y5.js +4 -0
- package/dist/src/chunk-gmr45m8f.js +4 -0
- package/dist/src/chunk-gsyfebqj.js +4 -0
- package/dist/src/chunk-h5rpn9wr.js +247 -0
- package/dist/src/chunk-hb1x7v55.js +4 -0
- package/dist/src/chunk-hrfytkxh.js +168 -0
- package/dist/src/chunk-j4yjzbak.js +4 -0
- package/dist/src/chunk-jd6a5v6p.js +5 -0
- package/dist/src/chunk-jh6vhqzx.js +5 -0
- package/dist/src/chunk-kn5spq15.js +4 -0
- package/dist/src/{chunk-w2mwa0jk.js → chunk-m94qs0f0.js} +2 -2
- package/dist/src/chunk-mjrps0ac.js +7 -0
- package/dist/src/chunk-n03dmn5q.js +5 -0
- package/dist/src/chunk-n72qhwd9.js +4 -0
- package/dist/src/{chunk-km0dy5vc.js → chunk-ndt1ccxm.js} +9 -9
- package/dist/src/chunk-nr6y0n4y.js +5 -0
- package/dist/src/chunk-pcsen2vs.js +4 -0
- package/dist/src/chunk-ppfr0b8h.js +4 -0
- package/dist/src/chunk-q10bdnat.js +4 -0
- package/dist/src/chunk-q9xmq595.js +4 -0
- package/dist/src/{chunk-2v7tw1nj.js → chunk-qcxzr2my.js} +3 -3
- package/dist/src/chunk-qf6nynk6.js +7 -0
- package/dist/src/chunk-qyqypn28.js +5 -0
- package/dist/src/chunk-r2epb56s.js +4 -0
- package/dist/src/chunk-r5bxavdx.js +311 -0
- package/dist/src/{chunk-r14wwk37.js → chunk-r6z1eztj.js} +12 -12
- package/dist/src/{chunk-d57432wq.js → chunk-r7bpkgff.js} +2 -2
- package/dist/src/chunk-r8jf3d92.js +4 -0
- package/dist/src/{chunk-9rkfyt6q.js → chunk-rbpdk7m0.js} +3 -3
- package/dist/src/chunk-rc0dbypm.js +4 -0
- package/dist/src/chunk-rhcty4ms.js +4 -0
- package/dist/src/chunk-rpvckv3p.js +4 -0
- package/dist/src/{chunk-s1zq65ny.js → chunk-rqc9ap3x.js} +2 -2
- package/dist/src/chunk-rvvy1bte.js +7 -0
- package/dist/src/chunk-ry0mz41y.js +4 -0
- package/dist/src/{chunk-34zxqcmq.js → chunk-s3jc6cwp.js} +3 -3
- package/dist/src/chunk-sfv61xjb.js +6 -0
- package/dist/src/chunk-t6bfvfkg.js +4 -0
- package/dist/src/chunk-t6c8akcm.js +5 -0
- package/dist/src/chunk-t7w8rctc.js +4 -0
- package/dist/src/chunk-thbh3jew.js +5 -0
- package/dist/src/chunk-v2wd4n3e.js +5 -0
- package/dist/src/{chunk-zg67wjkh.js → chunk-v6pya0dm.js} +3 -3
- package/dist/src/chunk-vy3bwm1d.js +17 -0
- package/dist/src/chunk-w3vs79ex.js +27 -0
- package/dist/src/chunk-w4zga19f.js +4 -0
- package/dist/src/chunk-w5b2jwk3.js +14 -0
- package/dist/src/chunk-w7hkv422.js +5 -0
- package/dist/src/{chunk-qv2918jt.js → chunk-waqwcjyn.js} +2 -2
- package/dist/src/{chunk-b4cxdzwy.js → chunk-wbh8spm5.js} +7 -7
- package/dist/src/{chunk-ajsrz473.js → chunk-wyrkw6hw.js} +3 -3
- package/dist/src/chunk-xa73x2cx.js +5 -0
- package/dist/src/{chunk-eka89q3k.js → chunk-xgan0qqp.js} +1 -1
- package/dist/src/chunk-y2vs6jwg.js +4 -0
- package/dist/src/chunk-yattm52s.js +4 -0
- package/dist/src/{chunk-9y5bcy28.js → chunk-yb97j25b.js} +4 -4
- package/dist/src/{chunk-c9nk1r78.js → chunk-ybbtagbt.js} +3 -3
- package/dist/src/chunk-ycaj2sgf.js +9 -0
- package/dist/src/chunk-yf7ympyz.js +325 -0
- package/dist/src/chunk-yjawdzk8.js +4 -0
- package/dist/src/chunk-z637nqg8.js +11 -0
- package/dist/src/{chunk-0w1spptt.js → chunk-zgja5f3p.js} +4 -4
- package/dist/src/chunk-zs1sghs9.js +4 -0
- package/dist/src/daemon/processEntry.js +2 -2
- package/dist/src/index.js +4 -4
- package/dist/src/runtime/bunRuntimeGuard.js +2 -2
- package/dist/src/utils/workers/iosBundleExtractWorker.js +2 -2
- package/ios/CameraPosterInjection/Injection/CameraPosterInjection.m +466 -0
- package/package.json +3 -2
- package/schemas/test-plan.schema.json +370 -52
- package/dist/src/chunk-09442h7v.js +0 -4
- package/dist/src/chunk-0e4gm1kj.js +0 -5
- package/dist/src/chunk-0eb8576f.js +0 -4
- package/dist/src/chunk-0rjm4nx7.js +0 -5
- package/dist/src/chunk-1zmh2eak.js +0 -4
- package/dist/src/chunk-28k63ha3.js +0 -5
- package/dist/src/chunk-2d4wmp8b.js +0 -4
- package/dist/src/chunk-2e6s75qv.js +0 -78
- package/dist/src/chunk-32jpxz2y.js +0 -323
- package/dist/src/chunk-3jmvqygr.js +0 -238
- package/dist/src/chunk-3swvfhqt.js +0 -5
- package/dist/src/chunk-44bt78m9.js +0 -5
- package/dist/src/chunk-488vt2bp.js +0 -4
- package/dist/src/chunk-4fgdhcwx.js +0 -5
- package/dist/src/chunk-4jp2se4w.js +0 -4
- package/dist/src/chunk-4vhr9e4t.js +0 -4
- package/dist/src/chunk-4xd6zs3y.js +0 -15
- package/dist/src/chunk-51567pg8.js +0 -4
- package/dist/src/chunk-5agqsfev.js +0 -4
- package/dist/src/chunk-5d706gmr.js +0 -4
- package/dist/src/chunk-5kd4rqk7.js +0 -5
- package/dist/src/chunk-61t538bm.js +0 -4
- package/dist/src/chunk-6d3mmqxt.js +0 -54
- package/dist/src/chunk-6hyt398x.js +0 -5
- package/dist/src/chunk-6mnr8kpm.js +0 -4
- package/dist/src/chunk-79q5xsdc.js +0 -42
- package/dist/src/chunk-7bdgand3.js +0 -4
- package/dist/src/chunk-84cp9dw5.js +0 -4
- package/dist/src/chunk-86f2h5ww.js +0 -5
- package/dist/src/chunk-8cghfzb2.js +0 -19
- package/dist/src/chunk-9tf2p9y9.js +0 -5
- package/dist/src/chunk-a2sc4jm0.js +0 -5
- package/dist/src/chunk-aa5ng3d1.js +0 -4
- package/dist/src/chunk-b3h0a6ca.js +0 -4
- package/dist/src/chunk-b6a737qt.js +0 -4
- package/dist/src/chunk-bn64x5z5.js +0 -5
- package/dist/src/chunk-bvh649za.js +0 -12
- package/dist/src/chunk-c9tyfg4j.js +0 -26
- package/dist/src/chunk-cfsdfqnm.js +0 -4
- package/dist/src/chunk-cxyf04jc.js +0 -7
- package/dist/src/chunk-da08tx5v.js +0 -4
- package/dist/src/chunk-f2tc08m2.js +0 -4
- package/dist/src/chunk-f8tnk179.js +0 -5
- package/dist/src/chunk-f9s1kkhx.js +0 -5
- package/dist/src/chunk-fbp8a4rx.js +0 -4
- package/dist/src/chunk-fd2z0sze.js +0 -4
- package/dist/src/chunk-fk927f4q.js +0 -54
- package/dist/src/chunk-fxmr3a0f.js +0 -4
- package/dist/src/chunk-gaqwhd44.js +0 -4
- package/dist/src/chunk-ggtd5x5a.js +0 -5
- package/dist/src/chunk-gndcfrm7.js +0 -4
- package/dist/src/chunk-h3n4adc6.js +0 -310
- package/dist/src/chunk-h5pjbb83.js +0 -4
- package/dist/src/chunk-hgnnh302.js +0 -4
- package/dist/src/chunk-hmke8nhx.js +0 -5
- package/dist/src/chunk-j2bx12hn.js +0 -4
- package/dist/src/chunk-j70y1a2g.js +0 -4
- package/dist/src/chunk-js1jpyxp.js +0 -6
- package/dist/src/chunk-kbjq0qvb.js +0 -4
- package/dist/src/chunk-kfwx57xd.js +0 -4
- package/dist/src/chunk-kzwctna2.js +0 -4
- package/dist/src/chunk-m9ehyehy.js +0 -4
- package/dist/src/chunk-mct91p1f.js +0 -4
- package/dist/src/chunk-mf9spd4g.js +0 -5
- package/dist/src/chunk-mgrcansb.js +0 -4
- package/dist/src/chunk-mqc1d0eb.js +0 -6
- package/dist/src/chunk-n1zmpk0z.js +0 -4
- package/dist/src/chunk-ncyjf63g.js +0 -4
- package/dist/src/chunk-nr64d21q.js +0 -973
- package/dist/src/chunk-nwm2pq5v.js +0 -168
- package/dist/src/chunk-pm06b05d.js +0 -9
- package/dist/src/chunk-q50s00ry.js +0 -4
- package/dist/src/chunk-qwye1958.js +0 -14
- package/dist/src/chunk-r8z9pfve.js +0 -5
- package/dist/src/chunk-rdpgkjf6.js +0 -4
- package/dist/src/chunk-rkr0dks9.js +0 -5
- package/dist/src/chunk-rn84t3sf.js +0 -11
- package/dist/src/chunk-s123kn7n.js +0 -4
- package/dist/src/chunk-s73qn3fx.js +0 -4
- package/dist/src/chunk-sjn0nj4p.js +0 -5
- package/dist/src/chunk-sns0c35v.js +0 -7
- package/dist/src/chunk-t4dr5c8v.js +0 -8
- package/dist/src/chunk-tc8k9c1j.js +0 -4
- package/dist/src/chunk-teznhase.js +0 -4
- package/dist/src/chunk-ty9xgmz4.js +0 -4
- package/dist/src/chunk-tyazf3sk.js +0 -145
- package/dist/src/chunk-v6npjrjm.js +0 -5
- package/dist/src/chunk-vbvtzkwz.js +0 -5
- package/dist/src/chunk-vefd8qee.js +0 -8
- package/dist/src/chunk-vs9r72ta.js +0 -17
- package/dist/src/chunk-w88k0bgr.js +0 -4
- package/dist/src/chunk-wzdt0enk.js +0 -4
- package/dist/src/chunk-xhhv854c.js +0 -4
- package/dist/src/chunk-y58270hd.js +0 -4
- package/dist/src/chunk-yk0hmbex.js +0 -4
- package/dist/src/chunk-ympy4fdz.js +0 -28
- package/dist/src/chunk-yw436axy.js +0 -4
- package/dist/src/chunk-z04jrpjy.js +0 -5
- package/dist/src/chunk-z2xznczw.js +0 -4
- package/dist/src/chunk-z4xnrgps.js +0 -4
- package/dist/src/chunk-z7csyszv.js +0 -4
- package/dist/src/chunk-z8t0v07j.js +0 -11
- package/dist/src/chunk-z916af47.js +0 -228
- package/dist/src/chunk-zcr8he8q.js +0 -5
- package/dist/src/chunk-zd9vmkzn.js +0 -9
- package/dist/src/chunk-zj939v0h.js +0 -5
- package/dist/src/chunk-zkdjwtc1.js +0 -4
- package/dist/src/chunk-zkv5kzt6.js +0 -4
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var{create:hz,defineProperty:Vn,getOwnPropertyDescriptor:gz,getOwnPropertyNames:_z,getPrototypeOf:yz}=Object,vz=Object.prototype.hasOwnProperty,B=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Wu=(e,t)=>{let r={};for(var o in e)Vn(r,o,{get:e[o],enumerable:!0});if(t)Vn(r,Symbol.toStringTag,{value:"Module"});return r},Sz=(e,t,r,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(var n=_z(t),s=0,i=n.length,a;s<i;s++)if(a=n[s],!vz.call(e,a)&&a!==r)Vn(e,a,{get:((c)=>t[c]).bind(null,a),enumerable:!(o=gz(t,a))||o.enumerable})}return e},Bn=(e,t,r)=>(r=e!=null?hz(yz(e)):{},Sz(t||!e||!e.__esModule?Vn(r,"default",{value:e,enumerable:!0}):r,e));var bz=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Yu=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),zz=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),$z=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function Xu(e){return typeof e==="string"&&Yu.has(e.replace(/#$/,""))}function el(e,t){if(!("$schema"in e)||typeof e.$schema!=="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(bz.has(r))return"2020-12";if(Yu.has(r))return"2019-09";if(zz.has(r)||$z.has(r))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}function jo(e){let t=Object.values(e).filter((o)=>typeof o==="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function Ni(e,t="|"){return e.map((r)=>Mi(r)).join(t)}function Mo(e,t){if(typeof t==="bigint")return t.toString();return t}class ol{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function Zo(e){return new ol(e)}function nl(e){return e===null||e===void 0}function Jn(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function sl(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-o)<n)return 0;return r-o}var rl=Symbol("evaluating");function il(e,t,r){let o=void 0;Object.defineProperty(e,t,{get(){if(o===rl)return;if(o===void 0)o=rl,o=r();return o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function yt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function qo(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Zt(e){return qo(e._zod.def)??e._zod.def.shape}function al(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return yt(this,t,o),o},enumerable:!0,configurable:!0})}function cl(e,t,r){if(t in e)yt(e,t,r);else e[t]=r}function _r(e,t,r,o){let n=Zt(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(n,s);if(!i.enumerable)continue;if(i.get)al(e,s,()=>{let a=t._zod.def.shape[s];return o?o(a,s):a});else cl(e,s,o?o(i.value,s):i.value)}}function Rz(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);if(!o.enumerable)continue;if(o.get)al(e,r,()=>t[r]);else cl(e,r,o.value)}}function ut(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function ul(e){return JSON.stringify(e)}function ll(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ai="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function qr(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var dl=Zo(()=>{if(rt.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function yr(e){if(qr(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(qr(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function ji(e){if(yr(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var pl=new Set(["string","number","symbol"]);function Wt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Rt(e,t,r){let o=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)o._zod.parent=e;return o}function oe(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function Mi(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function ml(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Kn=(()=>({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]}))(),Zi={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function wz(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let s={};return _r(s,e,Gn(e,t)),Rt(e,ut(r,{shape:s,checks:[]}))}function Gn(e,t){let r=Zt(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw Error(`Unrecognized key: "${String(n)}"`);if(t[n])o.push(n)}return o}function Pz(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(Gn(e,t)),i={};return _r(i,e,Reflect.ownKeys(Zt(e)).filter((a)=>!s.has(a))),Rt(e,ut(r,{shape:i,checks:[]}))}function kz(e,t){if(!yr(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=Zt(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,s)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Rt(e,ut(e._zod.def,{shape:fl(e,t)}))}function fl(e,t){let r={};return _r(r,e,Reflect.ownKeys(Zt(e))),Rz(r,t),r}function xz(e,t){if(!yr(t))throw Error("Invalid input to safeExtend: expected a plain object");return Rt(e,ut(e._zod.def,{shape:fl(e,t)}))}function Ez(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};_r(r,e,Reflect.ownKeys(Zt(e))),_r(r,t,Reflect.ownKeys(Zt(t)));let o=ut(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Rt(e,o)}function hl(e,t,r,o="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw Error(`.${o}() cannot be used on object schemas containing refinements`);let a=r?new Set(Gn(t,r)):void 0,c={};return _r(c,t,Reflect.ownKeys(Zt(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),Rt(t,ut(t._zod.def,{shape:c,checks:[]}))}function Tz(e,t,r){let o=r?new Set(Gn(t,r)):void 0,n={};return _r(n,t,Reflect.ownKeys(Zt(t)),(s,i)=>o&&!o.has(i)?s:new e({type:"nonoptional",innerType:s})),Rt(t,ut(t._zod.def,{shape:n}))}function Et(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function gl(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Yt(e,t){return t.map((r)=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Ao(e){return typeof e==="string"?e:e?.message}function Li(e){let t=[];for(let r of e??[]){let o=r._zod.def;if(!/_(length|size)$|_equals$/.test(o.check))break;let n=o.maximum??o.length??o.size;if(n>=0)t.push([n,r])}return t}function Wn(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function Tt(e,t,r){var o;let n=e.inst?._zod?.traits;if(n?.has("$ZodType"))if(n.has("$ZodCheck"))(o=e).schema??(o.schema=e.inst);else e.schema=e.inst;let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:Ao(e.inst?._zod.def?.error?.(e))??Ao(s?.(e))??Ao(t?.error?.(e))??Ao(r.customError?.(e))??Ao(r.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e)){if(c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__")continue;a[c]=e[c]}if(a.path??(a.path=[]),a.message=i,t?.reportInput)a.input=e.input;return a}var Oz=/[\uD800-\uDBFF]/;function Yn(e){let t=e.length;if(!Oz.test(e))return t;let r=t;for(let o=0;o<t-1;o++)if((e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320)r--,o++;return r}function Xn(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function _l(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function vr(...e){let[t,r,o]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:o};return{...t}}function yl(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);if(o.get)Object.defineProperty(e,r,{...o,enumerable:!1});else Cz(e,r,o.value)}}function qt(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function Qn(e,t,r){return qt(e,t,r,!1)}function vl(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return qt(this,r,o(this))},set(n){qt(this,r,n)}})}return t}function Cz(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:qt(this,t,r.bind(this))},set(o){qt(this,t,o)}})}function Iz(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var Ii,Gt=!1,Nz={configurable:!0,get(){Gt=!0;return}};function ve(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&Ii!==e._zod){Ii=void 0;return}Ii=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,Nz);let n=Gt;Gt=!1;try{let s=r(this);if(Gt)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s});return Gt=Gt||n,s}catch(s){throw delete this[t],Gt=Gt||n,s}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function Az(e,t,r,o){let n=Iz(e,t);if(!n)return;Object.defineProperty(n,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:s})}})}var jz="~constantCatch";function Sl(e){let t=()=>e;return t[jz]=!0,t}var bl,Fi=Object.freeze({status:"aborted"}),Ui={value:void 0,enumerable:!1},zl="captureStackTrace"in Error?Error:null;function Mz(e){let t=zl;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return zl=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function L(e,t,r,o){let n={};function s(m){this.def=m,this.constr=d,this.traits=new Set}s.prototype=n;let i=r,a=i&&new WeakSet;function c(m,h){if(!m._zod){Ui.value=new s(h);try{Object.defineProperty(m,"_zod",Ui)}finally{Ui.value=void 0}}else if(m._zod.traits.has(e))return;if(m._zod.traits.add(e),t(m,h),a){let v=Object.getPrototypeOf(m),y=m._zod.constr.prototype,g=v;while(g&&g!==y)g=Object.getPrototypeOf(g);let P=g??v;if(!a.has(P))a.add(P),yl(P,i)}let f=d.prototype;for(let v in f){if(!Object.prototype.hasOwnProperty.call(f,v))continue;if(!(v in m))m[v]=f[v].bind(m)}}let u=o?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(m){let h=o?.Parent?Mz(l):this;c(h,m);let f=h._zod.deferred;if(f){for(let y of f)y();h._zod.deferred=void 0}let v=globalThis.__zod_globalConfig?.postProcessor;if(v)v(h);return h}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:(m)=>{if(o?.Parent&&m instanceof o.Parent)return!0;return m?._zod?.traits?.has(e)}}),Object.defineProperty(d,"name",{value:e}),d}class Ot extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Lo extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(bl=globalThis).__zod_globalConfig??(bl.__zod_globalConfig={});var rt=globalThis.__zod_globalConfig;function ot(e){if(e)Object.assign(rt,e);return rt}function Zz(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Mo,2)),e.message}function qz(e){this._zod.message=e}var Lz={get:Zz,set:qz,enumerable:!0,configurable:!0},Bi={value:void 0,enumerable:!1},$l=new WeakSet([Object.prototype,Error.prototype]),Rl=(e,t)=>{e.name="$ZodError",Bi.value=t,Object.defineProperty(e,"issues",Bi),Bi.value=void 0,Object.defineProperty(e,"message",Lz);let r=Object.getPrototypeOf(e);if(!$l.has(r))$l.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}})},wl=L("$ZodError",Rl),ET=L("$ZodError",Rl,void 0,{Parent:Error});function Dz(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function Ji(e,t=(r)=>r.message){let r={},o=[];for(let n of e.issues)if(n.path.length>0)Dz(r,n.path[0],()=>[]).push(t(n));else o.push(t(n));return{formErrors:o,fieldErrors:r}}function Ki(e,t=(r)=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map((a)=>o({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(t(i));else{let c=r,u=0;while(u<a.length){let l=a[u],d=u===a.length-1;if(l==="_errors"){if(d)c._errors.push(t(i));u++;continue}if(!Object.prototype.hasOwnProperty.call(c,l))Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=c[l];if(d)m._errors.push(t(i));c=m,u++}}}};return o(e),r}function es(e,t){return{callee:t?.callee??e,Err:t?.Err}}var ts=(e)=>{let t=(r,o,n,s)=>{let i=n?{...n,async:!1}:{async:!1},a=r._zod.run({value:o,issues:[]},i);if(a instanceof Promise)throw new Ot;if(a.issues.length){let c=new(s?.Err??e)(a.issues.map((u)=>Tt(u,i,ot())));throw Ai(c,s?.callee??t),c}return a.value};return t};var rs=(e)=>{let t=async(r,o,n,s)=>{let i=n?{...n,async:!0}:{async:!0},a=r._zod.run({value:o,issues:[]},i);if(a instanceof Promise)a=await a;if(a.issues.length){let c=new(s?.Err??e)(a.issues.map((u)=>Tt(u,i,ot())));throw Ai(c,s?.callee??t),c}return a.value};return t};var os=(e)=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new Ot;return s.issues.length?Pl(e,s.issues,n):{success:!0,data:s.value}};function Pl(e,t,r){let o;return{success:!1,get error(){if(!o)o=new e(t.map((n)=>Tt(n,r,ot()))),t=void 0,r=void 0;return o},set error(n){o=n,t=void 0,r=void 0}}}var ns=(e)=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)s=await s;return s.issues.length?Pl(e,s.issues,n):{success:!0,data:s.value}};var Uz=Symbol.for("zod.compile.invalid"),Fz=Symbol.for("zod.compile.fallback"),Gi=(e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==Uz)return!0;if(o.definite===!0&&r===void 0)return!1}return Vz(e,t,r)};function Vz(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n)o[Fz]=!0,s=n({value:t,issues:[]},o);else s=e._zod.run({value:t,issues:[]},o);if(s instanceof Promise)throw new Ot;return s.issues.length===0}var Wi=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);if(n instanceof Promise)n=await n;return n.issues.length===0},kl=(e)=>{let t=ts(e),r=(o,n,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,a,es(r,i))};return r};var xl=(e)=>{let t=ts(e),r=(o,n,s,i)=>t(o,n,s,es(r,i));return r};var El=(e)=>{let t=rs(e),r=async(o,n,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,a,es(r,i))};return r};var Tl=(e)=>{let t=rs(e),r=async(o,n,s,i)=>await t(o,n,s,es(r,i));return r};var Ol=(e)=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return os(e)(t,r,n)};var Cl=(e)=>(t,r,o)=>os(e)(t,r,o);var Il=(e)=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return ns(e)(t,r,n)};var Nl=(e)=>async(t,r,o)=>ns(e)(t,r,o);var Al=/^[cC][0-9a-z]{6,}$/,jl=/^[0-9a-z]+$/,Ml=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Zl=/^[0-9a-vA-V]{20}$/,ql=/^[A-Za-z0-9]{27}$/,Ll=/^[a-zA-Z0-9_-]{21}$/;function Dl(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Ul=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Fl=/^([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})$/,Xi=(e)=>{if(!e)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}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var Vl=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Hz="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Hl(){return new RegExp(Hz,"u")}var Bl=/^(?:(?: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])$/,Jl=/^(([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 Kl=/^((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])$/,Gl=/^(([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])$/,Wl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Yl=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var Xl=/^https?$/,Ql=/^\+[1-9]\d{6,14}$/;var ed="(?:(?:\\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 Bz(e){return new RegExp(`^${e}$`)}var td=Bz(ed);function Yi(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.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{${e.precision}}`:e.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 rd(e){return new RegExp(`^${Yi(e)}$`)}function od(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Yi({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${Yi({precision:e.precision})}`:r;return new RegExp(`^${ed}T(?:${o})$`)}var nd=/^[\s\S]{0,}$/;var Qi=/^-?\d+$/,Do=/^-?\d+(?:\.\d+)?$/,sd=/^(?:true|false)$/i,id=/^null$/i;var ad=/^[^A-Z]*$/,cd=/^[^a-z]*$/;var Je=L("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var ea=(e)=>{let t=e.value;return!nl(t)&&t.length!==void 0},is={number:"number",bigint:"bigint",object:"date"},ta=L("$ZodCheckLessThan",(e,t)=>{Je.init(e,t);let r=is[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;o.issues.push({origin:is[typeof o.value]??r,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ra=L("$ZodCheckGreaterThan",(e,t)=>{Je.init(e,t);let r=is[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;o.issues.push({origin:is[typeof o.value]??r,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ud=L("$ZodCheckMultipleOf",(e,t)=>{Je.init(e,t),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):sl(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),ld=L("$ZodCheckNumberFormat",(e,t)=>{Je.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=Kn[t.format];e._zod.check=(i)=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){if(a>0)i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});else i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}if(a<n)i.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(a>s)i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var dd=L("$ZodCheckMaxLength",(e,t)=>{var r;Je.init(e,t),(r=e._zod.def).when??(r.when=ea),e._zod.check=(o)=>{let n=o.value,s=n.length;if((typeof n==="string"&&s>t.maximum?Yn(n):s)<=t.maximum)return;let a=Xn(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),pd=L("$ZodCheckMinLength",(e,t)=>{var r;Je.init(e,t),(r=e._zod.def).when??(r.when=ea),e._zod.check=(o)=>{let n=o.value,s=n.length;if((typeof n==="string"&&s>=t.minimum&&s<t.minimum*2?Yn(n):s)>=t.minimum)return;let a=Xn(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),md=L("$ZodCheckLengthEquals",(e,t)=>{var r;Je.init(e,t),(r=e._zod.def).when??(r.when=ea),e._zod.check=(o)=>{let n=o.value,s=n.length,i=typeof n==="string"&&s>=t.length&&s<=t.length*2?Yn(n):s;if(i===t.length)return;let a=Xn(n),c=i>t.length;o.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Uo=L("$ZodCheckStringFormat",(e,t)=>{var r,o;if(Je.init(e,t),t.pattern)(r=e._zod).check??(r.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(o=e._zod).check??(o.check=()=>{})}),fd=L("$ZodCheckRegex",(e,t)=>{Uo.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),hd=L("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ad),Uo.init(e,t)}),gd=L("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=cd),Uo.init(e,t)}),_d=L("$ZodCheckIncludes",(e,t)=>{Je.init(e,t);let r=Wt(t.includes),o=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=(n)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),yd=L("$ZodCheckStartsWith",(e,t)=>{Je.init(e,t);let r=new RegExp(`^${Wt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),vd=L("$ZodCheckEndsWith",(e,t)=>{Je.init(e,t);let r=new RegExp(`.*${Wt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Sd=L("$ZodCheckOverwrite",(e,t)=>{Je.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class oa{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
|
|
3
|
+
`).filter((s)=>s),o=Math.min(...r.map((s)=>s.length-s.trimStart().length)),n=r.map((s)=>s.slice(o)).map((s)=>" ".repeat(this.indent*2)+s);for(let s of n)this.content.push(s)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
4
|
+
${t.join(`
|
|
5
|
+
`)}
|
|
6
|
+
};`)(...Object.values(this.closed))}}var zd={major:4,minor:6,patch:7};var xe=L("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=zd;let o=e._zod.def.checks,n=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o?.length?[...o]:[];for(let s of n)for(let i of s._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=(a,c,u)=>{if(a.memo)return a;let l=Et(a),d;for(let m of c){if(m._zod.def.when){if(gl(a))continue;if(!m._zod.def.when(a))continue}else if(l)continue;let h=a.issues.length,f=m._zod.check(a);if(f instanceof Promise&&u?.async===!1)throw new Ot;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{if(await f,a.issues.length===h)return;if(Wn(a.issues,h,e),!l)l=Et(a,h)});else{if(a.issues.length===h)continue;if(Wn(a.issues,h,e),!l)l=Et(a,h)}}if(d)return d.then(()=>a);return a},i=(a,c,u)=>{if(Et(a))return a.aborted=!0,a;let l=s(c,n,u);if(l instanceof Promise){if(u.async===!1)throw new Ot;return l.then((d)=>e._zod.parse(d,u))}return e._zod.parse(l,u)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});if(l instanceof Promise)return l.then((d)=>i(d,a,c));return i(l,a,c)}let u=e._zod.parse(a,c);if(u instanceof Promise){if(c.async===!1)throw new Ot;return u.then((l)=>s(l,n,c))}return s(u,n,c)}}},{get "~standard"(){return Qn(this,"~standard",sa(this))},set "~standard"(e){qt(this,"~standard",e)}}),Id=(e,t)=>e.issues.length?{issues:e.issues.map((r)=>Tt(r,t,ot()))}:{value:e.value};async function Jz(e,t){let r={async:!0};return Id(await e._zod.run({value:t,issues:[]},r),r)}function sa(e){return{validate:(t)=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return Id(o,r)}catch(o){}return Jz(e,t)},vendor:"zod",version:1}}var ls=L("$ZodString",(e,t)=>{xe.init(e,t),e._zod.pattern=t.pattern??nd,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Ne=L("$ZodStringFormat",(e,t)=>{Uo.init(e,t),ls.init(e,t)}),Nd=L("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Fl),Ne.init(e,t)}),Ad=L("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Xi(o))}else t.pattern??(t.pattern=Xi());Ne.init(e,t)}),jd=L("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Vl),Ne.init(e,t)}),Md=1,cs=2;function Zd(e){try{if(typeof URL<"u"&&typeof URL.canParse==="function")return URL.canParse(e);return new URL(e),!0}catch{return!1}}function Kz(e,t){if(!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t))return Zd(e)||cs;return Gz(e,t)}function Gz(e,t){if(!t.normalize&&t.protocol?.source===Xl.source&&!/^https?:\/\//i.test(e))return Md;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse==="function")return r.parse(e)??cs}return new URL(e)}catch{return cs}}var Wz=/[\t\n\r]/g;function $d(e){return e.replace(Wz,"")}function Yz(e,t){return t.lastIndex=0,t.test(e.hostname)}function Xz(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var qd=L("$ZodURL",(e,t)=>{Ne.init(e,t),e._zod.check=(r)=>{try{let o=r.value.trim(),n=Kz(o,t);if(n===Md){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(n===cs){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(n===!0){r.value=$d(o);return}if(t.hostname&&!Yz(n,t.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort});if(t.protocol&&!Xz(n,t.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort});r.value=t.normalize?n.href:$d(o);return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Ld=L("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Hl()),Ne.init(e,t)}),Dd=L("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Ll:Dl(t.length)),Ne.init(e,t)}),Ud=L("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Al),Ne.init(e,t)}),Fd=L("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=jl),Ne.init(e,t)}),Vd=L("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ml),Ne.init(e,t)}),Hd=L("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Zl),Ne.init(e,t)}),Bd=L("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ql),Ne.init(e,t)}),Jd=L("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=od(t)),Ne.init(e,t)}),Kd=L("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=td),Ne.init(e,t)}),Gd=L("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=rd(t)),Ne.init(e,t)}),Wd=L("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ul),Ne.init(e,t)}),Yd=L("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Bl),Ne.init(e,t)}),Qz=/^[0-9a-fA-F:.]+$/;function Xd(e){if(!Qz.test(e))return!1;return Zd(`http://[${e}]`)}var Qd=L("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Jl),Ne.init(e,t),e._zod.check=(r)=>{if(!Xd(r.value))r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var tp=L("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Kl),Ne.init(e,t)});function e$(e){let t=e.split("/");if(t.length!==2)return!1;let[r,o]=t;if(!o)return!1;let n=Number(o);if(`${n}`!==o)return!1;if(n<0||n>128)return!1;return Xd(r)}var rp=L("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Gl),Ne.init(e,t),e._zod.check=(r)=>{if(!e$(r.value))r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function op(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var ia=/^[0-9a-zA-Z+/]*={0,2}$/,np=L("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ia),Ne.init(e,t),e._zod.check=(r)=>{if(op(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),ds=/^[A-Za-z0-9_-]*$/;function t$(e){if(!ds.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return op(r)}var sp=L("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ds),Ne.init(e,t),e._zod.check=(r)=>{if(t$(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),ip=L("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ql),Ne.init(e,t)});function r$(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(t&&(!("alg"in n)||n.alg!==t))return!1;return!0}catch{return!1}}var ap=L("$ZodJWT",(e,t)=>{Ne.init(e,t),e._zod.check=(r)=>{if(r$(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var aa=L("$ZodNumber",(e,t)=>{xe.init(e,t),e._zod.pattern=Do,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(i){}let n=r.value;if(typeof n==="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let s=typeof n==="number"?Number.isNaN(n)?"NaN":!Number.isFinite(n)?String(n):void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),cp=L("$ZodNumberFormat",(e,t)=>{ld.init(e,t),aa.init(e,t)}),up=L("$ZodBoolean",(e,t)=>{xe.init(e,t),e._zod.pattern=sd,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(s){}let n=r.value;if(typeof n==="boolean")return r;return r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}});var lp=L("$ZodNull",(e,t)=>{xe.init(e,t),e._zod.pattern=id,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;if(n===null)return r;return r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),dp=L("$ZodAny",(e,t)=>{xe.init(e,t),e._zod.parse=(r)=>r}),pp=L("$ZodUnknown",(e,t)=>{xe.init(e,t),e._zod.parse=(r)=>r}),mp=L("$ZodNever",(e,t)=>{xe.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function o$(e,t){let r=Li(e._zod.def.checks);if(!r.length)return;let o=Math.min(...r.map((s)=>s[0])),n=e._zod.parse;e._zod.parse=(s,i)=>{let a=t(s.value);if(a>o&&!i?.skipChecks&&i?.direction!=="backward"){for(let[c,u]of Li(e._zod.def.checks))if(a>c&&u._zod.def.when(s)){let l=s.issues.length;return u._zod.check(s),s.issues[l].continue=!1,Wn(s.issues,l,e),s}}return n(s,i)}}var n$=(e)=>Array.isArray(e)?e.length:-1;function Rd(e,t,r){if(e.issues.length)t.issues.push(...Yt(r,e.issues));t.value[r]=e.value}var fp=L("$ZodArray",(e,t)=>{xe.init(e,t);let r=rt.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!Array.isArray(s))return o.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),o;o.value=r?r.alloc(e,o,Array(s.length),n):Array(s.length);let i=[],a=n?.abortEarly;for(let c=0;c<s.length;c++){let u=s[c],l=t.element._zod.run({value:u,issues:[]},n);if(l instanceof Promise)i.push(l.then((d)=>Rd(d,o,c)));else if(Rd(l,o,c),a&&l.issues.length!==0&&Et(l))break}if(i.length)return Promise.all(i).then(()=>o);return o},o$(e,n$)});function us(e,t,r,o,n,s){let i=r in o,a=s==="optional";if(!i&&a&&n==="optional")return;if(e.issues.length){if(n!==void 0&&a&&!i)return;t.issues.push(...Yt(r,e.issues))}if(!i&&n===void 0){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(i||n==="defaulted"&&!a)t.value[r]=void 0}else t.value[r]=e.value}var s$=[];function hp(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),o=r.length?r:s$,n=o.length?[...t,...o]:t;for(let i of n)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(i)}": expected a Zod schema`);let s=ml(e.shape);return{...e,allKeys:n,symbolKeys:o,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function gp(e,t,r,o,n,s,i){let a=[],c=n.keySet,u=n.catchall._zod,l=u.def.type,{optin:d,optout:m}=u,h=0;for(let f in t){if(i&&r.issues.length!==h){if(Et(r,h))break;h=r.issues.length}if(c.has(f))continue;if(f==="__proto__"){if(l==="never")a.push(f);continue}if(l==="never"){a.push(f);continue}let v=u.run({value:t[f],issues:[]},o);if(v instanceof Promise)e.push(v.then((y)=>us(y,r,f,t,d,m)));else us(v,r,f,t,d,m)}if(a.length)r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s,continue:!0});if(!e.length)return r;return Promise.all(e).then(()=>r)}var i$=L("$ZodObject",(e,t)=>{xe.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),o=r?.get?r.get.raw:t.shape??{};if(o){let u=()=>{let l={...o};return Object.defineProperty(t,"shape",{value:l}),u.raw=l,l};u.raw=o,Object.defineProperty(t,"shape",{get:u})}let n=Zo(()=>hp(t));ve(e,"propValues",(u)=>{let l=u.def.shape,d={};for(let m in l){let h=l[m]._zod;if(h.values){if(!Object.prototype.hasOwnProperty.call(d,m))yt(d,m,new Set);for(let f of h.values)d[m].add(f);if(h.optin!==void 0)d[m].add(void 0)}}return d});let s=qr,i=t.catchall,a,c=rt.memoizer;c?.attach(e),e._zod.parse=(u,l)=>{a??(a=n.value);let d=u.value;if(!s(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u;u.value=c?c.alloc(e,u,{},l):{};let m=[],h=a.shape,f=l?.abortEarly,v=u.issues.length;for(let y of a.allKeys){if(f&&u.issues.length!==v){if(Et(u,v))break;v=u.issues.length}if(y==="__proto__")continue;let g=h[y],P=g._zod.optin,w=g._zod.optout,x=g._zod.run({value:d[y],issues:[]},l);if(x instanceof Promise)m.push(x.then((O)=>us(O,u,y,d,P,w)));else us(x,u,y,d,P,w)}if(!i)return m.length?Promise.all(m).then(()=>u):u;return gp(m,d,u,l,n.value,e,f===!0)}}),_p=L("$ZodObjectJIT",(e,t)=>{i$.init(e,t);let r=e._zod.parse,o=Zo(()=>hp(t)),n=rt.memoizer,s=(h)=>{let f=o.value,v=f.symbolKeys,y=new oa(["payload","ctx"],{shape:h,inst:e,memo:n,syms:v}),g=(O)=>`shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`,P=(O,R)=>`
|
|
7
|
+
let ${O}_ab = false;
|
|
8
|
+
for (let i = 0; i < ${O}.issues.length; i++) {
|
|
9
|
+
const iss = ${O}.issues[i];
|
|
10
|
+
iss.path = iss.path ? [${R}, ...iss.path] : [${R}];
|
|
11
|
+
payload.issues.push(iss);
|
|
12
|
+
if (iss.continue !== true) ${O}_ab = true;
|
|
13
|
+
}
|
|
14
|
+
if (${O}_ab && ctx && ctx.abortEarly) {
|
|
15
|
+
payload.value = newResult;
|
|
16
|
+
return payload;
|
|
17
|
+
}`;y.write("const input = payload.value;");let w=Object.create(null),x=0;for(let O of f.allKeys)w[O]=`key_${x++}`;y.write(n?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let O of f.allKeys){if(O==="__proto__")continue;let R=w[O],S=typeof O==="symbol"?`syms[${v.indexOf(O)}]`:ul(O),E=`${S} in input`,A=h[O],H=A?._zod?.optin,j=H!==void 0,V=A?._zod?.optout==="optional";if(y.write(`const ${R} = ${g(S)};`),j&&V){let W=H==="optional"?`${R}_present`:`${R}.value !== undefined || ${R}_present`;y.write(`
|
|
18
|
+
const ${R}_present = ${E};
|
|
19
|
+
if (!${R}.issues.length || ${R}_present) {
|
|
20
|
+
if (${R}.issues.length) {${P(R,S)}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (${W}) {
|
|
24
|
+
newResult[${S}] = ${R}.value;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
`)}else if(!j)y.write(`
|
|
29
|
+
const ${R}_present = ${E};
|
|
30
|
+
if (${R}.issues.length) {${P(R,S)}
|
|
31
|
+
}
|
|
32
|
+
if (!${R}_present && !${R}.issues.length) {
|
|
33
|
+
payload.issues.push({
|
|
34
|
+
code: "invalid_type",
|
|
35
|
+
expected: "nonoptional",
|
|
36
|
+
input: undefined,
|
|
37
|
+
path: [${S}]
|
|
38
|
+
});
|
|
39
|
+
if (ctx && ctx.abortEarly) {
|
|
40
|
+
payload.value = newResult;
|
|
41
|
+
return payload;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (${R}_present) {
|
|
46
|
+
newResult[${S}] = ${R}.value;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
`);else if(y.write(`
|
|
50
|
+
if (${R}.issues.length) {${P(R,S)}
|
|
51
|
+
}
|
|
52
|
+
`),H==="defaulted")y.write(`newResult[${S}] = ${R}.value;`);else y.write(`
|
|
53
|
+
if (${R}.value !== undefined || ${E}) {
|
|
54
|
+
newResult[${S}] = ${R}.value;
|
|
55
|
+
}
|
|
56
|
+
`)}return y.write("payload.value = newResult;"),y.write("return payload;"),y.compile()},i,a=qr,c=!rt.jitless,l=c&&dl.value,d=t.catchall,m;e._zod.parse=(h,f)=>{m??(m=o.value);let v=h.value;if(!a(v))return h.issues.push({expected:"object",code:"invalid_type",input:v,inst:e}),h;if(c&&l&&f?.async===!1&&f.jitless!==!0){if(!i)i=s(t.shape);if(h=i(h,f),!d)return h;return gp([],v,h,f,m,e,f?.abortEarly===!0)}return r(h,f)}});function wd(e,t,r,o){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let n=e.filter((s)=>!Et(s));if(n.length===1)return t.value=n[0].value,n[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((s)=>s.issues.map((i)=>Tt(i,o,ot())))}),t}var ca=L("$ZodUnion",(e,t)=>{xe.init(e,t),ve(e,"optin",(o)=>o.def.options.some((n)=>n._zod.optin==="defaulted")?"defaulted":o.def.options.some((n)=>n._zod.optin!==void 0)?"optional":void 0),ve(e,"optout",(o)=>o.def.options.some((n)=>n._zod.optout==="optional")?"optional":void 0),ve(e,"values",(o)=>{if(o.def.options.every((n)=>n._zod.values))return new Set(o.def.options.flatMap((n)=>Array.from(n._zod.values)));return}),ve(e,"pattern",(o)=>{if(o.def.options.every((n)=>n._zod.pattern)){let n=o.def.options.map((s)=>s._zod.pattern);return new RegExp(`^(${n.map((s)=>Jn(s.source)).join("|")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let s=!1,i=[];for(let a of t.options){let c=a._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}if(!s)return wd(i,o,e,n);return Promise.all(i).then((a)=>wd(a,o,e,n))}});function a$(e){let t=new Map;for(let r of e.options){let o=r._zod.propValues?.[e.discriminator];if(!o||o.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let n of o)if(t.has(n)){if(n!==void 0)throw Error(`Duplicate discriminator value "${String(n)}"`);t.set(n,null)}else t.set(n,r)}return t}var yp=L("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ca.init(e,t);let r=e._zod.parse;ve(e,"propValues",(n)=>{let s={},i=0;for(let a of n.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw Error(`Invalid discriminated union option at index "${n.def.options.indexOf(a)}"`);if(c[n.def.discriminator]?.has(void 0))i++;for(let[u,l]of Object.entries(c)){if(!Object.prototype.hasOwnProperty.call(s,u))yt(s,u,new Set);for(let d of l)s[u].add(d)}}if(!n.def.unionFallback&&i>1)s[n.def.discriminator]?.delete(void 0);return s}),t.options.forEach((n,s)=>{let i=qo(n._zod.def);if(i&&!Object.prototype.hasOwnProperty.call(i,t.discriminator))throw Error(`Invalid discriminated union option at index "${s}"`)});let o=Zo(()=>a$(t));e._zod.parse=(n,s)=>{let i=n.value;if(!qr(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),n;let a=i?.[t.discriminator],c=o.value.get(a);if(c&&(a!==void 0||s.direction!=="backward"))return c._zod.run(n,s);if(t.unionFallback||s.direction==="backward")return r(n,s);return n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()).filter((u)=>o.value.get(u)!==null),input:i,path:[t.discriminator],inst:e}),n}}),vp=L("$ZodIntersection",(e,t)=>{xe.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,s=t.left._zod.run({value:n,issues:[]},o),i=t.right._zod.run({value:n,issues:[]},o);if(s instanceof Promise||i instanceof Promise)return Promise.all([s,i]).then(([c,u])=>Pd(r,c,u));return Pd(r,s,i)}});function na(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(yr(e)&&yr(t)){let r=Object.keys(t),o=Object.keys(e).filter((s)=>r.indexOf(s)!==-1),n={...e,...t};if(Object.prototype.hasOwnProperty.call(n,"__proto__"))delete n.__proto__;for(let s of o){if(s==="__proto__")continue;let i=na(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};n[s]=i.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],s=t[o],i=na(n,s);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Pd(e,t,r){let o=new Map,n,s=new Map,i=(u,l)=>{let d;if(u.code==="unrecognized_keys"&&!u.path?.length)n??(n=u),d=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let m=String(u.path[0]);if(!s.has(m))s.set(m,u);d=[m]}else return!1;for(let m of d){if(!o.has(m))o.set(m,{});o.get(m)[l]=!0}return!0};for(let u of t.issues)if(!i(u,"l"))e.issues.push(u);for(let u of r.issues)if(!i(u,"r"))e.issues.push(u);let a=[...o].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){let u=n?a.filter((l)=>n.keys.includes(l)):[];if(u.length)e.issues.push({...n,keys:u});for(let l of a)if(!u.includes(l)&&s.has(l))e.issues.push(s.get(l))}let c=na(t.value,r.value);if(!c.valid){if(Et(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Sp=L("$ZodRecord",(e,t)=>{xe.init(e,t);let r=rt.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!yr(s))return o.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),o;let i=[],a=t.keyType._zod.values;if(a&&!t.partial){o.value=r?r.alloc(e,o,{},n):{};let c=new Set;for(let l of a)if(typeof l==="string"||typeof l==="number"||typeof l==="symbol"){if(c.add(typeof l==="number"?l.toString():l),l==="__proto__")continue;let d=t.keyType._zod.run({value:l,issues:[]},n);if(d instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(d.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map((f)=>Tt(f,n,ot())),input:l,path:[l],inst:e});continue}let m=d.value;if(m==="__proto__")continue;let h=t.valueType._zod.run({value:s[l],issues:[]},n);if(h instanceof Promise)i.push(h.then((f)=>{if(f.issues.length)o.issues.push(...Yt(l,f.issues));o.value[m]=f.value}));else{if(h.issues.length)o.issues.push(...Yt(l,h.issues));o.value[m]=h.value}}let u;for(let l in s)if(!c.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;o.value[l]=s[l]}else u=u??[],u.push(l);if(u&&u.length>0)o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:u,continue:!0})}else{o.value=r?r.alloc(e,o,{},n):{};let c;for(let u of Reflect.ownKeys(s)){if(u==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(s,u))continue;let l=t.keyType._zod.run({value:u,issues:[]},n);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof u==="string"&&Do.test(u)&&l.issues.length){let f=t.keyType._zod.run({value:Number(u),issues:[]},n);if(f instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(f.issues.length===0)l=f}if(l.issues.length){if(t.mode==="loose")o.value[u]=s[u];else if(a)c=c??[],c.push(u);else o.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map((f)=>Tt(f,n,ot())),input:u,path:[u],inst:e});continue}let m=l.value;if(m==="__proto__")continue;let h=t.valueType._zod.run({value:s[u],issues:[]},n);if(h instanceof Promise)i.push(h.then((f)=>{if(f.issues.length)o.issues.push(...Yt(u,f.issues));o.value[m]=f.value}));else{if(h.issues.length)o.issues.push(...Yt(u,h.issues));o.value[m]=h.value}}if(c&&c.length>0)o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:c,continue:!0})}if(i.length)return Promise.all(i).then(()=>o);return o}});var bp=L("$ZodEnum",(e,t)=>{xe.init(e,t);let r=jo(t.entries),o=new Set(r);e._zod.values=o,ve(e,"pattern",(n)=>{let s=jo(n.def.entries).filter((i)=>pl.has(typeof i));return new RegExp(s.length?`^(${s.map((i)=>Wt(i.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,s)=>{let i=n.value;if(o.has(i))return n;return n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),zp=L("$ZodLiteral",(e,t)=>{xe.init(e,t);let r=new Set(t.values);e._zod.values=r,ve(e,"pattern",(o)=>{let n=o.def.values;return new RegExp(n.length?`^(${n.map((s)=>typeof s==="string"?Wt(s):s?Wt(s.toString()):String(s)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,n)=>{let s=o.value;if(r.has(s))return o;return o.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),o}});var $p=L("$ZodTransform",(e,t)=>{xe.init(e,t),e._zod.optin="optional",rt.memoizer?.guard(e),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Lo(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then((i)=>(r.value=i,r));if(n instanceof Promise)throw new Ot;return r.value=n,r}});function kd(e,t){return e.value=t.issues.length?void 0:t.value,e}var ua=L("$ZodOptional",(e,t)=>{xe.init(e,t),ve(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",ve(e,"values",(r)=>{let o=r.def.innerType._zod.values;return o?new Set([...o,void 0]):void 0}),ve(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${Jn(o.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let n=t.innerType._zod.run({value:r.value,issues:[]},o);if(n instanceof Promise)return n.then((s)=>kd(r,s));return kd(r,n)}return t.innerType._zod.run(r,o)}}),Rp=L("$ZodExactOptional",(e,t)=>{ua.init(e,t),ve(e,"values",(r)=>r.def.innerType._zod.values),ve(e,"pattern",(r)=>r.def.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),wp=L("$ZodNullable",(e,t)=>{xe.init(e,t),ve(e,"optin",(r)=>r.def.innerType._zod.optin),ve(e,"optout",(r)=>r.def.innerType._zod.optout),ve(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${Jn(o.source)}|null)$`):void 0}),ve(e,"values",(r)=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>{if(r.value===null)return r;return t.innerType._zod.run(r,o)}}),Pp=L("$ZodDefault",(e,t)=>{xe.init(e,t),e._zod.optin="defaulted",ve(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>xd(s,t));return xd(n,t)}});function xd(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var kp=L("$ZodPrefault",(e,t)=>{xe.init(e,t),e._zod.optin="defaulted",ve(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,o)}}),xp=L("$ZodNonOptional",(e,t)=>{xe.init(e,t),ve(e,"values",(r)=>{let o=r.def.innerType._zod.values;return o?new Set([...o].filter((n)=>n!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>Ed(s,e));return Ed(n,e)}});function Ed(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function Td(e,t,r,o){if(!t.issues.length){if(e.value=t.value,t.memo)e.memo=!0;return e}return e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map((n)=>Tt(n,o,ot()))},input:e.value}),e}var Ep=L("$ZodCatch",(e,t)=>{xe.init(e,t),ve(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),ve(e,"optout",(r)=>r.def.innerType._zod.optout),ve(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run({value:r.value,issues:[]},o);if(n instanceof Promise)return n.then((s)=>Td(r,s,t,o));return Td(r,n,t,o)}});var la=L("$ZodPipe",(e,t)=>{xe.init(e,t),ve(e,"values",(r)=>r.def.in._zod.values),ve(e,"optin",(r)=>r.def.in._zod.optin),ve(e,"optout",(r)=>r.def.out._zod.optout),ve(e,"propValues",(r)=>r.def.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let s=t.out._zod.run(r,o);if(s instanceof Promise)return s.then((i)=>as(i,t.in,o));return as(s,t.in,o)}let n=t.in._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>as(s,t.out,o));return as(n,t.out,o)}});function as(e,t,r){if(e.issues.some((o)=>o.code!=="unrecognized_keys"))return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},r)}var Tp=L("$ZodPreprocess",(e,t)=>{la.init(e,t)}),Op=L("$ZodReadonly",(e,t)=>{xe.init(e,t),ve(e,"propValues",(r)=>r.def.innerType._zod.propValues),ve(e,"values",(r)=>r.def.innerType._zod.values),ve(e,"optin",(r)=>r.def.innerType?._zod?.optin),ve(e,"optout",(r)=>r.def.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then(Od);return Od(n)}});function Od(e){if(!e.memo)e.value=Object.freeze(e.value);return e}var Cp=L("$ZodLazy",(e,t)=>{xe.init(e,t),il(e._zod,"innerType",()=>{let r=t;if(!r._cachedInner)r._cachedInner=t.getter();return r._cachedInner}),ve(e,"pattern",(r)=>r.innerType?._zod?.pattern),ve(e,"propValues",(r)=>r.innerType?._zod?.propValues),ve(e,"optin",(r)=>r.innerType?._zod?.optin??void 0),ve(e,"optout",(r)=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),Ip=L("$ZodCustom",(e,t)=>{Je.init(e,t),xe.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=(r)=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then((s)=>Cd(s,r,o,e));Cd(n,r,o,e);return}});function Cd(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)n.params=o._zod.def.params;t.issues.push(vr(n))}}class Ap extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var pa="~memo",Np=[];function jp(e){return e!==null&&typeof e==="object"}function da(e){return e.map((t)=>t.path?{...t,path:t.path.slice()}:{...t})}var Mp=new WeakMap,Fo=0,fs=1,Vo=2;function hs(e,t,r){let o=Mp.get(e);if(o!==void 0)return o?Vo:Fo;if(t.has(e))return Vo;t.add(e);let n=Fo,s=(l)=>{if(n!==Vo&&l?._zod){let d=hs(l,t,r);if(d>n)n=d}},i=(l,d)=>{let m=Fo;for(let h of Reflect.ownKeys(l)){let f=Object.getOwnPropertyDescriptor(l,h);if(d&&!f.enumerable)continue;let v=f.get?fs:f.value?._zod?hs(f.value,t,r):Fo;if(v>m)m=v}return m},a=(l)=>{if(l>n)n=l},c=e._zod.def,u=c.type;switch(u){case"object":{let l=qo(c);a(l?i(l,!0):fs),s(c.catchall);break}case"array":s(c.element);break;case"tuple":for(let l of c.items)s(l);s(c.rest);break;case"record":case"map":s(c.keyType),s(c.valueType);break;case"set":s(c.valueType);break;case"union":for(let l of c.options)s(l);break;case"intersection":s(c.left),s(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(c.innerType);break;case"pipe":s(c.in),s(c.out);break;case"function":s(c.input),s(c.output);break;case"lazy":{let l=c._cachedInner??(r?e._zod.innerType:void 0);a(l?hs(l,t,!1):fs);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 l in c){let d=Object.getOwnPropertyDescriptor(c,l);if(!d||d.get)continue;let m=d.value;if(!m||typeof m!=="object")continue;if(m._zod)s(m);else if(Array.isArray(m))for(let h of m)s(h)}}return t.delete(e),c$(e,n)}function c$(e,t){if(t!==fs)Mp.set(e,t===Vo);return t}function u$(e,t){let r=e.buckets.get(t);if(!r)r=new WeakMap,e.buckets.set(t,r);return r}var ps,ms=[],l$={alloc(e,t,r){let o=ps;if(!o)return r;ps=void 0;let n={value:r,issues:null};return o.set(t.value,n),ms.push(n),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,o=(n,s)=>{if(s.direction!=="backward"&&d$(s,n.value))throw new Ap;return r(n,s)};if(e._zod.parse=o,e._zod.run===r)e._zod.run=o})},attach(e){var t;let r,o=!1,n,s;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let i=e._zod.parse,a=(c,u)=>{if(r===void 0){let g=hs(e,new Set,!1);if(g===Fo){if(e._zod.parse=i,e._zod.run===a)e._zod.run=i;return i(c,u)}if(g===Vo||o)r=!0;else o=!0}let l=c.value;if(!jp(l))return i(c,u);let d=u[pa];if(!d)d={buckets:new WeakMap,backEdges:void 0},u[pa]=d;let m;if(n===u)m=s;else m=u$(d,e),n=u,s=m;let h=m.get(l);if(h){if(c.value=h.value,h.issues){if(h.issues.length)c.issues.push(...da(h.issues))}else c.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(h.value);return c}ps=m;let f=ms.length,v=i(c,u);ps=void 0;let y=ms.length>f?ms.pop():void 0;if(v instanceof Promise)return v.then((g)=>{if(y)y.issues=g.issues.length?da(g.issues):Np;return g});if(y)y.issues=v.issues.length?da(v.issues):Np;return v};if(e._zod.parse=a,e._zod.run===i)e._zod.run=a})}};function ma(){return l$}function d$(e,t){let r=e[pa]?.backEdges;return r!==void 0&&jp(t)&&r.has(t)}var p$=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(s){return e[s]??null}let r={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",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};function n(s,i){if(s==="number"&&typeof i==="number"&&!Number.isFinite(i))return String(i);return o[s]??s}return(s)=>{switch(s.code){case"invalid_type":{let i=n(s.expected),a=_l(s.input),c=n(a,s.input);return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":if(s.values.length===1)return`Invalid input: expected ${Mi(s.values[0])}`;return`Invalid option: expected one of ${Ni(s.values,"|")}`;case"too_big":{let i=s.exact?"exactly ":s.inclusive?"<=":"<",a=t(s.origin);if(a)return`Too big: expected ${s.origin??"value"} to have ${i}${s.maximum.toString()} ${a.unit??"elements"}`;return`Too big: expected ${s.origin??"value"} to be ${i}${s.maximum.toString()}`}case"too_small":{let i=s.exact?"exactly ":s.inclusive?">=":">",a=t(s.origin);if(a)return`Too small: expected ${s.origin} to have ${i}${s.minimum.toString()} ${a.unit}`;return`Too small: expected ${s.origin} to be ${i}${s.minimum.toString()}`}case"invalid_format":{let i=s;if(i.format==="starts_with")return`Invalid string: must start with "${i.prefix}"`;if(i.format==="ends_with")return`Invalid string: must end with "${i.suffix}"`;if(i.format==="includes")return`Invalid string: must include "${i.includes}"`;if(i.format==="regex")return`Invalid string: must match pattern ${i.pattern}`;return`Invalid ${r[i.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${Ni(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":if(s.options&&Array.isArray(s.options)&&s.options.length>0)return`Invalid discriminator value. Expected ${s.options.map((a)=>`'${a}'`).join(" | ")}`;if(s.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function fa(){return{localeError:p$()}}var Zp;class qp{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let o={...r,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Lp(){return new qp}(Zp=globalThis).__zod_globalRegistry??(Zp.__zod_globalRegistry=Lp());var Xt=globalThis.__zod_globalRegistry;function ha(e){if(e.checks)e.checks=[...e.checks];return e}function Dp(e,t){return new e(ha({type:"string",...oe(t)}))}function Up(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...oe(t)})}function Fp(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...oe(t)})}function Vp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...oe(t)})}function Hp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...oe(t)})}function Bp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...oe(t)})}function Jp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...oe(t)})}function ga(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...oe(t)})}function Kp(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...oe(t)})}function Gp(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...oe(t)})}function Wp(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...oe(t)})}function Yp(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...oe(t)})}function Xp(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...oe(t)})}function Qp(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...oe(t)})}function em(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...oe(t)})}function tm(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...oe(t)})}function rm(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...oe(t)})}function om(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...oe(t)})}function nm(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...oe(t)})}function sm(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...oe(t)})}function im(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...oe(t)})}function am(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...oe(t)})}function cm(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...oe(t)})}function gs(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...oe(t)})}function ya(e,t){return new e({type:"string",format:"date",check:"string_format",...oe(t)})}function va(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...oe(t)})}function Sa(e,t){return new e({type:"string",format:"duration",check:"string_format",...oe(t)})}function um(e,t){return new e(ha({type:"number",checks:[],...oe(t)}))}function lm(e,t){return new e(ha({type:"number",coerce:!0,checks:[],...oe(t)}))}function dm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...oe(t)})}function pm(e,t){return new e({type:"boolean",...oe(t)})}function mm(e,t){return new e({type:"null",...oe(t)})}function fm(e){return new e({type:"any"})}function hm(e){return new e({type:"unknown"})}function _m(e,t){return new e({type:"never",...oe(t)})}function _s(e,t){return new ta({check:"less_than",...oe(t),value:e,inclusive:!1})}function Ho(e,t){return new ta({check:"less_than",...oe(t),value:e,inclusive:!0})}function ys(e,t){return new ra({check:"greater_than",...oe(t),value:e,inclusive:!1})}function Bo(e,t){return new ra({check:"greater_than",...oe(t),value:e,inclusive:!0})}function vs(e,t){return new ud({check:"multiple_of",...oe(t),value:e})}function Ss(e,t){return new dd({check:"max_length",...oe(t),maximum:e})}function Dr(e,t){return new pd({check:"min_length",...oe(t),minimum:e})}function bs(e,t){return new md({check:"length_equals",...oe(t),length:e})}function ba(e,t){return new fd({check:"string_format",format:"regex",...oe(t),pattern:e})}function za(e){return new hd({check:"string_format",format:"lowercase",...oe(e)})}function $a(e){return new gd({check:"string_format",format:"uppercase",...oe(e)})}function Ra(e,t){return new _d({check:"string_format",format:"includes",...oe(t),includes:e})}function wa(e,t){return new yd({check:"string_format",format:"starts_with",...oe(t),prefix:e})}function Pa(e,t){return new vd({check:"string_format",format:"ends_with",...oe(t),suffix:e})}function Qt(e){return new Sd({check:"overwrite",tx:e})}function ka(e){return Qt((t)=>t.normalize(e))}function xa(){return Qt((e)=>e.trim())}function Ea(){return Qt((e)=>e.toLowerCase())}function Ta(){return Qt((e)=>e.toUpperCase())}function Oa(){return Qt((e)=>ll(e))}function zm(e,t,r){return new e({type:"array",element:t,...oe(r)})}function $m(e,t,r){return new e({type:"custom",check:"custom",fn:t,...oe(r)})}function Rm(e,t){let r=m$((o)=>(o.addIssue=(n)=>{if(typeof n==="string")o.issues.push(vr(n,o.value,r._zod.def));else{let s=n;if(s.fatal)s.continue=!1;if(s.code??(s.code="custom"),!("input"in s))s.input=o.value;s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),o.issues.push(vr(s))}},e(o.value,o)),t);return r}function m$(e,t){let r=new Je({check:"custom",...oe(t)});return r._zod.check=e,r}function Jo(e,...t){for(let r of t)for(let o of Reflect.ownKeys(r))if(Object.prototype.propertyIsEnumerable.call(r,o))yt(e,o,r[o]);return e}function Ia(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??Xt,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Lt(e,t,r,o,n){let s=typeof t.unrepresentable==="function"?t.unrepresentable({zodSchema:e,path:o.path,message:n}):t.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw Error(n);return Object.assign(r,s),!0}function Ue(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,s=t.seen.get(e);if(s){if(s.count++,r.schemaPath.includes(e))s.cycle=r.path;return s.schema}let i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,l);else{let m=i.schema,h=t.processors[n.type];if(!h)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);h(e,t,m,l)}let d=e._zod.parent;if(d){if(!i.ref)i.ref=d;Ue(d,t,l),t.seen.get(d).isParent=!0}}let c=t.metadataRegistry.get(e);if(c)Jo(i.schema,c);if(t.io==="input"&&Qe(e))delete i.schema.examples,delete i.schema.default;if(t.io==="input"&&"_prefault"in i.schema)(o=i.schema).default??(o.default=i.schema._prefault);return delete i.schema._prefault,t.seen.get(e).schema}function Pm(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Na(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let o=new Map;for(let i of e.seen.entries()){let a=e.metadataRegistry.get(i[0])?.id;if(a){let c=o.get(a);if(c&&c!==i[0])throw Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,i[0])}}let n=(i)=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(i[0])?.id,m=e.external.uri??((f)=>f);if(d)return{ref:m(d)};let h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${m("__shared")}#/${a}/${Pm(h)}`}}let c="#",u=`${c}/${a}/`;if(i[1]===r&&!i[1].schema.id)return{ref:c};let l=i[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+Pm(l)}},s=(i)=>{if(i[1].schema.$ref)return;let a=i[1],{ref:c,defId:u}=n(i);if(a.def={...a.schema},u)a.defId=u;let l=a.schema;for(let d in l)delete l[d];l.$ref=c};if(e.cycles==="throw")for(let i of e.seen.entries()){let a=i[1];if(a.cycle)throw Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
57
|
+
|
|
58
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let a=i[1];if(t===i[0]){s(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1){if(e.reused==="ref")s(i)}}if(e.external)e.sharedDefsExtractedFor=e.external}function Em(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let o of t){if(!o||typeof o!=="object")return;Em(o);let n=Object.keys(o);if(n.length!==1||n[0]!=="type")return;let s=o.type;for(let i of Array.isArray(s)?s:[s]){if(typeof i!=="string")return;if(!r.includes(i))r.push(i)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var Tm=new Set(["type","properties","required","additionalProperties"]),km=["oneOf","anyOf"];function xm(e){let t=e.additionalProperties;if(t===void 0||t===!1||typeof t!=="object"||t===null)return null;return Object.keys(t).length?t:null}function Ca(e){let t=[];for(let s of e){if(typeof s!=="object"||s.type!=="object")return null;for(let i in s)if(!Tm.has(i))return null;t.push(s)}let r={},o=new Set;for(let s of t){for(let i in s.properties){if(Object.prototype.hasOwnProperty.call(r,i))continue;let a=[];for(let u of t){let l=u.properties?.[i]??xm(u);if(l===null||l===void 0)continue;if(!a.some((d)=>JSON.stringify(d)===JSON.stringify(l)))a.push(l)}let c=a.length===1?a[0]:Ca(a)??{allOf:a};yt(r,i,c)}for(let i of s.required??[])o.add(i)}let n={type:"object",properties:r};if(o.size)n.required=[...o];if(t.every((s)=>s.additionalProperties===!1))n.additionalProperties=!1;else{let s=[];for(let i of t){let a=xm(i);if(a&&!s.some((c)=>JSON.stringify(c)===JSON.stringify(a)))s.push(a)}if(s.length===1)n.additionalProperties=s[0];else if(s.length>1)n.additionalProperties={allOf:s}}return n}function f$(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let n of Tm)if(n in e)return;let r=t.filter((n)=>km.some((s)=>Array.isArray(n[s]))),o=null;if(!r.length)o=Ca(t);else{let n=r[0],s=km.find((c)=>Array.isArray(n[c]));if(Object.keys(n).length!==1)return;let i=t.filter((c)=>c!==n),a=n[s].map((c)=>Ca([...i,c]));if(a.some((c)=>!c))return;o={[s]:a}}if(!o)return;delete e.allOf,Jo(e,o)}function Aa(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=(a)=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){o(d);let h=e.seen.get(d),f=h.schema;if(f.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))u.allOf=u.allOf??[],u.allOf.push(f);else Jo(u,f);if(Jo(u,l),a._zod.parent===d)for(let y in u){if(y==="$ref"||y==="allOf")continue;if(!(y in l))delete u[y]}if(f.$ref&&h.def)for(let y in u){if(y==="$ref"||y==="allOf")continue;if(y in h.def&&JSON.stringify(u[y])===JSON.stringify(h.def[y]))delete u[y]}}let m=a._zod.parent;if(m&&m!==d){o(m);let h=e.seen.get(m);if(h?.schema.$ref){if(u.$ref=h.schema.$ref,h.def)for(let f in u){if(f==="$ref"||f==="allOf")continue;if(f in h.def&&JSON.stringify(u[f])===JSON.stringify(h.def[f]))delete u[f]}}}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())o(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())Em(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let u of[c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let d=a.get(l);if(d)d.push(u);else a.set(l,[u])}for(let c of e.intersections)for(let u of a.get(c)??[])f$(u)}}let n={};if(e.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")n.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")n.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(a)}Jo(n,r.defId?r.schema:r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;if(s!==void 0&&n.id===s)delete n.id;let i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];if(c.def&&c.defId){if(c.def.id===c.defId)delete c.def.id;yt(i,c.defId,c.def)}}if(e.external)e.sharedEmitDoneFor=e.external;if(e.external);else if(Object.keys(i).length>0)if(e.target==="draft-2020-12")n.$defs=i;else n.definitions=i;try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ko(t,"input",e.processors),output:Ko(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch(a){throw Error("Error converting schema to JSON.")}}function Qe(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Qe(o.element,r);if(o.type==="set")return Qe(o.valueType,r);if(o.type==="lazy")return Qe(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return Qe(o.innerType,r);if(o.type==="intersection")return Qe(o.left,r)||Qe(o.right,r);if(o.type==="record"||o.type==="map")return Qe(o.keyType,r)||Qe(o.valueType,r);if(o.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return Qe(o.in,r)||Qe(o.out,r)}if(o.type==="object"){for(let n in o.shape)if(Qe(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Qe(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Qe(n,r))return!0;if(o.rest&&Qe(o.rest,r))return!0;return!1}return!1}var Om=(e,t={})=>(r)=>{let o=Ia({...r,processors:t});return Ue(e,o),Na(o,e),Aa(o,e)},Ko=(e,t,r={})=>(o)=>{let{libraryOptions:n,target:s}=o??{},i=Ia({...n??{},target:s,io:t,processors:r});return Ue(e,i),Na(i,e),Aa(i,e)};var Ur=(e,t,r)=>{if(e[t]===void 0||r>e[t])e[t]=r},Fr=(e,t,r)=>{if(e[t]===void 0||r<e[t])e[t]=r},Cm=(e,t)=>{Ur(e,"minimum",t),Fr(e,"maximum",t)},jm=(e,t)=>{if(e.multipleOf??(e.multipleOf=[]),!e.multipleOf.includes(t))e.multipleOf.push(t)},Mm=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},Zm=(e,t)=>{e.mime=e.mime?e.mime.filter((r)=>t.includes(r)):[...t]},qm=(e,t)=>{if(e.format=t,t.includes("int"))e.isInt=!0},Im=(e,t)=>Ur(e,"minimum",t.minimum),Nm=(e,t)=>Fr(e,"maximum",t.maximum),Am=(e)=>(t,r)=>{qm(t,r.format);let[o,n]=e[r.format];Ur(t,"minimum",o),Fr(t,"maximum",n)},h$={greater_than:(e,t)=>Ur(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Fr(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>jm(e,t.value),number_format:Am(Kn),bigint_format:Am(Zi),min_length:Im,max_length:Nm,length_equals:(e,t)=>Cm(e,t.length),min_size:Im,max_size:Nm,size_equals:(e,t)=>Cm(e,t.size),string_format:(e,t)=>{if(qm(e,t.format),t.pattern)Mm(e,t.pattern);if(t.format==="base64"||t.format==="base64url")e.contentEncoding=t.format;if(t.local||t.precision===-1)e.laxFormat=!0},mime_type:(e,t)=>Zm(e,t.mime)};function St(e){let t={},r=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let s of o)h$[s._zod.def.check]?.(t,s._zod.def);let n=e._zod.bag;if(n.minimum!==void 0)Ur(t,"minimum",n.minimum);if(n.exclusiveMinimum!==void 0)Ur(t,"exclusiveMinimum",n.exclusiveMinimum);if(n.maximum!==void 0)Fr(t,"maximum",n.maximum);if(n.exclusiveMaximum!==void 0)Fr(t,"exclusiveMaximum",n.exclusiveMaximum);if(n.multipleOf!==void 0)jm(t,n.multipleOf);if(n.format!==void 0){if(t.format??(t.format=n.format),n.format.includes("int"))t.isInt=!0}if(n.mime)Zm(t,n.mime);for(let s of n.patterns??[])Mm(t,s);return t}var g$={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},_$=new Map([[ia,Wl],[ds,Yl]]),Lm=(e)=>_$.get(e)??e,Dm=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u,laxFormat:l}=St(e);if(typeof s==="number")n.minLength=s;if(typeof i==="number")n.maxLength=i;if(a){if(n.format=g$[a]??a,n.format==="")delete n.format;if(a==="time"||l)delete n.format}if(u)n.contentEncoding=u;if(c&&c.size>0){let d=[...c].map(Lm);if(d.length===1)n.pattern=d[0].source;else if(d.length>1)n.allOf=[...d.map((m)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))]}},Um=(e,t,r,o)=>{let n=r,{minimum:s,maximum:i,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=St(e);n.type=l?"integer":"number";let d=typeof u==="number"&&u>=(s??Number.NEGATIVE_INFINITY),m=typeof c==="number"&&c<=(i??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";if(d)if(h)n.minimum=u,n.exclusiveMinimum=!0;else n.exclusiveMinimum=u;else if(typeof s==="number")n.minimum=s;if(m)if(h)n.maximum=c,n.exclusiveMaximum=!0;else n.exclusiveMaximum=c;else if(typeof i==="number")n.maximum=i;if(a){let f=new Set;for(let g of a)if(Number.isFinite(g)&&g!==0)f.add(Math.abs(g));else Lt(e,t,n,o,`A multipleOf divisor of ${g} cannot be represented in JSON Schema`);let[v,...y]=f;if(v!==void 0)n.multipleOf=v;if(y.length)n.allOf=[...n.allOf??[],...y.map((g)=>({multipleOf:g}))]}},Fm=(e,t,r,o)=>{r.type="boolean"};var Vm=(e,t,r,o)=>{if(t.target==="openapi-3.0")r.type="string",r.nullable=!0,r.enum=[null];else r.type="null"};var Hm=(e,t,r,o)=>{r.not={}},Bm=(e,t,r,o)=>{},Jm=(e,t,r,o)=>{};var Km=(e,t,r,o)=>{let n=e._zod.def,s=jo(n.entries);if(s.length===0){r.not={};return}if(s.every((i)=>typeof i==="number"))r.type="number";if(s.every((i)=>typeof i==="string"))r.type="string";r.enum=s},Gm=(e,t,r,o)=>{let n=e._zod.def;if(n.values.length===0){r.not={};return}let s=[];for(let i of n.values)if(i===void 0){if(Lt(e,t,r,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof i==="bigint"){if(Lt(e,t,r,o,"BigInt literals cannot be represented in JSON Schema"))return;s.push(Number(i))}else s.push(i);if(s.length===0);else if(s.length===1){let i=s[0];if(r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0")r.enum=[i];else r.const=i}else{if(s.every((i)=>typeof i==="number"))r.type="number";if(s.every((i)=>typeof i==="string"))r.type="string";if(s.every((i)=>typeof i==="boolean"))r.type="boolean";if(s.every((i)=>i===null))r.type="null";r.enum=s}};var Wm=(e,t,r,o)=>{Lt(e,t,r,o,"Custom types cannot be represented in JSON Schema")};var Ym=(e,t,r,o)=>{Lt(e,t,r,o,"Transforms cannot be represented in JSON Schema")};var Xm=(e,t,r,o)=>{let n=r,s=e._zod.def,{minimum:i,maximum:a}=St(e);if(typeof i==="number")n.minItems=i;if(typeof a==="number")n.maxItems=a;n.type="array",n.items=Ue(s.element,t,{...o,path:[...o.path,"items"]})};function zs(e){let t=e._zod.def;if(t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform"))return zs(t.out);if(t.type==="catch")return zs(t.innerType);return e._zod.optin}var Qm=(e,t,r,o)=>{let n=r,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&Lt(e,t,n,o,"Symbol keys cannot be represented in JSON Schema"))return;n.type="object",n.properties={};for(let u in i)yt(n.properties,u,Ue(i[u],t,{...o,path:[...o.path,"properties",u]}));let c=[];for(let u of Object.keys(i)){let l=s.shape[u];if(t.io==="input"?zs(l)===void 0:l._zod.optout===void 0)c.push(u)}if(c.length>0)n.required=c;if(s.catchall?._zod.def.type==="never")n.additionalProperties=!1;else if(!s.catchall){if(t.io==="output")n.additionalProperties=!1}else if(s.catchall)n.additionalProperties=Ue(s.catchall,t,{...o,path:[...o.path,"additionalProperties"]})},ef=(e,t,r,o)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((a,c)=>Ue(a,t,{...o,path:[...o.path,s?"oneOf":"anyOf",c]}));if(s)r.oneOf=i;else r.anyOf=i},tf=(e,t,r,o)=>{let n=e._zod.def,s=Ue(n.left,t,{...o,path:[...o.path,"allOf",0]}),i=Ue(n.right,t,{...o,path:[...o.path,"allOf",1]}),a=(u)=>("allOf"in u)&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];r.allOf=c,t.intersections.push(c)};function ja(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let f=e.get(t)?.def;if(!f)return t;let v=ja(e,f,r);return v===f?t:v}for(let f of["anyOf","oneOf"]){let v=t[f];if(!Array.isArray(v))continue;let y=v.map((g)=>ja(e,g,r));if(y.some((g,P)=>g!==v[P]))t={...t,[f]:y}}let o=Array.isArray(t.type)?t.type:[t.type],n=!o.includes("string")&&o.some((f)=>f==="number"||f==="integer"),s=t.enum??(t.const!==void 0?[t.const]:void 0);if(!n&&!s?.some((f)=>typeof f==="number"))return t;let{minimum:i,maximum:a,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:d,id:m,...h}=t;if(h.enum)h.enum=h.enum.map((f)=>typeof f==="number"?String(f):f);else if(typeof h.const==="number")h.const=String(h.const);if(!n)return h;if(h.type="string",!s)h.pattern=(o.includes("number")?Do:Qi).source;return h}var Ma=new WeakMap;function y$(e){let t=new Map;for(let o of e.seen.values())if(o.def&&!t.has(o.schema))t.set(o.schema,o);let r=new Map;for(let o of Ma.get(e)??[]){let n=e.seen.get(o),s=(n?.def??n?.schema)?.propertyNames;if(!s||s===!0||r.has(s))continue;let i=ja(t,s,new Set);if(i!==s)r.set(s,i)}if(!r.size)return;for(let o of e.seen.values())for(let n of[o.schema,o.def]){let s=n&&r.get(n.propertyNames);if(s)n.propertyNames=s}}var rf=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object";let i=s.keyType,a=St(i).patterns;if(s.mode==="loose"&&a&&a.size>0){let l=Ue(s.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let d of a)yt(n.patternProperties,Lm(d).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){n.propertyNames=Ue(s.keyType,t,{...o,path:[...o.path,"propertyNames"]});let l=Ma.get(t);if(!l)l=[],Ma.set(t,l),t.deferred.push(()=>y$(t));l.push(e)}n.additionalProperties=Ue(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let c=i._zod.values,u=t.io==="input"&&zs(s.valueType)!==void 0;if(c&&!s.partial&&!u){let l=[...c].filter((d)=>typeof d==="string"||typeof d==="number");if(l.length>0)n.required=l.map(String)}},of=(e,t,r,o)=>{let n=e._zod.def,s=Ue(n.innerType,t,o),i=t.seen.get(e);if(t.target==="openapi-3.0")i.ref=n.innerType,r.nullable=!0;else r.anyOf=[s,{type:"null"}]},nf=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Za=Symbol();function sf(e,t,r,o,n){let s=!1,i=JSON.stringify(e,(a,c)=>{if(typeof c!=="bigint")return c;return s=!0,null});if(!s)return JSON.parse(i);return Lt(t,r,o,n,"BigInt defaults cannot be represented in JSON Schema"),Za}var af=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i=sf(n.defaultValue,e,t,r,o);if(i!==Za)r.default=i},cf=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let s=t.seen.get(e);if(s.ref=n.innerType,t.io!=="input")return;let i=sf(n.defaultValue,e,t,r,o);if(i!==Za)r._prefault=i},uf=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{Lt(e,t,r,o,"Dynamic catch values are not supported in JSON Schema");return}r.default=i},lf=(e,t,r,o)=>{let n=e._zod.def,s=n.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?n.out:n.in:n.out;Ue(i,t,o);let a=t.seen.get(e);a.ref=i},df=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.readOnly=!0};var qa=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},pf=(e,t,r,o)=>{let n=e._zod.innerType;Ue(n,t,o);let s=t.seen.get(e);s.ref=n};var mf=new WeakSet([Object.prototype,Error.prototype]);function $s(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let o=r(this);return Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0})}})}var k$=(e,t)=>{wl.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);if(mf.has(r))return;mf.add(r),$s(r,"format",(o)=>(n)=>Ki(o,n)),$s(r,"flatten",(o)=>(n)=>Ji(o,n)),$s(r,"addIssue",(o)=>(n)=>{o.issues.push(n),o.message=JSON.stringify(o.issues,Mo,2)}),$s(r,"addIssues",(o)=>(n)=>{o.issues.push(...n),o.message=JSON.stringify(o.issues,Mo,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var lt=L("ZodError",k$,void 0,{Parent:Error});var ff=ts(lt),hf=rs(lt),gf=os(lt),_f=ns(lt),yf=kl(lt),vf=xl(lt),Sf=El(lt),bf=Tl(lt),zf=Ol(lt),$f=Cl(lt),Rf=Il(lt),wf=Nl(lt);function E$(){if(!rt.localeError)ot(fa())}function ws(){if(!rt.memoizer)ot({memoizer:ma()})}var Te=L("ZodType",(e,t)=>(E$(),xe.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ut(t,{checks:[...t.checks??[],...e.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Rt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(y0(e,t))},superRefine(e,t){return this.check(v0(e,t))},overwrite(e){return this.check(Qt(e))},optional(){return Me(this)},exactOptional(){return n0(this)},nullable(){return xf(this)},nullish(){return Me(xf(this))},nonoptional(e){return l0(this,e)},array(){return Re(this)},or(e){return Hn([this,e])},and(e){return ks(this,e)},transform(e){return Ef(this,Df(e))},default(e){return a0(this,e)},prefault(e){return u0(this,e)},catch(e){return p0(this,e)},pipe(e){return Ef(this,e)},readonly(){return h0(this)},describe(e){let t=this.clone();return Xt.add(t,{description:e}),t},meta(...e){if(e.length===0)return Xt.get(this);let t=this.clone();return Xt.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get "~standard"(){return Qn(this,"~standard",{...sa(this),jsonSchema:{input:Ko(this,"input"),output:Ko(this,"output")}})},set "~standard"(e){qt(this,"~standard",e)},parse:function e(t,r){return ff(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await hf(this,t,r,{callee:e})},safeParse(e,t){return gf(this,e,t)},async safeParseAsync(e,t){return _f(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){qt(this,"spa",e)},validate(e,t){return Gi(this,e,t)},validateAsync(e,t){return Wi(this,e,t)},encode:function e(t,r){return yf(this,t,r,{callee:e})},decode:function e(t,r){return vf(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await Sf(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await bf(this,t,r,{callee:e})},safeEncode(e,t){return zf(this,e,t)},safeDecode(e,t){return $f(this,e,t)},async safeEncodeAsync(e,t){return Rf(this,e,t)},async safeDecodeAsync(e,t){return wf(this,e,t)},toJSONSchema(e){return Om(this,{})(e)},get description(){return Xt.get(this)?.description},get _def(){return this._zod.def}}),Tf=L("_ZodString",(e,t)=>{ls.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dm(e,r,o,n)},vl({format:(e)=>St(e).format??null,minLength:(e)=>St(e).minimum??null,maxLength:(e)=>St(e).maximum??null},{regex(...e){return this.check(ba(...e))},includes(...e){return this.check(Ra(...e))},startsWith(...e){return this.check(wa(...e))},endsWith(...e){return this.check(Pa(...e))},min(...e){return this.check(Dr(...e))},max(...e){return this.check(Ss(...e))},length(...e){return this.check(bs(...e))},nonempty(...e){return this.check(Dr(1,...e))},lowercase(e){return this.check(za(e))},uppercase(e){return this.check($a(e))},trim(){return this.check(xa())},normalize(...e){return this.check(ka(...e))},toLowerCase(){return this.check(Ea())},toUpperCase(){return this.check(Ta())},slugify(){return this.check(Oa())}})),Of=L("ZodString",(e,t)=>{ls.init(e,t),Tf.init(e,t)},{email(e){return this.check(Up(T$,e))},url(e){return this.check(ga(Af,e))},jwt(e){return this.check(cm(B$,e))},emoji(e){return this.check(Kp(C$,e))},guid(e){return this.check(Fp(O$,e))},uuid(e){return this.check(Vp(Rs,e))},uuidv4(e){return this.check(Hp(Rs,e))},uuidv6(e){return this.check(Bp(Rs,e))},uuidv7(e){return this.check(Jp(Rs,e))},nanoid(e){return this.check(Gp(I$,e))},cuid(e){return this.check(Wp(N$,e))},cuid2(e){return this.check(Yp(A$,e))},ulid(e){return this.check(Xp(j$,e))},base64(e){return this.check(sm(F$,e))},base64url(e){return this.check(im(V$,e))},xid(e){return this.check(Qp(M$,e))},ksuid(e){return this.check(em(Z$,e))},ipv4(e){return this.check(tm(q$,e))},ipv6(e){return this.check(rm(L$,e))},cidrv4(e){return this.check(om(D$,e))},cidrv6(e){return this.check(nm(U$,e))},e164(e){return this.check(am(H$,e))},datetime(e){return this.check(gs(Da,e))},date(e){return this.check(ya(Cf,e))},time(e){return this.check(va(If,e))},duration(e){return this.check(Sa(Nf,e))}});function C(e){return Dp(Of,e)}var qe=L("ZodStringFormat",(e,t)=>{Ne.init(e,t),Tf.init(e,t)}),Da=L("ZodISODateTime",(e,t)=>{Jd.init(e,t),qe.init(e,t)}),Cf=L("ZodISODate",(e,t)=>{Kd.init(e,t),qe.init(e,t)}),If=L("ZodISOTime",(e,t)=>{Gd.init(e,t),qe.init(e,t)}),Nf=L("ZodISODuration",(e,t)=>{Wd.init(e,t),qe.init(e,t)}),T$=L("ZodEmail",(e,t)=>{jd.init(e,t),qe.init(e,t)});var O$=L("ZodGUID",(e,t)=>{Nd.init(e,t),qe.init(e,t)});var Rs=L("ZodUUID",(e,t)=>{Ad.init(e,t),qe.init(e,t)});var Af=L("ZodURL",(e,t)=>{qd.init(e,t),qe.init(e,t)});function jf(e){return ga(Af,e)}var C$=L("ZodEmoji",(e,t)=>{Ld.init(e,t),qe.init(e,t)});var I$=L("ZodNanoID",(e,t)=>{Dd.init(e,t),qe.init(e,t)});var N$=L("ZodCUID",(e,t)=>{Ud.init(e,t),qe.init(e,t)});var A$=L("ZodCUID2",(e,t)=>{Fd.init(e,t),qe.init(e,t)});var j$=L("ZodULID",(e,t)=>{Vd.init(e,t),qe.init(e,t)});var M$=L("ZodXID",(e,t)=>{Hd.init(e,t),qe.init(e,t)});var Z$=L("ZodKSUID",(e,t)=>{Bd.init(e,t),qe.init(e,t)});var q$=L("ZodIPv4",(e,t)=>{Yd.init(e,t),qe.init(e,t)});var L$=L("ZodIPv6",(e,t)=>{Qd.init(e,t),qe.init(e,t)});var D$=L("ZodCIDRv4",(e,t)=>{tp.init(e,t),qe.init(e,t)});var U$=L("ZodCIDRv6",(e,t)=>{rp.init(e,t),qe.init(e,t)});var F$=L("ZodBase64",(e,t)=>{np.init(e,t),qe.init(e,t)});var V$=L("ZodBase64URL",(e,t)=>{sp.init(e,t),qe.init(e,t)});var H$=L("ZodE164",(e,t)=>{ip.init(e,t),qe.init(e,t)});var B$=L("ZodJWT",(e,t)=>{ap.init(e,t),qe.init(e,t)});var Ps=L("ZodNumber",(e,t)=>{aa.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Um(e,r,o,n),e.isFinite=!0},vl({minValue:(e)=>{let{minimum:t,exclusiveMinimum:r}=St(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:(e)=>{let{maximum:t,exclusiveMaximum:r}=St(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:(e)=>{let{isInt:t,multipleOf:r}=St(e);return!!t||!!r?.some(Number.isSafeInteger)},format:(e)=>St(e).format??null},{gt(e,t){return this.check(ys(e,t))},gte(e,t){return this.check(Bo(e,t))},min(e,t){return this.check(Bo(e,t))},lt(e,t){return this.check(_s(e,t))},lte(e,t){return this.check(Ho(e,t))},max(e,t){return this.check(Ho(e,t))},int(e){return this.check(Pf(e))},safe(e){return this.check(Pf(e))},positive(e){return this.check(ys(0,e))},nonnegative(e){return this.check(Bo(0,e))},negative(e){return this.check(_s(0,e))},nonpositive(e){return this.check(Ho(0,e))},multipleOf(e,t){return this.check(vs(e,t))},step(e,t){return this.check(vs(e,t))},finite(){return this}}));function ur(e){return um(Ps,e)}var J$=L("ZodNumberFormat",(e,t)=>{cp.init(e,t),Ps.init(e,t)});function Pf(e){return dm(J$,e)}var Mf=L("ZodBoolean",(e,t)=>{up.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fm(e,r,o,n)});function Ar(e){return pm(Mf,e)}var K$=L("ZodNull",(e,t)=>{lp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vm(e,r,o,n)});function Ua(e){return mm(K$,e)}var G$=L("ZodAny",(e,t)=>{dp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bm(e,r,o,n)});function Zf(){return fm(G$)}var W$=L("ZodUnknown",(e,t)=>{pp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jm(e,r,o,n)});function Di(){return hm(W$)}var Y$=L("ZodNever",(e,t)=>{mp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hm(e,r,o,n)});function X$(e){return _m(Y$,e)}var Q$=L("ZodArray",(e,t)=>{ws(),fp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xm(e,r,o,n),e.element=t.element},{min(e,t){return this.check(Dr(e,t))},nonempty(e){return this.check(Dr(1,e))},max(e,t){return this.check(Ss(e,t))},length(e,t){return this.check(bs(e,t))},unwrap(){return this.element}});function Re(e,t){return zm(Q$,e,t)}var qf=L("ZodObject",(e,t)=>{ws(),_p.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qm(e,r,o,n),Az(e,"shape",(r)=>r._zod.def.shape,!1)},{keyof(){return hc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(ut(this._zod.def,{catchall:e}))},passthrough(){return this.clone(ut(this._zod.def,{catchall:Di()}))},loose(){return this.clone(ut(this._zod.def,{catchall:Di()}))},strict(){return this.clone(ut(this._zod.def,{catchall:X$()}))},strip(){return this.clone(ut(this._zod.def,{catchall:void 0}))},extend(e){return kz(this,e)},safeExtend(e){return xz(this,e)},merge(e){return Ez(this,e)},pick(e){return wz(this,e)},omit(e){return Pz(this,e)},partial(...e){return hl(Uf,this,e[0])},exactPartial(...e){return hl(Ff,this,e[0],"exactPartial")},required(...e){return Tz(Vf,this,e[0])}});function X(e,t){let r={type:"object",shape:e??{},...oe(t)};return new qf(r)}function yn(e,t){return new qf({type:"object",shape:e,catchall:Di(),...oe(t)})}var Lf=L("ZodUnion",(e,t)=>{ca.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ef(e,r,o,n),e.options=t.options});function Hn(e,t){return new Lf({type:"union",options:e,...oe(t)})}var e0=L("ZodDiscriminatedUnion",(e,t)=>{Lf.init(e,t),yp.init(e,t)});function Fa(e,t,r){return new e0({type:"union",options:t,discriminator:e,...oe(r)})}var t0=L("ZodIntersection",(e,t)=>{vp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>tf(e,r,o,n)});function ks(e,t){return new t0({type:"intersection",left:e,right:t})}var kf=L("ZodRecord",(e,t)=>{ws(),Sp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>rf(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function gi(e,t,r){if(!t||!t._zod)return new kf({type:"record",keyType:C(),valueType:e,...oe(t)});return new kf({type:"record",keyType:e,valueType:t,...oe(r)})}var La=L("ZodEnum",(e,t)=>{bp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Km(e,o,n,s),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let s={};for(let i of o)if(r.has(i))s[i]=t.entries[i];else throw Error(`Key ${i} not found in enum`);return new La({...t,checks:[],...oe(n),entries:s})},e.exclude=(o,n)=>{let s={...t.entries};for(let i of o)if(r.has(i))delete s[i];else throw Error(`Key ${i} not found in enum`);return new La({...t,checks:[],...oe(n),entries:s})}});function hc(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new La({type:"enum",entries:r,...oe(t)})}var r0=L("ZodLiteral",(e,t)=>{zp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gm(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ke(e,t){return new r0({type:"literal",values:Array.isArray(e)?e:[e],...oe(t)})}var o0=L("ZodTransform",(e,t)=>{ws(),$p.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ym(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Lo(e.constructor.name);r.addIssue=(s)=>{if(typeof s==="string")r.issues.push(vr(s,r.value,t));else{let i=s;if(i.fatal)i.continue=!1;if(i.code??(i.code="custom"),!("input"in i))i.input=r.value;i.inst??(i.inst=e),r.issues.push(vr(i))}};let n=t.transform(r.value,r);if(n instanceof Promise)return n.then((s)=>(r.value=s,r));return r.value=n,r}});function Df(e){return new o0({type:"transform",transform:e})}var Uf=L("ZodOptional",(e,t)=>{ua.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qa(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Me(e){return new Uf({type:"optional",innerType:e})}var Ff=L("ZodExactOptional",(e,t)=>{Rp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qa(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function n0(e){return new Ff({type:"optional",innerType:e})}var s0=L("ZodNullable",(e,t)=>{wp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>of(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function xf(e){return new s0({type:"nullable",innerType:e})}var i0=L("ZodDefault",(e,t)=>{Pp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>af(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function a0(e,t){return new i0({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():ji(t)}})}var c0=L("ZodPrefault",(e,t)=>{kp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>cf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function u0(e,t){return new c0({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():ji(t)}})}var Vf=L("ZodNonOptional",(e,t)=>{xp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>nf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function l0(e,t){return new Vf({type:"nonoptional",innerType:e,...oe(t)})}var d0=L("ZodCatch",(e,t)=>{Ep.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>uf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function p0(e,t){return new d0({type:"catch",innerType:e,catchValue:typeof t==="function"?t:Sl(t)})}var Hf=L("ZodPipe",(e,t)=>{la.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lf(e,r,o,n),e.in=t.in,e.out=t.out});function Ef(e,t){return new Hf({type:"pipe",in:e,out:t})}var m0=L("ZodPreprocess",(e,t)=>{Hf.init(e,t),Tp.init(e,t)}),f0=L("ZodReadonly",(e,t)=>{Op.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>df(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function h0(e){return new f0({type:"readonly",innerType:e})}var g0=L("ZodLazy",(e,t)=>{Cp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pf(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Bf(e){return new g0({type:"lazy",getter:e})}var _0=L("ZodCustom",(e,t)=>{Ip.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wm(e,r,o,n)});function y0(e,t={}){return $m(_0,e,t)}function v0(e,t){return Rm(e,t)}function Va(e,t){return new m0({type:"pipe",in:Df(e),out:t})}var Kf={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};var Jf;(function(e){})(Jf||(Jf={}));function b0(e){return gs(Da,e)}function z0(e){return lm(Ps,e)}var Hr="2025-11-25",uV="2025-03-26",iv=[Hr,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Ha="io.modelcontextprotocol/related-task",ss="io.modelcontextprotocol/protocolVersion",iu="io.modelcontextprotocol/clientInfo",_a="io.modelcontextprotocol/serverInfo",Tr="io.modelcontextprotocol/clientCapabilities",Rh="io.modelcontextprotocol/subscriptionId",Qu="io.modelcontextprotocol/logLevel",pV="traceparent",mV="tracestate",fV="baggage",Br="2.0";var Ph=Bf(()=>Hn([C(),ur(),Ar(),Ua(),gi(C(),Ph),Re(Ph)])),Hi=gi(C(),Ph),Y0=Re(Ph),qA=Hn([C(),ur().int()]),VA=C(),S_=X({ttl:ur().optional()}),w_=X({taskId:C()}),WA=yn({progressToken:qA.optional(),[Ha]:w_.optional()}),to=X({_meta:WA.optional()}),ov=to.extend({task:S_.optional()}),qi=X({method:C(),params:to.loose().optional()}),Zs=X({_meta:WA.optional()}),Qs=X({method:C(),params:Zs.loose().optional()}),zA=yn({get[_a](){return YS.optional().catch(void 0)}}),Zn=yn({_meta:zA.optional()}),Ah=Hn([C(),ur().int()]),KS=X({jsonrpc:Ke(Br),id:Ah,...qi.shape}).strict(),GS=X({jsonrpc:Ke(Br),...Qs.shape}).strict(),sv=X({jsonrpc:Ke(Br),id:Ah,result:Zn}).strict(),av=X({jsonrpc:Ke(Br),id:Ah.optional(),error:X({code:ur().int(),message:C(),data:Di().optional()})}).strict(),ep=Hn([KS,GS,sv,av]),J0=Hn([sv,av]),jA=Zn.strict(),R_=Zs.extend({requestId:Ah.optional(),reason:C().optional()}),KA=Qs.extend({method:Ke("notifications/cancelled"),params:R_}),P_=X({src:C(),mimeType:C().optional(),sizes:Re(C()).optional(),theme:hc(["light","dark"]).optional()}),Th=X({icons:Re(P_).optional()}),gm=X({name:C(),title:C().optional()}),YS=gm.extend({...gm.shape,...Th.shape,version:C(),websiteUrl:C().optional(),description:C().optional()}),R0=ks(X({applyDefaults:Ar().optional()}),Hi),w0=Va((e)=>{if(e&&typeof e==="object"&&!Array.isArray(e)&&Object.keys(e).length===0)return{form:{}};return e},ks(X({form:R0.optional(),url:Hi.optional()}),Hi.optional())),A_=yn({list:Hi.optional(),cancel:Hi.optional(),requests:yn({sampling:yn({createMessage:Hi.optional()}).optional(),elicitation:yn({create:Hi.optional()}).optional()}).optional()}),T_=yn({list:Hi.optional(),cancel:Hi.optional(),requests:yn({tools:yn({call:Hi.optional()}).optional()}).optional()}),k_=X({experimental:gi(C(),Hi).optional(),sampling:X({context:Hi.optional(),tools:Hi.optional()}).optional(),elicitation:w0.optional(),roots:X({listChanged:Ar().optional()}).optional(),tasks:A_.optional(),extensions:gi(C(),Hi).optional()}),E_=to.extend({protocolVersion:C(),capabilities:k_,clientInfo:YS}),GA=qi.extend({method:Ke("initialize"),params:E_}),YA=X({experimental:gi(C(),Hi).optional(),logging:Hi.optional(),completions:Hi.optional(),prompts:X({listChanged:Ar().optional()}).optional(),resources:X({subscribe:Ar().optional(),listChanged:Ar().optional()}).optional(),tools:X({listChanged:Ar().optional()}).optional(),tasks:T_.optional(),extensions:gi(C(),Hi).optional()}),I_=Zn.extend({protocolVersion:C(),capabilities:YA,serverInfo:YS,instructions:C().optional()}),__=Qs.extend({method:Ke("notifications/initialized"),params:Zs.optional()}),x_=qi.extend({method:Ke("server/discover"),params:to.optional()}),cv=Zn.extend({supportedVersions:Re(C()),capabilities:YA,instructions:C().optional()}),JA=qi.extend({method:Ke("ping"),params:to.optional()}),C_=X({progress:ur(),total:Me(ur()),message:Me(C())}),D_=X({...Zs.shape,...C_.shape,progressToken:qA}),XA=Qs.extend({method:Ke("notifications/progress"),params:D_}),ym=to.extend({cursor:VA.optional()}),kh=qi.extend({params:ym.optional()}),tl=Zn.extend({nextCursor:VA.optional()}),ZA=X({uri:C(),mimeType:Me(C()),_meta:gi(C(),Di()).optional()}),QA=ZA.extend({text:C()}),Ba=C().refine((e)=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),eT=ZA.extend({blob:Ba}),Eh=hc(["user","assistant"]),vm=X({audience:Re(Eh).optional(),priority:ur().min(0).max(1).optional(),lastModified:b0({offset:!0}).optional()}),Ih=X({...gm.shape,...Th.shape,uri:C(),description:Me(C()),mimeType:Me(C()),size:Me(ur()),annotations:vm.optional(),_meta:Me(yn({}))}),O_=X({...gm.shape,...Th.shape,uriTemplate:C(),description:Me(C()),mimeType:Me(C()),annotations:vm.optional(),_meta:Me(yn({}))}),M_=kh.extend({method:Ke("resources/list")}),N_=tl.extend({resources:Re(Ih)}),F_=kh.extend({method:Ke("resources/templates/list")}),L_=tl.extend({resourceTemplates:Re(O_)}),JS=to.extend({uri:C()}),B_=JS,$_=qi.extend({method:Ke("resources/read"),params:B_}),U_=Zn.extend({contents:Re(Hn([QA,eT]))}),H_=Qs.extend({method:Ke("notifications/resources/list_changed"),params:Zs.optional()}),q_=JS,V_=qi.extend({method:Ke("resources/subscribe"),params:q_}),W_=JS,z_=qi.extend({method:Ke("resources/unsubscribe"),params:W_}),tT=X({toolsListChanged:Ar().optional(),promptsListChanged:Ar().optional(),resourcesListChanged:Ar().optional(),resourceSubscriptions:Re(C()).optional()}),j_=to.extend({notifications:tT}),K_=qi.extend({method:Ke("subscriptions/listen"),params:j_}),G_=Zs.extend({notifications:tT}),Y_=Qs.extend({method:Ke("notifications/subscriptions/acknowledged"),params:G_}),J_=zA.extend({[Rh]:Ah}),X_=Zn.extend({_meta:J_}),Z_=Zs.extend({uri:C()}),Q_=Qs.extend({method:Ke("notifications/resources/updated"),params:Z_}),ex=X({name:C(),description:Me(C()),required:Me(Ar())}),tx=X({...gm.shape,...Th.shape,description:Me(C()),arguments:Me(Re(ex)),_meta:Me(yn({}))}),rx=kh.extend({method:Ke("prompts/list")}),nx=tl.extend({prompts:Re(tx)}),ix=to.extend({name:C(),arguments:gi(C(),C()).optional()}),ox=qi.extend({method:Ke("prompts/get"),params:ix}),XS=X({type:Ke("text"),text:C(),annotations:vm.optional(),_meta:gi(C(),Di()).optional()}),ZS=X({type:Ke("image"),data:Ba,mimeType:C(),annotations:vm.optional(),_meta:gi(C(),Di()).optional()}),QS=X({type:Ke("audio"),data:Ba,mimeType:C(),annotations:vm.optional(),_meta:gi(C(),Di()).optional()}),sx=X({type:Ke("tool_use"),name:C(),id:C(),input:gi(C(),Di()),_meta:gi(C(),Di()).optional()}),ax=X({type:Ke("resource"),resource:Hn([QA,eT]),annotations:vm.optional(),_meta:gi(C(),Di()).optional()}),cx=Ih.extend({type:Ke("resource_link")}),ew=Hn([XS,ZS,QS,cx,ax]),dx=X({role:Eh,content:ew}),lx=Zn.extend({description:C().optional(),messages:Re(dx)}),ux=Qs.extend({method:Ke("notifications/prompts/list_changed"),params:Zs.optional()}),px=X({title:C().optional(),readOnlyHint:Ar().optional(),destructiveHint:Ar().optional(),idempotentHint:Ar().optional(),openWorldHint:Ar().optional()}),mx=X({taskSupport:hc(["required","optional","forbidden"]).optional()}),rT=X({...gm.shape,...Th.shape,description:C().optional(),inputSchema:X({type:Ke("object"),properties:gi(C(),Ph).optional(),required:Re(C()).optional()}).catchall(Di()),outputSchema:yn({$schema:C().optional()}).optional(),annotations:px.optional(),execution:mx.optional(),_meta:gi(C(),Di()).optional()}),fx=kh.extend({method:Ke("tools/list")}),hx=tl.extend({tools:Re(rT)}),nT=Zn.extend({content:Re(ew).default([]),structuredContent:Di().optional(),isError:Ar().optional()}),X0=nT.or(Zn.extend({toolResult:Di()})),gx=ov.extend({name:C(),arguments:gi(C(),Di()).optional()}),yx=qi.extend({method:Ke("tools/call"),params:gx}),vx=Qs.extend({method:Ke("notifications/tools/list_changed"),params:Zs.optional()}),iT=X({autoRefresh:Ar().default(!0),debounceMs:ur().int().nonnegative().default(300)}),_h=hc(["debug","info","notice","warning","error","critical","alert","emergency"]),bx=to.extend({level:_h}),Sx=qi.extend({method:Ke("logging/setLevel"),params:bx}),wx=Zs.extend({level:_h,logger:C().optional(),data:Di()}),Rx=Qs.extend({method:Ke("notifications/message"),params:wx}),Px=X({name:C().optional()}),Ax=X({hints:Re(Px).optional(),costPriority:ur().min(0).max(1).optional(),speedPriority:ur().min(0).max(1).optional(),intelligencePriority:ur().min(0).max(1).optional()}),Tx=X({mode:hc(["auto","required","none"]).optional()}),kx=X({type:Ke("tool_result"),toolUseId:C().describe("The unique identifier for the corresponding tool call."),content:Re(ew),structuredContent:Di().optional(),isError:Ar().optional(),_meta:gi(C(),Di()).optional()}),Ex=Fa("type",[XS,ZS,QS]),dv=Fa("type",[XS,ZS,QS,sx,kx]),Ix=X({role:Eh,content:Hn([dv,Re(dv)]),_meta:gi(C(),Di()).optional()}),_x=ov.extend({messages:Re(Ix),modelPreferences:Ax.optional(),systemPrompt:C().optional(),includeContext:hc(["none","thisServer","allServers"]).optional(),temperature:ur().optional(),maxTokens:ur().int(),stopSequences:Re(C()).optional(),metadata:Hi.optional(),tools:Re(rT).optional(),toolChoice:Tx.optional()}),xx=qi.extend({method:Ke("sampling/createMessage"),params:_x}),Cx=Zn.extend({model:C(),stopReason:Me(hc(["endTurn","stopSequence","maxTokens"]).or(C())),role:Eh,content:Ex}),Dx=Zn.extend({model:C(),stopReason:Me(hc(["endTurn","stopSequence","maxTokens","toolUse"]).or(C())),role:Eh,content:Hn([dv,Re(dv)])}),tw=X({type:Ke("boolean"),title:C().optional(),description:C().optional(),default:Ar().optional()}),xh=X({type:Ke("string"),title:C().optional(),description:C().optional(),minLength:ur().optional(),maxLength:ur().optional(),format:hc(["email","uri","date","date-time"]).optional(),default:C().optional()}),Ch=X({type:hc(["number","integer"]),title:C().optional(),description:C().optional(),minimum:ur().optional(),maximum:ur().optional(),default:ur().optional()}),rw=X({type:Ke("string"),title:C().optional(),description:C().optional(),enum:Re(C()),default:C().optional()}),nw=X({type:Ke("string"),title:C().optional(),description:C().optional(),oneOf:Re(X({const:C(),title:C()})),default:C().optional()}),iw=X({type:Ke("string"),title:C().optional(),description:C().optional(),enum:Re(C()),enumNames:Re(C()).optional(),default:C().optional()}),Ox=Hn([rw,nw]),ow=X({type:Ke("array"),title:C().optional(),description:C().optional(),minItems:ur().optional(),maxItems:ur().optional(),items:X({type:Ke("string"),enum:Re(C())}),default:Re(C()).optional()}),sw=X({type:Ke("array"),title:C().optional(),description:C().optional(),minItems:ur().optional(),maxItems:ur().optional(),items:X({anyOf:Re(X({const:C(),title:C()}))}),default:Re(C()).optional()}),Mx=Hn([ow,sw]),Nx=Hn([iw,Ox,Mx]),aw=Hn([Nx,tw,xh,Ch]),Dh=ov.extend({mode:Ke("form").optional(),message:C(),requestedSchema:X({type:Ke("object"),properties:gi(C(),aw),required:Re(C()).optional()}).catchall(Di())}),Fx=ov.extend({mode:Ke("url"),message:C(),elicitationId:C(),url:C().url()}),Lx=Hn([Dh,Fx]),Bx=qi.extend({method:Ke("elicitation/create"),params:Lx}),$x=Zs.extend({elicitationId:C()}),Ux=Qs.extend({method:Ke("notifications/elicitation/complete"),params:$x}),Hx=Zn.extend({action:hc(["accept","decline","cancel"]),content:Va((e)=>e===null?void 0:e,gi(C(),Hn([C(),ur(),Ar(),Re(C())])).optional())}),qx=X({type:Ke("ref/resource"),uri:C()}),Vx=X({type:Ke("ref/prompt"),name:C()}),Wx=to.extend({ref:Hn([Vx,qx]),argument:X({name:C(),value:C()}),context:X({arguments:gi(C(),C()).optional()}).optional()}),zx=qi.extend({method:Ke("completion/complete"),params:Wx}),jx=Zn.extend({completion:yn({values:Re(C()).max(100),total:Me(ur().int()),hasMore:Me(Ar())})}),Kx=X({uri:C().startsWith("file://"),name:C().optional(),_meta:gi(C(),Di()).optional()}),Gx=qi.extend({method:Ke("roots/list"),params:to.optional()}),Yx=Zn.extend({roots:Re(Kx)}),Jx=Qs.extend({method:Ke("notifications/roots/list_changed"),params:Zs.optional()}),Z0=yn({ttl:ur().optional(),pollInterval:ur().optional()}),Xx=hc(["working","input_required","completed","failed","cancelled"]),Oh=X({taskId:C(),status:Xx,ttl:Hn([ur(),Ua()]),createdAt:C(),lastUpdatedAt:C(),pollInterval:Me(ur()),statusMessage:Me(C())}),Q0=Zn.extend({task:Oh}),Zx=Zs.merge(Oh),eF=Qs.extend({method:Ke("notifications/tasks/status"),params:Zx}),tF=qi.extend({method:Ke("tasks/get"),params:to.extend({taskId:C()})}),rF=Zn.merge(Oh),nF=qi.extend({method:Ke("tasks/result"),params:to.extend({taskId:C()})}),iF=Zn.loose(),oF=kh.extend({method:Ke("tasks/list")}),sF=tl.extend({tasks:Re(Oh)}),aF=qi.extend({method:Ke("tasks/cancel"),params:to.extend({taskId:C()})}),cF=Zn.merge(Oh),dF=Hn([JA,GA,x_,zx,Sx,ox,rx,M_,F_,$_,V_,z_,K_,yx,fx]),lF=Hn([KA,XA,__,Jx]),uF=Hn([jA,Cx,Dx,Hx,Yx]),pF=Hn([JA,xx,Bx,Gx]),mF=Hn([KA,XA,Rx,Q_,H_,vx,ux,Y_,Ux]),fF=Hn([jA,I_,cv,jx,lx,nx,N_,L_,U_,nT,hx,X_]);var He=jf().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Kf.custom,message:"URL must be parseable",fatal:!0}),Fi}).refine((e)=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Qx=yn({resource:C().url(),authorization_servers:Re(He).optional(),jwks_uri:C().url().optional(),scopes_supported:Re(C()).optional(),bearer_methods_supported:Re(C()).optional(),resource_signing_alg_values_supported:Re(C()).optional(),resource_name:C().optional(),resource_documentation:C().optional(),resource_policy_uri:C().url().optional(),resource_tos_uri:C().url().optional(),tls_client_certificate_bound_access_tokens:Ar().optional(),authorization_details_types_supported:Re(C()).optional(),dpop_signing_alg_values_supported:Re(C()).optional(),dpop_bound_access_tokens_required:Ar().optional()}),oT=yn({issuer:C(),authorization_endpoint:He,token_endpoint:He,registration_endpoint:He.optional(),scopes_supported:Re(C()).optional(),response_types_supported:Re(C()),response_modes_supported:Re(C()).optional(),grant_types_supported:Re(C()).optional(),token_endpoint_auth_methods_supported:Re(C()).optional(),token_endpoint_auth_signing_alg_values_supported:Re(C()).optional(),service_documentation:He.optional(),revocation_endpoint:He.optional(),revocation_endpoint_auth_methods_supported:Re(C()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Re(C()).optional(),introspection_endpoint:C().optional(),introspection_endpoint_auth_methods_supported:Re(C()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Re(C()).optional(),code_challenge_methods_supported:Re(C()).optional(),client_id_metadata_document_supported:Ar().optional(),authorization_response_iss_parameter_supported:Ar().optional().catch(void 0),dpop_signing_alg_values_supported:Re(C()).optional()}),eC=yn({issuer:C(),authorization_endpoint:He,token_endpoint:He,userinfo_endpoint:He.optional(),jwks_uri:He,registration_endpoint:He.optional(),scopes_supported:Re(C()).optional(),response_types_supported:Re(C()),response_modes_supported:Re(C()).optional(),grant_types_supported:Re(C()).optional(),acr_values_supported:Re(C()).optional(),subject_types_supported:Re(C()),id_token_signing_alg_values_supported:Re(C()),id_token_encryption_alg_values_supported:Re(C()).optional(),id_token_encryption_enc_values_supported:Re(C()).optional(),userinfo_signing_alg_values_supported:Re(C()).optional(),userinfo_encryption_alg_values_supported:Re(C()).optional(),userinfo_encryption_enc_values_supported:Re(C()).optional(),request_object_signing_alg_values_supported:Re(C()).optional(),request_object_encryption_alg_values_supported:Re(C()).optional(),request_object_encryption_enc_values_supported:Re(C()).optional(),token_endpoint_auth_methods_supported:Re(C()).optional(),token_endpoint_auth_signing_alg_values_supported:Re(C()).optional(),display_values_supported:Re(C()).optional(),claim_types_supported:Re(C()).optional(),claims_supported:Re(C()).optional(),service_documentation:C().optional(),claims_locales_supported:Re(C()).optional(),ui_locales_supported:Re(C()).optional(),claims_parameter_supported:Ar().optional(),request_parameter_supported:Ar().optional(),request_uri_parameter_supported:Ar().optional(),require_request_uri_registration:Ar().optional(),op_policy_uri:He.optional(),op_tos_uri:He.optional(),client_id_metadata_document_supported:Ar().optional(),authorization_response_iss_parameter_supported:Ar().optional().catch(void 0)}),tC=X({...eC.shape,...oT.pick({code_challenge_methods_supported:!0}).shape}),sT=X({access_token:C(),id_token:C().optional(),token_type:C(),expires_in:z0().optional(),scope:C().optional(),refresh_token:C().optional(),issuer:C().optional().catch(void 0)}).strip(),rC=X({issued_token_type:Ke("urn:ietf:params:oauth:token-type:id-jag"),access_token:C(),token_type:C().optional(),expires_in:ur().optional(),scope:C().optional()}).strip(),aT=X({error:C(),error_description:C().optional(),error_uri:C().optional()}),Ja=He.optional().or(Ke("").transform(()=>{return})),nC=X({redirect_uris:Re(He),token_endpoint_auth_method:C().optional(),grant_types:Re(C()).optional(),response_types:Re(C()).optional(),application_type:C().optional(),client_name:C().optional(),client_uri:He.optional(),logo_uri:Ja,scope:C().optional(),contacts:Re(C()).optional(),tos_uri:Ja,policy_uri:C().optional(),jwks_uri:He.optional(),jwks:Zf().optional(),software_id:C().optional(),software_version:C().optional(),software_statement:C().optional()}).strip(),iC=X({client_id:C(),client_secret:C().optional(),client_id_issued_at:ur().optional(),client_secret_expires_at:ur().optional(),issuer:C().optional().catch(void 0)}).strip(),oC=nC.merge(iC),hF=X({error:C(),error_description:C().optional()}).strip(),gF=X({token:C(),token_type_hint:C().optional()}).strip();function Wo(e){let t=Object.values(e).filter((o)=>typeof o==="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function Ga(e,t="|"){return e.map((r)=>Xa(r)).join(t)}function Yo(e,t){if(typeof t==="bigint")return t.toString();return t}class Xf{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function Xo(e){return new Xf(e)}function Qf(e){return e===null||e===void 0}function xs(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function eh(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-o)<n)return 0;return r-o}var Yf=Symbol("evaluating");function th(e,t,r){let o=void 0;Object.defineProperty(e,t,{get(){if(o===Yf)return;if(o===void 0)o=Yf,o=r();return o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function dt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Qo(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Dt(e){return Qo(e._zod.def)??e._zod.def.shape}function rh(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return dt(this,t,o),o},enumerable:!0,configurable:!0})}function oh(e,t,r){if(t in e)dt(e,t,r);else e[t]=r}function Sr(e,t,r,o){let n=Dt(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(n,s);if(!i.enumerable)continue;if(i.get)rh(e,s,()=>{let a=t._zod.def.shape[s];return o?o(a,s):a});else oh(e,s,o?o(i.value,s):i.value)}}function O0(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);if(!o.enumerable)continue;if(o.get)rh(e,r,()=>t[r]);else oh(e,r,o.value)}}function pt(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function nh(e){return JSON.stringify(e)}function sh(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Wa="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Jr(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var ih=Xo(()=>{if(nt.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function br(e){if(Jr(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(Jr(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function Ya(e){if(br(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var ah=new Set(["string","number","symbol"]);function tr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ct(e,t,r){let o=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)o._zod.parent=e;return o}function ne(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function Xa(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function ch(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Es=(()=>({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]}))(),Qa={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function C0(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let s={};return Sr(s,e,Ts(e,t)),Ct(e,pt(r,{shape:s,checks:[]}))}function Ts(e,t){let r=Dt(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw Error(`Unrecognized key: "${String(n)}"`);if(t[n])o.push(n)}return o}function I0(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(Ts(e,t)),i={};return Sr(i,e,Reflect.ownKeys(Dt(e)).filter((a)=>!s.has(a))),Ct(e,pt(r,{shape:i,checks:[]}))}function N0(e,t){if(!br(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=Dt(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,s)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Ct(e,pt(e._zod.def,{shape:uh(e,t)}))}function uh(e,t){let r={};return Sr(r,e,Reflect.ownKeys(Dt(e))),O0(r,t),r}function A0(e,t){if(!br(t))throw Error("Invalid input to safeExtend: expected a plain object");return Ct(e,pt(e._zod.def,{shape:uh(e,t)}))}function j0(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};Sr(r,e,Reflect.ownKeys(Dt(e))),Sr(r,t,Reflect.ownKeys(Dt(t)));let o=pt(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Ct(e,o)}function lh(e,t,r,o="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw Error(`.${o}() cannot be used on object schemas containing refinements`);let a=r?new Set(Ts(t,r)):void 0,c={};return Sr(c,t,Reflect.ownKeys(Dt(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),Ct(t,pt(t._zod.def,{shape:c,checks:[]}))}function M0(e,t,r){let o=r?new Set(Ts(t,r)):void 0,n={};return Sr(n,t,Reflect.ownKeys(Dt(t)),(s,i)=>o&&!o.has(i)?s:new e({type:"nonoptional",innerType:s})),Ct(t,pt(t._zod.def,{shape:n}))}function It(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function dh(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function rr(e,t){return t.map((r)=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Go(e){return typeof e==="string"?e:e?.message}function ec(e){let t=[];for(let r of e??[]){let o=r._zod.def;if(!/_(length|size)$|_equals$/.test(o.check))break;let n=o.maximum??o.length??o.size;if(n>=0)t.push([n,r])}return t}function Os(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function Nt(e,t,r){var o;let n=e.inst?._zod?.traits;if(n?.has("$ZodType"))if(n.has("$ZodCheck"))(o=e).schema??(o.schema=e.inst);else e.schema=e.inst;let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:Go(e.inst?._zod.def?.error?.(e))??Go(s?.(e))??Go(t?.error?.(e))??Go(r.customError?.(e))??Go(r.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e)){if(c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__")continue;a[c]=e[c]}if(a.path??(a.path=[]),a.message=i,t?.reportInput)a.input=e.input;return a}var q0=/[\uD800-\uDBFF]/;function Cs(e){let t=e.length;if(!q0.test(e))return t;let r=t;for(let o=0;o<t-1;o++)if((e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320)r--,o++;return r}function Is(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function ph(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function zr(...e){let[t,r,o]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:o};return{...t}}function mh(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);if(o.get)Object.defineProperty(e,r,{...o,enumerable:!1});else L0(e,r,o.value)}}function Ut(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function Ns(e,t,r){return Ut(e,t,r,!1)}function fh(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return Ut(this,r,o(this))},set(n){Ut(this,r,n)}})}return t}function L0(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:Ut(this,t,r.bind(this))},set(o){Ut(this,t,o)}})}function D0(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var Ka,er=!1,U0={configurable:!0,get(){er=!0;return}};function Se(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&Ka!==e._zod){Ka=void 0;return}Ka=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,U0);let n=er;er=!1;try{let s=r(this);if(er)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s});return er=er||n,s}catch(s){throw delete this[t],er=er||n,s}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function F0(e,t,r,o){let n=D0(e,t);if(!n)return;Object.defineProperty(n,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:s})}})}var V0="~constantCatch";function hh(e){let t=()=>e;return t[V0]=!0,t}var gh;var tc={value:void 0,enumerable:!1},yh="captureStackTrace"in Error?Error:null;function H0(e){let t=yh;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return yh=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function D(e,t,r,o){let n={};function s(m){this.def=m,this.constr=d,this.traits=new Set}s.prototype=n;let i=r,a=i&&new WeakSet;function c(m,h){if(!m._zod){tc.value=new s(h);try{Object.defineProperty(m,"_zod",tc)}finally{tc.value=void 0}}else if(m._zod.traits.has(e))return;if(m._zod.traits.add(e),t(m,h),a){let v=Object.getPrototypeOf(m),y=m._zod.constr.prototype,g=v;while(g&&g!==y)g=Object.getPrototypeOf(g);let P=g??v;if(!a.has(P))a.add(P),mh(P,i)}let f=d.prototype;for(let v in f){if(!Object.prototype.hasOwnProperty.call(f,v))continue;if(!(v in m))m[v]=f[v].bind(m)}}let u=o?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(m){let h=o?.Parent?H0(l):this;c(h,m);let f=h._zod.deferred;if(f){for(let y of f)y();h._zod.deferred=void 0}let v=globalThis.__zod_globalConfig?.postProcessor;if(v)v(h);return h}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:(m)=>{if(o?.Parent&&m instanceof o.Parent)return!0;return m?._zod?.traits?.has(e)}}),Object.defineProperty(d,"name",{value:e}),d}class At extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class en extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(gh=globalThis).__zod_globalConfig??(gh.__zod_globalConfig={});var nt=globalThis.__zod_globalConfig;function mt(e){if(e)Object.assign(nt,e);return nt}function B0(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Yo,2)),e.message}function K0(e){this._zod.message=e}var G0={get:B0,set:K0,enumerable:!0,configurable:!0},oc={value:void 0,enumerable:!1},vh=new WeakSet([Object.prototype,Error.prototype]),Sh=(e,t)=>{e.name="$ZodError",oc.value=t,Object.defineProperty(e,"issues",oc),oc.value=void 0,Object.defineProperty(e,"message",G0);let r=Object.getPrototypeOf(e);if(!vh.has(r))vh.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}})},bh=D("$ZodError",Sh),PI=D("$ZodError",Sh,void 0,{Parent:Error});function W0(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function zh(e,t=(r)=>r.message){let r={},o=[];for(let n of e.issues)if(n.path.length>0)W0(r,n.path[0],()=>[]).push(t(n));else o.push(t(n));return{formErrors:o,fieldErrors:r}}function $h(e,t=(r)=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map((a)=>o({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(t(i));else{let c=r,u=0;while(u<a.length){let l=a[u],d=u===a.length-1;if(l==="_errors"){if(d)c._errors.push(t(i));u++;continue}if(!Object.prototype.hasOwnProperty.call(c,l))Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=c[l];if(d)m._errors.push(t(i));c=m,u++}}}};return o(e),r}function As(e,t){return{callee:t?.callee??e,Err:t?.Err}}var js=(e)=>{let t=(r,o,n,s)=>{let i=n?{...n,async:!1}:{async:!1},a=r._zod.run({value:o,issues:[]},i);if(a instanceof Promise)throw new At;if(a.issues.length){let c=new(s?.Err??e)(a.issues.map((u)=>Nt(u,i,mt())));throw Wa(c,s?.callee??t),c}return a.value};return t};var Ms=(e)=>{let t=async(r,o,n,s)=>{let i=n?{...n,async:!0}:{async:!0},a=r._zod.run({value:o,issues:[]},i);if(a instanceof Promise)a=await a;if(a.issues.length){let c=new(s?.Err??e)(a.issues.map((u)=>Nt(u,i,mt())));throw Wa(c,s?.callee??t),c}return a.value};return t};var qs=(e)=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new At;return s.issues.length?wh(e,s.issues,n):{success:!0,data:s.value}};function wh(e,t,r){let o;return{success:!1,get error(){if(!o)o=new e(t.map((n)=>Nt(n,r,mt()))),t=void 0,r=void 0;return o},set error(n){o=n,t=void 0,r=void 0}}}var Ls=(e)=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)s=await s;return s.issues.length?wh(e,s.issues,n):{success:!0,data:s.value}};var eR=Symbol.for("zod.compile.invalid"),tR=Symbol.for("zod.compile.fallback"),nc=(e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==eR)return!0;if(o.definite===!0&&r===void 0)return!1}return rR(e,t,r)};function rR(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n)o[tR]=!0,s=n({value:t,issues:[]},o);else s=e._zod.run({value:t,issues:[]},o);if(s instanceof Promise)throw new At;return s.issues.length===0}var sc=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);if(n instanceof Promise)n=await n;return n.issues.length===0},jh=(e)=>{let t=js(e),r=(o,n,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,a,As(r,i))};return r};var Zh=(e)=>{let t=js(e),r=(o,n,s,i)=>t(o,n,s,As(r,i));return r};var qh=(e)=>{let t=Ms(e),r=async(o,n,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,a,As(r,i))};return r};var Lh=(e)=>{let t=Ms(e),r=async(o,n,s,i)=>await t(o,n,s,As(r,i));return r};var Uh=(e)=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return qs(e)(t,r,n)};var Vh=(e)=>(t,r,o)=>qs(e)(t,r,o);var Hh=(e)=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ls(e)(t,r,n)};var Bh=(e)=>async(t,r,o)=>Ls(e)(t,r,o);var Jh=/^[cC][0-9a-z]{6,}$/,Kh=/^[0-9a-z]+$/,Gh=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Wh=/^[0-9a-vA-V]{20}$/,Yh=/^[A-Za-z0-9]{27}$/,Xh=/^[a-zA-Z0-9_-]{21}$/;function Qh(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var eg=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var tg=/^([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})$/,ac=(e)=>{if(!e)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}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var rg=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var oR="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function og(){return new RegExp(oR,"u")}var ng=/^(?:(?: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])$/,sg=/^(([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 ig=/^((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])$/,ag=/^(([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])$/,cg=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ug=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var lg=/^https?$/,dg=/^\+[1-9]\d{6,14}$/;var pg="(?:(?:\\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 nR(e){return new RegExp(`^${e}$`)}var mg=nR(pg);function ic(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.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{${e.precision}}`:e.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 fg(e){return new RegExp(`^${ic(e)}$`)}function hg(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${ic({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${ic({precision:e.precision})}`:r;return new RegExp(`^${pg}T(?:${o})$`)}var gg=/^[\s\S]{0,}$/;var cc=/^-?\d+$/,tn=/^-?\d+(?:\.\d+)?$/,_g=/^(?:true|false)$/i,yg=/^null$/i;var vg=/^[^A-Z]*$/,Sg=/^[^a-z]*$/;var Ge=D("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var uc=(e)=>{let t=e.value;return!Qf(t)&&t.length!==void 0},Ds={number:"number",bigint:"bigint",object:"date"},lc=D("$ZodCheckLessThan",(e,t)=>{Ge.init(e,t);let r=Ds[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;o.issues.push({origin:Ds[typeof o.value]??r,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),dc=D("$ZodCheckGreaterThan",(e,t)=>{Ge.init(e,t);let r=Ds[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;o.issues.push({origin:Ds[typeof o.value]??r,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),bg=D("$ZodCheckMultipleOf",(e,t)=>{Ge.init(e,t),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):eh(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),zg=D("$ZodCheckNumberFormat",(e,t)=>{Ge.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=Es[t.format];e._zod.check=(i)=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){if(a>0)i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});else i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}if(a<n)i.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(a>s)i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var $g=D("$ZodCheckMaxLength",(e,t)=>{var r;Ge.init(e,t),(r=e._zod.def).when??(r.when=uc),e._zod.check=(o)=>{let n=o.value,s=n.length;if((typeof n==="string"&&s>t.maximum?Cs(n):s)<=t.maximum)return;let a=Is(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Rg=D("$ZodCheckMinLength",(e,t)=>{var r;Ge.init(e,t),(r=e._zod.def).when??(r.when=uc),e._zod.check=(o)=>{let n=o.value,s=n.length;if((typeof n==="string"&&s>=t.minimum&&s<t.minimum*2?Cs(n):s)>=t.minimum)return;let a=Is(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),wg=D("$ZodCheckLengthEquals",(e,t)=>{var r;Ge.init(e,t),(r=e._zod.def).when??(r.when=uc),e._zod.check=(o)=>{let n=o.value,s=n.length,i=typeof n==="string"&&s>=t.length&&s<=t.length*2?Cs(n):s;if(i===t.length)return;let a=Is(n),c=i>t.length;o.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),on=D("$ZodCheckStringFormat",(e,t)=>{var r,o;if(Ge.init(e,t),t.pattern)(r=e._zod).check??(r.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(o=e._zod).check??(o.check=()=>{})}),Pg=D("$ZodCheckRegex",(e,t)=>{on.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),kg=D("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=vg),on.init(e,t)}),xg=D("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Sg),on.init(e,t)}),Eg=D("$ZodCheckIncludes",(e,t)=>{Ge.init(e,t);let r=tr(t.includes),o=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=(n)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Tg=D("$ZodCheckStartsWith",(e,t)=>{Ge.init(e,t);let r=new RegExp(`^${tr(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Og=D("$ZodCheckEndsWith",(e,t)=>{Ge.init(e,t);let r=new RegExp(`.*${tr(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Cg=D("$ZodCheckOverwrite",(e,t)=>{Ge.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class pc{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
|
|
59
|
+
`).filter((s)=>s),o=Math.min(...r.map((s)=>s.length-s.trimStart().length)),n=r.map((s)=>s.slice(o)).map((s)=>" ".repeat(this.indent*2)+s);for(let s of n)this.content.push(s)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
60
|
+
${t.join(`
|
|
61
|
+
`)}
|
|
62
|
+
};`)(...Object.values(this.closed))}}var Ng={major:4,minor:6,patch:7};var Oe=D("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ng;let o=e._zod.def.checks,n=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o?.length?[...o]:[];for(let s of n)for(let i of s._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=(a,c,u)=>{if(a.memo)return a;let l=It(a),d;for(let m of c){if(m._zod.def.when){if(dh(a))continue;if(!m._zod.def.when(a))continue}else if(l)continue;let h=a.issues.length,f=m._zod.check(a);if(f instanceof Promise&&u?.async===!1)throw new At;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{if(await f,a.issues.length===h)return;if(Os(a.issues,h,e),!l)l=It(a,h)});else{if(a.issues.length===h)continue;if(Os(a.issues,h,e),!l)l=It(a,h)}}if(d)return d.then(()=>a);return a},i=(a,c,u)=>{if(It(a))return a.aborted=!0,a;let l=s(c,n,u);if(l instanceof Promise){if(u.async===!1)throw new At;return l.then((d)=>e._zod.parse(d,u))}return e._zod.parse(l,u)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});if(l instanceof Promise)return l.then((d)=>i(d,a,c));return i(l,a,c)}let u=e._zod.parse(a,c);if(u instanceof Promise){if(c.async===!1)throw new At;return u.then((l)=>s(l,n,c))}return s(u,n,c)}}},{get "~standard"(){return Ns(this,"~standard",fc(this))},set "~standard"(e){Ut(this,"~standard",e)}}),Hg=(e,t)=>e.issues.length?{issues:e.issues.map((r)=>Nt(r,t,mt()))}:{value:e.value};async function sR(e,t){let r={async:!0};return Hg(await e._zod.run({value:t,issues:[]},r),r)}function fc(e){return{validate:(t)=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return Hg(o,r)}catch(o){}return sR(e,t)},vendor:"zod",version:1}}var Hs=D("$ZodString",(e,t)=>{Oe.init(e,t),e._zod.pattern=t.pattern??gg,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Ae=D("$ZodStringFormat",(e,t)=>{on.init(e,t),Hs.init(e,t)}),Bg=D("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=tg),Ae.init(e,t)}),Jg=D("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ac(o))}else t.pattern??(t.pattern=ac());Ae.init(e,t)}),Kg=D("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=rg),Ae.init(e,t)}),Gg=1,Fs=2;function Wg(e){try{if(typeof URL<"u"&&typeof URL.canParse==="function")return URL.canParse(e);return new URL(e),!0}catch{return!1}}function iR(e,t){if(!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t))return Wg(e)||Fs;return aR(e,t)}function aR(e,t){if(!t.normalize&&t.protocol?.source===lg.source&&!/^https?:\/\//i.test(e))return Gg;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse==="function")return r.parse(e)??Fs}return new URL(e)}catch{return Fs}}var cR=/[\t\n\r]/g;function Ag(e){return e.replace(cR,"")}function uR(e,t){return t.lastIndex=0,t.test(e.hostname)}function lR(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var Yg=D("$ZodURL",(e,t)=>{Ae.init(e,t),e._zod.check=(r)=>{try{let o=r.value.trim(),n=iR(o,t);if(n===Gg){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(n===Fs){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(n===!0){r.value=Ag(o);return}if(t.hostname&&!uR(n,t.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort});if(t.protocol&&!lR(n,t.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort});r.value=t.normalize?n.href:Ag(o);return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Xg=D("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=og()),Ae.init(e,t)}),Qg=D("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Xh:Qh(t.length)),Ae.init(e,t)}),e_=D("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Jh),Ae.init(e,t)}),t_=D("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Kh),Ae.init(e,t)}),r_=D("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Gh),Ae.init(e,t)}),o_=D("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Wh),Ae.init(e,t)}),n_=D("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Yh),Ae.init(e,t)}),s_=D("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=hg(t)),Ae.init(e,t)}),i_=D("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=mg),Ae.init(e,t)}),a_=D("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=fg(t)),Ae.init(e,t)}),c_=D("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=eg),Ae.init(e,t)}),u_=D("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ng),Ae.init(e,t)}),dR=/^[0-9a-fA-F:.]+$/;function l_(e){if(!dR.test(e))return!1;return Wg(`http://[${e}]`)}var d_=D("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=sg),Ae.init(e,t),e._zod.check=(r)=>{if(!l_(r.value))r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var p_=D("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ig),Ae.init(e,t)});function pR(e){let t=e.split("/");if(t.length!==2)return!1;let[r,o]=t;if(!o)return!1;let n=Number(o);if(`${n}`!==o)return!1;if(n<0||n>128)return!1;return l_(r)}var m_=D("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ag),Ae.init(e,t),e._zod.check=(r)=>{if(!pR(r.value))r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function f_(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var gc=/^[0-9a-zA-Z+/]*={0,2}$/,h_=D("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=gc),Ae.init(e,t),e._zod.check=(r)=>{if(f_(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),Bs=/^[A-Za-z0-9_-]*$/;function mR(e){if(!Bs.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return f_(r)}var g_=D("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Bs),Ae.init(e,t),e._zod.check=(r)=>{if(mR(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),y_=D("$ZodE164",(e,t)=>{t.pattern??(t.pattern=dg),Ae.init(e,t)});function fR(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(t&&(!("alg"in n)||n.alg!==t))return!1;return!0}catch{return!1}}var v_=D("$ZodJWT",(e,t)=>{Ae.init(e,t),e._zod.check=(r)=>{if(fR(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var _c=D("$ZodNumber",(e,t)=>{Oe.init(e,t),e._zod.pattern=tn,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(i){}let n=r.value;if(typeof n==="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let s=typeof n==="number"?Number.isNaN(n)?"NaN":!Number.isFinite(n)?String(n):void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),b_=D("$ZodNumberFormat",(e,t)=>{zg.init(e,t),_c.init(e,t)}),ey=D("$ZodBoolean",(e,t)=>{Oe.init(e,t),e._zod.pattern=_g,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(s){}let n=r.value;if(typeof n==="boolean")return r;return r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}});var ty=D("$ZodNull",(e,t)=>{Oe.init(e,t),e._zod.pattern=yg,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;if(n===null)return r;return r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}});var ry=D("$ZodUnknown",(e,t)=>{Oe.init(e,t),e._zod.parse=(r)=>r}),oy=D("$ZodNever",(e,t)=>{Oe.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function hR(e,t){let r=ec(e._zod.def.checks);if(!r.length)return;let o=Math.min(...r.map((s)=>s[0])),n=e._zod.parse;e._zod.parse=(s,i)=>{let a=t(s.value);if(a>o&&!i?.skipChecks&&i?.direction!=="backward"){for(let[c,u]of ec(e._zod.def.checks))if(a>c&&u._zod.def.when(s)){let l=s.issues.length;return u._zod.check(s),s.issues[l].continue=!1,Os(s.issues,l,e),s}}return n(s,i)}}var gR=(e)=>Array.isArray(e)?e.length:-1;function jg(e,t,r){if(e.issues.length)t.issues.push(...rr(r,e.issues));t.value[r]=e.value}var ny=D("$ZodArray",(e,t)=>{Oe.init(e,t);let r=nt.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!Array.isArray(s))return o.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),o;o.value=r?r.alloc(e,o,Array(s.length),n):Array(s.length);let i=[],a=n?.abortEarly;for(let c=0;c<s.length;c++){let u=s[c],l=t.element._zod.run({value:u,issues:[]},n);if(l instanceof Promise)i.push(l.then((d)=>jg(d,o,c)));else if(jg(l,o,c),a&&l.issues.length!==0&&It(l))break}if(i.length)return Promise.all(i).then(()=>o);return o},hR(e,gR)});function Vs(e,t,r,o,n,s){let i=r in o,a=s==="optional";if(!i&&a&&n==="optional")return;if(e.issues.length){if(n!==void 0&&a&&!i)return;t.issues.push(...rr(r,e.issues))}if(!i&&n===void 0){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(i||n==="defaulted"&&!a)t.value[r]=void 0}else t.value[r]=e.value}var _R=[];function sy(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),o=r.length?r:_R,n=o.length?[...t,...o]:t;for(let i of n)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(i)}": expected a Zod schema`);let s=ch(e.shape);return{...e,allKeys:n,symbolKeys:o,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function iy(e,t,r,o,n,s,i){let a=[],c=n.keySet,u=n.catchall._zod,l=u.def.type,{optin:d,optout:m}=u,h=0;for(let f in t){if(i&&r.issues.length!==h){if(It(r,h))break;h=r.issues.length}if(c.has(f))continue;if(f==="__proto__"){if(l==="never")a.push(f);continue}if(l==="never"){a.push(f);continue}let v=u.run({value:t[f],issues:[]},o);if(v instanceof Promise)e.push(v.then((y)=>Vs(y,r,f,t,d,m)));else Vs(v,r,f,t,d,m)}if(a.length)r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s,continue:!0});if(!e.length)return r;return Promise.all(e).then(()=>r)}var yR=D("$ZodObject",(e,t)=>{Oe.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),o=r?.get?r.get.raw:t.shape??{};if(o){let u=()=>{let l={...o};return Object.defineProperty(t,"shape",{value:l}),u.raw=l,l};u.raw=o,Object.defineProperty(t,"shape",{get:u})}let n=Xo(()=>sy(t));Se(e,"propValues",(u)=>{let l=u.def.shape,d={};for(let m in l){let h=l[m]._zod;if(h.values){if(!Object.prototype.hasOwnProperty.call(d,m))dt(d,m,new Set);for(let f of h.values)d[m].add(f);if(h.optin!==void 0)d[m].add(void 0)}}return d});let s=Jr,i=t.catchall,a,c=nt.memoizer;c?.attach(e),e._zod.parse=(u,l)=>{a??(a=n.value);let d=u.value;if(!s(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u;u.value=c?c.alloc(e,u,{},l):{};let m=[],h=a.shape,f=l?.abortEarly,v=u.issues.length;for(let y of a.allKeys){if(f&&u.issues.length!==v){if(It(u,v))break;v=u.issues.length}if(y==="__proto__")continue;let g=h[y],P=g._zod.optin,w=g._zod.optout,x=g._zod.run({value:d[y],issues:[]},l);if(x instanceof Promise)m.push(x.then((O)=>Vs(O,u,y,d,P,w)));else Vs(x,u,y,d,P,w)}if(!i)return m.length?Promise.all(m).then(()=>u):u;return iy(m,d,u,l,n.value,e,f===!0)}}),ay=D("$ZodObjectJIT",(e,t)=>{yR.init(e,t);let r=e._zod.parse,o=Xo(()=>sy(t)),n=nt.memoizer,s=(h)=>{let f=o.value,v=f.symbolKeys,y=new pc(["payload","ctx"],{shape:h,inst:e,memo:n,syms:v}),g=(O)=>`shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`,P=(O,R)=>`
|
|
63
|
+
let ${O}_ab = false;
|
|
64
|
+
for (let i = 0; i < ${O}.issues.length; i++) {
|
|
65
|
+
const iss = ${O}.issues[i];
|
|
66
|
+
iss.path = iss.path ? [${R}, ...iss.path] : [${R}];
|
|
67
|
+
payload.issues.push(iss);
|
|
68
|
+
if (iss.continue !== true) ${O}_ab = true;
|
|
69
|
+
}
|
|
70
|
+
if (${O}_ab && ctx && ctx.abortEarly) {
|
|
71
|
+
payload.value = newResult;
|
|
72
|
+
return payload;
|
|
73
|
+
}`;y.write("const input = payload.value;");let w=Object.create(null),x=0;for(let O of f.allKeys)w[O]=`key_${x++}`;y.write(n?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let O of f.allKeys){if(O==="__proto__")continue;let R=w[O],S=typeof O==="symbol"?`syms[${v.indexOf(O)}]`:nh(O),E=`${S} in input`,A=h[O],H=A?._zod?.optin,j=H!==void 0,V=A?._zod?.optout==="optional";if(y.write(`const ${R} = ${g(S)};`),j&&V){let W=H==="optional"?`${R}_present`:`${R}.value !== undefined || ${R}_present`;y.write(`
|
|
74
|
+
const ${R}_present = ${E};
|
|
75
|
+
if (!${R}.issues.length || ${R}_present) {
|
|
76
|
+
if (${R}.issues.length) {${P(R,S)}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (${W}) {
|
|
80
|
+
newResult[${S}] = ${R}.value;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
`)}else if(!j)y.write(`
|
|
85
|
+
const ${R}_present = ${E};
|
|
86
|
+
if (${R}.issues.length) {${P(R,S)}
|
|
87
|
+
}
|
|
88
|
+
if (!${R}_present && !${R}.issues.length) {
|
|
89
|
+
payload.issues.push({
|
|
90
|
+
code: "invalid_type",
|
|
91
|
+
expected: "nonoptional",
|
|
92
|
+
input: undefined,
|
|
93
|
+
path: [${S}]
|
|
94
|
+
});
|
|
95
|
+
if (ctx && ctx.abortEarly) {
|
|
96
|
+
payload.value = newResult;
|
|
97
|
+
return payload;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (${R}_present) {
|
|
102
|
+
newResult[${S}] = ${R}.value;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
`);else if(y.write(`
|
|
106
|
+
if (${R}.issues.length) {${P(R,S)}
|
|
107
|
+
}
|
|
108
|
+
`),H==="defaulted")y.write(`newResult[${S}] = ${R}.value;`);else y.write(`
|
|
109
|
+
if (${R}.value !== undefined || ${E}) {
|
|
110
|
+
newResult[${S}] = ${R}.value;
|
|
111
|
+
}
|
|
112
|
+
`)}return y.write("payload.value = newResult;"),y.write("return payload;"),y.compile()},i,a=Jr,c=!nt.jitless,l=c&&ih.value,d=t.catchall,m;e._zod.parse=(h,f)=>{m??(m=o.value);let v=h.value;if(!a(v))return h.issues.push({expected:"object",code:"invalid_type",input:v,inst:e}),h;if(c&&l&&f?.async===!1&&f.jitless!==!0){if(!i)i=s(t.shape);if(h=i(h,f),!d)return h;return iy([],v,h,f,m,e,f?.abortEarly===!0)}return r(h,f)}});function Mg(e,t,r,o){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let n=e.filter((s)=>!It(s));if(n.length===1)return t.value=n[0].value,n[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((s)=>s.issues.map((i)=>Nt(i,o,mt())))}),t}var yc=D("$ZodUnion",(e,t)=>{Oe.init(e,t),Se(e,"optin",(o)=>o.def.options.some((n)=>n._zod.optin==="defaulted")?"defaulted":o.def.options.some((n)=>n._zod.optin!==void 0)?"optional":void 0),Se(e,"optout",(o)=>o.def.options.some((n)=>n._zod.optout==="optional")?"optional":void 0),Se(e,"values",(o)=>{if(o.def.options.every((n)=>n._zod.values))return new Set(o.def.options.flatMap((n)=>Array.from(n._zod.values)));return}),Se(e,"pattern",(o)=>{if(o.def.options.every((n)=>n._zod.pattern)){let n=o.def.options.map((s)=>s._zod.pattern);return new RegExp(`^(${n.map((s)=>xs(s.source)).join("|")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let s=!1,i=[];for(let a of t.options){let c=a._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}if(!s)return Mg(i,o,e,n);return Promise.all(i).then((a)=>Mg(a,o,e,n))}});function vR(e){let t=new Map;for(let r of e.options){let o=r._zod.propValues?.[e.discriminator];if(!o||o.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let n of o)if(t.has(n)){if(n!==void 0)throw Error(`Duplicate discriminator value "${String(n)}"`);t.set(n,null)}else t.set(n,r)}return t}var cy=D("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,yc.init(e,t);let r=e._zod.parse;Se(e,"propValues",(n)=>{let s={},i=0;for(let a of n.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw Error(`Invalid discriminated union option at index "${n.def.options.indexOf(a)}"`);if(c[n.def.discriminator]?.has(void 0))i++;for(let[u,l]of Object.entries(c)){if(!Object.prototype.hasOwnProperty.call(s,u))dt(s,u,new Set);for(let d of l)s[u].add(d)}}if(!n.def.unionFallback&&i>1)s[n.def.discriminator]?.delete(void 0);return s}),t.options.forEach((n,s)=>{let i=Qo(n._zod.def);if(i&&!Object.prototype.hasOwnProperty.call(i,t.discriminator))throw Error(`Invalid discriminated union option at index "${s}"`)});let o=Xo(()=>vR(t));e._zod.parse=(n,s)=>{let i=n.value;if(!Jr(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),n;let a=i?.[t.discriminator],c=o.value.get(a);if(c&&(a!==void 0||s.direction!=="backward"))return c._zod.run(n,s);if(t.unionFallback||s.direction==="backward")return r(n,s);return n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()).filter((u)=>o.value.get(u)!==null),input:i,path:[t.discriminator],inst:e}),n}}),uy=D("$ZodIntersection",(e,t)=>{Oe.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,s=t.left._zod.run({value:n,issues:[]},o),i=t.right._zod.run({value:n,issues:[]},o);if(s instanceof Promise||i instanceof Promise)return Promise.all([s,i]).then(([c,u])=>Zg(r,c,u));return Zg(r,s,i)}});function mc(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(br(e)&&br(t)){let r=Object.keys(t),o=Object.keys(e).filter((s)=>r.indexOf(s)!==-1),n={...e,...t};if(Object.prototype.hasOwnProperty.call(n,"__proto__"))delete n.__proto__;for(let s of o){if(s==="__proto__")continue;let i=mc(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};n[s]=i.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],s=t[o],i=mc(n,s);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Zg(e,t,r){let o=new Map,n,s=new Map,i=(u,l)=>{let d;if(u.code==="unrecognized_keys"&&!u.path?.length)n??(n=u),d=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let m=String(u.path[0]);if(!s.has(m))s.set(m,u);d=[m]}else return!1;for(let m of d){if(!o.has(m))o.set(m,{});o.get(m)[l]=!0}return!0};for(let u of t.issues)if(!i(u,"l"))e.issues.push(u);for(let u of r.issues)if(!i(u,"r"))e.issues.push(u);let a=[...o].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){let u=n?a.filter((l)=>n.keys.includes(l)):[];if(u.length)e.issues.push({...n,keys:u});for(let l of a)if(!u.includes(l)&&s.has(l))e.issues.push(s.get(l))}let c=mc(t.value,r.value);if(!c.valid){if(It(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var ly=D("$ZodRecord",(e,t)=>{Oe.init(e,t);let r=nt.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!br(s))return o.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),o;let i=[],a=t.keyType._zod.values;if(a&&!t.partial){o.value=r?r.alloc(e,o,{},n):{};let c=new Set;for(let l of a)if(typeof l==="string"||typeof l==="number"||typeof l==="symbol"){if(c.add(typeof l==="number"?l.toString():l),l==="__proto__")continue;let d=t.keyType._zod.run({value:l,issues:[]},n);if(d instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(d.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map((f)=>Nt(f,n,mt())),input:l,path:[l],inst:e});continue}let m=d.value;if(m==="__proto__")continue;let h=t.valueType._zod.run({value:s[l],issues:[]},n);if(h instanceof Promise)i.push(h.then((f)=>{if(f.issues.length)o.issues.push(...rr(l,f.issues));o.value[m]=f.value}));else{if(h.issues.length)o.issues.push(...rr(l,h.issues));o.value[m]=h.value}}let u;for(let l in s)if(!c.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;o.value[l]=s[l]}else u=u??[],u.push(l);if(u&&u.length>0)o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:u,continue:!0})}else{o.value=r?r.alloc(e,o,{},n):{};let c;for(let u of Reflect.ownKeys(s)){if(u==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(s,u))continue;let l=t.keyType._zod.run({value:u,issues:[]},n);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof u==="string"&&tn.test(u)&&l.issues.length){let f=t.keyType._zod.run({value:Number(u),issues:[]},n);if(f instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(f.issues.length===0)l=f}if(l.issues.length){if(t.mode==="loose")o.value[u]=s[u];else if(a)c=c??[],c.push(u);else o.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map((f)=>Nt(f,n,mt())),input:u,path:[u],inst:e});continue}let m=l.value;if(m==="__proto__")continue;let h=t.valueType._zod.run({value:s[u],issues:[]},n);if(h instanceof Promise)i.push(h.then((f)=>{if(f.issues.length)o.issues.push(...rr(u,f.issues));o.value[m]=f.value}));else{if(h.issues.length)o.issues.push(...rr(u,h.issues));o.value[m]=h.value}}if(c&&c.length>0)o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:c,continue:!0})}if(i.length)return Promise.all(i).then(()=>o);return o}});var dy=D("$ZodEnum",(e,t)=>{Oe.init(e,t);let r=Wo(t.entries),o=new Set(r);e._zod.values=o,Se(e,"pattern",(n)=>{let s=Wo(n.def.entries).filter((i)=>ah.has(typeof i));return new RegExp(s.length?`^(${s.map((i)=>tr(i.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,s)=>{let i=n.value;if(o.has(i))return n;return n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),py=D("$ZodLiteral",(e,t)=>{Oe.init(e,t);let r=new Set(t.values);e._zod.values=r,Se(e,"pattern",(o)=>{let n=o.def.values;return new RegExp(n.length?`^(${n.map((s)=>typeof s==="string"?tr(s):s?tr(s.toString()):String(s)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,n)=>{let s=o.value;if(r.has(s))return o;return o.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),o}});var my=D("$ZodTransform",(e,t)=>{Oe.init(e,t),e._zod.optin="optional",nt.memoizer?.guard(e),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new en(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then((i)=>(r.value=i,r));if(n instanceof Promise)throw new At;return r.value=n,r}});function qg(e,t){return e.value=t.issues.length?void 0:t.value,e}var vc=D("$ZodOptional",(e,t)=>{Oe.init(e,t),Se(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Se(e,"values",(r)=>{let o=r.def.innerType._zod.values;return o?new Set([...o,void 0]):void 0}),Se(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${xs(o.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let n=t.innerType._zod.run({value:r.value,issues:[]},o);if(n instanceof Promise)return n.then((s)=>qg(r,s));return qg(r,n)}return t.innerType._zod.run(r,o)}}),fy=D("$ZodExactOptional",(e,t)=>{vc.init(e,t),Se(e,"values",(r)=>r.def.innerType._zod.values),Se(e,"pattern",(r)=>r.def.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),hy=D("$ZodNullable",(e,t)=>{Oe.init(e,t),Se(e,"optin",(r)=>r.def.innerType._zod.optin),Se(e,"optout",(r)=>r.def.innerType._zod.optout),Se(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${xs(o.source)}|null)$`):void 0}),Se(e,"values",(r)=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>{if(r.value===null)return r;return t.innerType._zod.run(r,o)}}),gy=D("$ZodDefault",(e,t)=>{Oe.init(e,t),e._zod.optin="defaulted",Se(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>Lg(s,t));return Lg(n,t)}});function Lg(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var _y=D("$ZodPrefault",(e,t)=>{Oe.init(e,t),e._zod.optin="defaulted",Se(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,o)}}),yy=D("$ZodNonOptional",(e,t)=>{Oe.init(e,t),Se(e,"values",(r)=>{let o=r.def.innerType._zod.values;return o?new Set([...o].filter((n)=>n!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>Dg(s,e));return Dg(n,e)}});function Dg(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function Ug(e,t,r,o){if(!t.issues.length){if(e.value=t.value,t.memo)e.memo=!0;return e}return e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map((n)=>Nt(n,o,mt()))},input:e.value}),e}var vy=D("$ZodCatch",(e,t)=>{Oe.init(e,t),Se(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Se(e,"optout",(r)=>r.def.innerType._zod.optout),Se(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run({value:r.value,issues:[]},o);if(n instanceof Promise)return n.then((s)=>Ug(r,s,t,o));return Ug(r,n,t,o)}});var Sc=D("$ZodPipe",(e,t)=>{Oe.init(e,t),Se(e,"values",(r)=>r.def.in._zod.values),Se(e,"optin",(r)=>r.def.in._zod.optin),Se(e,"optout",(r)=>r.def.out._zod.optout),Se(e,"propValues",(r)=>r.def.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let s=t.out._zod.run(r,o);if(s instanceof Promise)return s.then((i)=>Us(i,t.in,o));return Us(s,t.in,o)}let n=t.in._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>Us(s,t.out,o));return Us(n,t.out,o)}});function Us(e,t,r){if(e.issues.some((o)=>o.code!=="unrecognized_keys"))return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},r)}var Sy=D("$ZodPreprocess",(e,t)=>{Sc.init(e,t)}),by=D("$ZodReadonly",(e,t)=>{Oe.init(e,t),Se(e,"propValues",(r)=>r.def.innerType._zod.propValues),Se(e,"values",(r)=>r.def.innerType._zod.values),Se(e,"optin",(r)=>r.def.innerType?._zod?.optin),Se(e,"optout",(r)=>r.def.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then(Fg);return Fg(n)}});function Fg(e){if(!e.memo)e.value=Object.freeze(e.value);return e}var zy=D("$ZodLazy",(e,t)=>{Oe.init(e,t),th(e._zod,"innerType",()=>{let r=t;if(!r._cachedInner)r._cachedInner=t.getter();return r._cachedInner}),Se(e,"pattern",(r)=>r.innerType?._zod?.pattern),Se(e,"propValues",(r)=>r.innerType?._zod?.propValues),Se(e,"optin",(r)=>r.innerType?._zod?.optin??void 0),Se(e,"optout",(r)=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),$y=D("$ZodCustom",(e,t)=>{Ge.init(e,t),Oe.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=(r)=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then((s)=>Vg(s,r,o,e));Vg(n,r,o,e);return}});function Vg(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)n.params=o._zod.def.params;t.issues.push(zr(n))}}class wy extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var zc="~memo",Ry=[];function Py(e){return e!==null&&typeof e==="object"}function bc(e){return e.map((t)=>t.path?{...t,path:t.path.slice()}:{...t})}var ky=new WeakMap,nn=0,Gs=1,sn=2;function Ws(e,t,r){let o=ky.get(e);if(o!==void 0)return o?sn:nn;if(t.has(e))return sn;t.add(e);let n=nn,s=(l)=>{if(n!==sn&&l?._zod){let d=Ws(l,t,r);if(d>n)n=d}},i=(l,d)=>{let m=nn;for(let h of Reflect.ownKeys(l)){let f=Object.getOwnPropertyDescriptor(l,h);if(d&&!f.enumerable)continue;let v=f.get?Gs:f.value?._zod?Ws(f.value,t,r):nn;if(v>m)m=v}return m},a=(l)=>{if(l>n)n=l},c=e._zod.def,u=c.type;switch(u){case"object":{let l=Qo(c);a(l?i(l,!0):Gs),s(c.catchall);break}case"array":s(c.element);break;case"tuple":for(let l of c.items)s(l);s(c.rest);break;case"record":case"map":s(c.keyType),s(c.valueType);break;case"set":s(c.valueType);break;case"union":for(let l of c.options)s(l);break;case"intersection":s(c.left),s(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(c.innerType);break;case"pipe":s(c.in),s(c.out);break;case"function":s(c.input),s(c.output);break;case"lazy":{let l=c._cachedInner??(r?e._zod.innerType:void 0);a(l?Ws(l,t,!1):Gs);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 l in c){let d=Object.getOwnPropertyDescriptor(c,l);if(!d||d.get)continue;let m=d.value;if(!m||typeof m!=="object")continue;if(m._zod)s(m);else if(Array.isArray(m))for(let h of m)s(h)}}return t.delete(e),SR(e,n)}function SR(e,t){if(t!==Gs)ky.set(e,t===sn);return t}function bR(e,t){let r=e.buckets.get(t);if(!r)r=new WeakMap,e.buckets.set(t,r);return r}var Js,Ks=[],zR={alloc(e,t,r){let o=Js;if(!o)return r;Js=void 0;let n={value:r,issues:null};return o.set(t.value,n),Ks.push(n),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,o=(n,s)=>{if(s.direction!=="backward"&&$R(s,n.value))throw new wy;return r(n,s)};if(e._zod.parse=o,e._zod.run===r)e._zod.run=o})},attach(e){var t;let r,o=!1,n,s;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let i=e._zod.parse,a=(c,u)=>{if(r===void 0){let g=Ws(e,new Set,!1);if(g===nn){if(e._zod.parse=i,e._zod.run===a)e._zod.run=i;return i(c,u)}if(g===sn||o)r=!0;else o=!0}let l=c.value;if(!Py(l))return i(c,u);let d=u[zc];if(!d)d={buckets:new WeakMap,backEdges:void 0},u[zc]=d;let m;if(n===u)m=s;else m=bR(d,e),n=u,s=m;let h=m.get(l);if(h){if(c.value=h.value,h.issues){if(h.issues.length)c.issues.push(...bc(h.issues))}else c.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(h.value);return c}Js=m;let f=Ks.length,v=i(c,u);Js=void 0;let y=Ks.length>f?Ks.pop():void 0;if(v instanceof Promise)return v.then((g)=>{if(y)y.issues=g.issues.length?bc(g.issues):Ry;return g});if(y)y.issues=v.issues.length?bc(v.issues):Ry;return v};if(e._zod.parse=a,e._zod.run===i)e._zod.run=a})}};function xy(){return zR}function $R(e,t){let r=e[zc]?.backEdges;return r!==void 0&&Py(t)&&r.has(t)}var RR=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(s){return e[s]??null}let r={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",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};function n(s,i){if(s==="number"&&typeof i==="number"&&!Number.isFinite(i))return String(i);return o[s]??s}return(s)=>{switch(s.code){case"invalid_type":{let i=n(s.expected),a=ph(s.input),c=n(a,s.input);return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":if(s.values.length===1)return`Invalid input: expected ${Xa(s.values[0])}`;return`Invalid option: expected one of ${Ga(s.values,"|")}`;case"too_big":{let i=s.exact?"exactly ":s.inclusive?"<=":"<",a=t(s.origin);if(a)return`Too big: expected ${s.origin??"value"} to have ${i}${s.maximum.toString()} ${a.unit??"elements"}`;return`Too big: expected ${s.origin??"value"} to be ${i}${s.maximum.toString()}`}case"too_small":{let i=s.exact?"exactly ":s.inclusive?">=":">",a=t(s.origin);if(a)return`Too small: expected ${s.origin} to have ${i}${s.minimum.toString()} ${a.unit}`;return`Too small: expected ${s.origin} to be ${i}${s.minimum.toString()}`}case"invalid_format":{let i=s;if(i.format==="starts_with")return`Invalid string: must start with "${i.prefix}"`;if(i.format==="ends_with")return`Invalid string: must end with "${i.suffix}"`;if(i.format==="includes")return`Invalid string: must include "${i.includes}"`;if(i.format==="regex")return`Invalid string: must match pattern ${i.pattern}`;return`Invalid ${r[i.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${Ga(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":if(s.options&&Array.isArray(s.options)&&s.options.length>0)return`Invalid discriminator value. Expected ${s.options.map((a)=>`'${a}'`).join(" | ")}`;if(s.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function $c(){return{localeError:RR()}}var Ey;class Ty{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let o={...r,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function wR(){return new Ty}(Ey=globalThis).__zod_globalRegistry??(Ey.__zod_globalRegistry=wR());var $r=globalThis.__zod_globalRegistry;function Oy(e){if(e.checks)e.checks=[...e.checks];return e}function Cy(e,t){return new e(Oy({type:"string",...ne(t)}))}function Rc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ne(t)})}function Iy(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ne(t)})}function Ny(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ne(t)})}function Ay(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ne(t)})}function jy(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ne(t)})}function My(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ne(t)})}function wc(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ne(t)})}function Zy(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ne(t)})}function qy(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ne(t)})}function Ly(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ne(t)})}function Dy(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ne(t)})}function Uy(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ne(t)})}function Fy(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ne(t)})}function Vy(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ne(t)})}function Hy(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ne(t)})}function By(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ne(t)})}function Jy(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ne(t)})}function Ky(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ne(t)})}function Gy(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ne(t)})}function Wy(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ne(t)})}function Yy(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ne(t)})}function Xy(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ne(t)})}function Ys(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ne(t)})}function Xs(e,t){return new e({type:"string",format:"date",check:"string_format",...ne(t)})}function Pc(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ne(t)})}function kc(e,t){return new e({type:"string",format:"duration",check:"string_format",...ne(t)})}function Qy(e,t){return new e(Oy({type:"number",checks:[],...ne(t)}))}function ev(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ne(t)})}function tv(e,t){return new e({type:"boolean",...ne(t)})}function rv(e,t){return new e({type:"null",...ne(t)})}function nv(e){return new e({type:"unknown"})}function uv(e,t){return new e({type:"never",...ne(t)})}function ei(e,t){return new lc({check:"less_than",...ne(t),value:e,inclusive:!1})}function an(e,t){return new lc({check:"less_than",...ne(t),value:e,inclusive:!0})}function ti(e,t){return new dc({check:"greater_than",...ne(t),value:e,inclusive:!1})}function cn(e,t){return new dc({check:"greater_than",...ne(t),value:e,inclusive:!0})}function ri(e,t){return new bg({check:"multiple_of",...ne(t),value:e})}function oi(e,t){return new $g({check:"max_length",...ne(t),maximum:e})}function Kr(e,t){return new Rg({check:"min_length",...ne(t),minimum:e})}function ni(e,t){return new wg({check:"length_equals",...ne(t),length:e})}function xc(e,t){return new Pg({check:"string_format",format:"regex",...ne(t),pattern:e})}function Ec(e){return new kg({check:"string_format",format:"lowercase",...ne(e)})}function Tc(e){return new xg({check:"string_format",format:"uppercase",...ne(e)})}function Oc(e,t){return new Eg({check:"string_format",format:"includes",...ne(t),includes:e})}function Cc(e,t){return new Tg({check:"string_format",format:"starts_with",...ne(t),prefix:e})}function Ic(e,t){return new Og({check:"string_format",format:"ends_with",...ne(t),suffix:e})}function or(e){return new Cg({check:"overwrite",tx:e})}function Nc(e){return or((t)=>t.normalize(e))}function Ac(){return or((e)=>e.trim())}function jc(){return or((e)=>e.toLowerCase())}function Mc(){return or((e)=>e.toUpperCase())}function Zc(){return or((e)=>sh(e))}function pv(e,t,r){return new e({type:"array",element:t,...ne(r)})}function mv(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ne(r)})}function fv(e,t){let r=PR((o)=>(o.addIssue=(n)=>{if(typeof n==="string")o.issues.push(zr(n,o.value,r._zod.def));else{let s=n;if(s.fatal)s.continue=!1;if(s.code??(s.code="custom"),!("input"in s))s.input=o.value;s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),o.issues.push(zr(s))}},e(o.value,o)),t);return r}function PR(e,t){let r=new Ge({check:"custom",...ne(t)});return r._zod.check=e,r}function un(e,...t){for(let r of t)for(let o of Reflect.ownKeys(r))if(Object.prototype.propertyIsEnumerable.call(r,o))dt(e,o,r[o]);return e}function dn(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??$r,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Be(e,t,r,o,n){let s=typeof t.unrepresentable==="function"?t.unrepresentable({zodSchema:e,path:o.path,message:n}):t.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw Error(n);return Object.assign(r,s),!0}function Ee(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,s=t.seen.get(e);if(s){if(s.count++,r.schemaPath.includes(e))s.cycle=r.path;return s.schema}let i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,l);else{let m=i.schema,h=t.processors[n.type];if(!h)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);h(e,t,m,l)}let d=e._zod.parent;if(d){if(!i.ref)i.ref=d;Ee(d,t,l),t.seen.get(d).isParent=!0}}let c=t.metadataRegistry.get(e);if(c)un(i.schema,c);if(t.io==="input"&&et(e))delete i.schema.examples,delete i.schema.default;if(t.io==="input"&&"_prefault"in i.schema)(o=i.schema).default??(o.default=i.schema._prefault);return delete i.schema._prefault,t.seen.get(e).schema}function hv(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function pn(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let o=new Map;for(let i of e.seen.entries()){let a=e.metadataRegistry.get(i[0])?.id;if(a){let c=o.get(a);if(c&&c!==i[0])throw Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,i[0])}}let n=(i)=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(i[0])?.id,m=e.external.uri??((f)=>f);if(d)return{ref:m(d)};let h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${m("__shared")}#/${a}/${hv(h)}`}}let c="#",u=`${c}/${a}/`;if(i[1]===r&&!i[1].schema.id)return{ref:c};let l=i[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+hv(l)}},s=(i)=>{if(i[1].schema.$ref)return;let a=i[1],{ref:c,defId:u}=n(i);if(a.def={...a.schema},u)a.defId=u;let l=a.schema;for(let d in l)delete l[d];l.$ref=c};if(e.cycles==="throw")for(let i of e.seen.entries()){let a=i[1];if(a.cycle)throw Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
113
|
+
|
|
114
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let a=i[1];if(t===i[0]){s(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1){if(e.reused==="ref")s(i)}}if(e.external)e.sharedDefsExtractedFor=e.external}function yv(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let o of t){if(!o||typeof o!=="object")return;yv(o);let n=Object.keys(o);if(n.length!==1||n[0]!=="type")return;let s=o.type;for(let i of Array.isArray(s)?s:[s]){if(typeof i!=="string")return;if(!r.includes(i))r.push(i)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var vv=new Set(["type","properties","required","additionalProperties"]),gv=["oneOf","anyOf"];function _v(e){let t=e.additionalProperties;if(t===void 0||t===!1||typeof t!=="object"||t===null)return null;return Object.keys(t).length?t:null}function qc(e){let t=[];for(let s of e){if(typeof s!=="object"||s.type!=="object")return null;for(let i in s)if(!vv.has(i))return null;t.push(s)}let r={},o=new Set;for(let s of t){for(let i in s.properties){if(Object.prototype.hasOwnProperty.call(r,i))continue;let a=[];for(let u of t){let l=u.properties?.[i]??_v(u);if(l===null||l===void 0)continue;if(!a.some((d)=>JSON.stringify(d)===JSON.stringify(l)))a.push(l)}let c=a.length===1?a[0]:qc(a)??{allOf:a};dt(r,i,c)}for(let i of s.required??[])o.add(i)}let n={type:"object",properties:r};if(o.size)n.required=[...o];if(t.every((s)=>s.additionalProperties===!1))n.additionalProperties=!1;else{let s=[];for(let i of t){let a=_v(i);if(a&&!s.some((c)=>JSON.stringify(c)===JSON.stringify(a)))s.push(a)}if(s.length===1)n.additionalProperties=s[0];else if(s.length>1)n.additionalProperties={allOf:s}}return n}function kR(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let n of vv)if(n in e)return;let r=t.filter((n)=>gv.some((s)=>Array.isArray(n[s]))),o=null;if(!r.length)o=qc(t);else{let n=r[0],s=gv.find((c)=>Array.isArray(n[c]));if(Object.keys(n).length!==1)return;let i=t.filter((c)=>c!==n),a=n[s].map((c)=>qc([...i,c]));if(a.some((c)=>!c))return;o={[s]:a}}if(!o)return;delete e.allOf,un(e,o)}function mn(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=(a)=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){o(d);let h=e.seen.get(d),f=h.schema;if(f.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))u.allOf=u.allOf??[],u.allOf.push(f);else un(u,f);if(un(u,l),a._zod.parent===d)for(let y in u){if(y==="$ref"||y==="allOf")continue;if(!(y in l))delete u[y]}if(f.$ref&&h.def)for(let y in u){if(y==="$ref"||y==="allOf")continue;if(y in h.def&&JSON.stringify(u[y])===JSON.stringify(h.def[y]))delete u[y]}}let m=a._zod.parent;if(m&&m!==d){o(m);let h=e.seen.get(m);if(h?.schema.$ref){if(u.$ref=h.schema.$ref,h.def)for(let f in u){if(f==="$ref"||f==="allOf")continue;if(f in h.def&&JSON.stringify(u[f])===JSON.stringify(h.def[f]))delete u[f]}}}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())o(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())yv(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let u of[c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let d=a.get(l);if(d)d.push(u);else a.set(l,[u])}for(let c of e.intersections)for(let u of a.get(c)??[])kR(u)}}let n={};if(e.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")n.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")n.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(a)}un(n,r.defId?r.schema:r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;if(s!==void 0&&n.id===s)delete n.id;let i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];if(c.def&&c.defId){if(c.def.id===c.defId)delete c.def.id;dt(i,c.defId,c.def)}}if(e.external)e.sharedEmitDoneFor=e.external;if(e.external);else if(Object.keys(i).length>0)if(e.target==="draft-2020-12")n.$defs=i;else n.definitions=i;try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:ln(t,"input",e.processors),output:ln(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch(a){throw Error("Error converting schema to JSON.")}}function et(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return et(o.element,r);if(o.type==="set")return et(o.valueType,r);if(o.type==="lazy")return et(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return et(o.innerType,r);if(o.type==="intersection")return et(o.left,r)||et(o.right,r);if(o.type==="record"||o.type==="map")return et(o.keyType,r)||et(o.valueType,r);if(o.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return et(o.in,r)||et(o.out,r)}if(o.type==="object"){for(let n in o.shape)if(et(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(et(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(et(n,r))return!0;if(o.rest&&et(o.rest,r))return!0;return!1}return!1}var Sv=(e,t={})=>(r)=>{let o=dn({...r,processors:t});return Ee(e,o),pn(o,e),mn(o,e)},ln=(e,t,r={})=>(o)=>{let{libraryOptions:n,target:s}=o??{},i=dn({...n??{},target:s,io:t,processors:r});return Ee(e,i),pn(i,e),mn(i,e)};var Gr=(e,t,r)=>{if(e[t]===void 0||r>e[t])e[t]=r},Wr=(e,t,r)=>{if(e[t]===void 0||r<e[t])e[t]=r},bv=(e,t)=>{Gr(e,"minimum",t),Wr(e,"maximum",t)},Pv=(e,t)=>{if(e.multipleOf??(e.multipleOf=[]),!e.multipleOf.includes(t))e.multipleOf.push(t)},kv=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},xv=(e,t)=>{e.mime=e.mime?e.mime.filter((r)=>t.includes(r)):[...t]},Ev=(e,t)=>{if(e.format=t,t.includes("int"))e.isInt=!0},zv=(e,t)=>Gr(e,"minimum",t.minimum),$v=(e,t)=>Wr(e,"maximum",t.maximum),Rv=(e)=>(t,r)=>{Ev(t,r.format);let[o,n]=e[r.format];Gr(t,"minimum",o),Wr(t,"maximum",n)},xR={greater_than:(e,t)=>Gr(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Wr(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Pv(e,t.value),number_format:Rv(Es),bigint_format:Rv(Qa),min_length:zv,max_length:$v,length_equals:(e,t)=>bv(e,t.length),min_size:zv,max_size:$v,size_equals:(e,t)=>bv(e,t.size),string_format:(e,t)=>{if(Ev(e,t.format),t.pattern)kv(e,t.pattern);if(t.format==="base64"||t.format==="base64url")e.contentEncoding=t.format;if(t.local||t.precision===-1)e.laxFormat=!0},mime_type:(e,t)=>xv(e,t.mime)};function st(e){let t={},r=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let s of o)xR[s._zod.def.check]?.(t,s._zod.def);let n=e._zod.bag;if(n.minimum!==void 0)Gr(t,"minimum",n.minimum);if(n.exclusiveMinimum!==void 0)Gr(t,"exclusiveMinimum",n.exclusiveMinimum);if(n.maximum!==void 0)Wr(t,"maximum",n.maximum);if(n.exclusiveMaximum!==void 0)Wr(t,"exclusiveMaximum",n.exclusiveMaximum);if(n.multipleOf!==void 0)Pv(t,n.multipleOf);if(n.format!==void 0){if(t.format??(t.format=n.format),n.format.includes("int"))t.isInt=!0}if(n.mime)xv(t,n.mime);for(let s of n.patterns??[])kv(t,s);return t}var ER={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},TR=new Map([[gc,cg],[Bs,ug]]),Tv=(e)=>TR.get(e)??e,Uc=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u,laxFormat:l}=st(e);if(typeof s==="number")n.minLength=s;if(typeof i==="number")n.maxLength=i;if(a){if(n.format=ER[a]??a,n.format==="")delete n.format;if(a==="time"||l)delete n.format}if(u)n.contentEncoding=u;if(c&&c.size>0){let d=[...c].map(Tv);if(d.length===1)n.pattern=d[0].source;else if(d.length>1)n.allOf=[...d.map((m)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))]}},Fc=(e,t,r,o)=>{let n=r,{minimum:s,maximum:i,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=st(e);n.type=l?"integer":"number";let d=typeof u==="number"&&u>=(s??Number.NEGATIVE_INFINITY),m=typeof c==="number"&&c<=(i??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";if(d)if(h)n.minimum=u,n.exclusiveMinimum=!0;else n.exclusiveMinimum=u;else if(typeof s==="number")n.minimum=s;if(m)if(h)n.maximum=c,n.exclusiveMaximum=!0;else n.exclusiveMaximum=c;else if(typeof i==="number")n.maximum=i;if(a){let f=new Set;for(let g of a)if(Number.isFinite(g)&&g!==0)f.add(Math.abs(g));else Be(e,t,n,o,`A multipleOf divisor of ${g} cannot be represented in JSON Schema`);let[v,...y]=f;if(v!==void 0)n.multipleOf=v;if(y.length)n.allOf=[...n.allOf??[],...y.map((g)=>({multipleOf:g}))]}},Vc=(e,t,r,o)=>{r.type="boolean"},Ov=(e,t,r,o)=>{Be(e,t,r,o,"BigInt cannot be represented in JSON Schema")},Cv=(e,t,r,o)=>{Be(e,t,r,o,"Symbols cannot be represented in JSON Schema")},Hc=(e,t,r,o)=>{if(t.target==="openapi-3.0")r.type="string",r.nullable=!0,r.enum=[null];else r.type="null"},Iv=(e,t,r,o)=>{Be(e,t,r,o,"Undefined cannot be represented in JSON Schema")},Nv=(e,t,r,o)=>{Be(e,t,r,o,"Void cannot be represented in JSON Schema")},Bc=(e,t,r,o)=>{r.not={}},Av=(e,t,r,o)=>{},Jc=(e,t,r,o)=>{},jv=(e,t,r,o)=>{Be(e,t,r,o,"Date cannot be represented in JSON Schema")},Kc=(e,t,r,o)=>{let n=e._zod.def,s=Wo(n.entries);if(s.length===0){r.not={};return}if(s.every((i)=>typeof i==="number"))r.type="number";if(s.every((i)=>typeof i==="string"))r.type="string";r.enum=s},Gc=(e,t,r,o)=>{let n=e._zod.def;if(n.values.length===0){r.not={};return}let s=[];for(let i of n.values)if(i===void 0){if(Be(e,t,r,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof i==="bigint"){if(Be(e,t,r,o,"BigInt literals cannot be represented in JSON Schema"))return;s.push(Number(i))}else s.push(i);if(s.length===0);else if(s.length===1){let i=s[0];if(r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0")r.enum=[i];else r.const=i}else{if(s.every((i)=>typeof i==="number"))r.type="number";if(s.every((i)=>typeof i==="string"))r.type="string";if(s.every((i)=>typeof i==="boolean"))r.type="boolean";if(s.every((i)=>i===null))r.type="null";r.enum=s}},Mv=(e,t,r,o)=>{Be(e,t,r,o,"NaN cannot be represented in JSON Schema")},Zv=(e,t,r,o)=>{let n=r,s=e._zod.pattern;if(!s)throw Error("Pattern not found in template literal");n.type="string",n.pattern=s.source},qv=(e,t,r,o)=>{let n=r;n.type="string",n.format="binary",n.contentEncoding="binary";let{minimum:s,maximum:i,mime:a}=st(e);if(s!==void 0)n.minLength=s;if(i!==void 0)n.maxLength=i;if(!a)return;if(a.length===0)n.not={};else if(a.length===1)n.contentMediaType=a[0];else n.anyOf=a.map((c)=>({contentMediaType:c}))},Lv=(e,t,r,o)=>{r.type="boolean"},Wc=(e,t,r,o)=>{Be(e,t,r,o,"Custom types cannot be represented in JSON Schema")},Dv=(e,t,r,o)=>{Be(e,t,r,o,"Function types cannot be represented in JSON Schema")},Yc=(e,t,r,o)=>{Be(e,t,r,o,"Transforms cannot be represented in JSON Schema")},Uv=(e,t,r,o)=>{Be(e,t,r,o,"Map cannot be represented in JSON Schema")},Fv=(e,t,r,o)=>{Be(e,t,r,o,"Set cannot be represented in JSON Schema")},Xc=(e,t,r,o)=>{let n=r,s=e._zod.def,{minimum:i,maximum:a}=st(e);if(typeof i==="number")n.minItems=i;if(typeof a==="number")n.maxItems=a;n.type="array",n.items=Ee(s.element,t,{...o,path:[...o.path,"items"]})};function fn(e){let t=e._zod.def;if(t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform"))return fn(t.out);if(t.type==="catch")return fn(t.innerType);return e._zod.optin}var Qc=(e,t,r,o)=>{let n=r,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&Be(e,t,n,o,"Symbol keys cannot be represented in JSON Schema"))return;n.type="object",n.properties={};for(let u in i)dt(n.properties,u,Ee(i[u],t,{...o,path:[...o.path,"properties",u]}));let c=[];for(let u of Object.keys(i)){let l=s.shape[u];if(t.io==="input"?fn(l)===void 0:l._zod.optout===void 0)c.push(u)}if(c.length>0)n.required=c;if(s.catchall?._zod.def.type==="never")n.additionalProperties=!1;else if(!s.catchall){if(t.io==="output")n.additionalProperties=!1}else if(s.catchall)n.additionalProperties=Ee(s.catchall,t,{...o,path:[...o.path,"additionalProperties"]})},eu=(e,t,r,o)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((a,c)=>Ee(a,t,{...o,path:[...o.path,s?"oneOf":"anyOf",c]}));if(s)r.oneOf=i;else r.anyOf=i},tu=(e,t,r,o)=>{let n=e._zod.def,s=Ee(n.left,t,{...o,path:[...o.path,"allOf",0]}),i=Ee(n.right,t,{...o,path:[...o.path,"allOf",1]}),a=(u)=>("allOf"in u)&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];r.allOf=c,t.intersections.push(c)},Vv=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",c=s.items.map((v,y)=>Ee(v,t,{...o,path:[...o.path,i,y]})),u=s.rest?Ee(s.rest,t,{...o,path:[...o.path,a,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null,l=s.items.length;while(l>0){let v=s.items[l-1];if(!(t.io==="input"?fn(v)!==void 0:v._zod.optout==="optional"))break;l--}let d=s.items.length,m=!s.rest;if(t.target==="draft-2020-12"){if(n.prefixItems=c,m)n.items=!1;else if(u)n.items=u;if(l>0)n.minItems=l;if(m)n.maxItems=d}else if(t.target==="openapi-3.0"){if(n.items={anyOf:c},u)n.items.anyOf.push(u);if(l>0)n.minItems=l;if(m)n.maxItems=d}else{if(n.items=c,m)n.additionalItems=!1;else if(u)n.additionalItems=u;if(l>0)n.minItems=l;if(m)n.maxItems=d}let{minimum:h,maximum:f}=st(e);if(typeof h==="number")n.minItems=h;if(typeof f==="number")n.maxItems=f};function Lc(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let f=e.get(t)?.def;if(!f)return t;let v=Lc(e,f,r);return v===f?t:v}for(let f of["anyOf","oneOf"]){let v=t[f];if(!Array.isArray(v))continue;let y=v.map((g)=>Lc(e,g,r));if(y.some((g,P)=>g!==v[P]))t={...t,[f]:y}}let o=Array.isArray(t.type)?t.type:[t.type],n=!o.includes("string")&&o.some((f)=>f==="number"||f==="integer"),s=t.enum??(t.const!==void 0?[t.const]:void 0);if(!n&&!s?.some((f)=>typeof f==="number"))return t;let{minimum:i,maximum:a,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:d,id:m,...h}=t;if(h.enum)h.enum=h.enum.map((f)=>typeof f==="number"?String(f):f);else if(typeof h.const==="number")h.const=String(h.const);if(!n)return h;if(h.type="string",!s)h.pattern=(o.includes("number")?tn:cc).source;return h}var Dc=new WeakMap;function OR(e){let t=new Map;for(let o of e.seen.values())if(o.def&&!t.has(o.schema))t.set(o.schema,o);let r=new Map;for(let o of Dc.get(e)??[]){let n=e.seen.get(o),s=(n?.def??n?.schema)?.propertyNames;if(!s||s===!0||r.has(s))continue;let i=Lc(t,s,new Set);if(i!==s)r.set(s,i)}if(!r.size)return;for(let o of e.seen.values())for(let n of[o.schema,o.def]){let s=n&&r.get(n.propertyNames);if(s)n.propertyNames=s}}var ru=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object";let i=s.keyType,a=st(i).patterns;if(s.mode==="loose"&&a&&a.size>0){let l=Ee(s.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let d of a)dt(n.patternProperties,Tv(d).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){n.propertyNames=Ee(s.keyType,t,{...o,path:[...o.path,"propertyNames"]});let l=Dc.get(t);if(!l)l=[],Dc.set(t,l),t.deferred.push(()=>OR(t));l.push(e)}n.additionalProperties=Ee(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let c=i._zod.values,u=t.io==="input"&&fn(s.valueType)!==void 0;if(c&&!s.partial&&!u){let l=[...c].filter((d)=>typeof d==="string"||typeof d==="number");if(l.length>0)n.required=l.map(String)}},ou=(e,t,r,o)=>{let n=e._zod.def,s=Ee(n.innerType,t,o),i=t.seen.get(e);if(t.target==="openapi-3.0")i.ref=n.innerType,r.nullable=!0;else r.anyOf=[s,{type:"null"}]},nu=(e,t,r,o)=>{let n=e._zod.def;Ee(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},su=Symbol();function Hv(e,t,r,o,n){let s=!1,i=JSON.stringify(e,(a,c)=>{if(typeof c!=="bigint")return c;return s=!0,null});if(!s)return JSON.parse(i);return Be(t,r,o,n,"BigInt defaults cannot be represented in JSON Schema"),su}var au=(e,t,r,o)=>{let n=e._zod.def;Ee(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i=Hv(n.defaultValue,e,t,r,o);if(i!==su)r.default=i},cu=(e,t,r,o)=>{let n=e._zod.def;Ee(n.innerType,t,o);let s=t.seen.get(e);if(s.ref=n.innerType,t.io!=="input")return;let i=Hv(n.defaultValue,e,t,r,o);if(i!==su)r._prefault=i},uu=(e,t,r,o)=>{let n=e._zod.def;Ee(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{Be(e,t,r,o,"Dynamic catch values are not supported in JSON Schema");return}r.default=i},lu=(e,t,r,o)=>{let n=e._zod.def,s=n.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?n.out:n.in:n.out;Ee(i,t,o);let a=t.seen.get(e);a.ref=i},du=(e,t,r,o)=>{let n=e._zod.def;Ee(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.readOnly=!0},Bv=(e,t,r,o)=>{let n=e._zod.def;Ee(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},si=(e,t,r,o)=>{let n=e._zod.def;Ee(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},pu=(e,t,r,o)=>{let n=e._zod.innerType;Ee(n,t,o);let s=t.seen.get(e);s.ref=n},wv={string:Uc,number:Fc,boolean:Vc,bigint:Ov,symbol:Cv,null:Hc,undefined:Iv,void:Nv,never:Bc,any:Av,unknown:Jc,date:jv,enum:Kc,literal:Gc,nan:Mv,template_literal:Zv,file:qv,success:Lv,custom:Wc,function:Dv,transform:Yc,map:Uv,set:Fv,array:Xc,object:Qc,union:eu,intersection:tu,tuple:Vv,record:ru,nullable:ou,nonoptional:nu,default:au,prefault:cu,catch:uu,pipe:lu,readonly:du,promise:Bv,optional:si,lazy:pu};function ii(e,t){if("_idmap"in e){let o=e,n=dn({...t,processors:wv}),s={};for(let c of o._idmap.entries()){let[u,l]=c;Ee(l,n)}let i={},a={registry:o,uri:t?.uri,defs:s};n.external=a;for(let c of o._idmap.entries()){let[u,l]=c;pn(n,l),dt(i,u,mn(n,l))}if(Object.keys(s).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[c]:s}}return{schemas:i}}let r=dn({...t,processors:wv});return Ee(e,r),pn(r,e),mn(r,e)}var Jv=new WeakSet([Object.prototype,Error.prototype]);function ai(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let o=r(this);return Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0})}})}var LR=(e,t)=>{bh.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);if(Jv.has(r))return;Jv.add(r),ai(r,"format",(o)=>(n)=>$h(o,n)),ai(r,"flatten",(o)=>(n)=>zh(o,n)),ai(r,"addIssue",(o)=>(n)=>{o.issues.push(n),o.message=JSON.stringify(o.issues,Yo,2)}),ai(r,"addIssues",(o)=>(n)=>{o.issues.push(...n),o.message=JSON.stringify(o.issues,Yo,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var ft=D("ZodError",LR,void 0,{Parent:Error});var Kv=js(ft),Gv=Ms(ft),ci=qs(ft),Wv=Ls(ft),Yv=jh(ft),Xv=Zh(ft),Qv=qh(ft),eS=Lh(ft),tS=Uh(ft),rS=Vh(ft),oS=Hh(ft),nS=Bh(ft);function UR(){if(!nt.localeError)mt($c())}function li(){if(!nt.memoizer)mt({memoizer:xy()})}var je=D("ZodType",(e,t)=>(UR(),Oe.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(pt(t,{checks:[...t.checks??[],...e.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Ct(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Lw(e,t))},superRefine(e,t){return this.check(Dw(e,t))},overwrite(e){return this.check(or(e))},optional(){return he(this)},exactOptional(){return Pw(this)},nullable(){return aS(this)},nullish(){return he(aS(this))},nonoptional(e){return Cw(this,e)},array(){return Q(this)},or(e){return ce([this,e])},and(e){return Yr(this,e)},transform(e){return cS(this,vS(e))},default(e){return Ew(this,e)},prefault(e){return Ow(this,e)},catch(e){return Nw(this,e)},pipe(e){return cS(this,e)},readonly(){return Mw(this)},describe(e){let t=this.clone();return $r.add(t,{description:e}),t},meta(...e){if(e.length===0)return $r.get(this);let t=this.clone();return $r.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get "~standard"(){return Ns(this,"~standard",{...fc(this),jsonSchema:{input:ln(this,"input"),output:ln(this,"output")}})},set "~standard"(e){Ut(this,"~standard",e)},parse:function e(t,r){return Kv(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await Gv(this,t,r,{callee:e})},safeParse(e,t){return ci(this,e,t)},async safeParseAsync(e,t){return Wv(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Ut(this,"spa",e)},validate(e,t){return nc(this,e,t)},validateAsync(e,t){return sc(this,e,t)},encode:function e(t,r){return Yv(this,t,r,{callee:e})},decode:function e(t,r){return Xv(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await Qv(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await eS(this,t,r,{callee:e})},safeEncode(e,t){return tS(this,e,t)},safeDecode(e,t){return rS(this,e,t)},async safeEncodeAsync(e,t){return oS(this,e,t)},async safeDecodeAsync(e,t){return nS(this,e,t)},toJSONSchema(e){return Sv(this,{})(e)},get description(){return $r.get(this)?.description},get _def(){return this._zod.def}}),uS=D("_ZodString",(e,t)=>{Hs.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Uc(e,r,o,n)},fh({format:(e)=>st(e).format??null,minLength:(e)=>st(e).minimum??null,maxLength:(e)=>st(e).maximum??null},{regex(...e){return this.check(xc(...e))},includes(...e){return this.check(Oc(...e))},startsWith(...e){return this.check(Cc(...e))},endsWith(...e){return this.check(Ic(...e))},min(...e){return this.check(Kr(...e))},max(...e){return this.check(oi(...e))},length(...e){return this.check(ni(...e))},nonempty(...e){return this.check(Kr(1,...e))},lowercase(e){return this.check(Ec(e))},uppercase(e){return this.check(Tc(e))},trim(){return this.check(Ac())},normalize(...e){return this.check(Nc(...e))},toLowerCase(){return this.check(jc())},toUpperCase(){return this.check(Mc())},slugify(){return this.check(Zc())}})),FR=D("ZodString",(e,t)=>{Hs.init(e,t),uS.init(e,t)},{email(e){return this.check(Rc(pS,e))},url(e){return this.check(wc(fS,e))},jwt(e){return this.check(Xy(fw,e))},emoji(e){return this.check(Zy(HR,e))},guid(e){return this.check(Iy(VR,e))},uuid(e){return this.check(Ny(ui,e))},uuidv4(e){return this.check(Ay(ui,e))},uuidv6(e){return this.check(jy(ui,e))},uuidv7(e){return this.check(My(ui,e))},nanoid(e){return this.check(qy(BR,e))},cuid(e){return this.check(Ly(JR,e))},cuid2(e){return this.check(Dy(KR,e))},ulid(e){return this.check(Uy(GR,e))},base64(e){return this.check(Gy(dw,e))},base64url(e){return this.check(Wy(pw,e))},xid(e){return this.check(Fy(WR,e))},ksuid(e){return this.check(Vy(YR,e))},ipv4(e){return this.check(Hy(XR,e))},ipv6(e){return this.check(By(QR,e))},cidrv4(e){return this.check(Jy(uw,e))},cidrv6(e){return this.check(Ky(lw,e))},e164(e){return this.check(Yy(mw,e))},datetime(e){return this.check(Ys(fu,e))},date(e){return this.check(Xs(hu,e))},time(e){return this.check(Pc(lS,e))},duration(e){return this.check(kc(dS,e))}});function k(e){return Cy(FR,e)}var Le=D("ZodStringFormat",(e,t)=>{Ae.init(e,t),uS.init(e,t)}),fu=D("ZodISODateTime",(e,t)=>{s_.init(e,t),Le.init(e,t)}),hu=D("ZodISODate",(e,t)=>{i_.init(e,t),Le.init(e,t)}),lS=D("ZodISOTime",(e,t)=>{a_.init(e,t),Le.init(e,t)}),dS=D("ZodISODuration",(e,t)=>{c_.init(e,t),Le.init(e,t)}),pS=D("ZodEmail",(e,t)=>{Kg.init(e,t),Le.init(e,t)});function mS(e){return Rc(pS,e)}var VR=D("ZodGUID",(e,t)=>{Bg.init(e,t),Le.init(e,t)});var ui=D("ZodUUID",(e,t)=>{Jg.init(e,t),Le.init(e,t)});var fS=D("ZodURL",(e,t)=>{Yg.init(e,t),Le.init(e,t)});function hS(e){return wc(fS,e)}var HR=D("ZodEmoji",(e,t)=>{Xg.init(e,t),Le.init(e,t)});var BR=D("ZodNanoID",(e,t)=>{Qg.init(e,t),Le.init(e,t)});var JR=D("ZodCUID",(e,t)=>{e_.init(e,t),Le.init(e,t)});var KR=D("ZodCUID2",(e,t)=>{t_.init(e,t),Le.init(e,t)});var GR=D("ZodULID",(e,t)=>{r_.init(e,t),Le.init(e,t)});var WR=D("ZodXID",(e,t)=>{o_.init(e,t),Le.init(e,t)});var YR=D("ZodKSUID",(e,t)=>{n_.init(e,t),Le.init(e,t)});var XR=D("ZodIPv4",(e,t)=>{u_.init(e,t),Le.init(e,t)});var QR=D("ZodIPv6",(e,t)=>{d_.init(e,t),Le.init(e,t)});var uw=D("ZodCIDRv4",(e,t)=>{p_.init(e,t),Le.init(e,t)});var lw=D("ZodCIDRv6",(e,t)=>{m_.init(e,t),Le.init(e,t)});var dw=D("ZodBase64",(e,t)=>{h_.init(e,t),Le.init(e,t)});var pw=D("ZodBase64URL",(e,t)=>{g_.init(e,t),Le.init(e,t)});var mw=D("ZodE164",(e,t)=>{y_.init(e,t),Le.init(e,t)});var fw=D("ZodJWT",(e,t)=>{v_.init(e,t),Le.init(e,t)});var gS=D("ZodNumber",(e,t)=>{_c.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fc(e,r,o,n),e.isFinite=!0},fh({minValue:(e)=>{let{minimum:t,exclusiveMinimum:r}=st(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:(e)=>{let{maximum:t,exclusiveMaximum:r}=st(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:(e)=>{let{isInt:t,multipleOf:r}=st(e);return!!t||!!r?.some(Number.isSafeInteger)},format:(e)=>st(e).format??null},{gt(e,t){return this.check(ti(e,t))},gte(e,t){return this.check(cn(e,t))},min(e,t){return this.check(cn(e,t))},lt(e,t){return this.check(ei(e,t))},lte(e,t){return this.check(an(e,t))},max(e,t){return this.check(an(e,t))},int(e){return this.check(sS(e))},safe(e){return this.check(sS(e))},positive(e){return this.check(ti(0,e))},nonnegative(e){return this.check(cn(0,e))},negative(e){return this.check(ei(0,e))},nonpositive(e){return this.check(an(0,e))},multipleOf(e,t){return this.check(ri(e,t))},step(e,t){return this.check(ri(e,t))},finite(){return this}}));function te(e){return Qy(gS,e)}var hw=D("ZodNumberFormat",(e,t)=>{b_.init(e,t),gS.init(e,t)});function sS(e){return ev(hw,e)}var gw=D("ZodBoolean",(e,t)=>{ey.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vc(e,r,o,n)});function fe(e){return tv(gw,e)}var _w=D("ZodNull",(e,t)=>{ty.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hc(e,r,o,n)});function di(e){return rv(_w,e)}var yw=D("ZodUnknown",(e,t)=>{ry.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jc(e,r,o,n)});function me(){return nv(yw)}var vw=D("ZodNever",(e,t)=>{oy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bc(e,r,o,n)});function Sw(e){return uv(vw,e)}var bw=D("ZodArray",(e,t)=>{li(),ny.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xc(e,r,o,n),e.element=t.element},{min(e,t){return this.check(Kr(e,t))},nonempty(e){return this.check(Kr(1,e))},max(e,t){return this.check(oi(e,t))},length(e,t){return this.check(ni(e,t))},unwrap(){return this.element}});function Q(e,t){return pv(bw,e,t)}var _S=D("ZodObject",(e,t)=>{li(),ay.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qc(e,r,o,n),F0(e,"shape",(r)=>r._zod.def.shape,!1)},{keyof(){return ze(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(pt(this._zod.def,{catchall:e}))},passthrough(){return this.clone(pt(this._zod.def,{catchall:me()}))},loose(){return this.clone(pt(this._zod.def,{catchall:me()}))},strict(){return this.clone(pt(this._zod.def,{catchall:Sw()}))},strip(){return this.clone(pt(this._zod.def,{catchall:void 0}))},extend(e){return N0(this,e)},safeExtend(e){return A0(this,e)},merge(e){return j0(this,e)},pick(e){return C0(this,e)},omit(e){return I0(this,e)},partial(...e){return lh(SS,this,e[0])},exactPartial(...e){return lh(bS,this,e[0],"exactPartial")},required(...e){return M0(zS,this,e[0])}});function Z(e,t){let r={type:"object",shape:e??{},...ne(t)};return new _S(r)}function be(e,t){return new _S({type:"object",shape:e,catchall:me(),...ne(t)})}var yS=D("ZodUnion",(e,t)=>{yc.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>eu(e,r,o,n),e.options=t.options});function ce(e,t){return new yS({type:"union",options:e,...ne(t)})}var zw=D("ZodDiscriminatedUnion",(e,t)=>{yS.init(e,t),cy.init(e,t)});function gu(e,t,r){return new zw({type:"union",options:t,discriminator:e,...ne(r)})}var $w=D("ZodIntersection",(e,t)=>{uy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>tu(e,r,o,n)});function Yr(e,t){return new $w({type:"intersection",left:e,right:t})}var iS=D("ZodRecord",(e,t)=>{li(),ly.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ru(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function ie(e,t,r){if(!t||!t._zod)return new iS({type:"record",keyType:k(),valueType:e,...ne(t)});return new iS({type:"record",keyType:e,valueType:t,...ne(r)})}var mu=D("ZodEnum",(e,t)=>{dy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Kc(e,o,n,s),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let s={};for(let i of o)if(r.has(i))s[i]=t.entries[i];else throw Error(`Key ${i} not found in enum`);return new mu({...t,checks:[],...ne(n),entries:s})},e.exclude=(o,n)=>{let s={...t.entries};for(let i of o)if(r.has(i))delete s[i];else throw Error(`Key ${i} not found in enum`);return new mu({...t,checks:[],...ne(n),entries:s})}});function ze(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new mu({type:"enum",entries:r,...ne(t)})}var Rw=D("ZodLiteral",(e,t)=>{py.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gc(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function J(e,t){return new Rw({type:"literal",values:Array.isArray(e)?e:[e],...ne(t)})}var ww=D("ZodTransform",(e,t)=>{li(),my.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yc(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new en(e.constructor.name);r.addIssue=(s)=>{if(typeof s==="string")r.issues.push(zr(s,r.value,t));else{let i=s;if(i.fatal)i.continue=!1;if(i.code??(i.code="custom"),!("input"in i))i.input=r.value;i.inst??(i.inst=e),r.issues.push(zr(i))}};let n=t.transform(r.value,r);if(n instanceof Promise)return n.then((s)=>(r.value=s,r));return r.value=n,r}});function vS(e){return new ww({type:"transform",transform:e})}var SS=D("ZodOptional",(e,t)=>{vc.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>si(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function he(e){return new SS({type:"optional",innerType:e})}var bS=D("ZodExactOptional",(e,t)=>{fy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>si(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Pw(e){return new bS({type:"optional",innerType:e})}var kw=D("ZodNullable",(e,t)=>{hy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ou(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function aS(e){return new kw({type:"nullable",innerType:e})}var xw=D("ZodDefault",(e,t)=>{gy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>au(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ew(e,t){return new xw({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():Ya(t)}})}var Tw=D("ZodPrefault",(e,t)=>{_y.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>cu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ow(e,t){return new Tw({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():Ya(t)}})}var zS=D("ZodNonOptional",(e,t)=>{yy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>nu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Cw(e,t){return new zS({type:"nonoptional",innerType:e,...ne(t)})}var Iw=D("ZodCatch",(e,t)=>{vy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>uu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Nw(e,t){return new Iw({type:"catch",innerType:e,catchValue:typeof t==="function"?t:hh(t)})}var $S=D("ZodPipe",(e,t)=>{Sc.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lu(e,r,o,n),e.in=t.in,e.out=t.out});function cS(e,t){return new $S({type:"pipe",in:e,out:t})}var Aw=D("ZodPreprocess",(e,t)=>{$S.init(e,t),Sy.init(e,t)}),jw=D("ZodReadonly",(e,t)=>{by.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>du(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Mw(e){return new jw({type:"readonly",innerType:e})}var Zw=D("ZodLazy",(e,t)=>{zy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pu(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function _u(e){return new Zw({type:"lazy",getter:e})}var qw=D("ZodCustom",(e,t)=>{$y.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wc(e,r,o,n)});function Lw(e,t={}){return mv(qw,e,t)}function Dw(e,t){return fv(e,t)}function pi(e,t){return new Aw({type:"pipe",in:vS(e),out:t})}function yu(e){return Ys(fu,e)}function Uw(e){return Xs(hu,e)}var Ru=Symbol.for("mcp.sdk.errorBrands");function yF(e,t){let r=new Set,o=t;while(typeof o==="function"){let n=o.mcpBrand;if(Object.prototype.hasOwnProperty.call(o,"mcpBrand")&&typeof n==="string")r.add(n);o=Object.getPrototypeOf(o)}if(r.size===0)return;Object.defineProperty(e,Ru,{value:r,enumerable:!1,configurable:!0})}function lv(e,t){try{if(typeof t==="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand==="string"&&Object.prototype.hasOwnProperty.call(t,Ru)){let r=t[Ru];if(r&&typeof r.has==="function"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var oo=function(e){return e.InvalidRequest="invalid_request",e.InvalidClient="invalid_client",e.InvalidGrant="invalid_grant",e.UnauthorizedClient="unauthorized_client",e.UnsupportedGrantType="unsupported_grant_type",e.InvalidScope="invalid_scope",e.AccessDenied="access_denied",e.ServerError="server_error",e.TemporarilyUnavailable="temporarily_unavailable",e.UnsupportedResponseType="unsupported_response_type",e.UnsupportedTokenType="unsupported_token_type",e.InvalidToken="invalid_token",e.MethodNotAllowed="method_not_allowed",e.TooManyRequests="too_many_requests",e.InvalidClientMetadata="invalid_client_metadata",e.InvalidRedirectUri="invalid_redirect_uri",e.InsufficientScope="insufficient_scope",e.InvalidTarget="invalid_target",e.InvalidDpopProof="invalid_dpop_proof",e.UseDpopNonce="use_dpop_nonce",e}({}),Si=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return lv(this,t)}static isInstance(t){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return lv(this,t)}constructor(t,r,o){super(r);this.code=t,this.errorUri=o,this.name="OAuthError",yF(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};if(this.errorUri)t.error_uri=this.errorUri;return t}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},gt=function(e){return e.NotConnected="NOT_CONNECTED",e.AlreadyConnected="ALREADY_CONNECTED",e.NotInitialized="NOT_INITIALIZED",e.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",e.RequestTimeout="REQUEST_TIMEOUT",e.ConnectionClosed="CONNECTION_CLOSED",e.SendFailed="SEND_FAILED",e.InvalidResult="INVALID_RESULT",e.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",e.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",e.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",e.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",e.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",e.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",e.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",e.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",e.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",e.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",e.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",e}({}),ct=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return lv(this,e)}static isInstance(e){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return lv(this,e)}constructor(e,t,r,o){super(t,o);this.code=e,this.data=r,this.name="SdkError",yF(this,new.target)}},LA=class extends ct{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r,o){super(e,t,r,o);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};var wS={};function see(e){return Object.hasOwn(wS,e)?wS[e]:void 0}function PS(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Fw(e,t,r){return e==="elicitation"&&t==="form"&&r.form===void 0&&r.url===void 0}function VS(e){switch(e.method){case"elicitation/create":if(e.params?.mode==="url")return{elicitation:{url:{}}};return{elicitation:{form:{}}};case"sampling/createMessage":{let t=e.params;if(t!==void 0&&(t.tools!==void 0||t.toolChoice!==void 0))return{sampling:{tools:{}}};return{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function vF(e,t){let r={};for(let[o,n]of Object.entries(e)){if(n===void 0)continue;let s=t===void 0?void 0:t[o];if(s===void 0){r[o]=n;continue}if(PS(n)&&PS(s)){let i={};for(let[a,c]of Object.entries(n))if(c!==void 0&&s[a]===void 0&&!Fw(o,a,s))i[a]=c;if(Object.keys(i).length>0)r[o]=i}}return Object.keys(r).length>0?r:void 0}var HS="2026-07-28",cT=[HS];function bm(e){return e>=HS}function BS(e){return e.filter((t)=>!bm(t))}function bi(e){return e.filter((t)=>bm(t))}function WS(e){let t=e.structuredContent;if(t===void 0)return e;if(!(typeof t!=="object"||t===null||Array.isArray(t)))return e;if(e.content?.some((r)=>r.type==="text")??!1)return e;return{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}var eb=["task","inputRequests","requestState"];function xu(e){if(e===null||typeof e!=="object"||Array.isArray(e)||e.content!==void 0||eb.some((t)=>(t in e)))return e;return{...e,content:[]}}function Vw(){let e=_u(()=>ce([k(),te(),fe(),di(),ie(k(),e),Q(e)])),t=ie(k(),e),r=ce([k(),te().int()]),o=k(),n=Z({ttl:te().optional()}),s=Z({taskId:k()}),i=be({progressToken:r.optional(),"io.modelcontextprotocol/related-task":s.optional()}),a=Z({_meta:i.optional()}),c=a.extend({task:n.optional()}),u=Z({method:k(),params:a.loose().optional()}),l=Z({_meta:i.optional()}),d=Z({method:k(),params:l.loose().optional()}),m=be({_meta:i.optional()}),h=ce([k(),te().int()]),f=m.strict(),v=l.extend({requestId:h.optional(),reason:k().optional()}),y=d.extend({method:J("notifications/cancelled"),params:v}),g=Z({src:k(),mimeType:k().optional(),sizes:Q(k()).optional(),theme:ze(["light","dark"]).optional()}),P=Z({icons:Q(g).optional()}),w=Z({name:k(),title:k().optional()}),x=w.extend({...w.shape,...P.shape,version:k(),websiteUrl:k().optional(),description:k().optional()}),O=Yr(Z({applyDefaults:fe().optional()}),t),R=pi((Ye)=>{if(Ye&&typeof Ye==="object"&&!Array.isArray(Ye)&&Object.keys(Ye).length===0)return{form:{}};return Ye},Yr(Z({form:O.optional(),url:t.optional()}),t.optional())),S=be({list:t.optional(),cancel:t.optional(),requests:be({sampling:be({createMessage:t.optional()}).optional(),elicitation:be({create:t.optional()}).optional()}).optional()}),E=be({list:t.optional(),cancel:t.optional(),requests:be({tools:be({call:t.optional()}).optional()}).optional()}),A=Z({experimental:ie(k(),t).optional(),sampling:Z({context:t.optional(),tools:t.optional()}).optional(),elicitation:R.optional(),roots:Z({listChanged:fe().optional()}).optional(),tasks:S.optional(),extensions:ie(k(),t).optional()}),H=a.extend({protocolVersion:k(),capabilities:A,clientInfo:x}),j=u.extend({method:J("initialize"),params:H}),V=Z({experimental:ie(k(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:Z({listChanged:fe().optional()}).optional(),resources:Z({subscribe:fe().optional(),listChanged:fe().optional()}).optional(),tools:Z({listChanged:fe().optional()}).optional(),tasks:E.optional(),extensions:ie(k(),t).optional()}),W=m.extend({protocolVersion:k(),capabilities:V,serverInfo:x,instructions:k().optional()}),Y=d.extend({method:J("notifications/initialized"),params:l.optional()}),ae=u.extend({method:J("ping"),params:a.optional()}),we=Z({progress:te(),total:he(te()),message:he(k())}),$e=Z({...l.shape,...we.shape,progressToken:r}),Ce=d.extend({method:J("notifications/progress"),params:$e}),de=a.extend({cursor:o.optional()}),N=u.extend({params:de.optional()}),M=m.extend({nextCursor:o.optional()}),b=Z({uri:k(),mimeType:he(k()),_meta:ie(k(),me()).optional()}),p=b.extend({text:k()}),_=k().refine((Ye)=>{try{return atob(Ye),!0}catch{return!1}},{message:"Invalid Base64 string"}),z=b.extend({blob:_}),I=ze(["user","assistant"]),U=Z({audience:Q(I).optional(),priority:te().min(0).max(1).optional(),lastModified:yu({offset:!0}).optional()}),G=Z({...w.shape,...P.shape,uri:k(),description:he(k()),mimeType:he(k()),size:he(te()),annotations:U.optional(),_meta:he(be({}))}),K=Z({...w.shape,...P.shape,uriTemplate:k(),description:he(k()),mimeType:he(k()),annotations:U.optional(),_meta:he(be({}))}),ue=N.extend({method:J("resources/list")}),Pe=M.extend({resources:Q(G)}),T=N.extend({method:J("resources/templates/list")}),q=M.extend({resourceTemplates:Q(K)}),F=a.extend({uri:k()}),ee=F,re=u.extend({method:J("resources/read"),params:ee}),se=m.extend({contents:Q(ce([p,z]))}),_e=d.extend({method:J("notifications/resources/list_changed"),params:l.optional()}),Ze=F,ke=u.extend({method:J("resources/subscribe"),params:Ze}),De=F,Ie=u.extend({method:J("resources/unsubscribe"),params:De}),ht=l.extend({uri:k()}),Ve=d.extend({method:J("notifications/resources/updated"),params:ht}),jt=Z({name:k(),description:he(k()),required:he(fe())}),zt=Z({...w.shape,...P.shape,description:he(k()),arguments:he(Q(jt)),_meta:he(be({}))}),Mt=N.extend({method:J("prompts/list")}),Vt=M.extend({prompts:Q(zt)}),Ht=a.extend({name:k(),arguments:ie(k(),k()).optional()}),ir=u.extend({method:J("prompts/get"),params:Ht}),ar=Z({type:J("text"),text:k(),annotations:U.optional(),_meta:ie(k(),me()).optional()}),cr=Z({type:J("image"),data:_,mimeType:k(),annotations:U.optional(),_meta:ie(k(),me()).optional()}),lr=Z({type:J("audio"),data:_,mimeType:k(),annotations:U.optional(),_meta:ie(k(),me()).optional()}),io=Z({type:J("tool_use"),name:k(),id:k(),input:ie(k(),me()),_meta:ie(k(),me()).optional()}),Bt=Z({type:J("resource"),resource:ce([p,z]),annotations:U.optional(),_meta:ie(k(),me()).optional()}),ao=G.extend({type:J("resource_link")}),_t=ce([ar,cr,lr,ao,Bt]),Pr=Z({role:I,content:_t}),kr=m.extend({description:k().optional(),messages:Q(Pr)}),dr=d.extend({method:J("notifications/prompts/list_changed"),params:l.optional()}),co=Z({title:k().optional(),readOnlyHint:fe().optional(),destructiveHint:fe().optional(),idempotentHint:fe().optional(),openWorldHint:fe().optional()}),xr=Z({taskSupport:ze(["required","optional","forbidden"]).optional()}),pr=Z({...w.shape,...P.shape,description:k().optional(),inputSchema:Z({type:J("object"),properties:ie(k(),e).optional(),required:Q(k()).optional()}).catchall(me()),outputSchema:Z({type:J("object"),properties:ie(k(),e).optional(),required:Q(k()).optional()}).catchall(me()).optional(),annotations:co.optional(),execution:xr.optional(),_meta:ie(k(),me()).optional()}),Er=N.extend({method:J("tools/list")}),Or=M.extend({tools:Q(pr)}),Cr=m.extend({content:Q(_t),structuredContent:ie(k(),me()).optional(),isError:fe().optional()}),We=c.extend({name:k(),arguments:ie(k(),me()).optional()}),uo=u.extend({method:J("tools/call"),params:We}),kn=d.extend({method:J("notifications/tools/list_changed"),params:l.optional()}),Ir=ze(["debug","info","notice","warning","error","critical","alert","emergency"]),lo=a.extend({level:Ir}),po=u.extend({method:J("logging/setLevel"),params:lo}),mo=l.extend({level:Ir,logger:k().optional(),data:me()}),fo=d.extend({method:J("notifications/message"),params:mo}),ho=Z({name:k().optional()}),go=Z({hints:Q(ho).optional(),costPriority:te().min(0).max(1).optional(),speedPriority:te().min(0).max(1).optional(),intelligencePriority:te().min(0).max(1).optional()}),_o=Z({mode:ze(["auto","required","none"]).optional()}),xn=Z({type:J("tool_result"),toolUseId:k().describe("The unique identifier for the corresponding tool call."),content:Q(_t),structuredContent:Z({}).loose().optional(),isError:fe().optional(),_meta:ie(k(),me()).optional()}),yo=gu("type",[ar,cr,lr]),Jt=gu("type",[ar,cr,lr,io,xn]),vo=Z({role:I,content:ce([Jt,Q(Jt)]),_meta:ie(k(),me()).optional()}),So=c.extend({messages:Q(vo),modelPreferences:go.optional(),systemPrompt:k().optional(),includeContext:ze(["none","thisServer","allServers"]).optional(),temperature:te().optional(),maxTokens:te().int(),stopSequences:Q(k()).optional(),metadata:t.optional(),tools:Q(pr).optional(),toolChoice:_o.optional()}),bo=u.extend({method:J("sampling/createMessage"),params:So}),zo=m.extend({model:k(),stopReason:he(ze(["endTurn","stopSequence","maxTokens"]).or(k())),role:I,content:yo}),$o=m.extend({model:k(),stopReason:he(ze(["endTurn","stopSequence","maxTokens","toolUse"]).or(k())),role:I,content:ce([Jt,Q(Jt)])}),Ro=Z({type:J("boolean"),title:k().optional(),description:k().optional(),default:fe().optional()}),wo=Z({type:J("string"),title:k().optional(),description:k().optional(),minLength:te().optional(),maxLength:te().optional(),format:ze(["email","uri","date","date-time"]).optional(),default:k().optional()}),Po=Z({type:ze(["number","integer"]),title:k().optional(),description:k().optional(),minimum:te().optional(),maximum:te().optional(),default:te().optional()}),ko=Z({type:J("string"),title:k().optional(),description:k().optional(),enum:Q(k()),default:k().optional()}),xo=Z({type:J("string"),title:k().optional(),description:k().optional(),oneOf:Q(Z({const:k(),title:k()})),default:k().optional()}),Eo=Z({type:J("string"),title:k().optional(),description:k().optional(),enum:Q(k()),enumNames:Q(k()).optional(),default:k().optional()}),To=ce([ko,xo]),mr=Z({type:J("array"),title:k().optional(),description:k().optional(),minItems:te().optional(),maxItems:te().optional(),items:Z({type:J("string"),enum:Q(k())}),default:Q(k()).optional()}),fr=Z({type:J("array"),title:k().optional(),description:k().optional(),minItems:te().optional(),maxItems:te().optional(),items:Z({anyOf:Q(Z({const:k(),title:k()}))}),default:Q(k()).optional()}),En=ce([mr,fr]),Tn=ce([Eo,To,En]),it=ce([Tn,Ro,wo,Po]),at=c.extend({mode:J("form").optional(),message:k(),requestedSchema:Z({type:J("object"),properties:ie(k(),it),required:Q(k()).optional()}).catchall(me())}),Oo=c.extend({mode:J("url"),message:k(),elicitationId:k(),url:k().url()}),$t=ce([at,Oo]),On=u.extend({method:J("elicitation/create"),params:$t}),Cn=l.extend({elicitationId:k()}),In=d.extend({method:J("notifications/elicitation/complete"),params:Cn}),Nn=m.extend({action:ze(["accept","decline","cancel"]),content:pi((Ye)=>Ye===null?void 0:Ye,ie(k(),ce([k(),te(),fe(),Q(k())])).optional())}),An=Z({type:J("ref/resource"),uri:k()}),jn=Z({type:J("ref/prompt"),name:k()}),Mn=a.extend({ref:ce([jn,An]),argument:Z({name:k(),value:k()}),context:Z({arguments:ie(k(),k()).optional()}).optional()}),Co=u.extend({method:J("completion/complete"),params:Mn}),qn=m.extend({completion:be({values:Q(k()).max(100),total:he(te().int()),hasMore:he(fe())})}),Ln=Z({uri:k().startsWith("file://"),name:k().optional(),_meta:ie(k(),me()).optional()}),Nr=u.extend({method:J("roots/list"),params:a.optional()}),Io=m.extend({roots:Q(Ln)}),Dn=d.extend({method:J("notifications/roots/list_changed"),params:l.optional()}),Un=be({ttl:te().optional(),pollInterval:te().optional()}),No=ze(["working","input_required","completed","failed","cancelled"]),Kt=Z({taskId:k(),status:No,ttl:ce([te(),di()]),createdAt:k(),lastUpdatedAt:k(),pollInterval:he(te()),statusMessage:he(k())}),tt=m.extend({task:Kt}),Fn=l.merge(Kt),hr=d.extend({method:J("notifications/tasks/status"),params:Fn}),jr=u.extend({method:J("tasks/get"),params:a.extend({taskId:k()})}),Mr=m.merge(Kt),Zr=u.extend({method:J("tasks/result"),params:a.extend({taskId:k()})}),Ci=m.loose(),Xe=N.extend({method:J("tasks/list")}),Fe=M.extend({tasks:Q(Kt)}),gr=u.extend({method:J("tasks/cancel"),params:a.extend({taskId:k()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,TaskMetadataSchema:n,RelatedTaskMetadataSchema:s,RequestMetaSchema:i,BaseRequestParamsSchema:a,TaskAugmentedRequestParamsSchema:c,RequestSchema:u,NotificationsParamsSchema:l,NotificationSchema:d,ResultSchema:m,RequestIdSchema:h,EmptyResultSchema:f,CancelledNotificationParamsSchema:v,CancelledNotificationSchema:y,IconSchema:g,IconsSchema:P,BaseMetadataSchema:w,ImplementationSchema:x,ClientTasksCapabilitySchema:S,ServerTasksCapabilitySchema:E,ClientCapabilitiesSchema:A,InitializeRequestParamsSchema:H,InitializeRequestSchema:j,ServerCapabilitiesSchema:V,InitializeResultSchema:W,InitializedNotificationSchema:Y,PingRequestSchema:ae,ProgressSchema:we,ProgressNotificationParamsSchema:$e,ProgressNotificationSchema:Ce,PaginatedRequestParamsSchema:de,PaginatedRequestSchema:N,PaginatedResultSchema:M,ResourceContentsSchema:b,TextResourceContentsSchema:p,BlobResourceContentsSchema:z,RoleSchema:I,AnnotationsSchema:U,ResourceSchema:G,ResourceTemplateSchema:K,ListResourcesRequestSchema:ue,ListResourcesResultSchema:Pe,ListResourceTemplatesRequestSchema:T,ListResourceTemplatesResultSchema:q,ResourceRequestParamsSchema:F,ReadResourceRequestParamsSchema:ee,ReadResourceRequestSchema:re,ReadResourceResultSchema:se,ResourceListChangedNotificationSchema:_e,SubscribeRequestParamsSchema:Ze,SubscribeRequestSchema:ke,UnsubscribeRequestParamsSchema:De,UnsubscribeRequestSchema:Ie,ResourceUpdatedNotificationParamsSchema:ht,ResourceUpdatedNotificationSchema:Ve,PromptArgumentSchema:jt,PromptSchema:zt,ListPromptsRequestSchema:Mt,ListPromptsResultSchema:Vt,GetPromptRequestParamsSchema:Ht,GetPromptRequestSchema:ir,TextContentSchema:ar,ImageContentSchema:cr,AudioContentSchema:lr,ToolUseContentSchema:io,EmbeddedResourceSchema:Bt,ResourceLinkSchema:ao,ContentBlockSchema:_t,PromptMessageSchema:Pr,GetPromptResultSchema:kr,PromptListChangedNotificationSchema:dr,ToolAnnotationsSchema:co,ToolExecutionSchema:xr,ToolSchema:pr,ListToolsRequestSchema:Er,ListToolsResultSchema:Or,CallToolResultSchema:Cr,CallToolRequestParamsSchema:We,CallToolRequestSchema:uo,ToolListChangedNotificationSchema:kn,LoggingLevelSchema:Ir,SetLevelRequestParamsSchema:lo,SetLevelRequestSchema:po,LoggingMessageNotificationParamsSchema:mo,LoggingMessageNotificationSchema:fo,ModelHintSchema:ho,ModelPreferencesSchema:go,ToolChoiceSchema:_o,ToolResultContentSchema:xn,SamplingContentSchema:yo,SamplingMessageContentBlockSchema:Jt,SamplingMessageSchema:vo,CreateMessageRequestParamsSchema:So,CreateMessageRequestSchema:bo,CreateMessageResultSchema:zo,CreateMessageResultWithToolsSchema:$o,BooleanSchemaSchema:Ro,StringSchemaSchema:wo,NumberSchemaSchema:Po,UntitledSingleSelectEnumSchemaSchema:ko,TitledSingleSelectEnumSchemaSchema:xo,LegacyTitledEnumSchemaSchema:Eo,SingleSelectEnumSchemaSchema:To,UntitledMultiSelectEnumSchemaSchema:mr,TitledMultiSelectEnumSchemaSchema:fr,MultiSelectEnumSchemaSchema:En,EnumSchemaSchema:Tn,PrimitiveSchemaDefinitionSchema:it,ElicitRequestFormParamsSchema:at,ElicitRequestURLParamsSchema:Oo,ElicitRequestParamsSchema:$t,ElicitRequestSchema:On,ElicitationCompleteNotificationParamsSchema:Cn,ElicitationCompleteNotificationSchema:In,ElicitResultSchema:Nn,ResourceTemplateReferenceSchema:An,PromptReferenceSchema:jn,CompleteRequestParamsSchema:Mn,CompleteRequestSchema:Co,CompleteResultSchema:qn,RootSchema:Ln,ListRootsRequestSchema:Nr,ListRootsResultSchema:Io,RootsListChangedNotificationSchema:Dn,TaskCreationParamsSchema:Un,TaskStatusSchema:No,TaskSchema:Kt,CreateTaskResultSchema:tt,TaskStatusNotificationParamsSchema:Fn,TaskStatusNotificationSchema:hr,GetTaskRequestSchema:jr,GetTaskResultSchema:Mr,GetTaskPayloadRequestSchema:Zr,GetTaskPayloadResultSchema:Ci,ListTasksRequestSchema:Xe,ListTasksResultSchema:Fe,CancelTaskRequestSchema:gr,CancelTaskResultSchema:m.merge(Kt),ClientRequestSchema:ce([ae,j,Co,po,ir,Mt,ue,T,re,ke,Ie,uo,Er,jr,Zr,Xe,gr]),ClientNotificationSchema:ce([y,Ce,Y,Dn,hr]),ClientResultSchema:ce([f,zo,$o,Nn,Io,Mr,Fe,tt]),ServerRequestSchema:ce([ae,bo,On,Nr,jr,Zr,Xe,gr]),ServerNotificationSchema:ce([y,Ce,fo,Ve,_e,kn,dr,hr,In]),ServerResultSchema:ce([f,W,qn,kr,Vt,Pe,q,se,Cr,Or,Mr,Fe,tt]),CallToolResultWireSchema:me().superRefine((Ye,fz)=>{if(typeof Ye!=="object"||Ye===null||Array.isArray(Ye)||Ye.content!==void 0)return;for(let Gu of eb)if(Gu in Ye){fz.addIssue({code:"custom",message:`content is required when the body carries '${Gu}' \u2014 another result family cannot default into an empty tools/call success`});return}}).transform(xu).pipe(Cr)}}var Hw;function tb(){return Hw??=Vw()}function rb(e){return e.type!=="object"}var Bw=new Set(["const","enum","default","examples"]),Jw=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function kS(e){return e!==void 0&&!(typeof e==="string"&&e.startsWith("#"))}function Kw(e){let t=typeof e.$schema==="string"?e.$schema:void 0;if(kS(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let r=Xu(e.$schema)&&e.$recursiveAnchor!==!0,o=(n,s)=>{if(Array.isArray(n))return n.map((c)=>o(c,!1));if(n===null||typeof n!=="object")return n;if(!s&&kS(n.$id))return n;let i={},a=!1;for(let[c,u]of Object.entries(n))if(s)i[c]=o(u,!1);else if((c==="$ref"||c==="$dynamicRef")&&typeof u==="string")i[c]=u==="#"?"#/properties/result":u.startsWith("#/")?`#/properties/result${u.slice(1)}`:u;else if(c==="$recursiveRef"&&u==="#"&&r)a=!0;else if(Bw.has(c))i[c]=u;else if(Jw.has(c))i[c]=o(u,!0);else i[c]=o(u,!1);if(a)if("$ref"in i)i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:"#/properties/result"}];else i.$ref="#/properties/result";return i};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:o(e,!1)},required:["result"]}}var ob={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},nb={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},Gw={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},mi;function Eu(){if(mi)return mi;let e=tb();return mi={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},mi}function sb(e){return Object.prototype.hasOwnProperty.call(ob,e)}function ib(e){return Object.prototype.hasOwnProperty.call(nb,e)}function Ww(e){return Object.prototype.hasOwnProperty.call(Gw,e)}function Yw(e){return Ww(e)?Eu().resultSchemas[e]:void 0}function Xw(e){return sb(e)?Eu().requestSchemas[e]:void 0}function Qw(e){return ib(e)?Eu().notificationSchemas[e]:void 0}var DA=Object.keys(ob),UA=Object.keys(nb);function wu(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function fi(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}var xS={ok:!1,reason:"not-in-era"};function ES(e){return wu(e)&&wu(e.outputSchema)&&rb(e.outputSchema)}function TS(e){return e}var Tu={era:"2025-11-25",hasRequestMethod:sb,hasNotificationMethod:ib,validateRequest:(e,t)=>fi(Xw(e),t),validateResult:(e,t)=>fi(Yw(e),t),validateNotification:(e,t)=>fi(Qw(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>xS,validateInputResponse:()=>xS,samplingResultVariant:(e,t)=>{let r=tb();return fi(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:(e)=>{return},validateEnvelopeMeta:(e)=>[],projectCallToolResult(e,t){let r=WS(e),o=r.structuredContent;if(o===void 0)return r;let n=typeof o!=="object"||o===null||Array.isArray(o),s=t!==void 0&&rb(t);if(!n&&!s)return r;return{...r,structuredContent:{result:o}}},decodeResult(e,t){if(wu(t)&&"resultType"in t){let r={...t};return delete r.resultType,{kind:"complete",result:TS(r)}}return{kind:"complete",result:TS(t)}},encodeResult(e,t){if(e!=="tools/list")return t;let r=t.tools;if(!Array.isArray(r)||!r.some((o)=>ES(o)))return t;return{...t,tools:r.map((o)=>ES(o)?{...o,outputSchema:Kw(o.outputSchema)}:o)}},encodeErrorCode:(e)=>e===-32002?-32602:e,checkInboundEnvelope:(e)=>{return}};function eP(){let e=_u(()=>ce([k(),te(),fe(),di(),ie(k(),e),Q(e)])),t=ie(k(),e),r=ce([k(),te().int()]),o=k(),n=ce([k(),te().int()]),s=ze(["user","assistant"]),i=ze(["debug","info","notice","warning","error","critical","alert","emergency"]),a=k().refine((Fe)=>{try{return atob(Fe),!0}catch{return!1}},{message:"Invalid Base64 string"}),c=Z({ttl:te().optional()}),u=Z({taskId:k()}),l=be({progressToken:r.optional(),"io.modelcontextprotocol/related-task":u.optional()}),d=Z({_meta:l.optional()}),m=d.extend({task:c.optional()}),h=Z({_meta:l.optional()}),f=Z({method:k(),params:h.loose().optional()}),v=Z({src:k(),mimeType:k().optional(),sizes:Q(k()).optional(),theme:ze(["light","dark"]).optional()}),y=Z({icons:Q(v).optional()}),g=Z({name:k(),title:k().optional()}),P=g.extend({...g.shape,...y.shape,version:k(),websiteUrl:k().optional(),description:k().optional()}),w=Yr(Z({applyDefaults:fe().optional()}),t),x=pi((Fe)=>{if(Fe&&typeof Fe==="object"&&!Array.isArray(Fe)&&Object.keys(Fe).length===0)return{form:{}};return Fe},Yr(Z({form:w.optional(),url:t.optional()}),t.optional())),O=be({list:t.optional(),cancel:t.optional(),requests:be({sampling:be({createMessage:t.optional()}).optional(),elicitation:be({create:t.optional()}).optional()}).optional()}),R=be({list:t.optional(),cancel:t.optional(),requests:be({tools:be({call:t.optional()}).optional()}).optional()}),S=Z({experimental:ie(k(),t).optional(),sampling:Z({context:t.optional(),tools:t.optional()}).optional(),elicitation:x.optional(),roots:Z({listChanged:fe().optional()}).optional(),tasks:O.optional(),extensions:ie(k(),t).optional()}),E=Z({experimental:ie(k(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:Z({listChanged:fe().optional()}).optional(),resources:Z({subscribe:fe().optional(),listChanged:fe().optional()}).optional(),tools:Z({listChanged:fe().optional()}).optional(),tasks:R.optional(),extensions:ie(k(),t).optional()}),A=Z({progress:te(),total:he(te()),message:he(k())}),H=Z({...h.shape,...A.shape,progressToken:r}),j=f.extend({method:J("notifications/progress"),params:H}),V=h.extend({level:i,logger:k().optional(),data:me()}),W=f.extend({method:J("notifications/message"),params:V}),Y=Z({uri:k(),mimeType:he(k()),_meta:ie(k(),me()).optional()}),ae=Y.extend({text:k()}),we=Y.extend({blob:a}),$e=Z({audience:Q(s).optional(),priority:te().min(0).max(1).optional(),lastModified:yu({offset:!0}).optional()}),Ce=Z({...g.shape,...y.shape,uri:k(),description:he(k()),mimeType:he(k()),size:he(te()),annotations:$e.optional(),_meta:he(be({}))}),de=Z({...g.shape,...y.shape,uriTemplate:k(),description:he(k()),mimeType:he(k()),annotations:$e.optional(),_meta:he(be({}))}),N=f.extend({method:J("notifications/resources/list_changed"),params:h.optional()}),M=h.extend({uri:k()}),b=f.extend({method:J("notifications/resources/updated"),params:M}),p=Z({name:k(),description:he(k()),required:he(fe())}),_=Z({...g.shape,...y.shape,description:he(k()),arguments:he(Q(p)),_meta:he(be({}))}),z=f.extend({method:J("notifications/prompts/list_changed"),params:h.optional()}),I=Z({type:J("text"),text:k(),annotations:$e.optional(),_meta:ie(k(),me()).optional()}),U=Z({type:J("image"),data:a,mimeType:k(),annotations:$e.optional(),_meta:ie(k(),me()).optional()}),G=Z({type:J("audio"),data:a,mimeType:k(),annotations:$e.optional(),_meta:ie(k(),me()).optional()}),K=Z({type:J("tool_use"),name:k(),id:k(),input:ie(k(),me()),_meta:ie(k(),me()).optional()}),ue=Z({type:J("resource"),resource:ce([ae,we]),annotations:$e.optional(),_meta:ie(k(),me()).optional()}),Pe=Ce.extend({type:J("resource_link")}),T=ce([I,U,G,Pe,ue]),q=Z({role:s,content:T}),F=Z({title:k().optional(),readOnlyHint:fe().optional(),destructiveHint:fe().optional(),idempotentHint:fe().optional(),openWorldHint:fe().optional()}),ee=f.extend({method:J("notifications/tools/list_changed"),params:h.optional()}),re=Z({name:k().optional()}),se=Z({hints:Q(re).optional(),costPriority:te().min(0).max(1).optional(),speedPriority:te().min(0).max(1).optional(),intelligencePriority:te().min(0).max(1).optional()}),_e=Z({mode:ze(["auto","required","none"]).optional()}),Ze=Z({type:J("boolean"),title:k().optional(),description:k().optional(),default:fe().optional()}),ke=Z({type:J("string"),title:k().optional(),description:k().optional(),minLength:te().optional(),maxLength:te().optional(),format:ze(["email","uri","date","date-time"]).optional(),default:k().optional()}),De=Z({type:ze(["number","integer"]),title:k().optional(),description:k().optional(),minimum:te().optional(),maximum:te().optional(),default:te().optional()}),Ie=Z({type:J("string"),title:k().optional(),description:k().optional(),enum:Q(k()),default:k().optional()}),ht=Z({type:J("string"),title:k().optional(),description:k().optional(),oneOf:Q(Z({const:k(),title:k()})),default:k().optional()}),Ve=Z({type:J("string"),title:k().optional(),description:k().optional(),enum:Q(k()),enumNames:Q(k()).optional(),default:k().optional()}),jt=ce([Ie,ht]),zt=Z({type:J("array"),title:k().optional(),description:k().optional(),minItems:te().optional(),maxItems:te().optional(),items:Z({type:J("string"),enum:Q(k())}),default:Q(k()).optional()}),Mt=Z({type:J("array"),title:k().optional(),description:k().optional(),minItems:te().optional(),maxItems:te().optional(),items:Z({anyOf:Q(Z({const:k(),title:k()}))}),default:Q(k()).optional()}),Vt=ce([zt,Mt]),Ht=ce([Ve,jt,Vt]),ir=ce([Ht,Ze,ke,De]),ar=m.extend({mode:J("form").optional(),message:k(),requestedSchema:Z({type:J("object"),properties:ie(k(),ir),required:Q(k()).optional()}).catchall(me())}),cr=Z({type:J("ref/resource"),uri:k()}),lr=Z({type:J("ref/prompt"),name:k()}),io=Z({uri:k().startsWith("file://"),name:k().optional(),_meta:ie(k(),me()).optional()}),Bt=S.shape,ao=Z({experimental:Bt.experimental,sampling:Bt.sampling,elicitation:Bt.elicitation,roots:Bt.roots,extensions:Bt.extensions}),_t=E.shape,Pr=Z({experimental:_t.experimental,logging:_t.logging,completions:_t.completions,prompts:_t.prompts,resources:_t.resources,tools:_t.tools,extensions:_t.extensions}),kr=be({progressToken:r.optional(),[ss]:k(),[iu]:P.optional(),[Tr]:ao,[Qu]:i.optional()}),dr=Z({...g.shape,...y.shape,description:k().optional(),inputSchema:be({$schema:k().optional(),type:J("object")}),outputSchema:be({$schema:k().optional()}).optional(),annotations:F.optional(),_meta:ie(k(),me()).optional()}),co=Z({type:J("tool_result"),toolUseId:k(),content:Q(T),structuredContent:me().optional(),isError:fe().optional(),_meta:ie(k(),me()).optional()}),xr=ce([I,U,G,K,co]),pr=Z({role:s,content:ce([xr,Q(xr)]),_meta:ie(k(),me()).optional()}),Er=k(),Or=be({[_a]:P.optional().catch(void 0)}),Cr=Or.optional();function We(Fe){return be({_meta:Cr,resultType:Er.default("complete"),...Fe})}let uo=We({}),kn=We({nextCursor:o.optional()}),Ir=We({content:Q(T),structuredContent:me().optional(),isError:fe().optional()}),lo=We({ttlMs:te().int().min(0),cacheScope:ze(["public","private"]),tools:Q(dr),nextCursor:o.optional()}),po=We({ttlMs:te().int().min(0),cacheScope:ze(["public","private"]),prompts:Q(_),nextCursor:o.optional()}),mo=We({description:k().optional(),messages:Q(q)}),fo=We({ttlMs:te().int().min(0),cacheScope:ze(["public","private"]),resources:Q(Ce),nextCursor:o.optional()}),ho=We({ttlMs:te().int().min(0),cacheScope:ze(["public","private"]),resourceTemplates:Q(de),nextCursor:o.optional()}),go=We({ttlMs:te().int().min(0),cacheScope:ze(["public","private"]),contents:Q(ce([ae,we]))}),_o=We({completion:Z({values:Q(k()).max(100),total:te().int().optional(),hasMore:fe().optional()}).loose()}),xn=We({ttlMs:te().int().min(0),cacheScope:ze(["public","private"])}),yo=We({ttlMs:te().int().min(0).catch(0),cacheScope:ze(["public","private"]).catch("private"),supportedVersions:Q(k()),capabilities:Pr,instructions:k().optional()}),Jt=Z({messages:Q(pr),modelPreferences:se.optional(),systemPrompt:k().optional(),includeContext:ze(["none","thisServer","allServers"]).optional(),temperature:te().optional(),maxTokens:te().int(),stopSequences:Q(k()).optional(),metadata:t.optional(),tools:Q(dr).optional(),toolChoice:_e.optional()}),vo=Z({method:J("sampling/createMessage"),params:Jt}),So=Z({method:J("roots/list"),params:Z({_meta:ie(k(),me()).optional()}).optional()}),bo=Z({...pr.shape,model:k(),stopReason:k().optional()}),zo=Z({roots:Q(io)}),$o=Z({action:ze(["accept","decline","cancel"]),content:ie(k(),ce([k(),te(),fe(),Q(k())])).optional()}),Ro=Z({mode:J("url"),message:k(),url:k().url()}),wo=ce([ar,Ro]),Po=Z({method:J("elicitation/create"),params:wo}),ko=ce([vo,So,Po]),xo=ce([bo,zo,$o]),Eo=ie(k(),ko),To=ie(k(),xo),mr=We({inputRequests:Eo.optional(),requestState:k().optional()}),fr={inputResponses:To.optional(),requestState:k().optional()},En=Z({_meta:kr,...fr}),Tn=be({progressToken:r.optional()});function it(Fe,gr){return Z({method:J(Fe),params:Z({_meta:kr,...gr})})}function at(Fe,gr){return Z({method:J(Fe),params:Z({_meta:Tn.optional(),...gr}).optional()})}let Oo={name:k(),arguments:ie(k(),me()).optional(),...fr},$t={cursor:o.optional()},On=it("tools/call",Oo),Cn=it("tools/list",$t),In=it("prompts/list",$t),Nn=it("prompts/get",{name:k(),arguments:ie(k(),k()).optional(),...fr}),An=it("resources/list",$t),jn=it("resources/templates/list",$t),Mn=it("resources/read",{uri:k(),...fr}),Co={ref:ce([lr,cr]),argument:Z({name:k(),value:k()}),context:Z({arguments:ie(k(),k()).optional()}).optional()},qn=it("completion/complete",Co),Ln=it("server/discover",{}),Nr=Z({toolsListChanged:fe().optional(),promptsListChanged:fe().optional(),resourcesListChanged:fe().optional(),resourceSubscriptions:Q(k()).optional()}),Io={notifications:Nr},Dn=it("subscriptions/listen",Io),Un=Or.extend({"io.modelcontextprotocol/subscriptionId":n}),No=be({_meta:Un,resultType:Er.default("complete")}),Kt={"tools/call":at("tools/call",Oo),"tools/list":at("tools/list",$t),"prompts/get":at("prompts/get",{name:k(),arguments:ie(k(),k()).optional()}),"prompts/list":at("prompts/list",$t),"resources/list":at("resources/list",$t),"resources/templates/list":at("resources/templates/list",$t),"resources/read":at("resources/read",{uri:k()}),"completion/complete":at("completion/complete",Co),"server/discover":at("server/discover",{}),"subscriptions/listen":at("subscriptions/listen",Io)};function tt(Fe){return be({_meta:Cr,...Fe})}let Fn={"tools/call":tt({content:Q(T),structuredContent:me().optional(),isError:fe().optional()}),"tools/list":tt({ttlMs:te().int().min(0),cacheScope:ze(["public","private"]),tools:Q(dr),nextCursor:o.optional()}),"prompts/get":tt({description:k().optional(),messages:Q(q)}),"prompts/list":tt({ttlMs:te().int().min(0),cacheScope:ze(["public","private"]),prompts:Q(_),nextCursor:o.optional()}),"resources/list":tt({ttlMs:te().int().min(0),cacheScope:ze(["public","private"]),resources:Q(Ce),nextCursor:o.optional()}),"resources/templates/list":tt({ttlMs:te().int().min(0),cacheScope:ze(["public","private"]),resourceTemplates:Q(de),nextCursor:o.optional()}),"resources/read":tt({ttlMs:te().int().min(0),cacheScope:ze(["public","private"]),contents:Q(ce([ae,we]))}),"completion/complete":tt({completion:Z({values:Q(k()).max(100),total:te().int().optional(),hasMore:fe().optional()}).loose()}),"server/discover":tt({ttlMs:te().int().min(0).catch(0),cacheScope:ze(["public","private"]).catch("private"),supportedVersions:Q(k()),capabilities:Pr,instructions:k().optional()}),"subscriptions/listen":tt({})},hr=be({"io.modelcontextprotocol/subscriptionId":n.optional()}),jr=Z({method:J("notifications/subscriptions/acknowledged"),params:Z({_meta:hr.optional(),notifications:Nr})}),Mr=Z({_meta:hr.optional(),requestId:n,reason:k().optional()}),Zr=Z({method:J("notifications/cancelled"),params:Mr}),Ci={"notifications/cancelled":Zr,"notifications/progress":j,"notifications/message":W,"notifications/resources/updated":b,"notifications/resources/list_changed":N,"notifications/tools/list_changed":ee,"notifications/prompts/list_changed":z,"notifications/subscriptions/acknowledged":jr},Xe=(Fe)=>Z({jsonrpc:J("2.0"),id:ce([k(),te().int()]),result:Fe}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:i,TaskMetadataSchema:c,RelatedTaskMetadataSchema:u,RequestMetaSchema:l,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:m,NotificationsParamsSchema:h,NotificationSchema:f,IconSchema:v,IconsSchema:y,BaseMetadataSchema:g,ImplementationSchema:P,ClientTasksCapabilitySchema:O,ServerTasksCapabilitySchema:R,ClientCapabilitiesSchema:S,ServerCapabilitiesSchema:E,ProgressSchema:A,ProgressNotificationParamsSchema:H,ProgressNotificationSchema:j,LoggingMessageNotificationParamsSchema:V,LoggingMessageNotificationSchema:W,ResourceContentsSchema:Y,TextResourceContentsSchema:ae,BlobResourceContentsSchema:we,AnnotationsSchema:$e,ResourceSchema:Ce,ResourceTemplateSchema:de,ResourceListChangedNotificationSchema:N,ResourceUpdatedNotificationParamsSchema:M,ResourceUpdatedNotificationSchema:b,PromptArgumentSchema:p,PromptSchema:_,PromptListChangedNotificationSchema:z,TextContentSchema:I,ImageContentSchema:U,AudioContentSchema:G,ToolUseContentSchema:K,EmbeddedResourceSchema:ue,ResourceLinkSchema:Pe,ContentBlockSchema:T,PromptMessageSchema:q,ToolAnnotationsSchema:F,ToolListChangedNotificationSchema:ee,ModelHintSchema:re,ModelPreferencesSchema:se,ToolChoiceSchema:_e,BooleanSchemaSchema:Ze,StringSchemaSchema:ke,NumberSchemaSchema:De,UntitledSingleSelectEnumSchemaSchema:Ie,TitledSingleSelectEnumSchemaSchema:ht,LegacyTitledEnumSchemaSchema:Ve,SingleSelectEnumSchemaSchema:jt,UntitledMultiSelectEnumSchemaSchema:zt,TitledMultiSelectEnumSchemaSchema:Mt,MultiSelectEnumSchemaSchema:Vt,EnumSchemaSchema:Ht,PrimitiveSchemaDefinitionSchema:ir,ElicitRequestFormParamsSchema:ar,ResourceTemplateReferenceSchema:cr,PromptReferenceSchema:lr,RootSchema:io,ClientCapabilities2026Schema:ao,ServerCapabilities2026Schema:Pr,RequestMetaEnvelopeSchema:kr,ToolSchema:dr,ToolResultContentSchema:co,SamplingMessageContentBlockSchema:xr,SamplingMessageSchema:pr,ResultTypeSchema:Er,ResultMetaSchema:Or,ResultSchema:uo,PaginatedResultSchema:kn,CallToolResultSchema:Ir,ListToolsResultSchema:lo,ListPromptsResultSchema:po,GetPromptResultSchema:mo,ListResourcesResultSchema:fo,ListResourceTemplatesResultSchema:ho,ReadResourceResultSchema:go,CompleteResultSchema:_o,CacheableResultSchema:xn,DiscoverResultSchema:yo,CreateMessageRequestParamsSchema:Jt,CreateMessageRequestSchema:vo,ListRootsRequestSchema:So,CreateMessageResultSchema:bo,ListRootsResultSchema:zo,ElicitResultSchema:$o,ElicitRequestURLParamsSchema:Ro,ElicitRequestParamsSchema:wo,ElicitRequestSchema:Po,InputRequestSchema:ko,InputResponseSchema:xo,InputRequestsSchema:Eo,InputResponsesSchema:To,InputRequiredResultSchema:mr,InputResponseRequestParamsSchema:En,CallToolRequestSchema:On,ListToolsRequestSchema:Cn,ListPromptsRequestSchema:In,GetPromptRequestSchema:Nn,ListResourcesRequestSchema:An,ListResourceTemplatesRequestSchema:jn,ReadResourceRequestSchema:Mn,CompleteRequestSchema:qn,DiscoverRequestSchema:Ln,SubscriptionFilterSchema:Nr,SubscriptionsListenRequestSchema:Dn,SubscriptionsListenResultMetaSchema:Un,SubscriptionsListenResultSchema:No,dispatchRequestSchemas:Kt,dispatchResultSchemas:Fn,NotificationMetaSchema:hr,SubscriptionsAcknowledgedNotificationSchema:jr,CancelledNotificationParamsSchema:Mr,CancelledNotificationSchema:Zr,notificationSchemas2026:Ci,JSONRPCResultResponseSchema:Xe(uo),CallToolResultResponseSchema:Xe(ce([Ir,mr])),ListToolsResultResponseSchema:Xe(lo),ListPromptsResultResponseSchema:Xe(po),GetPromptResultResponseSchema:Xe(ce([mo,mr])),ListResourcesResultResponseSchema:Xe(fo),ListResourceTemplatesResultResponseSchema:Xe(ho),ReadResourceResultResponseSchema:Xe(ce([go,mr])),CompleteResultResponseSchema:Xe(_o),DiscoverResultResponseSchema:Xe(yo),SubscriptionsListenResultResponseSchema:Xe(No)}}var tP;function nr(){return tP??=eP()}var rP=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function oP(e){return rP.includes(e)}var Qr=Symbol("modelcontextprotocol.resultCacheHintFallback");function zi(e,t){if(t===void 0)return e;let r=e[Qr];if(r===void 0)return{...e,[Qr]:t};let o={},n=r.ttlMs??t.ttlMs;if(n!==void 0)o.ttlMs=n;let s=r.cacheScope??t.cacheScope;if(s!==void 0)o.cacheScope=s;return{...e,[Qr]:o}}function nP(e){return e[Qr]}function Ou(e){return typeof e==="number"&&Number.isSafeInteger(e)&&e>=0}function Cu(e){return e==="public"||e==="private"}function bF(e,t){if(e.ttlMs!==void 0&&!Ou(e.ttlMs))throw RangeError(`Invalid cache hint for ${t}: ttlMs must be a non-negative safe integer (got ${String(e.ttlMs)})`);if(e.cacheScope!==void 0&&!Cu(e.cacheScope))throw RangeError(`Invalid cache hint for ${t}: cacheScope must be 'public' or 'private' (got ${String(e.cacheScope)})`)}var pe=function(e){return e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.ResourceNotFound=-32002]="ResourceNotFound",e[e.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",e[e.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired",e}({}),ge=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return lv(this,t)}static isInstance(t){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return lv(this,t)}constructor(t,r,o){super(r);this.code=t,this.data=o,this.name="ProtocolError",yF(this,new.target)}static fromError(t,r,o){if(t===pe.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new sP(n.elicitations,r)}if(t===pe.UnsupportedProtocolVersion&&o){let n=o;if(Array.isArray(n.supported)&&typeof n.requested==="string")return new hV({supported:n.supported,requested:n.requested},r)}if(t===pe.InvalidParams||t===pe.ResourceNotFound){let n=o;if(typeof n?.uri==="string"&&(t===pe.ResourceNotFound||Object.keys(n).length===1))return new Sm(n.uri,r)}if(t===pe.MissingRequiredClientCapability&&o){let n=o;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities==="object"&&!Array.isArray(n.requiredCapabilities))return new SF({requiredCapabilities:n.requiredCapabilities},r)}return new e(t,r,o)}},Sm=class extends ge{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(pe.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},sP=class extends ge{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(pe.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},hV=class extends ge{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(pe.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},SF=class extends ge{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(pe.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},iP=0,aP="private",cP=["tools/call","prompts/get","resources/read"];function uP(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:"complete"};if(r==="complete")return t;if(cP.includes(e))return t;throw new ge(pe.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function lP(e,t){let r=nP(t);if(t.resultType!=="complete"||!oP(e))return r===void 0?t:hP(t);let o=t,n=Ou(o.ttlMs)?o.ttlMs:mP(r),s=Cu(o.cacheScope)?o.cacheScope:fP(r),i={...o,ttlMs:n,cacheScope:s};return delete i[Qr],i}function dP(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function pP(e,t){if(t===void 0)return e;let r=e._meta;if(r===void 0)return{...e,_meta:{[_a]:t}};if(!dP(r))return e;if(r[_a]!==void 0)return e;return{...e,_meta:{...r,[_a]:t}}}function mP(e){return e!==void 0&&Ou(e.ttlMs)?e.ttlMs:iP}function fP(e){return e!==void 0&&Cu(e.cacheScope)?e.cacheScope:aP}function hP(e){let t={...e};return delete t[Qr],t}var gP=["elicitation/create","sampling/createMessage","roots/list"],hi;function ab(){if(hi)return hi;let e=nr();return hi={request:{"elicitation/create":Z({method:J("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":Z({method:J("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":Z({method:J("roots/list"),params:be({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},hi}function cb(e){return gP.includes(e)}function vu(e){return cb(e)?ab().request[e]:void 0}function _P(e){return cb(e)?ab().response[e]:void 0}var Iu={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},ub={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function lb(e){return Object.prototype.hasOwnProperty.call(Iu,e)}function db(e){return Object.prototype.hasOwnProperty.call(ub,e)}function yP(e){return Object.prototype.hasOwnProperty.call(Iu,e)}function vP(e){return lb(e)?nr().dispatchRequestSchemas[e]:void 0}function SP(e){return yP(e)?nr().dispatchResultSchemas[e]:void 0}function bP(e){return db(e)?nr().notificationSchemas2026[e]:void 0}var FA=Object.keys(Iu),HA=Object.keys(ub);function vn(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function gn(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}var zP={ok:!1,reason:"not-in-era"},$P=[ss,Tr];function RP(e,t){let r=t,o=!1,n=()=>{if(!o)r={...r},o=!0;return r},s=t.tools;if(e==="tools/list"&&Array.isArray(s)&&s.some((a)=>vn(a)&&("execution"in a)))n().tools=s.map((a)=>{if(!vn(a)||!("execution"in a))return a;let c={...a};return delete c.execution,c});let i=t.capabilities;if(vn(i)&&"tasks"in i){let a={...i};delete a.tasks,n().capabilities=a}return r}var Nu={era:"2026-07-28",hasRequestMethod:lb,hasNotificationMethod:db,hasInputRequestMethod:(e)=>vu(e)!==void 0,validateRequest:(e,t)=>gn(vP(e),t),validateResult:(e,t)=>gn(SP(e),t),validateNotification:(e,t)=>gn(bP(e),t),validateInputRequest:(e,t)=>gn(vu(e),t),validateInputResponse:(e,t)=>gn(_P(e),t),samplingResultVariant:()=>zP,outboundEnvelope(e){return{[ss]:e.protocolVersion,[iu]:e.clientInfo,[Tr]:e.clientCapabilities,...e.logLevel!==void 0&&{[Qu]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let o of $P)if(!(o in e))t.push({key:o,problem:"missing"});let r=nr().RequestMetaEnvelopeSchema.safeParse(e);if(!r.success)for(let o of r.error.issues){let n=o.path.map(String),s=n.length>0?n.join("."):"_meta";if(n.length===1&&t.some((i)=>i.key===s&&i.problem==="missing"))continue;t.push({key:s,problem:o.message})}return t},projectCallToolResult:(e)=>WS(e),inputRequestSchema:vu,decodeResult(e,t){if(!vn(t))return{kind:"invalid",error:new ct(gt.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(r===void 0)return{kind:"invalid",error:new ct(gt.InvalidResult,`Invalid result for ${e}: missing required resultType \u2014 servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:"missing-resultType"})};if(typeof r!=="string")return{kind:"invalid",error:new ct(gt.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if(r==="input_required"){let i=t.inputRequests,a=vn(i)?i:{},c=t.requestState,u=t._meta===void 0?void 0:nr().ResultMetaSchema.safeParse(t._meta),l=u?.success?u.data:void 0;if(Object.keys(a).length===0&&typeof c!=="string")return{kind:"invalid",error:new ct(gt.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:"input-required-missing-both"})};return{kind:"input_required",inputRequests:a,...typeof c==="string"&&{requestState:c},...l!==void 0&&{_meta:l}}}if(r!=="complete")return{kind:"invalid",error:new ct(gt.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let o=wP(),n=Object.hasOwn(o,e)?o[e]:void 0;if(n!==void 0){let i=n.safeParse(t);if(!i.success)return{kind:"invalid",error:new ct(gt.InvalidResult,`Invalid result for ${e}: ${i.error}`,{method:e})}}let s={...t};return delete s.resultType,{kind:"complete",result:s}},encodeResult(e,t,r){return pP(lP(e,uP(e,RP(e,t))),r)},encodeErrorCode:(e)=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let t=nr().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map((r)=>r.message).join("; ")}`}},_i;function wP(){if(_i)return _i;let e=nr();return _i={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},_i}var $n="2026-07-28";function Ft(e){return e!==void 0&&bm(e)?Nu:Tu}function OS(e){if(e.revision!==void 0)return Ft(e.revision).era;return e.era==="modern"?Nu.era:Tu.era}function Su(e){return pb.some((t)=>t.hasRequestMethod(e))}function bu(e){return pb.some((t)=>t.hasNotificationMethod(e))}function CS(e){return e==="tasks/get"||e==="tasks/cancel"}var pb=[Tu,Nu];function IS(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function cw(e){if(!IS(e))return;let t=e._meta;return IS(t)?t:void 0}function $i(e){let t=cw(e);return t!==void 0&&ss in t}function Au(e){let t=cw(e)?.[ss];return typeof t==="string"?t:void 0}function vi(e){return Ft($n).validateEnvelopeMeta(e)}var PP=Wu({AnnotationsSchema:()=>vm,AudioContentSchema:()=>QS,BaseMetadataSchema:()=>gm,BaseRequestParamsSchema:()=>to,BlobResourceContentsSchema:()=>eT,BooleanSchemaSchema:()=>tw,CallToolRequestParamsSchema:()=>gx,CallToolRequestSchema:()=>yx,CallToolResultSchema:()=>nT,CancelTaskRequestSchema:()=>aF,CancelTaskResultSchema:()=>cF,CancelledNotificationParamsSchema:()=>R_,CancelledNotificationSchema:()=>KA,ClientCapabilitiesSchema:()=>k_,ClientNotificationSchema:()=>lF,ClientRequestSchema:()=>dF,ClientResultSchema:()=>uF,ClientTasksCapabilitySchema:()=>A_,CompatibilityCallToolResultSchema:()=>X0,CompleteRequestParamsSchema:()=>Wx,CompleteRequestSchema:()=>zx,CompleteResultSchema:()=>jx,ContentBlockSchema:()=>ew,CreateMessageRequestParamsSchema:()=>_x,CreateMessageRequestSchema:()=>xx,CreateMessageResultSchema:()=>Cx,CreateMessageResultWithToolsSchema:()=>Dx,CreateTaskResultSchema:()=>Q0,CursorSchema:()=>VA,DiscoverRequestSchema:()=>x_,DiscoverResultSchema:()=>cv,ElicitRequestFormParamsSchema:()=>Dh,ElicitRequestParamsSchema:()=>Lx,ElicitRequestSchema:()=>Bx,ElicitRequestURLParamsSchema:()=>Fx,ElicitResultSchema:()=>Hx,ElicitationCompleteNotificationParamsSchema:()=>$x,ElicitationCompleteNotificationSchema:()=>Ux,EmbeddedResourceSchema:()=>ax,EmptyResultSchema:()=>jA,EnumSchemaSchema:()=>Nx,GetPromptRequestParamsSchema:()=>ix,GetPromptRequestSchema:()=>ox,GetPromptResultSchema:()=>lx,GetTaskPayloadRequestSchema:()=>nF,GetTaskPayloadResultSchema:()=>iF,GetTaskRequestSchema:()=>tF,GetTaskResultSchema:()=>rF,IconSchema:()=>P_,IconsSchema:()=>Th,ImageContentSchema:()=>ZS,ImplementationSchema:()=>YS,InitializeRequestParamsSchema:()=>E_,InitializeRequestSchema:()=>GA,InitializeResultSchema:()=>I_,InitializedNotificationSchema:()=>__,JSONArraySchema:()=>Y0,JSONObjectSchema:()=>Hi,JSONRPCErrorResponseSchema:()=>av,JSONRPCMessageSchema:()=>ep,JSONRPCNotificationSchema:()=>GS,JSONRPCRequestSchema:()=>KS,JSONRPCResponseSchema:()=>J0,JSONRPCResultResponseSchema:()=>sv,JSONValueSchema:()=>Ph,LegacyTitledEnumSchemaSchema:()=>iw,ListChangedOptionsBaseSchema:()=>iT,ListPromptsRequestSchema:()=>rx,ListPromptsResultSchema:()=>nx,ListResourceTemplatesRequestSchema:()=>F_,ListResourceTemplatesResultSchema:()=>L_,ListResourcesRequestSchema:()=>M_,ListResourcesResultSchema:()=>N_,ListRootsRequestSchema:()=>Gx,ListRootsResultSchema:()=>Yx,ListTasksRequestSchema:()=>oF,ListTasksResultSchema:()=>sF,ListToolsRequestSchema:()=>fx,ListToolsResultSchema:()=>hx,LoggingLevelSchema:()=>_h,LoggingMessageNotificationParamsSchema:()=>wx,LoggingMessageNotificationSchema:()=>Rx,ModelHintSchema:()=>Px,ModelPreferencesSchema:()=>Ax,MultiSelectEnumSchemaSchema:()=>Mx,NotificationSchema:()=>Qs,NotificationsParamsSchema:()=>Zs,NumberSchemaSchema:()=>Ch,PaginatedRequestParamsSchema:()=>ym,PaginatedRequestSchema:()=>kh,PaginatedResultSchema:()=>tl,PingRequestSchema:()=>JA,PrimitiveSchemaDefinitionSchema:()=>aw,ProgressNotificationParamsSchema:()=>D_,ProgressNotificationSchema:()=>XA,ProgressSchema:()=>C_,ProgressTokenSchema:()=>qA,PromptArgumentSchema:()=>ex,PromptListChangedNotificationSchema:()=>ux,PromptMessageSchema:()=>dx,PromptReferenceSchema:()=>Vx,PromptSchema:()=>tx,ReadResourceRequestParamsSchema:()=>B_,ReadResourceRequestSchema:()=>$_,ReadResourceResultSchema:()=>U_,RelatedTaskMetadataSchema:()=>w_,RequestIdSchema:()=>Ah,RequestMetaSchema:()=>WA,RequestSchema:()=>qi,ResourceContentsSchema:()=>ZA,ResourceLinkSchema:()=>cx,ResourceListChangedNotificationSchema:()=>H_,ResourceRequestParamsSchema:()=>JS,ResourceSchema:()=>Ih,ResourceTemplateReferenceSchema:()=>qx,ResourceTemplateSchema:()=>O_,ResourceUpdatedNotificationParamsSchema:()=>Z_,ResourceUpdatedNotificationSchema:()=>Q_,ResultMetaObjectSchema:()=>zA,ResultSchema:()=>Zn,RoleSchema:()=>Eh,RootSchema:()=>Kx,RootsListChangedNotificationSchema:()=>Jx,SamplingContentSchema:()=>Ex,SamplingMessageContentBlockSchema:()=>dv,SamplingMessageSchema:()=>Ix,ServerCapabilitiesSchema:()=>YA,ServerNotificationSchema:()=>mF,ServerRequestSchema:()=>pF,ServerResultSchema:()=>fF,ServerTasksCapabilitySchema:()=>T_,SetLevelRequestParamsSchema:()=>bx,SetLevelRequestSchema:()=>Sx,SingleSelectEnumSchemaSchema:()=>Ox,StringSchemaSchema:()=>xh,SubscribeRequestParamsSchema:()=>q_,SubscribeRequestSchema:()=>V_,SubscriptionFilterSchema:()=>tT,SubscriptionsAcknowledgedNotificationParamsSchema:()=>G_,SubscriptionsAcknowledgedNotificationSchema:()=>Y_,SubscriptionsListenRequestParamsSchema:()=>j_,SubscriptionsListenRequestSchema:()=>K_,SubscriptionsListenResultMetaSchema:()=>J_,SubscriptionsListenResultSchema:()=>X_,TaskAugmentedRequestParamsSchema:()=>ov,TaskCreationParamsSchema:()=>Z0,TaskMetadataSchema:()=>S_,TaskSchema:()=>Oh,TaskStatusNotificationParamsSchema:()=>Zx,TaskStatusNotificationSchema:()=>eF,TaskStatusSchema:()=>Xx,TextContentSchema:()=>XS,TextResourceContentsSchema:()=>QA,TitledMultiSelectEnumSchemaSchema:()=>sw,TitledSingleSelectEnumSchemaSchema:()=>nw,ToolAnnotationsSchema:()=>px,ToolChoiceSchema:()=>Tx,ToolExecutionSchema:()=>mx,ToolListChangedNotificationSchema:()=>vx,ToolResultContentSchema:()=>kx,ToolSchema:()=>rT,ToolUseContentSchema:()=>sx,UnsubscribeRequestParamsSchema:()=>W_,UnsubscribeRequestSchema:()=>z_,UntitledMultiSelectEnumSchemaSchema:()=>ow,UntitledSingleSelectEnumSchemaSchema:()=>rw});function aee(e){return ep.parse(e)}var wm=(e)=>KS.safeParse(e).success,ju=(e)=>GS.safeParse(e).success,Mh=(e)=>sv.safeParse(e).success,Nh=(e)=>av.safeParse(e).success;var sr=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required";var l5=(e)=>GA.safeParse(e).success;function mb(e){if(e.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function fb(e){if(e.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var kP="Mcp-Param-",NS="x-mcp-header",xP=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,EP=new Set(["string","integer","boolean"]);function gV(e){let t=[],r=new Map,o,n=(i,a,c)=>{if(i===null||typeof i!=="object")return;let u=i;if(NS in u){if(!c||a.length===0)return`${Xr(a)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let d=u[NS];if(typeof d!=="string"||d.length===0)return`${Xr(a)}: x-mcp-header MUST be a non-empty string`;if(!xP.test(d))return`${Xr(a)}: x-mcp-header '${d}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let m=typeof u.type==="string"?u.type:void 0;if(m===void 0||!EP.has(m)){let v=`${Xr(a)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${m??"<none>"}`;if(m!=="number")return v;o??=v}let h=d.toLowerCase(),f=r.get(h);if(f!==void 0)return`x-mcp-header '${d}' is not case-insensitively unique (also declared as '${f}')`;r.set(h,d),t.push({path:a,headerName:d,type:m})}let l=u.properties;if(l!==null&&typeof l==="object")for(let[d,m]of Object.entries(l)){let h=n(m,[...a,d],c);if(h!==void 0)return h}for(let d of TP){let m=u[d];if(m===void 0)continue;let h=Array.isArray(m)?m:m!==null&&typeof m==="object"&&OP.has(d)?Object.values(m):[m];for(let f of h){let v=n(f,[...a,`<${d}>`],!1);if(v!==void 0)return v}}},s=n(e,[],!0);if(s!==void 0)return{valid:!1,reason:o??s};return o===void 0?{valid:!0,declarations:t}:{valid:!1,reason:o,declarations:t}}var TP=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],OP=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function Xr(e){return e.length===0?"<root>":e.join(".")}var CP="=?base64?",IP="?=",NP=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,AP=/^-?\d+(\.\d+)?$/;function jP(e){if(typeof e==="string")return e;if(typeof e==="boolean")return e?"true":"false";if(typeof e==="number"){if(!Number.isFinite(e))return;if(Number.isInteger(e)&&!Number.isSafeInteger(e))return;return String(e)}}function MP(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.codePointAt(o);return new TextDecoder("utf-8",{fatal:!0}).decode(r)}function hb(e){if(!(e.startsWith(CP)&&e.endsWith(IP)))return e;let t=e.slice(9,e.length-2);if(!NP.test(t))return;try{return MP(t)}catch{return}}function ZP(e,t){let r=e;for(let o of t){if(r===null||typeof r!=="object")return;r=r[o]}return r}function cee(e,t,r){for(let o of e){let n=`${kP}${o.headerName}`,s=r.get(n),i=ZP(t,o.path);if(i===void 0||i===null)continue;let a=jP(i);if(a===void 0)continue;if(s===null)return zu("param-header-missing",n,`the body carries ${Xr(o.path)}=${JSON.stringify(i)} but the ${n} header is absent`);let c=hb(s);if(c===void 0)return zu("param-header-invalid-encoding",n,`the ${n} header carries an invalid Base64 sentinel value`);if(!((o.type==="integer"||o.type==="number")&&AP.test(c)&&typeof i==="number"?Number(c)===i:c===a))return zu("param-header-mismatch",n,`the ${n} header decodes to ${JSON.stringify(c)} but the body carries ${Xr(o.path)}=${JSON.stringify(i)}`)}}function zu(e,t,r){return{kind:"reject",rung:"param-header-validation",cell:e,httpStatus:400,code:eo,message:`Bad Request: the request headers and body disagree: ${r}`,data:{mismatch:{header:t,body:r}},settled:!0}}var eo=-32020,BA=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32000],conformance:[],rationale:"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read."},{rung:"jsonrpc-shape",order:2,evaluatedAt:"edge",codes:[pe.InvalidRequest],conformance:["server-stateless"],rationale:"The body must be a JSON-RPC request or notification: posted responses and batch arrays containing a modern or invalid element are rejected before classification (element-wise batch rule); all-legacy arrays stay legacy traffic."},{rung:"era-classification",order:3,evaluatedAt:"edge",codes:[eo,pe.UnsupportedProtocolVersion],conformance:["server-stateless","http-header-validation","http-custom-header-server-validation"],rationale:"Body-primary era classification with the protocol-version header as a cross-check; a header/body disagreement is rejected with -32020 (HeaderMismatch), and an envelope-less request on a modern-only endpoint is answered with the unsupported-protocol-version error naming the supported revisions."},{rung:"envelope",order:4,evaluatedAt:"edge",codes:[pe.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope \u2014 and a missing envelope on a request whose protocol-version header names a modern revision \u2014 is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400."},{rung:"method-registry",order:5,evaluatedAt:"dispatch",codes:[pe.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision\u2019s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at."},{rung:"request-params",order:6,evaluatedAt:"dispatch",codes:[pe.InvalidParams],conformance:[],rationale:"Per-method params validation; emitted in-band by the dispatch layer (HTTP 200), never via the ladder status table."},{rung:"standard-header-validation",order:7,evaluatedAt:"pre-dispatch",codes:[eo],conformance:["http-header-validation"],rationale:"SEP-2243 standard `MCP-Protocol-Version` / `Mcp-Method` / `Mcp-Name` headers \u2014 presence, sentinel decoding, and `Mcp-Name` \u2194 body cross-check \u2014 are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The spec requires `MCP-Protocol-Version` and `Mcp-Method` on every modern *request* POST (`Mcp-Name` only for the methods that mirror `params.name` / `params.uri` / `params.taskId`, see `MCP_NAME_HEADER_SOURCE`) and names them in that order, so a request missing several is answered by the earliest. Notification POSTs are exempt: the presence half runs on requests only, so a modern-enveloped notification is dispatched even with no standard headers at all. The classifier\u2019s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half \u2014 including the missing `MCP-Protocol-Version` cell, which cannot live on the edge rung without breaking body-primary classification. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5\u20136) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[pe.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced \u2014 pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable."},{rung:"param-header-validation",order:9,evaluatedAt:"pre-dispatch",codes:[eo],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool\u2019s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung."}],Mu={[pe.ParseError]:400,[pe.InvalidRequest]:400,[pe.MethodNotFound]:404,[pe.UnsupportedProtocolVersion]:400,[pe.MissingRequiredClientCapability]:400,[eo]:400};function dee(e,t){if(t==="in-band")return e===pe.MissingRequiredClientCapability?400:200;return Mu[e]??400}function bt(e,t,r,o,n){return{kind:"reject",rung:e,cell:t,httpStatus:r,code:o.code,message:o.message,...o.data!==void 0&&{data:o.data},settled:n}}function Pt(e,t,r,o="era-classification"){return bt(o,e,400,new ge(eo,`Bad Request: the request headers and body disagree: ${r}`,{mismatch:{header:t,body:r}}),!0)}var AS={"tools/call":"name","prompts/get":"name","resources/read":"uri","tasks/get":"taskId","tasks/update":"taskId","tasks/cancel":"taskId"};function qP(e,t){let r=Object.hasOwn(AS,e)?AS[e]:void 0;if(r===void 0)return;let o=bn(t)?t[r]:void 0;return{field:r,value:typeof o==="string"?o:void 0}}function yi(e){let t=0;while(t<e.length){let o=e.codePointAt(t);if(o!==9&&o!==32)break;t+=1}let r=e.length;while(r>t){let o=e.codePointAt(r-1);if(o!==9&&o!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}function lee(e,t){if(t.messageKind!=="request")return;let r=t.message.method;if(e.protocolVersionHeader===void 0){let c=t.classification.revision;return Pt("version-header-missing","(missing)",c===void 0?"the body carries a modern per-request envelope but the required MCP-Protocol-Version header is absent":`the body envelope names protocol version ${c} but the required MCP-Protocol-Version header is absent`,"standard-header-validation")}if(e.mcpMethodHeader===void 0)return Pt("method-header-missing","(missing)",`the body names method ${r} but the required Mcp-Method header is absent`,"standard-header-validation");let o=qP(r,t.message.params);if(o===void 0)return;let{field:n,value:s}=o;if(e.mcpNameHeader===void 0){if(s===void 0)return;return Pt("name-header-missing","(missing)",`the body carries params.${n}="${s}" but the required Mcp-Name header is absent`,"standard-header-validation")}let i=yi(e.mcpNameHeader),a=hb(i);if(a===void 0)return Pt("name-header-invalid-encoding",i,"the Mcp-Name header carries an invalid Base64 sentinel value","standard-header-validation");if(s!==void 0&&a!==s)return Pt("name-header-mismatch",i,`the body carries params.${n}="${s}" but the Mcp-Name header names "${a}"`,"standard-header-validation")}function bn(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function gb(e){if(e===void 0)return{era:"modern"};return{era:bm(e)?"modern":"legacy",revision:e}}function LP(e){if(!$i(e))return!1;let t=Au(e);if(t===void 0||!bm(t))return!1;let r=cw(e);return r!==void 0&&vi(r).length===0}function DP(e){if(e.length===0)return bt("jsonrpc-shape","empty-batch",400,new ge(pe.InvalidRequest,"Bad Request: empty JSON-RPC batch"),!0);for(let t of e){if($i(bn(t)?t.params:void 0))return bt("jsonrpc-shape","batch-with-modern-element",400,new ge(pe.InvalidRequest,"Bad Request: JSON-RPC batches may not contain requests for protocol revision 2026-07-28 or later"),!0);if(!(wm(t)||ju(t)||Mh(t)||Nh(t)))return bt("jsonrpc-shape","batch-with-invalid-element",400,new ge(pe.InvalidRequest,"Bad Request: JSON-RPC batch contains an invalid message"),!0)}return{kind:"legacy",reason:"batch"}}function UP(e,t){let{params:r,method:o}=t,n=e.protocolVersionHeader,s=n!==void 0&&bm(n);if(o==="initialize"&&!LP(r)){if(s)return Pt("initialize-with-modern-header",n,"an initialize request (legacy handshake) was sent with a modern MCP-Protocol-Version header");let i=bn(r)&&typeof r.protocolVersion==="string"?r.protocolVersion:void 0;return{kind:"legacy",reason:"initialize",...i!==void 0&&{requestedVersion:i}}}if($i(r)){let i=cw(r),a=(i===void 0?[]:vi(i))[0];if(a!==void 0)return bt("envelope","envelope-invalid",400,new ge(pe.InvalidParams,`Invalid _meta envelope for protocol revision 2026-07-28: ${a.key}: ${a.problem}`,{envelope:a}),!0);let c=Au(r);if(n!==void 0&&c!==void 0&&n!==c)return Pt("header-body-version-mismatch",n,`the body envelope names protocol version ${c} but the MCP-Protocol-Version header names ${n}`);if(e.mcpMethodHeader!==void 0&&e.mcpMethodHeader!==o)return Pt("method-header-mismatch",e.mcpMethodHeader,`the body names method ${o} but the Mcp-Method header names ${e.mcpMethodHeader}`);return{kind:"modern",messageKind:"request",message:t,classification:gb(c)}}if(s){let i=cw(r),a=vi(i??{}).filter((u)=>u.problem==="missing").map((u)=>u.key),c=i===void 0?["_meta"]:a.length>0?a:[ss];return bt("envelope","modern-header-without-claim",400,new ge(pe.InvalidParams,`Invalid params: the MCP-Protocol-Version header names protocol revision ${n}, but the request is missing the required per-request envelope key(s): ${c.join(", ")}`,{envelope:{missing:c}}),!0)}return{kind:"legacy",reason:"no-claim",...n!==void 0&&{requestedVersion:n}}}function FP(e,t){let{params:r,method:o}=t,n=e.protocolVersionHeader,s=n!==void 0&&bm(n);if($i(r)){let i=Au(r);if(i===void 0){let c=cw(r),u=(c===void 0?[]:vi(c)).find((l)=>l.key===ss)??{key:ss,problem:"expected a protocol version string"};return bt("envelope","notification-envelope-invalid",400,new ge(pe.InvalidParams,`Invalid _meta envelope for protocol revision 2026-07-28: ${u.key}: ${u.problem}`,{envelope:u}),!0)}if(n!==void 0&&n!==i)return Pt("notification-header-body-version-mismatch",n,`the notification envelope names protocol version ${i} but the MCP-Protocol-Version header names ${n}`);let a=gb(i);if(a.era==="modern"&&e.mcpMethodHeader!==void 0&&e.mcpMethodHeader!==o)return Pt("notification-method-header-mismatch",e.mcpMethodHeader,`the notification body names method ${o} but the Mcp-Method header names ${e.mcpMethodHeader}`);return{kind:"modern",messageKind:"notification",message:t,classification:a}}if(s){if(e.mcpMethodHeader!==void 0&&e.mcpMethodHeader!==o)return Pt("notification-method-header-mismatch",e.mcpMethodHeader,`the notification body names method ${o} but the Mcp-Method header names ${e.mcpMethodHeader}`);return{kind:"modern",messageKind:"notification",message:t,classification:{era:"modern",revision:n}}}return{kind:"legacy",reason:"notification",...n!==void 0&&{requestedVersion:n}}}function wF(e){if(e={...e,...e.protocolVersionHeader!==void 0&&{protocolVersionHeader:yi(e.protocolVersionHeader)},...e.mcpMethodHeader!==void 0&&{mcpMethodHeader:yi(e.mcpMethodHeader)},...e.mcpNameHeader!==void 0&&{mcpNameHeader:yi(e.mcpNameHeader)}},e.httpMethod.toUpperCase()!=="POST")return{kind:"legacy",reason:"http-method"};let t=e.body;if(Array.isArray(t))return DP(t);if(Mh(t)||Nh(t))return{kind:"legacy",reason:"response"};if(bn(t)&&wm(t))return UP(e,t);if(bn(t)&&ju(t))return FP(e,t);return bt("jsonrpc-shape","invalid-json-rpc-body",400,new ge(pe.InvalidRequest,"Bad Request: the request body is not a valid JSON-RPC message"),!0)}function uee(e,t){switch(e.reason){case"http-method":return bt("http-method","modern-only-method-not-allowed",405,new ge(-32000,"Method not allowed."),!0);case"batch":return bt("jsonrpc-shape","modern-only-batch-not-supported",400,new ge(pe.InvalidRequest,"Bad Request: JSON-RPC batches are not supported by this endpoint"),!0);case"response":return bt("jsonrpc-shape","modern-only-response-post",400,new ge(pe.InvalidRequest,"Bad Request: JSON-RPC responses cannot be posted to this endpoint"),!0);case"notification":return;case"initialize":case"no-claim":{let r=e.requestedVersion;return bt("era-classification","modern-only-missing-envelope",400,r===void 0?new ge(pe.UnsupportedProtocolVersion,"Unsupported protocol version: the request did not name a protocol version",{supported:[...t]}):new hV({supported:[...t],requested:r}),!0)}}}function Ri(e,t){return ci(e,t)}function _n(e){return new Set(e.flatMap((t)=>Object.keys(t.shape)))}function ro(e){if(e==null)return!1;let t=typeof e;if(t!=="object"&&t!=="function")return!1;if(!("~standard"in e))return!1;return typeof e["~standard"]?.validate==="function"}var jS=!1,Pu="draft-2020-12";function wr(e,t="input"){let r=e["~standard"],o;if(r.jsonSchema)o=r.jsonSchema[t]({target:Pu});else if(r.vendor==="zod"){if(!("_zod"in e))throw Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");if(!jS)jS=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.");o=ii(e,{target:Pu,io:t})}else throw Error(`Schema library "${r.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t==="output"){if(o.type!==void 0)return o;return _b(o)?{type:"object",...o}:o}if(o.type!==void 0&&o.type!=="object")throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(o.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...o}}var VP=/^#\/(\$defs|definitions)\/([^/~%]+)$/;function _b(e,t=e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;let r=typeof e.$ref==="string"&&VP.exec(e.$ref);if(r&&t[r[1]]?.[r[2]]?.type==="object")return!0;for(let o of["oneOf","anyOf","allOf"]){let n=e[o];if(Array.isArray(n)&&n.length>0)return n.every((s)=>s!==null&&typeof s==="object"&&(s.type==="object"||_b(s,"$id"in s?{}:t)))}return!1}function HP(e){if(!e.path?.length)return e.message;return`${e.path.map((t)=>String(typeof t==="object"?t.key:t)).join(".")}: ${e.message}`}async function Rr(e,t){let r=await e["~standard"].validate(t);if(r.issues&&r.issues.length>0)return{success:!1,error:r.issues.map((o)=>HP(o)).join(", ")};return{success:!0,data:r.value}}function BP(e){let t=ii(e,{target:Pu,io:"input"});return typeof t.pattern==="string"?t.pattern:void 0}var JP=/\\\.\\d\{(\d+)\}/;function KP(e){let t=JP.exec(e),r=[void 0,-1,0];if(t)r.push(Number(t[1]));return[!1,!0].flatMap((o)=>[!1,!0].flatMap((n)=>r.map((s)=>yu({local:o,offset:n,precision:s}))))}function GP(e,t){let r;switch(e){case"email":r=[mS()];break;case"uri":r=[hS()];break;case"date":r=[Uw()];break;case"date-time":r=KP(t);break}return new Set(r.map((o)=>BP(o)).filter((o)=>o!==void 0))}function WP(e,t,r){if(r!=="zod")return!0;return GP(e,t).has(t)}function yb(e){let t=wr(e,"input"),r=t.properties||{},o=t.required||[];return Object.entries(r).map(([n,s])=>({name:n,description:s?.description,required:o.includes(n)}))}function zn(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function YP(e){try{return wr(e,"input")}catch(t){let r=t instanceof Error?t.message:String(t);throw new ge(pe.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}var XP=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function Zu(e){return XP.has(e)||e.startsWith("x-")}var QP=new Set(["$schema",...Object.keys(Dh.shape.requestedSchema.shape)]),MS={string:_n([xh,rw,nw,iw]),number:_n([Ch]),integer:_n([Ch]),boolean:_n([tw]),array:_n([ow,sw])},ek=new Set(xh.shape.format.unwrap().options);function tk(e,t,r,o){if(!zn(e))return e;let n=typeof e.type==="string"&&Object.hasOwn(MS,e.type)?MS[e.type]:void 0;if(n===void 0)return e;let s={};for(let[i,a]of Object.entries(e))if(n.has(i)||Zu(i))s[i]=a;else if(i==="pattern"&&e.type==="string"&&typeof e.format==="string"){if(!ek.has(e.format))s[i]=a;else if(typeof a!=="string"||!WP(e.format,a,r))o.push(`${t}.${i}`)}else o.push(`${t}.${i}`);return s}function rk(e,t){let r={},o=[];for(let[n,s]of Object.entries(e))if(n==="properties"&&zn(s))r[n]=Object.fromEntries(Object.entries(s).map(([i,a])=>[i,tk(a,`properties.${i}`,t,o)]));else if(QP.has(n))r[n]=s;else if(!Zu(n))o.push(n);if(o.length>0)throw new ge(pe.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return r}function ok(e,t){if(!zn(e.properties))return t;let r=Object.entries(e.properties).filter(([,o])=>!Ri(aw,o).success).map(([o])=>`properties.${o}`);return r.length>0?r.join(", "):t}function ku(e,t,r=""){if(Array.isArray(e)&&Array.isArray(t))return e.flatMap((o,n)=>ku(o,t[n],`${r}[${n}]`));if(!zn(e)||!zn(t))return[];return Object.entries(e).flatMap(([o,n])=>{let s=r?`${r}.${o}`:o;if(!Object.prototype.hasOwnProperty.call(t,o))return Zu(o)?[]:[s];return ku(n,t[o],s)})}function nk(e){if(!ro(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,r=rk(YP(e.requestedSchema),t),o=Ri(Dh.shape.requestedSchema,r);if(!o.success)throw new ge(pe.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${ok(r,o.error.message)}`);let n=ku(r,o.data);if(n.length>0)throw new ge(pe.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);let s=(o.data.required??[]).filter((i)=>!Object.prototype.hasOwnProperty.call(o.data.properties,i));if(s.length>0)throw new ge(pe.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:o.data}}function sk(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,r=typeof e.requestState==="string";if(!t&&!r)throw TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}var yV=Object.assign(sk,{elicit(e){try{return{method:"elicitation/create",params:nk(e)}}catch(t){throw t instanceof ge?TypeError(t.message,{cause:t}):t}},elicitUrl(e){return{method:"elicitation/create",params:{...e,mode:"url"}}},createMessage(e){return{method:"sampling/createMessage",params:e}},listRoots(){return{method:"roots/list"}}});function pee(e,t,r){let o=ik(e,t);if(o.kind!=="elicit"||o.action!=="accept"||o.content===void 0)return;if(r===void 0)return o.content;let n=r["~standard"].validate(o.content);if(n instanceof Promise)throw TypeError("acceptedContent(responses, key, schema) requires a synchronously-validating schema");return n.issues===void 0?n.value:void 0}function ik(e,t){if(e===void 0||typeof e!=="object"||e===null)return{kind:"missing"};let r=e[t];if(r===null||typeof r!=="object"||Array.isArray(r))return{kind:"missing"};let o=r;if(o.action==="accept"||o.action==="decline"||o.action==="cancel"){let n=o.content;return{kind:"elicit",action:o.action,...n!==null&&typeof n==="object"&&!Array.isArray(n)&&{content:n}}}if(Array.isArray(o.roots))return{kind:"roots",roots:o.roots};if(typeof o.role==="string"&&o.content!==void 0)return{kind:"sampling",result:o};return{kind:"missing"}}var vb=250;function Sb(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function bb(e,t){return new Promise((r,o)=>{if(t?.aborted){o(t.reason instanceof ct?t.reason:new ct(gt.RequestTimeout,String(t.reason)));return}let n=setTimeout(()=>{t?.removeEventListener("abort",s),r()},e),s=()=>{clearTimeout(n),o(t?.reason instanceof ct?t.reason:new ct(gt.RequestTimeout,String(t?.reason)))};t?.addEventListener("abort",s,{once:!0})})}function zb(e){let t=new AbortController,r=()=>t.abort(e?.reason);if(e?.addEventListener("abort",r,{once:!0}),e?.aborted)t.abort(e.reason);return{signal:t.signal,abort:(o)=>t.abort(o),dispose:()=>e?.removeEventListener("abort",r)}}var ak=["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"],ck={IdJagTokenExchangeResponseSchema:rC,OAuthClientInformationFullSchema:oC,OAuthClientInformationSchema:iC,OAuthClientMetadataSchema:nC,OAuthClientRegistrationErrorSchema:hF,OAuthErrorResponseSchema:aT,OAuthMetadataSchema:oT,OAuthProtectedResourceMetadataSchema:Qx,OAuthTokenRevocationRequestSchema:gF,OAuthTokensSchema:sT,OpenIdProviderDiscoveryMetadataSchema:tC,OpenIdProviderMetadataSchema:eC},$b={},Rb={};function wb(e,t){let r=e.slice(0,-6);$b[r]=t,Rb[r]=(o)=>t.safeParse(o).success}for(let e of ak)wb(e,PP[e]);for(let[e,t]of Object.entries(ck))wb(e,t);var ej=Object.freeze($b),tj=Object.freeze(Rb);function uk(e){switch(e){case"initialize":case"notifications/initialized":return Ft(void 0);case"server/discover":return Ft($n);default:return}}var lk=60000,dk=[ss,iu,Tr,Qu],pk=["inputResponses","requestState"];function qS(e,t){let r=e.params;if(!Sn(r))return{message:e,lifted:{}};let o=r._meta,n=Sn(o)?dk.filter((c)=>(c in o)):[],s=t==="request"?pk.filter((c)=>(c in r)):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},a={...r};if(n.length>0&&Sn(o)){let c={},u={...o};for(let l of n)c[l]=o[l],delete u[l];if(i.envelope=c,Object.keys(u).length>0)a._meta=u;else delete a._meta}for(let c of s){if(c==="inputResponses")i.inputResponses=a[c];if(c==="requestState")i.requestState=a[c];delete a[c]}return{message:{...e,params:a},lifted:i}}function LS(e,t){let r=e.validateResult(t,void 0);if(!r.ok&&r.reason==="not-in-era")return;return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(o){let n=e.validateResult(t,o);if(n.ok)return{value:n.value};return{issues:[{message:n.reason==="invalid"?n.message:`not-in-era: ${t}`}]}}}}}function Rn(e){return()=>e}var mk=Rn(void 0);function qu(e,t){return{...e,mcpReq:{...e.mcpReq,requestState:Rn(t)}}}var Pb;function mee(e,t){Pb(e,t)}var kb=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{Pb=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??iv,this.setNotificationHandler("notifications/cancelled",(t)=>{this._oncancel(t)}),this.setNotificationHandler("notifications/progress",(t)=>{this._onprogress(t)}),this.setRequestHandler("ping",(t)=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let r=e.params??{};return{...e,params:{...r,_meta:{...t,...r._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new ct(gt.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){if(e.params.requestId===void 0)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,o,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:n,onTimeout:o})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new ct(gt.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);if(t)clearTimeout(t.timeoutId),this._timeoutInfo.delete(e)}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let r=this.transport?.onerror;this._transport.onerror=(n)=>{r?.(n),this._onerror(n)};let o=this._transport?.onmessage;this._transport.onmessage=(n,s)=>{if(o?.(n,s),Mh(n)||Nh(n))this._onresponse(n);else if(wm(n))this._onrequest(n,s);else if(ju(n))this._onnotification(n,s);else this._onerror(Error(`Unknown message type: ${JSON.stringify(n)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let r=new ct(gt.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let o of e.values())o(r);for(let o of t.values())o.abort(r)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:r}=qS(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=OS(t.classification);if(i!==o.era){this._onerror(Error(`Era mismatch on inbound notification '${r.method}': classified as ${i} but this instance serves ${o.era}`));return}}if(bu(r.method)&&!o.hasNotificationMethod(r.method))return;let n=this._notificationHandlers.get(r.method),s=this.fallbackNotificationHandler;if(n===void 0&&s===void 0)return;Promise.resolve().then(()=>n===void 0?s(r):n(r,o)).catch((i)=>this._onerror(Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,t){let{message:r,lifted:o}=qS(e,"request"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop"){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let s=this._transport,i=(v,y,g)=>{let P={jsonrpc:"2.0",id:r.id,error:{code:v,message:y,...g!==void 0&&{data:g}}};s?.send(P).catch((w)=>this._onerror(Error(`Failed to send an error response: ${w}`)))};if(t?.classification!==void 0){let v=OS(t.classification);if(v!==n.era){this._onerror(Error(`Era mismatch on inbound request '${r.method}': classified as ${v} but this instance serves ${n.era}`));let y=t.classification.revision??v;i(pe.UnsupportedProtocolVersion,`Unsupported protocol version: ${y}`,{supported:this._supportedProtocolVersions,requested:y});return}}if(Su(r.method)&&!n.hasRequestMethod(r.method)&&!(CS(r.method)&&this._customSchemaRequestMethods.has(r.method))){i(pe.MethodNotFound,"Method not found");return}let a=this._requestHandlers.get(r.method)??this.fallbackRequestHandler;if(a===void 0){i(pe.MethodNotFound,"Method not found");return}let c=n.checkInboundEnvelope(o);if(c!==void 0){i(pe.InvalidParams,c);return}let u=(v,y)=>this._notificationViaCodec(this._resolveOutboundCodec(v.method),v,{...y,relatedRequestId:r.id}),l=(v,y,g)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(v.method),v,y,{...g,relatedRequestId:r.id}),d=new AbortController;this._requestHandlerAbortControllers.set(r.id,d);let m=o.inputResponses===void 0?void 0:fk(o.inputResponses),h={sessionId:s?.sessionId,mcpReq:{id:r.id,method:r.method,_meta:r.params?._meta,...o.envelope!==void 0&&{envelope:o.envelope},...m!==void 0&&{inputResponses:m.accepted},...m!==void 0&&m.droppedKeys.length>0&&{droppedInputResponseKeys:m.droppedKeys},requestState:o.requestState===void 0?mk:Rn(o.requestState),signal:d.signal,send:(v,y,g)=>{let P=this._resolveOutboundCodec(v.method);if(this._assertOutboundRequestInEra(P,v.method),ro(y))return l(v,y,g);let w=LS(P,v.method);if(w===void 0)throw TypeError(`'${v.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return l(v,w,y)},notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},f=this.buildContext(h,t);Promise.resolve().then(()=>a(r,f)).then(async(v)=>{if(d.signal.aborted)return;let y;try{y=n.encodeResult(r.method,v,this._outboundServerInfo())}catch(P){this._onerror(Error(`Failed to encode result for ${r.method}: ${P}`)),i(pe.InternalError,"Internal error");return}let g={result:y,jsonrpc:"2.0",id:r.id};await s?.send(g)},async(v)=>{if(d.signal.aborted)return;let y=Number.isSafeInteger(v.code)?v.code:pe.InternalError,g={jsonrpc:"2.0",id:r.id,error:{code:n.encodeErrorCode(y),message:v.message??"Internal error",...v.data!==void 0&&{data:v.data}}};await s?.send(g)}).catch((v)=>this._onerror(Error(`Failed to send response: ${v}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(r.id)===d)this._requestHandlerAbortControllers.delete(r.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,o=Number(t),n=this._progressHandlers.get(o);if(!n){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(o),i=this._timeoutInfo.get(o);if(i&&s&&i.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(a){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),s(a);return}n(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),Mh(e))r(e);else r(ge.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,r){let o=this._resolveOutboundCodec(e.method);if(ro(t)){if(!CS(e.method))this._assertOutboundRequestInEra(o,e.method);return this._requestWithSchemaViaCodec(o,e,t,r)}this._assertOutboundRequestInEra(o,e.method);let n=LS(o,e.method);if(n===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(o,e,n,t)}_negotiatedWireCodec(){return Ft(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=uk(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Su(t)&&!e.hasRequestMethod(t))throw new ct(gt.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,r){let o=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r)}_requestWithSchemaViaCodec(e,t,r,o){let{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:a}=o??{},c=Date.now(),u,l;return new Promise((d,m)=>{let h=(R)=>{m(R)};if(!this._transport){h(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(R){h(R);return}if(o?.signal?.aborted){let R=o.signal.reason;throw R instanceof ct?R:new ct(gt.RequestTimeout,String(R))}let f=e.era===$n&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,v=this._requestMessageId++;l=v;let y={...t,jsonrpc:"2.0",id:v};if(o?.onprogress)this._progressHandlers.set(v,o.onprogress),y.params={...t.params,_meta:{...t.params?._meta,progressToken:v}};let g=this._envelopeOutbound(y),P=!1,w=(R)=>{if(P)return;if(this._progressHandlers.delete(v),f===void 0){if(t.method!=="initialize")this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:v,reason:String(R)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch((S)=>this._onerror(Error(`Failed to send cancellation: ${S}`)))}else f.abort();m(R instanceof ct?R:new ct(gt.RequestTimeout,String(R)))};this._responseHandlers.set(v,(R)=>{if(o?.signal?.aborted)return;if(P=!0,R instanceof Error)return m(R);let S;try{S=e.decodeResult(t.method,R.result)}catch(A){return m(A instanceof Error?A:Error(String(A)))}if(S.kind==="invalid")return m(S.error);if(S.kind==="input_required"){if(o?.allowInputRequired===!0)return d(hk(S));let A={codec:e,request:t,resultSchema:r,options:o,flowStartedAt:c,retry:(H,j)=>this._requestWithSchemaViaCodec(e,H===void 0?{method:t.method}:{method:t.method,params:H},r,j)};return d(this._resolveNonCompleteResult(S,A))}let E=S.result;Rr(r,E).then((A)=>{if(A.success)d(A.data);else m(new ct(gt.InvalidResult,`Invalid result for ${t.method}: ${A.error}`))},m)}),u=()=>w(o?.signal?.reason),o?.signal?.addEventListener("abort",u,{once:!0});let x=o?.timeout??lk,O=()=>w(new ct(gt.RequestTimeout,"Request timed out",{timeout:x}));this._setupTimeout(v,x,o?.maxTotalTimeout,O,o?.resetTimeoutOnProgress??!1),this._transport.send(g,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:a,requestSignal:f?.signal}).catch((R)=>{this._progressHandlers.delete(v),m(R)})}).finally(()=>{if(u)o?.signal?.removeEventListener("abort",u);if(l!==void 0)this._responseHandlers.delete(l),this._cleanupTimeout(l)})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new ct(gt.NotConnected,"Not connected");if(bu(t.method)&&!e.hasNotificationMethod(t.method))throw new ct(gt.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let o=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&r?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;this._transport?.send(o,r).catch((n)=>this._onerror(n))});return}await this._transport.send(o,r)}setRequestHandler(e,t,r){this.assertRequestHandlerCapability(e);let o;if(typeof t==="function"){if(!Su(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);o=(n,s)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason==="not-in-era")a=i.validateInputRequest(e,n);if(!a.ok){if(a.reason==="not-in-era")throw new ge(pe.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(a.message)}return Promise.resolve(t(a.value,s))}}else if(r)o=async(n,s)=>{let i=await Rr(t.params,{...n.params});if(!i.success)throw new ge(pe.InvalidParams,`Invalid params for ${e}: ${i.error}`);return r(i.data,s)};else throw TypeError("setRequestHandler: handler is required");if(typeof t==="function")this._customSchemaRequestMethods.delete(e);else this._customSchemaRequestMethods.add(e);this._requestHandlers.set(e,this._wrapHandler(e,o))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e),this._customSchemaRequestMethods.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,r){if(typeof t==="function"){if(!bu(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(o,n)=>{let s=n.validateNotification(e,o);if(!s.ok){if(s.reason==="not-in-era")throw new ge(pe.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(s.message)}return Promise.resolve(t(s.value))});return}if(!r)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async(o)=>{let n=await Rr(t.params,{...o.params});if(!n.success)throw new ge(pe.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await r(n.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Sn(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function xb(e,t){let r={...e};for(let o in t){let n=o,s=t[n];if(s===void 0)continue;let i=r[n];r[n]=Sn(i)&&Sn(s)?{...i,...s}:s}return r}function DS(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function fk(e){let t={},r=[];if(!DS(e))return{accepted:t,droppedKeys:r};for(let[o,n]of Object.entries(e)){if(!DS(n)||"method"in n||"result"in n){r.push(o);continue}t[o]=n}return{accepted:t,droppedKeys:r}}function hk(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}/*!
|
|
115
|
+
* content-type
|
|
116
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
117
|
+
* MIT Licensed
|
|
118
|
+
*/var gk=B((e)=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/\\([\u000b\u0020-\u00ff])/g,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=n;function n(a){if(!a)throw TypeError("argument string is required");var c=typeof a==="object"?s(a):a;if(typeof c!=="string")throw TypeError("argument string is required to be a string");var u=c.indexOf(";"),l=u!==-1?c.slice(0,u).trim():c.trim();if(!o.test(l))throw TypeError("invalid media type");var d=new i(l.toLowerCase());if(u!==-1){var m,h,f;t.lastIndex=u;while(h=t.exec(c)){if(h.index!==u)throw TypeError("invalid parameter format");if(u+=h[0].length,m=h[1].toLowerCase(),f=h[2],f.charCodeAt(0)===34){if(f=f.slice(1,-1),f.indexOf("\\")!==-1)f=f.replace(r,"$1")}d.parameters[m]=f}if(u!==c.length)throw TypeError("invalid parameter format")}return d}function s(a){var c;if(typeof a.getHeader==="function")c=a.getHeader("content-type");else if(typeof a.headers==="object")c=a.headers&&a.headers["content-type"];if(typeof c!=="string")throw TypeError("content-type header is missing from object");return c}function i(a){this.parameters=Object.create(null),this.type=a}}),_k=Bn(gk(),1);function u5(e){if(!e)return;try{return _k.parse(e).type}catch{let t=(e.split(";",1)[0]??"").trim().toLowerCase();if(t===""||e.slice(t.length).includes(","))return;return t}}function p5(e){if(e==="application/json")return!0;return u5(e)==="application/json"}var yk=10485760,fee=class{_buffer;_maxBufferSize;constructor(e){this._maxBufferSize=e?.maxBufferSize??yk}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){while(this._buffer){let e=this._buffer.indexOf(`
|
|
119
|
+
`);if(e===-1)return null;let t=this._buffer.toString("utf8",0,e).replace(/\r$/,"");this._buffer=this._buffer.subarray(e+1);try{return vk(t)}catch(r){if(r instanceof SyntaxError)continue;throw r}}return null}clear(){this._buffer=void 0}};function vk(e){return ep.parse(JSON.parse(e))}function hee(e){return JSON.stringify(e)+`
|
|
120
|
+
`}var Sk=/^[A-Za-z0-9._-]{1,128}$/;function bk(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" "))t.push("Tool name contains spaces, which may cause parsing issues");if(e.includes(","))t.push("Tool name contains commas, which may cause parsing issues");if(e.startsWith("-")||e.endsWith("-"))t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if(e.startsWith(".")||e.endsWith("."))t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!Sk.test(e)){let r=[...e].filter((o)=>!/[A-Za-z0-9._-]/.test(o)).filter((o,n,s)=>s.indexOf(o)===n);return t.push(`Tool name contains invalid characters: ${r.map((o)=>`"${o}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function zk(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let r of t)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function Lu(e){let t=bk(e);return zk(e,t.warnings),t.isValid}var US=1e6,$u=1e6,FS=1e4,$k=1e6,Eb=class e{static isTemplate(t){return/\{[^}\s]+\}/.test(t)}static validateLength(t,r,o){if(t.length>r)throw Error(`${o} exceeds maximum length of ${r} characters (got ${t.length})`)}template;parts;get variableNames(){return this.parts.flatMap((t)=>typeof t==="string"?[]:t.names)}constructor(t){e.validateLength(t,US,"Template"),this.template=t,this.parts=this.parse(t)}toString(){return this.template}parse(t){let r=[],o="",n=0,s=0;while(n<t.length)if(t[n]==="{"){if(o)r.push(o),o="";let i=t.indexOf("}",n);if(i===-1)throw Error("Unclosed template expression");if(s++,s>FS)throw Error(`Template contains too many expressions (max ${FS})`);let a=t.slice(n+1,i),c=this.getOperator(a),u=a.includes("*"),l=this.getNames(a),d=l[0];for(let m of l)e.validateLength(m,$u,"Variable name");r.push({name:d,operator:c,names:l,exploded:u}),n=i+1}else o+=t[n],n++;if(o)r.push(o);return r}getOperator(t){return["+","#",".","/","?","&"].find((r)=>t.startsWith(r))||""}getNames(t){let r=this.getOperator(t);return t.slice(r.length).split(",").map((o)=>o.replace("*","").trim()).filter((o)=>o.length>0)}encodeValue(t,r){if(e.validateLength(t,$u,"Variable value"),r==="+"||r==="#")return encodeURI(t);return encodeURIComponent(t)}expandPart(t,r){if(t.operator==="?"||t.operator==="&"){let s=t.names.map((i)=>{let a=r[i];if(a===void 0)return"";return`${i}=${Array.isArray(a)?a.map((c)=>this.encodeValue(c,t.operator)).join(","):this.encodeValue(a.toString(),t.operator)}`}).filter((i)=>i.length>0);if(s.length===0)return"";return(t.operator==="?"?"?":"&")+s.join("&")}if(t.names.length>1){let s=t.names.map((i)=>r[i]).filter((i)=>i!==void 0);if(s.length===0)return"";return s.map((i)=>Array.isArray(i)?i[0]:i).join(",")}let o=r[t.name];if(o===void 0)return"";let n=(Array.isArray(o)?o:[o]).map((s)=>this.encodeValue(s,t.operator));switch(t.operator){case"":return n.join(",");case"+":return n.join(",");case"#":return"#"+n.join(",");case".":return"."+n.join(".");case"/":return"/"+n.join("/");default:return n.join(",")}}expand(t){let r="",o=!1;for(let n of this.parts){if(typeof n==="string"){r+=n;continue}let s=this.expandPart(n,t);if(!s)continue;if(r+=(n.operator==="?"||n.operator==="&")&&o?s.replace("?","&"):s,n.operator==="?"||n.operator==="&")o=!0}return r}escapeRegExp(t){return t.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}partToRegExp(t){let r=[];for(let s of t.names)e.validateLength(s,$u,"Variable name");if(t.operator==="?"||t.operator==="&"){for(let s=0;s<t.names.length;s++){let i=t.names[s],a=s===0?"\\"+t.operator:"&";r.push({pattern:a+this.escapeRegExp(i)+"=([^&]+)",name:i})}return r}let o,n=t.name;switch(t.operator){case"":o=t.exploded?"([^/,]+(?:,[^/,]+)*)":"([^/,]+)";break;case"+":case"#":o="(.+)";break;case".":o=String.raw`\.([^/,]+)`;break;case"/":o="/"+(t.exploded?"([^/,]+(?:,[^/,]+)*)":"([^/,]+)");break;default:o="([^/]+)"}return r.push({pattern:o,name:n}),r}match(t){e.validateLength(t,US,"URI");let r="^",o=[];for(let a of this.parts)if(typeof a==="string")r+=this.escapeRegExp(a);else{let c=this.partToRegExp(a);for(let{pattern:u,name:l}of c)r+=u,o.push({name:l,exploded:a.exploded})}r+="$",e.validateLength(r,$k,"Generated regex pattern");let n=new RegExp(r),s=t.match(n);if(!s)return null;let i={};for(let[a,c]of o.entries()){let{name:u,exploded:l}=c,d=s[a+1],m=u.replace("*","");i[m]=l&&d.includes(",")?d.split(","):d}return i}},gee=class e{_otherTransport;_messageQueue=[];_closed=!1;onclose;onerror;onmessage;sessionId;static createLinkedPair(){let t=new e,r=new e;return t._otherTransport=r,r._otherTransport=t,[t,r]}async start(){while(this._messageQueue.length>0){let t=this._messageQueue.shift();this.onmessage?.(t.message,t.extra)}}async close(){if(this._closed)return;this._closed=!0;let t=this._otherTransport;this._otherTransport=void 0;try{await t?.close()}finally{this.onclose?.()}}async send(t,r){if(!this._otherTransport)throw new ct(gt.NotConnected,"Not connected");if(this._otherTransport.onmessage)this._otherTransport.onmessage(t,{authInfo:r?.authInfo});else this._otherTransport._messageQueue.push({message:t,extra:{authInfo:r?.authInfo}})}};function Rk(e){return typeof e==="object"&&e!==null&&"_zod"in e}function wk(e){return typeof e==="object"&&e!==null&&!("_zod"in e)&&"_def"in e&&typeof e._def?.typeName==="string"}function Pk(e){if(typeof e!=="object"||e===null)return!1;if(ro(e))return!1;let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return!1;return Object.values(e).every((r)=>Rk(r))}function wi(e){if(e===void 0)return;if(Pk(e))return Z(e);if(typeof e==="object"&&e!==null&&!ro(e)&&Object.values(e).some((t)=>wk(t)))throw TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!ro(e))throw TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return e}var Pi=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var r=class extends t{constructor(g){super();if(!e.IDENTIFIER.test(g))throw Error("CodeGen: name must be a valid identifier");this.str=g}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=r;var o=class extends t{constructor(g){super();this._items=typeof g==="string"?[g]:g}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let g=this._items[0];return g===""||g==='""'}get str(){var g;return(g=this._str)!==null&&g!==void 0?g:this._str=this._items.reduce((P,w)=>`${P}${w}`,"")}get names(){var g;return(g=this._names)!==null&&g!==void 0?g:this._names=this._items.reduce((P,w)=>{if(w instanceof r)P[w.str]=(P[w.str]||0)+1;return P},{})}};e._Code=o,e.nil=new o("");function n(g,...P){let w=[g[0]],x=0;while(x<P.length)a(w,P[x]),w.push(g[++x]);return new o(w)}e._=n;let s=new o("+");function i(g,...P){let w=[h(g[0])],x=0;while(x<P.length)w.push(s),a(w,P[x]),w.push(s,h(g[++x]));return c(w),new o(w)}e.str=i;function a(g,P){if(P instanceof o)g.push(...P._items);else if(P instanceof r)g.push(P);else g.push(d(P))}e.addCodeArg=a;function c(g){let P=1;while(P<g.length-1){if(g[P]===s){let w=u(g[P-1],g[P+1]);if(w!==void 0){g.splice(P-1,3,w);continue}g[P++]="+"}P++}}function u(g,P){if(P==='""')return g;if(g==='""')return P;if(typeof g=="string"){if(P instanceof r||g[g.length-1]!=='"')return;if(typeof P!="string")return`${g.slice(0,-1)}${P}"`;if(P[0]==='"')return g.slice(0,-1)+P.slice(1);return}if(typeof P=="string"&&P[0]==='"'&&!(g instanceof r))return`"${g}${P.slice(1)}`}function l(g,P){return P.emptyStr()?g:g.emptyStr()?P:i`${g}${P}`}e.strConcat=l;function d(g){return typeof g=="number"||typeof g=="boolean"||g===null?g:h(Array.isArray(g)?g.join(","):g)}function m(g){return new o(h(g))}e.stringify=m;function h(g){return JSON.stringify(g).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=h;function f(g){return typeof g=="string"&&e.IDENTIFIER.test(g)?new o(`.${g}`):n`[${g}]`}e.getProperty=f;function v(g){if(typeof g=="string"&&e.IDENTIFIER.test(g))return new o(`${g}`);throw Error(`CodeGen: invalid export name: ${g}, use explicit $id name mapping`)}e.getEsmExportName=v;function y(g){return new o(g.toString())}e.regexpCode=y}),Tb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=Pi();var r=class extends Error{constructor(c){super(`CodeGen: "code" for ${c} not defined`);this.value=c.value}},o;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(o||(e.UsedValueState=o={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};var n=class{constructor({prefixes:c,parent:u}={}){this._names={},this._prefixes=c,this._parent=u}toName(c){return c instanceof t.Name?c:this.name(c)}name(c){return new t.Name(this._newName(c))}_newName(c){let u=this._names[c]||this._nameGroup(c);return`${c}${u.index++}`}_nameGroup(c){var u,l;if(((l=(u=this._parent)===null||u===void 0?void 0:u._prefixes)===null||l===void 0?void 0:l.has(c))||this._prefixes&&!this._prefixes.has(c))throw Error(`CodeGen: prefix "${c}" is not allowed in this scope`);return this._names[c]={prefix:c,index:0}}};e.Scope=n;var s=class extends t.Name{constructor(c,u){super(u);this.prefix=c}setValue(c,{property:u,itemIndex:l}){this.value=c,this.scopePath=t._`.${new t.Name(u)}[${l}]`}};e.ValueScopeName=s;let i=t._`\n`;var a=class extends n{constructor(c){super(c);this._values={},this._scope=c.scope,this.opts={...c,_n:c.lines?i:t.nil}}get(){return this._scope}name(c){return new s(c,this._newName(c))}value(c,u){var l;if(u.ref===void 0)throw Error("CodeGen: ref must be passed in value");let d=this.toName(c),{prefix:m}=d,h=(l=u.key)!==null&&l!==void 0?l:u.ref,f=this._values[m];if(f){let g=f.get(h);if(g)return g}else f=this._values[m]=new Map;f.set(h,d);let v=this._scope[m]||(this._scope[m]=[]),y=v.length;return v[y]=u.ref,d.setValue(u,{property:m,itemIndex:y}),d}getValue(c,u){let l=this._values[c];if(!l)return;return l.get(u)}scopeRefs(c,u=this._values){return this._reduceValues(u,(l)=>{if(l.scopePath===void 0)throw Error(`CodeGen: name "${l}" has no value`);return t._`${c}${l.scopePath}`})}scopeCode(c=this._values,u,l){return this._reduceValues(c,(d)=>{if(d.value===void 0)throw Error(`CodeGen: name "${d}" has no value`);return d.value.code},u,l)}_reduceValues(c,u,l={},d){let m=t.nil;for(let h in c){let f=c[h];if(!f)continue;let v=l[h]=l[h]||new Map;f.forEach((y)=>{if(v.has(y))return;v.set(y,o.Started);let g=u(y);if(g){let P=this.opts.es5?e.varKinds.var:e.varKinds.const;m=t._`${m}${P} ${y} = ${g};${this.opts._n}`}else if(g=d===null||d===void 0?void 0:d(y))m=t._`${m}${g}${this.opts._n}`;else throw new r(y);v.set(y,o.Completed)})}return m}};e.ValueScope=a}),le=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;let t=Pi(),r=Tb();var o=Pi();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var n=Tb();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return n.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return n.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return n.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return n.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};var s=class{optimizeNodes(){return this}optimizeNames(p,_){return this}},i=class extends s{constructor(p,_,z){super();this.varKind=p,this.name=_,this.rhs=z}render({es5:p,_n:_}){let z=p?r.varKinds.var:this.varKind,I=this.rhs===void 0?"":` = ${this.rhs}`;return`${z} ${this.name}${I};`+_}optimizeNames(p,_){if(!p[this.name.str])return;if(this.rhs)this.rhs=Y(this.rhs,p,_);return this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},a=class extends s{constructor(p,_,z){super();this.lhs=p,this.rhs=_,this.sideEffects=z}render({_n:p}){return`${this.lhs} = ${this.rhs};`+p}optimizeNames(p,_){if(this.lhs instanceof t.Name&&!p[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Y(this.rhs,p,_),this}get names(){return W(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends a{constructor(p,_,z,I){super(p,z,I);this.op=_}render({_n:p}){return`${this.lhs} ${this.op}= ${this.rhs};`+p}},u=class extends s{constructor(p){super();this.label=p,this.names={}}render({_n:p}){return`${this.label}:`+p}},l=class extends s{constructor(p){super();this.label=p,this.names={}}render({_n:p}){return`break${this.label?` ${this.label}`:""};`+p}},d=class extends s{constructor(p){super();this.error=p}render({_n:p}){return`throw ${this.error};`+p}get names(){return this.error.names}},m=class extends s{constructor(p){super();this.code=p}render({_n:p}){return`${this.code};`+p}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(p,_){return this.code=Y(this.code,p,_),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},h=class extends s{constructor(p=[]){super();this.nodes=p}render(p){return this.nodes.reduce((_,z)=>_+z.render(p),"")}optimizeNodes(){let{nodes:p}=this,_=p.length;while(_--){let z=p[_].optimizeNodes();if(Array.isArray(z))p.splice(_,1,...z);else if(z)p[_]=z;else p.splice(_,1)}return p.length>0?this:void 0}optimizeNames(p,_){let{nodes:z}=this,I=z.length;while(I--){let U=z[I];if(U.optimizeNames(p,_))continue;ae(p,U.names),z.splice(I,1)}return z.length>0?this:void 0}get names(){return this.nodes.reduce((p,_)=>V(p,_.names),{})}},f=class extends h{render(p){return"{"+p._n+super.render(p)+"}"+p._n}},v=class extends h{},y=class extends f{};y.kind="else";var g=class p extends f{constructor(_,z){super(z);this.condition=_}render(_){let z=`if(${this.condition})`+super.render(_);if(this.else)z+="else "+this.else.render(_);return z}optimizeNodes(){super.optimizeNodes();let _=this.condition;if(_===!0)return this.nodes;let z=this.else;if(z){let I=z.optimizeNodes();z=this.else=Array.isArray(I)?new y(I):I}if(z){if(_===!1)return z instanceof p?z:z.nodes;if(this.nodes.length)return this;return new p(we(_),z instanceof p?[z]:z.nodes)}if(_===!1||!this.nodes.length)return;return this}optimizeNames(_,z){var I;if(this.else=(I=this.else)===null||I===void 0?void 0:I.optimizeNames(_,z),!(super.optimizeNames(_,z)||this.else))return;return this.condition=Y(this.condition,_,z),this}get names(){let _=super.names;if(W(_,this.condition),this.else)V(_,this.else.names);return _}};g.kind="if";var P=class extends f{};P.kind="for";var w=class extends P{constructor(p){super();this.iteration=p}render(p){return`for(${this.iteration})`+super.render(p)}optimizeNames(p,_){if(!super.optimizeNames(p,_))return;return this.iteration=Y(this.iteration,p,_),this}get names(){return V(super.names,this.iteration.names)}},x=class extends P{constructor(p,_,z,I){super();this.varKind=p,this.name=_,this.from=z,this.to=I}render(p){let _=p.es5?r.varKinds.var:this.varKind,{name:z,from:I,to:U}=this;return`for(${_} ${z}=${I}; ${z}<${U}; ${z}++)`+super.render(p)}get names(){return W(W(super.names,this.from),this.to)}},O=class extends P{constructor(p,_,z,I){super();this.loop=p,this.varKind=_,this.name=z,this.iterable=I}render(p){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(p)}optimizeNames(p,_){if(!super.optimizeNames(p,_))return;return this.iterable=Y(this.iterable,p,_),this}get names(){return V(super.names,this.iterable.names)}},R=class extends f{constructor(p,_,z){super();this.name=p,this.args=_,this.async=z}render(p){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(p)}};R.kind="func";var S=class extends h{render(p){return"return "+super.render(p)}};S.kind="return";var E=class extends f{render(p){let _="try"+super.render(p);if(this.catch)_+=this.catch.render(p);if(this.finally)_+=this.finally.render(p);return _}optimizeNodes(){var p,_;return super.optimizeNodes(),(p=this.catch)===null||p===void 0||p.optimizeNodes(),(_=this.finally)===null||_===void 0||_.optimizeNodes(),this}optimizeNames(p,_){var z,I;return super.optimizeNames(p,_),(z=this.catch)===null||z===void 0||z.optimizeNames(p,_),(I=this.finally)===null||I===void 0||I.optimizeNames(p,_),this}get names(){let p=super.names;if(this.catch)V(p,this.catch.names);if(this.finally)V(p,this.finally.names);return p}},A=class extends f{constructor(p){super();this.error=p}render(p){return`catch(${this.error})`+super.render(p)}};A.kind="catch";var H=class extends f{render(p){return"finally"+super.render(p)}};H.kind="finally";var j=class{constructor(p,_={}){this._values={},this._blockStarts=[],this._constants={},this.opts={..._,_n:_.lines?`
|
|
121
|
+
`:""},this._extScope=p,this._scope=new r.Scope({parent:p}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name(p){return this._scope.name(p)}scopeName(p){return this._extScope.name(p)}scopeValue(p,_){let z=this._extScope.value(p,_);return(this._values[z.prefix]||(this._values[z.prefix]=new Set)).add(z),z}getScopeValue(p,_){return this._extScope.getValue(p,_)}scopeRefs(p){return this._extScope.scopeRefs(p,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(p,_,z,I){let U=this._scope.toName(_);if(z!==void 0&&I)this._constants[U.str]=z;return this._leafNode(new i(p,U,z)),U}const(p,_,z){return this._def(r.varKinds.const,p,_,z)}let(p,_,z){return this._def(r.varKinds.let,p,_,z)}var(p,_,z){return this._def(r.varKinds.var,p,_,z)}assign(p,_,z){return this._leafNode(new a(p,_,z))}add(p,_){return this._leafNode(new c(p,e.operators.ADD,_))}code(p){if(typeof p=="function")p();else if(p!==t.nil)this._leafNode(new m(p));return this}object(...p){let _=["{"];for(let[z,I]of p){if(_.length>1)_.push(",");if(_.push(z),z!==I||this.opts.es5)_.push(":"),(0,t.addCodeArg)(_,I)}return _.push("}"),new t._Code(_)}if(p,_,z){if(this._blockNode(new g(p)),_&&z)this.code(_).else().code(z).endIf();else if(_)this.code(_).endIf();else if(z)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(p){return this._elseNode(new g(p))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(g,y)}_for(p,_){if(this._blockNode(p),_)this.code(_).endFor();return this}for(p,_){return this._for(new w(p),_)}forRange(p,_,z,I,U=this.opts.es5?r.varKinds.var:r.varKinds.let){let G=this._scope.toName(p);return this._for(new x(U,G,_,z),()=>I(G))}forOf(p,_,z,I=r.varKinds.const){let U=this._scope.toName(p);if(this.opts.es5){let G=_ instanceof t.Name?_:this.var("_arr",_);return this.forRange("_i",0,t._`${G}.length`,(K)=>{this.var(U,t._`${G}[${K}]`),z(U)})}return this._for(new O("of",I,U,_),()=>z(U))}forIn(p,_,z,I=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(p,t._`Object.keys(${_})`,z);let U=this._scope.toName(p);return this._for(new O("in",I,U,_),()=>z(U))}endFor(){return this._endBlockNode(P)}label(p){return this._leafNode(new u(p))}break(p){return this._leafNode(new l(p))}return(p){let _=new S;if(this._blockNode(_),this.code(p),_.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(p,_,z){if(!_&&!z)throw Error('CodeGen: "try" without "catch" and "finally"');let I=new E;if(this._blockNode(I),this.code(p),_){let U=this.name("e");this._currNode=I.catch=new A(U),_(U)}if(z)this._currNode=I.finally=new H,this.code(z);return this._endBlockNode(A,H)}throw(p){return this._leafNode(new d(p))}block(p,_){if(this._blockStarts.push(this._nodes.length),p)this.code(p).endBlock(_);return this}endBlock(p){let _=this._blockStarts.pop();if(_===void 0)throw Error("CodeGen: not in self-balancing block");let z=this._nodes.length-_;if(z<0||p!==void 0&&z!==p)throw Error(`CodeGen: wrong number of nodes: ${z} vs ${p} expected`);return this._nodes.length=_,this}func(p,_=t.nil,z,I){if(this._blockNode(new R(p,_,z)),I)this.code(I).endFunc();return this}endFunc(){return this._endBlockNode(R)}optimize(p=1){while(p-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(p){return this._currNode.nodes.push(p),this}_blockNode(p){this._currNode.nodes.push(p),this._nodes.push(p)}_endBlockNode(p,_){let z=this._currNode;if(z instanceof p||_&&z instanceof _)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${_?`${p.kind}/${_.kind}`:p.kind}"`)}_elseNode(p){let _=this._currNode;if(!(_ instanceof g))throw Error('CodeGen: "else" without "if"');return this._currNode=_.else=p,this}get _root(){return this._nodes[0]}get _currNode(){let p=this._nodes;return p[p.length-1]}set _currNode(p){let _=this._nodes;_[_.length-1]=p}};e.CodeGen=j;function V(p,_){for(let z in _)p[z]=(p[z]||0)+(_[z]||0);return p}function W(p,_){return _ instanceof t._CodeOrName?V(p,_.names):p}function Y(p,_,z){if(p instanceof t.Name)return I(p);if(!U(p))return p;return new t._Code(p._items.reduce((G,K)=>{if(K instanceof t.Name)K=I(K);if(K instanceof t._Code)G.push(...K._items);else G.push(K);return G},[]));function I(G){let K=z[G.str];if(K===void 0||_[G.str]!==1)return G;return delete _[G.str],K}function U(G){return G instanceof t._Code&&G._items.some((K)=>K instanceof t.Name&&_[K.str]===1&&z[K.str]!==void 0)}}function ae(p,_){for(let z in _)p[z]=(p[z]||0)-(_[z]||0)}function we(p){return typeof p=="boolean"||typeof p=="number"||p===null?!p:t._`!${b(p)}`}e.not=we;let $e=M(e.operators.AND);function Ce(...p){return p.reduce($e)}e.and=Ce;let de=M(e.operators.OR);function N(...p){return p.reduce(de)}e.or=N;function M(p){return(_,z)=>_===t.nil?z:z===t.nil?_:t._`${b(_)} ${p} ${b(z)}`}function b(p){return p instanceof t.Name?p:t._`(${p})`}}),ye=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;let t=le(),r=Pi();function o(R){let S={};for(let E of R)S[E]=!0;return S}e.toHash=o;function n(R,S){if(typeof S=="boolean")return S;if(Object.keys(S).length===0)return!0;return s(R,S),!i(S,R.self.RULES.all)}e.alwaysValidSchema=n;function s(R,S=R.schema){let{opts:E,self:A}=R;if(!E.strictSchema)return;if(typeof S==="boolean")return;let H=A.RULES.keywords;for(let j in S)if(!H[j])O(R,`unknown keyword: "${j}"`)}e.checkUnknownRules=s;function i(R,S){if(typeof R=="boolean")return!R;for(let E in R)if(S[E])return!0;return!1}e.schemaHasRules=i;function a(R,S){if(typeof R=="boolean")return!R;for(let E in R)if(E!=="$ref"&&S.all[E])return!0;return!1}e.schemaHasRulesButRef=a;function c({topSchemaRef:R,schemaPath:S},E,A,H){if(!H){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return t._`${E}`}return t._`${R}${S}${(0,t.getProperty)(A)}`}e.schemaRefOrVal=c;function u(R){return m(decodeURIComponent(R))}e.unescapeFragment=u;function l(R){return encodeURIComponent(d(R))}e.escapeFragment=l;function d(R){if(typeof R=="number")return`${R}`;return R.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=d;function m(R){return R.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=m;function h(R,S){if(Array.isArray(R))for(let E of R)S(E);else S(R)}e.eachItem=h;function f({mergeNames:R,mergeToName:S,mergeValues:E,resultToName:A}){return(H,j,V,W)=>{let Y=V===void 0?j:V instanceof t.Name?(j instanceof t.Name?R(H,j,V):S(H,j,V),V):j instanceof t.Name?(S(H,V,j),j):E(j,V);return W===t.Name&&!(Y instanceof t.Name)?A(H,Y):Y}}e.mergeEvaluated={props:f({mergeNames:(R,S,E)=>R.if(t._`${E} !== true && ${S} !== undefined`,()=>{R.if(t._`${S} === true`,()=>R.assign(E,!0),()=>R.assign(E,t._`${E} || {}`).code(t._`Object.assign(${E}, ${S})`))}),mergeToName:(R,S,E)=>R.if(t._`${E} !== true`,()=>{if(S===!0)R.assign(E,!0);else R.assign(E,t._`${E} || {}`),y(R,E,S)}),mergeValues:(R,S)=>R===!0?!0:{...R,...S},resultToName:v}),items:f({mergeNames:(R,S,E)=>R.if(t._`${E} !== true && ${S} !== undefined`,()=>R.assign(E,t._`${S} === true ? true : ${E} > ${S} ? ${E} : ${S}`)),mergeToName:(R,S,E)=>R.if(t._`${E} !== true`,()=>R.assign(E,S===!0?!0:t._`${E} > ${S} ? ${E} : ${S}`)),mergeValues:(R,S)=>R===!0?!0:Math.max(R,S),resultToName:(R,S)=>R.var("items",S)})};function v(R,S){if(S===!0)return R.var("props",!0);let E=R.var("props",t._`{}`);if(S!==void 0)y(R,E,S);return E}e.evaluatedPropsToName=v;function y(R,S,E){Object.keys(E).forEach((A)=>R.assign(t._`${S}${(0,t.getProperty)(A)}`,!0))}e.setEvaluated=y;let g={};function P(R,S){return R.scopeValue("func",{ref:S,code:g[S.code]||(g[S.code]=new r._Code(S.code))})}e.useFunc=P;var w;(function(R){R[R.Num=0]="Num",R[R.Str=1]="Str"})(w||(e.Type=w={}));function x(R,S,E){if(R instanceof t.Name){let A=S===w.Num;return E?A?t._`"[" + ${R} + "]"`:t._`"['" + ${R} + "']"`:A?t._`"/" + ${R}`:t._`"/" + ${R}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0,t.getProperty)(R).toString():"/"+d(R)}e.getErrorPath=x;function O(R,S,E=R.opts.strictSchema){if(!E)return;if(S=`strict mode: ${S}`,E===!0)throw Error(S);R.self.logger.warn(S)}e.checkStrictMode=O}),kt=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};e.default=r}),xi=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=le(),r=ye(),o=kt();e.keywordError={message:({keyword:y})=>t.str`must pass "${y}" keyword validation`},e.keyword$DataError={message:({keyword:y,schemaType:g})=>g?t.str`"${y}" keyword must be ${g} ($data)`:t.str`"${y}" keyword is invalid ($data)`};function n(y,g=e.keywordError,P,w){let{it:x}=y,{gen:O,compositeRule:R,allErrors:S}=x,E=d(y,g,P);if(w!==null&&w!==void 0?w:R||S)c(O,E);else u(x,t._`[${E}]`)}e.reportError=n;function s(y,g=e.keywordError,P){let{it:w}=y,{gen:x,compositeRule:O,allErrors:R}=w;if(c(x,d(y,g,P)),!(O||R))u(w,o.default.vErrors)}e.reportExtraError=s;function i(y,g){y.assign(o.default.errors,g),y.if(t._`${o.default.vErrors} !== null`,()=>y.if(g,()=>y.assign(t._`${o.default.vErrors}.length`,g),()=>y.assign(o.default.vErrors,null)))}e.resetErrorsCount=i;function a({gen:y,keyword:g,schemaValue:P,data:w,errsCount:x,it:O}){if(x===void 0)throw Error("ajv implementation error");let R=y.name("err");y.forRange("i",x,o.default.errors,(S)=>{if(y.const(R,t._`${o.default.vErrors}[${S}]`),y.if(t._`${R}.instancePath === undefined`,()=>y.assign(t._`${R}.instancePath`,(0,t.strConcat)(o.default.instancePath,O.errorPath))),y.assign(t._`${R}.schemaPath`,t.str`${O.errSchemaPath}/${g}`),O.opts.verbose)y.assign(t._`${R}.schema`,P),y.assign(t._`${R}.data`,w)})}e.extendErrors=a;function c(y,g){let P=y.const("err",g);y.if(t._`${o.default.vErrors} === null`,()=>y.assign(o.default.vErrors,t._`[${P}]`),t._`${o.default.vErrors}.push(${P})`),y.code(t._`${o.default.errors}++`)}function u(y,g){let{gen:P,validateName:w,schemaEnv:x}=y;if(x.$async)P.throw(t._`new ${y.ValidationError}(${g})`);else P.assign(t._`${w}.errors`,g),P.return(!1)}let l={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function d(y,g,P){let{createErrors:w}=y.it;if(w===!1)return t._`{}`;return m(y,g,P)}function m(y,g,P={}){let{gen:w,it:x}=y,O=[h(x,P),f(y,P)];return v(y,g,O),w.object(...O)}function h({errorPath:y},{instancePath:g}){let P=g?t.str`${y}${(0,r.getErrorPath)(g,r.Type.Str)}`:y;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,P)]}function f({keyword:y,it:{errSchemaPath:g}},{schemaPath:P,parentSchema:w}){let x=w?g:t.str`${g}/${y}`;if(P)x=t.str`${x}${(0,r.getErrorPath)(P,r.Type.Str)}`;return[l.schemaPath,x]}function v(y,{params:g,message:P},w){let{keyword:x,data:O,schemaValue:R,it:S}=y,{opts:E,propertyName:A,topSchemaRef:H,schemaPath:j}=S;if(w.push([l.keyword,x],[l.params,typeof g=="function"?g(y):g||t._`{}`]),E.messages)w.push([l.message,typeof P=="function"?P(y):P]);if(E.verbose)w.push([l.schema,R],[l.parentSchema,t._`${H}${j}`],[o.default.data,O]);if(A)w.push([l.propertyName,A])}}),kk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=xi(),r=le(),o=kt(),n={message:"boolean schema is false"};function s(c){let{gen:u,schema:l,validateName:d}=c;if(l===!1)a(c,!1);else if(typeof l=="object"&&l.$async===!0)u.return(o.default.data);else u.assign(r._`${d}.errors`,null),u.return(!0)}e.topBoolOrEmptySchema=s;function i(c,u){let{gen:l,schema:d}=c;if(d===!1)l.var(u,!1),a(c);else l.var(u,!0)}e.boolOrEmptySchema=i;function a(c,u){let{gen:l,data:d}=c,m={gen:l,keyword:"false schema",data:d,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:c};(0,t.reportError)(m,n,void 0,u)}}),Ob=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;let t=new Set(["string","number","integer","boolean","null","object","array"]);function r(n){return typeof n=="string"&&t.has(n)}e.isJSONType=r;function o(){let n={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...n,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},n.number,n.string,n.array,n.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=o}),Cb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:n,self:s},i){let a=s.RULES.types[i];return a&&a!==!0&&r(n,a)}e.schemaHasRulesForType=t;function r(n,s){return s.rules.some((i)=>o(n,i))}e.shouldUseGroup=r;function o(n,s){var i;return n[s.keyword]!==void 0||((i=s.definition.implements)===null||i===void 0?void 0:i.some((a)=>n[a]!==void 0))}e.shouldUseRule=o}),ki=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;let t=Ob(),r=Cb(),o=xi(),n=le(),s=ye();var i;(function(w){w[w.Correct=0]="Correct",w[w.Wrong=1]="Wrong"})(i||(e.DataType=i={}));function a(w){let x=c(w.type);if(x.includes("null")){if(w.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!x.length&&w.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(w.nullable===!0)x.push("null")}return x}e.getSchemaTypes=a;function c(w){let x=Array.isArray(w)?w:w?[w]:[];if(x.every(t.isJSONType))return x;throw Error("type must be JSONType or JSONType[]: "+x.join(","))}e.getJSONTypes=c;function u(w,x){let{gen:O,data:R,opts:S}=w,E=d(x,S.coerceTypes),A=x.length>0&&!(E.length===0&&x.length===1&&(0,r.schemaHasRulesForType)(w,x[0]));if(A){let H=v(x,R,S.strictNumbers,i.Wrong);O.if(H,()=>{if(E.length)m(w,x,E);else g(w)})}return A}e.coerceAndCheckDataType=u;let l=new Set(["string","number","integer","boolean","null"]);function d(w,x){return x?w.filter((O)=>l.has(O)||x==="array"&&O==="array"):[]}function m(w,x,O){let{gen:R,data:S,opts:E}=w,A=R.let("dataType",n._`typeof ${S}`),H=R.let("coerced",n._`undefined`);if(E.coerceTypes==="array")R.if(n._`${A} == 'object' && Array.isArray(${S}) && ${S}.length == 1`,()=>R.assign(S,n._`${S}[0]`).assign(A,n._`typeof ${S}`).if(v(x,S,E.strictNumbers),()=>R.assign(H,S)));R.if(n._`${H} !== undefined`);for(let V of O)if(l.has(V)||V==="array"&&E.coerceTypes==="array")j(V);R.else(),g(w),R.endIf(),R.if(n._`${H} !== undefined`,()=>{R.assign(S,H),h(w,H)});function j(V){switch(V){case"string":R.elseIf(n._`${A} == "number" || ${A} == "boolean"`).assign(H,n._`"" + ${S}`).elseIf(n._`${S} === null`).assign(H,n._`""`);return;case"number":R.elseIf(n._`${A} == "boolean" || ${S} === null
|
|
122
|
+
|| (${A} == "string" && ${S} && ${S} == +${S})`).assign(H,n._`+${S}`);return;case"integer":R.elseIf(n._`${A} === "boolean" || ${S} === null
|
|
123
|
+
|| (${A} === "string" && ${S} && ${S} == +${S} && !(${S} % 1))`).assign(H,n._`+${S}`);return;case"boolean":R.elseIf(n._`${S} === "false" || ${S} === 0 || ${S} === null`).assign(H,!1).elseIf(n._`${S} === "true" || ${S} === 1`).assign(H,!0);return;case"null":R.elseIf(n._`${S} === "" || ${S} === 0 || ${S} === false`),R.assign(H,null);return;case"array":R.elseIf(n._`${A} === "string" || ${A} === "number"
|
|
124
|
+
|| ${A} === "boolean" || ${S} === null`).assign(H,n._`[${S}]`)}}}function h({gen:w,parentData:x,parentDataProperty:O},R){w.if(n._`${x} !== undefined`,()=>w.assign(n._`${x}[${O}]`,R))}function f(w,x,O,R=i.Correct){let S=R===i.Correct?n.operators.EQ:n.operators.NEQ,E;switch(w){case"null":return n._`${x} ${S} null`;case"array":E=n._`Array.isArray(${x})`;break;case"object":E=n._`${x} && typeof ${x} == "object" && !Array.isArray(${x})`;break;case"integer":E=A(n._`!(${x} % 1) && !isNaN(${x})`);break;case"number":E=A();break;default:return n._`typeof ${x} ${S} ${w}`}return R===i.Correct?E:(0,n.not)(E);function A(H=n.nil){return(0,n.and)(n._`typeof ${x} == "number"`,H,O?n._`isFinite(${x})`:n.nil)}}e.checkDataType=f;function v(w,x,O,R){if(w.length===1)return f(w[0],x,O,R);let S,E=(0,s.toHash)(w);if(E.array&&E.object){let A=n._`typeof ${x} != "object"`;S=E.null?A:n._`!${x} || ${A}`,delete E.null,delete E.array,delete E.object}else S=n.nil;if(E.number)delete E.integer;for(let A in E)S=(0,n.and)(S,f(A,x,O,R));return S}e.checkDataTypes=v;let y={message:({schema:w})=>`must be ${w}`,params:({schema:w,schemaValue:x})=>typeof w=="string"?n._`{type: ${w}}`:n._`{type: ${x}}`};function g(w){let x=P(w);(0,o.reportError)(x,y)}e.reportTypeError=g;function P(w){let{gen:x,data:O,schema:R}=w,S=(0,s.schemaRefOrVal)(w,R,"type");return{gen:x,keyword:"type",data:O,schema:R.type,schemaCode:S,schemaValue:S,parentSchema:R,params:{},it:w}}}),xk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=le(),r=ye();function o(s,i){let{properties:a,items:c}=s.schema;if(i==="object"&&a)for(let u in a)n(s,u,a[u].default);else if(i==="array"&&Array.isArray(c))c.forEach((u,l)=>n(s,l,u.default))}e.assignDefaults=o;function n(s,i,a){let{gen:c,compositeRule:u,data:l,opts:d}=s;if(a===void 0)return;let m=t._`${l}${(0,t.getProperty)(i)}`;if(u){(0,r.checkStrictMode)(s,`default is ignored for: ${m}`);return}let h=t._`${m} === undefined`;if(d.useDefaults==="empty")h=t._`${h} || ${m} === null || ${m} === ""`;c.if(h,t._`${m} = ${(0,t.stringify)(a)}`)}}),xt=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;let t=le(),r=ye(),o=kt(),n=ye();function s(w,x){let{gen:O,data:R,it:S}=w;O.if(d(O,R,x,S.opts.ownProperties),()=>{w.setParams({missingProperty:t._`${x}`},!0),w.error()})}e.checkReportMissingProp=s;function i({gen:w,data:x,it:{opts:O}},R,S){return(0,t.or)(...R.map((E)=>(0,t.and)(d(w,x,E,O.ownProperties),t._`${S} = ${E}`)))}e.checkMissingProp=i;function a(w,x){w.setParams({missingProperty:x},!0),w.error()}e.reportMissingProp=a;function c(w){return w.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:t._`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function u(w,x,O){return t._`${c(w)}.call(${x}, ${O})`}e.isOwnProperty=u;function l(w,x,O,R){let S=t._`${x}${(0,t.getProperty)(O)} !== undefined`;return R?t._`${S} && ${u(w,x,O)}`:S}e.propertyInData=l;function d(w,x,O,R){let S=t._`${x}${(0,t.getProperty)(O)} === undefined`;return R?(0,t.or)(S,(0,t.not)(u(w,x,O))):S}e.noPropertyInData=d;function m(w){return w?Object.keys(w).filter((x)=>x!=="__proto__"):[]}e.allSchemaProperties=m;function h(w,x){return m(x).filter((O)=>!(0,r.alwaysValidSchema)(w,x[O]))}e.schemaProperties=h;function f({schemaCode:w,data:x,it:{gen:O,topSchemaRef:R,schemaPath:S,errorPath:E},it:A},H,j,V){let W=V?t._`${w}, ${x}, ${R}${S}`:x,Y=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,E)],[o.default.parentData,A.parentData],[o.default.parentDataProperty,A.parentDataProperty],[o.default.rootData,o.default.rootData]];if(A.opts.dynamicRef)Y.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let ae=t._`${W}, ${O.object(...Y)}`;return j!==t.nil?t._`${H}.call(${j}, ${ae})`:t._`${H}(${ae})`}e.callValidateCode=f;let v=t._`new RegExp`;function y({gen:w,it:{opts:x}},O){let R=x.unicodeRegExp?"u":"",{regExp:S}=x.code,E=S(O,R);return w.scopeValue("pattern",{key:E.toString(),ref:E,code:t._`${S.code==="new RegExp"?v:(0,n.useFunc)(w,S)}(${O}, ${R})`})}e.usePattern=y;function g(w){let{gen:x,data:O,keyword:R,it:S}=w,E=x.name("valid");if(S.allErrors){let H=x.let("valid",!0);return A(()=>x.assign(H,!1)),H}return x.var(E,!0),A(()=>x.break()),E;function A(H){let j=x.const("len",t._`${O}.length`);x.forRange("i",0,j,(V)=>{w.subschema({keyword:R,dataProp:V,dataPropType:r.Type.Num},E),x.if((0,t.not)(E),H)})}}e.validateArray=g;function P(w){let{gen:x,schema:O,keyword:R,it:S}=w;if(!Array.isArray(O))throw Error("ajv implementation error");if(O.some((H)=>(0,r.alwaysValidSchema)(S,H))&&!S.opts.unevaluated)return;let E=x.let("valid",!1),A=x.name("_valid");x.block(()=>O.forEach((H,j)=>{let V=w.subschema({keyword:R,schemaProp:j,compositeRule:!0},A);if(x.assign(E,t._`${E} || ${A}`),!w.mergeValidEvaluated(V,A))x.if((0,t.not)(E))})),w.result(E,()=>w.reset(),()=>w.error(!0))}e.validateUnion=P}),Ek=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=le(),r=kt(),o=xt(),n=xi();function s(h,f){let{gen:v,keyword:y,schema:g,parentSchema:P,it:w}=h,x=f.macro.call(w.self,g,P,w),O=l(v,y,x);if(w.opts.validateSchema!==!1)w.self.validateSchema(x,!0);let R=v.name("valid");h.subschema({schema:x,schemaPath:t.nil,errSchemaPath:`${w.errSchemaPath}/${y}`,topSchemaRef:O,compositeRule:!0},R),h.pass(R,()=>h.error(!0))}e.macroKeywordCode=s;function i(h,f){var v;let{gen:y,keyword:g,schema:P,parentSchema:w,$data:x,it:O}=h;u(O,f);let R=l(y,g,!x&&f.compile?f.compile.call(O.self,P,w,O):f.validate),S=y.let("valid");h.block$data(S,E),h.ok((v=f.valid)!==null&&v!==void 0?v:S);function E(){if(f.errors===!1){if(j(),f.modifying)a(h);V(()=>h.error())}else{let W=f.async?A():H();if(f.modifying)a(h);V(()=>c(h,W))}}function A(){let W=y.let("ruleErrs",null);return y.try(()=>j(t._`await `),(Y)=>y.assign(S,!1).if(t._`${Y} instanceof ${O.ValidationError}`,()=>y.assign(W,t._`${Y}.errors`),()=>y.throw(Y))),W}function H(){let W=t._`${R}.errors`;return y.assign(W,null),j(t.nil),W}function j(W=f.async?t._`await `:t.nil){let Y=O.opts.passContext?r.default.this:r.default.self,ae=!(("compile"in f)&&!x||f.schema===!1);y.assign(S,t._`${W}${(0,o.callValidateCode)(h,R,Y,ae)}`,f.modifying)}function V(W){var Y;y.if((0,t.not)((Y=f.valid)!==null&&Y!==void 0?Y:S),W)}}e.funcKeywordCode=i;function a(h){let{gen:f,data:v,it:y}=h;f.if(y.parentData,()=>f.assign(v,t._`${y.parentData}[${y.parentDataProperty}]`))}function c(h,f){let{gen:v}=h;v.if(t._`Array.isArray(${f})`,()=>{v.assign(r.default.vErrors,t._`${r.default.vErrors} === null ? ${f} : ${r.default.vErrors}.concat(${f})`).assign(r.default.errors,t._`${r.default.vErrors}.length`),(0,n.extendErrors)(h)},()=>h.error())}function u({schemaEnv:h},f){if(f.async&&!h.$async)throw Error("async keyword in sync schema")}function l(h,f,v){if(v===void 0)throw Error(`keyword "${f}" failed to compile`);return h.scopeValue("keyword",typeof v=="function"?{ref:v}:{ref:v,code:(0,t.stringify)(v)})}function d(h,f,v=!1){return!f.length||f.some((y)=>y==="array"?Array.isArray(h):y==="object"?h&&typeof h=="object"&&!Array.isArray(h):typeof h==y||v&&typeof h>"u")}e.validSchemaType=d;function m({schema:h,opts:f,self:v,errSchemaPath:y},g,P){if(Array.isArray(g.keyword)?!g.keyword.includes(P):g.keyword!==P)throw Error("ajv implementation error");let w=g.dependencies;if(w===null||w===void 0?void 0:w.some((x)=>!Object.prototype.hasOwnProperty.call(h,x)))throw Error(`parent schema must have dependencies of ${P}: ${w.join(",")}`);if(g.validateSchema){if(!g.validateSchema(h[P])){let x=`keyword "${P}" value is invalid at path "${y}": `+v.errorsText(g.validateSchema.errors);if(f.validateSchema==="log")v.logger.error(x);else throw Error(x)}}}e.validateKeywordUsage=m}),Tk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=le(),r=ye();function o(i,{keyword:a,schemaProp:c,schema:u,schemaPath:l,errSchemaPath:d,topSchemaRef:m}){if(a!==void 0&&u!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(a!==void 0){let h=i.schema[a];return c===void 0?{schema:h,schemaPath:t._`${i.schemaPath}${(0,t.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${a}`}:{schema:h[c],schemaPath:t._`${i.schemaPath}${(0,t.getProperty)(a)}${(0,t.getProperty)(c)}`,errSchemaPath:`${i.errSchemaPath}/${a}/${(0,r.escapeFragment)(c)}`}}if(u!==void 0){if(l===void 0||d===void 0||m===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:l,topSchemaRef:m,errSchemaPath:d}}throw Error('either "keyword" or "schema" must be passed')}e.getSubschema=o;function n(i,a,{dataProp:c,dataPropType:u,data:l,dataTypes:d,propertyName:m}){if(l!==void 0&&c!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:h}=a;if(c!==void 0){let{errorPath:v,dataPathArr:y,opts:g}=a;f(h.let("data",t._`${a.data}${(0,t.getProperty)(c)}`,!0)),i.errorPath=t.str`${v}${(0,r.getErrorPath)(c,u,g.jsPropertySyntax)}`,i.parentDataProperty=t._`${c}`,i.dataPathArr=[...y,i.parentDataProperty]}if(l!==void 0){if(f(l instanceof t.Name?l:h.let("data",l,!0)),m!==void 0)i.propertyName=m}if(d)i.dataTypes=d;function f(v){i.data=v,i.dataLevel=a.dataLevel+1,i.dataTypes=[],a.definedProperties=new Set,i.parentData=a.data,i.dataNames=[...a.dataNames,v]}}e.extendSubschemaData=n;function s(i,{jtdDiscriminator:a,jtdMetadata:c,compositeRule:u,createErrors:l,allErrors:d}){if(u!==void 0)i.compositeRule=u;if(l!==void 0)i.createErrors=l;if(d!==void 0)i.allErrors=d;i.jtdDiscriminator=a,i.jtdMetadata=c}e.extendSubschemaMode=s}),Ib=B((e,t)=>{t.exports=function r(o,n){if(o===n)return!0;if(o&&n&&typeof o=="object"&&typeof n=="object"){if(o.constructor!==n.constructor)return!1;var s,i,a;if(Array.isArray(o)){if(s=o.length,s!=n.length)return!1;for(i=s;i--!==0;)if(!r(o[i],n[i]))return!1;return!0}if(o.constructor===RegExp)return o.source===n.source&&o.flags===n.flags;if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===n.valueOf();if(o.toString!==Object.prototype.toString)return o.toString()===n.toString();if(a=Object.keys(o),s=a.length,s!==Object.keys(n).length)return!1;for(i=s;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=s;i--!==0;){var c=a[i];if(!r(o[c],n[c]))return!1}return!0}return o!==o&&n!==n}}),Ok=B((e,t)=>{var r=t.exports=function(s,i,a){if(typeof i=="function")a=i,i={};a=i.cb||a;var c=typeof a=="function"?a:a.pre||function(){},u=a.post||function(){};o(i,c,u,s,"",s)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function o(s,i,a,c,u,l,d,m,h,f){if(c&&typeof c=="object"&&!Array.isArray(c)){i(c,u,l,d,m,h,f);for(var v in c){var y=c[v];if(Array.isArray(y)){if(v in r.arrayKeywords)for(var g=0;g<y.length;g++)o(s,i,a,y[g],u+"/"+v+"/"+g,l,u,v,c,g)}else if(v in r.propsKeywords){if(y&&typeof y=="object")for(var P in y)o(s,i,a,y[P],u+"/"+v+"/"+n(P),l,u,v,c,P)}else if(v in r.keywords||s.allKeys&&!(v in r.skipKeywords))o(s,i,a,y,u+"/"+v,l,u,v,c)}a(c,u,l,d,m,h,f)}}function n(s){return s.replace(/~/g,"~0").replace(/\//g,"~1")}}),Ei=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=ye(),r=Ib(),o=Ok(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(y,g=!0){if(typeof y=="boolean")return!0;if(g===!0)return!a(y);if(!g)return!1;return c(y)<=g}e.inlineRef=s;let i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a(y){for(let g in y){if(i.has(g))return!0;let P=y[g];if(Array.isArray(P)&&P.some(a))return!0;if(typeof P=="object"&&a(P))return!0}return!1}function c(y){let g=0;for(let P in y){if(P==="$ref")return 1/0;if(g++,n.has(P))continue;if(typeof y[P]=="object")(0,t.eachItem)(y[P],(w)=>g+=c(w));if(g===1/0)return 1/0}return g}function u(y,g="",P){if(P!==!1)g=m(g);return l(y,y.parse(g))}e.getFullPath=u;function l(y,g){return y.serialize(g).split("#")[0]+"#"}e._getFullPath=l;let d=/#\/?$/;function m(y){return y?y.replace(d,""):""}e.normalizeId=m;function h(y,g,P){return P=m(P),y.resolve(g,P)}e.resolveUrl=h;let f=/^[a-z_][-a-z0-9._]*$/i;function v(y,g){if(typeof y=="boolean")return{};let{schemaId:P,uriResolver:w}=this.opts,x=m(y[P]||g),O={"":x},R=u(w,x,!1),S={},E=new Set;return o(y,{allKeys:!0},(j,V,W,Y)=>{if(Y===void 0)return;let ae=R+V,we=O[Y];if(typeof j[P]=="string")we=$e.call(this,j[P]);Ce.call(this,j.$anchor),Ce.call(this,j.$dynamicAnchor),O[V]=we;function $e(de){let N=this.opts.uriResolver.resolve;if(de=m(we?N(we,de):de),E.has(de))throw H(de);E.add(de);let M=this.refs[de];if(typeof M=="string")M=this.refs[M];if(typeof M=="object")A(j,M.schema,de);else if(de!==m(ae))if(de[0]==="#")A(j,S[de],de),S[de]=j;else this.refs[de]=ae;return de}function Ce(de){if(typeof de=="string"){if(!f.test(de))throw Error(`invalid anchor "${de}"`);$e.call(this,`#${de}`)}}}),S;function A(j,V,W){if(V!==void 0&&!r(j,V))throw H(W)}function H(j){return Error(`reference "${j}" resolves to more than one schema`)}}e.getSchemaRefs=v}),no=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=kk(),r=ki(),o=Cb(),n=ki(),s=xk(),i=Ek(),a=Tk(),c=le(),u=kt(),l=Ei(),d=ye(),m=xi();function h(T){if(R(T)){if(E(T),O(T)){g(T);return}}f(T,()=>(0,t.topBoolOrEmptySchema)(T))}e.validateFunctionCode=h;function f({gen:T,validateName:q,schema:F,schemaEnv:ee,opts:re},se){if(re.code.es5)T.func(q,c._`${u.default.data}, ${u.default.valCxt}`,ee.$async,()=>{T.code(c._`"use strict"; ${w(F,re)}`),y(T,re),T.code(se)});else T.func(q,c._`${u.default.data}, ${v(re)}`,ee.$async,()=>T.code(w(F,re)).code(se))}function v(T){return c._`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${T.dynamicRef?c._`, ${u.default.dynamicAnchors}={}`:c.nil}}={}`}function y(T,q){T.if(u.default.valCxt,()=>{if(T.var(u.default.instancePath,c._`${u.default.valCxt}.${u.default.instancePath}`),T.var(u.default.parentData,c._`${u.default.valCxt}.${u.default.parentData}`),T.var(u.default.parentDataProperty,c._`${u.default.valCxt}.${u.default.parentDataProperty}`),T.var(u.default.rootData,c._`${u.default.valCxt}.${u.default.rootData}`),q.dynamicRef)T.var(u.default.dynamicAnchors,c._`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{if(T.var(u.default.instancePath,c._`""`),T.var(u.default.parentData,c._`undefined`),T.var(u.default.parentDataProperty,c._`undefined`),T.var(u.default.rootData,u.default.data),q.dynamicRef)T.var(u.default.dynamicAnchors,c._`{}`)})}function g(T){let{schema:q,opts:F,gen:ee}=T;f(T,()=>{if(F.$comment&&q.$comment)Y(T);if(j(T),ee.let(u.default.vErrors,null),ee.let(u.default.errors,0),F.unevaluated)P(T);A(T),ae(T)})}function P(T){let{gen:q,validateName:F}=T;T.evaluated=q.const("evaluated",c._`${F}.evaluated`),q.if(c._`${T.evaluated}.dynamicProps`,()=>q.assign(c._`${T.evaluated}.props`,c._`undefined`)),q.if(c._`${T.evaluated}.dynamicItems`,()=>q.assign(c._`${T.evaluated}.items`,c._`undefined`))}function w(T,q){let F=typeof T=="object"&&T[q.schemaId];return F&&(q.code.source||q.code.process)?c._`/*# sourceURL=${F} */`:c.nil}function x(T,q){if(R(T)){if(E(T),O(T)){S(T,q);return}}(0,t.boolOrEmptySchema)(T,q)}function O({schema:T,self:q}){if(typeof T=="boolean")return!T;for(let F in T)if(q.RULES.all[F])return!0;return!1}function R(T){return typeof T.schema!="boolean"}function S(T,q){let{schema:F,gen:ee,opts:re}=T;if(re.$comment&&F.$comment)Y(T);V(T),W(T);let se=ee.const("_errs",u.default.errors);A(T,se),ee.var(q,c._`${se} === ${u.default.errors}`)}function E(T){(0,d.checkUnknownRules)(T),H(T)}function A(T,q){if(T.opts.jtd)return $e(T,[],!1,q);let F=(0,r.getSchemaTypes)(T.schema);$e(T,F,!(0,r.coerceAndCheckDataType)(T,F),q)}function H(T){let{schema:q,errSchemaPath:F,opts:ee,self:re}=T;if(q.$ref&&ee.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(q,re.RULES))re.logger.warn(`$ref: keywords ignored in schema at path "${F}"`)}function j(T){let{schema:q,opts:F}=T;if(q.default!==void 0&&F.useDefaults&&F.strictSchema)(0,d.checkStrictMode)(T,"default is ignored in the schema root")}function V(T){let q=T.schema[T.opts.schemaId];if(q)T.baseId=(0,l.resolveUrl)(T.opts.uriResolver,T.baseId,q)}function W(T){if(T.schema.$async&&!T.schemaEnv.$async)throw Error("async schema in sync schema")}function Y({gen:T,schemaEnv:q,schema:F,errSchemaPath:ee,opts:re}){let se=F.$comment;if(re.$comment===!0)T.code(c._`${u.default.self}.logger.log(${se})`);else if(typeof re.$comment=="function"){let _e=c.str`${ee}/$comment`,Ze=T.scopeValue("root",{ref:q.root});T.code(c._`${u.default.self}.opts.$comment(${se}, ${_e}, ${Ze}.schema)`)}}function ae(T){let{gen:q,schemaEnv:F,validateName:ee,ValidationError:re,opts:se}=T;if(F.$async)q.if(c._`${u.default.errors} === 0`,()=>q.return(u.default.data),()=>q.throw(c._`new ${re}(${u.default.vErrors})`));else{if(q.assign(c._`${ee}.errors`,u.default.vErrors),se.unevaluated)we(T);q.return(c._`${u.default.errors} === 0`)}}function we({gen:T,evaluated:q,props:F,items:ee}){if(F instanceof c.Name)T.assign(c._`${q}.props`,F);if(ee instanceof c.Name)T.assign(c._`${q}.items`,ee)}function $e(T,q,F,ee){let{gen:re,schema:se,data:_e,allErrors:Ze,opts:ke,self:De}=T,{RULES:Ie}=De;if(se.$ref&&(ke.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(se,Ie))){re.block(()=>G(T,"$ref",Ie.all.$ref.definition));return}if(!ke.jtd)de(T,q);re.block(()=>{for(let Ve of Ie.rules)ht(Ve);ht(Ie.post)});function ht(Ve){if(!(0,o.shouldUseGroup)(se,Ve))return;if(Ve.type){if(re.if((0,n.checkDataType)(Ve.type,_e,ke.strictNumbers)),Ce(T,Ve),q.length===1&&q[0]===Ve.type&&F)re.else(),(0,n.reportTypeError)(T);re.endIf()}else Ce(T,Ve);if(!Ze)re.if(c._`${u.default.errors} === ${ee||0}`)}}function Ce(T,q){let{gen:F,schema:ee,opts:{useDefaults:re}}=T;if(re)(0,s.assignDefaults)(T,q.type);F.block(()=>{for(let se of q.rules)if((0,o.shouldUseRule)(ee,se))G(T,se.keyword,se.definition,q.type)})}function de(T,q){if(T.schemaEnv.meta||!T.opts.strictTypes)return;if(N(T,q),!T.opts.allowUnionTypes)M(T,q);b(T,T.dataTypes)}function N(T,q){if(!q.length)return;if(!T.dataTypes.length){T.dataTypes=q;return}q.forEach((F)=>{if(!_(T.dataTypes,F))I(T,`type "${F}" not allowed by context "${T.dataTypes.join(",")}"`)}),z(T,q)}function M(T,q){if(q.length>1&&!(q.length===2&&q.includes("null")))I(T,"use allowUnionTypes to allow union type keyword")}function b(T,q){let F=T.self.RULES.all;for(let ee in F){let re=F[ee];if(typeof re=="object"&&(0,o.shouldUseRule)(T.schema,re)){let{type:se}=re.definition;if(se.length&&!se.some((_e)=>p(q,_e)))I(T,`missing type "${se.join(",")}" for keyword "${ee}"`)}}}function p(T,q){return T.includes(q)||q==="number"&&T.includes("integer")}function _(T,q){return T.includes(q)||q==="integer"&&T.includes("number")}function z(T,q){let F=[];for(let ee of T.dataTypes)if(_(q,ee))F.push(ee);else if(q.includes("integer")&&ee==="number")F.push("integer");T.dataTypes=F}function I(T,q){let F=T.schemaEnv.baseId+T.errSchemaPath;q+=` at "${F}" (strictTypes)`,(0,d.checkStrictMode)(T,q,T.opts.strictTypes)}var U=class{constructor(T,q,F){if((0,i.validateKeywordUsage)(T,q,F),this.gen=T.gen,this.allErrors=T.allErrors,this.keyword=F,this.data=T.data,this.schema=T.schema[F],this.$data=q.$data&&T.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(T,this.schema,F,this.$data),this.schemaType=q.schemaType,this.parentSchema=T.schema,this.params={},this.it=T,this.def=q,this.$data)this.schemaCode=T.gen.const("vSchema",Pe(this.$data,T));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw Error(`${F} value must be ${JSON.stringify(q.schemaType)}`);if("code"in q?q.trackErrors:q.errors!==!1)this.errsCount=T.gen.const("_errs",u.default.errors)}result(T,q,F){this.failResult((0,c.not)(T),q,F)}failResult(T,q,F){if(this.gen.if(T),F)F();else this.error();if(q){if(this.gen.else(),q(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(T,q){this.failResult((0,c.not)(T),void 0,q)}fail(T){if(T===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(T),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(T){if(!this.$data)return this.fail(T);let{schemaCode:q}=this;this.fail(c._`${q} !== undefined && (${(0,c.or)(this.invalid$data(),T)})`)}error(T,q,F){if(q){this.setParams(q),this._error(T,F),this.setParams({});return}this._error(T,F)}_error(T,q){(T?m.reportExtraError:m.reportError)(this,this.def.error,q)}$dataError(){(0,m.reportError)(this,this.def.$dataError||m.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,m.resetErrorsCount)(this.gen,this.errsCount)}ok(T){if(!this.allErrors)this.gen.if(T)}setParams(T,q){if(q)Object.assign(this.params,T);else this.params=T}block$data(T,q,F=c.nil){this.gen.block(()=>{this.check$data(T,F),q()})}check$data(T=c.nil,q=c.nil){if(!this.$data)return;let{gen:F,schemaCode:ee,schemaType:re,def:se}=this;if(F.if((0,c.or)(c._`${ee} === undefined`,q)),T!==c.nil)F.assign(T,!0);if(re.length||se.validateSchema){if(F.elseIf(this.invalid$data()),this.$dataError(),T!==c.nil)F.assign(T,!1)}F.else()}invalid$data(){let{gen:T,schemaCode:q,schemaType:F,def:ee,it:re}=this;return(0,c.or)(se(),_e());function se(){if(F.length){if(!(q instanceof c.Name))throw Error("ajv implementation error");let Ze=Array.isArray(F)?F:[F];return c._`${(0,n.checkDataTypes)(Ze,q,re.opts.strictNumbers,n.DataType.Wrong)}`}return c.nil}function _e(){if(ee.validateSchema){let Ze=T.scopeValue("validate$data",{ref:ee.validateSchema});return c._`!${Ze}(${q})`}return c.nil}}subschema(T,q){let F=(0,a.getSubschema)(this.it,T);(0,a.extendSubschemaData)(F,this.it,T),(0,a.extendSubschemaMode)(F,T);let ee={...this.it,...F,items:void 0,props:void 0};return x(ee,q),ee}mergeEvaluated(T,q){let{it:F,gen:ee}=this;if(!F.opts.unevaluated)return;if(F.props!==!0&&T.props!==void 0)F.props=d.mergeEvaluated.props(ee,T.props,F.props,q);if(F.items!==!0&&T.items!==void 0)F.items=d.mergeEvaluated.items(ee,T.items,F.items,q)}mergeValidEvaluated(T,q){let{it:F,gen:ee}=this;if(F.opts.unevaluated&&(F.props!==!0||F.items!==!0))return ee.if(q,()=>this.mergeEvaluated(T,c.Name)),!0}};e.KeywordCxt=U;function G(T,q,F,ee){let re=new U(T,F,q);if("code"in F)F.code(re,ee);else if(re.$data&&F.validate)(0,i.funcKeywordCode)(re,F);else if("macro"in F)(0,i.macroKeywordCode)(re,F);else if(F.compile||F.validate)(0,i.funcKeywordCode)(re,F)}let K=/^\/(?:[^~]|~0|~1)*$/,ue=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Pe(T,{dataLevel:q,dataNames:F,dataPathArr:ee}){let re,se;if(T==="")return u.default.rootData;if(T[0]==="/"){if(!K.test(T))throw Error(`Invalid JSON-pointer: ${T}`);re=T,se=u.default.rootData}else{let De=ue.exec(T);if(!De)throw Error(`Invalid JSON-pointer: ${T}`);let Ie=+De[1];if(re=De[2],re==="#"){if(Ie>=q)throw Error(ke("property/index",Ie));return ee[q-Ie]}if(Ie>q)throw Error(ke("data",Ie));if(se=F[q-Ie],!re)return se}let _e=se,Ze=re.split("/");for(let De of Ze)if(De)se=c._`${se}${(0,c.getProperty)((0,d.unescapeJsonPointer)(De))}`,_e=c._`${_e} && ${se}`;return _e;function ke(De,Ie){return`Cannot access ${De} ${Ie} levels up, current level is ${q}`}}e.getData=Pe}),wn=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});var t=class extends Error{constructor(r){super("validation failed");this.errors=r,this.ajv=this.validation=!0}};e.default=t}),so=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ei();var r=class extends Error{constructor(o,n,s,i){super(i||`can't resolve reference ${s} from id ${n}`);this.missingRef=(0,t.resolveUrl)(o,n,s),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(o,this.missingRef))}};e.default=r}),Ti=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=le(),r=wn(),o=kt(),n=Ei(),s=ye(),i=no();var a=class{constructor(g){var P;this.refs={},this.dynamicAnchors={};let w;if(typeof g.schema=="object")w=g.schema;this.schema=g.schema,this.schemaId=g.schemaId,this.root=g.root||this,this.baseId=(P=g.baseId)!==null&&P!==void 0?P:(0,n.normalizeId)(w===null||w===void 0?void 0:w[g.schemaId||"$id"]),this.schemaPath=g.schemaPath,this.localRefs=g.localRefs,this.meta=g.meta,this.$async=w===null||w===void 0?void 0:w.$async,this.refs={}}};e.SchemaEnv=a;function c(g){let P=d.call(this,g);if(P)return P;let w=(0,n.getFullPath)(this.opts.uriResolver,g.root.baseId),{es5:x,lines:O}=this.opts.code,{ownProperties:R}=this.opts,S=new t.CodeGen(this.scope,{es5:x,lines:O,ownProperties:R}),E;if(g.$async)E=S.scopeValue("Error",{ref:r.default,code:t._`require("ajv/dist/runtime/validation_error").default`});let A=S.scopeName("validate");g.validateName=A;let H={gen:S,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:S.scopeValue("schema",this.opts.code.source===!0?{ref:g.schema,code:(0,t.stringify)(g.schema)}:{ref:g.schema}),validateName:A,ValidationError:E,schema:g.schema,schemaEnv:g,rootId:w,baseId:g.baseId||w,schemaPath:t.nil,errSchemaPath:g.schemaPath||(this.opts.jtd?"":"#"),errorPath:t._`""`,opts:this.opts,self:this},j;try{this._compilations.add(g),(0,i.validateFunctionCode)(H),S.optimize(this.opts.code.optimize);let V=S.toString();if(j=`${S.scopeRefs(o.default.scope)}return ${V}`,this.opts.code.process)j=this.opts.code.process(j,g);let W=Function(`${o.default.self}`,`${o.default.scope}`,j)(this,this.scope.get());if(this.scope.value(A,{ref:W}),W.errors=null,W.schema=g.schema,W.schemaEnv=g,g.$async)W.$async=!0;if(this.opts.code.source===!0)W.source={validateName:A,validateCode:V,scopeValues:S._values};if(this.opts.unevaluated){let{props:Y,items:ae}=H;if(W.evaluated={props:Y instanceof t.Name?void 0:Y,items:ae instanceof t.Name?void 0:ae,dynamicProps:Y instanceof t.Name,dynamicItems:ae instanceof t.Name},W.source)W.source.evaluated=(0,t.stringify)(W.evaluated)}return g.validate=W,g}catch(V){if(delete g.validate,delete g.validateName,j)this.logger.error("Error compiling schema, function code:",j);throw V}finally{this._compilations.delete(g)}}e.compileSchema=c;function u(g,P,w){var x;w=(0,n.resolveUrl)(this.opts.uriResolver,P,w);let O=g.refs[w];if(O)return O;let R=h.call(this,g,w);if(R===void 0){let S=(x=g.localRefs)===null||x===void 0?void 0:x[w],{schemaId:E}=this.opts;if(S)R=new a({schema:S,schemaId:E,root:g,baseId:P})}if(R===void 0)return;return g.refs[w]=l.call(this,R)}e.resolveRef=u;function l(g){if((0,n.inlineRef)(g.schema,this.opts.inlineRefs))return g.schema;return g.validate?g:c.call(this,g)}function d(g){for(let P of this._compilations)if(m(P,g))return P}e.getCompilingSchema=d;function m(g,P){return g.schema===P.schema&&g.root===P.root&&g.baseId===P.baseId}function h(g,P){let w;while(typeof(w=this.refs[P])=="string")P=w;return w||this.schemas[P]||f.call(this,g,P)}function f(g,P){let w=this.opts.uriResolver.parse(P),x=(0,n._getFullPath)(this.opts.uriResolver,w),O=(0,n.getFullPath)(this.opts.uriResolver,g.baseId,void 0);if(Object.keys(g.schema).length>0&&x===O)return y.call(this,w,g);let R=(0,n.normalizeId)(x),S=this.refs[R]||this.schemas[R];if(typeof S=="string"){let E=f.call(this,g,S);if(typeof(E===null||E===void 0?void 0:E.schema)!=="object")return;return y.call(this,w,E)}if(typeof(S===null||S===void 0?void 0:S.schema)!=="object")return;if(!S.validate)c.call(this,S);if(R===(0,n.normalizeId)(P)){let{schema:E}=S,{schemaId:A}=this.opts,H=E[A];if(H)O=(0,n.resolveUrl)(this.opts.uriResolver,O,H);return new a({schema:E,schemaId:A,root:g,baseId:O})}return y.call(this,w,S)}e.resolveSchema=f;let v=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(g,{baseId:P,schema:w,root:x}){var O;if(((O=g.fragment)===null||O===void 0?void 0:O[0])!=="/")return;for(let E of g.fragment.slice(1).split("/")){if(typeof w==="boolean")return;let A=w[(0,s.unescapeFragment)(E)];if(A===void 0)return;w=A;let H=typeof w==="object"&&w[this.opts.schemaId];if(!v.has(E)&&H)P=(0,n.resolveUrl)(this.opts.uriResolver,P,H)}let R;if(typeof w!="boolean"&&w.$ref&&!(0,s.schemaHasRulesButRef)(w,this.RULES)){let E=(0,n.resolveUrl)(this.opts.uriResolver,P,w.$ref);R=f.call(this,x,E)}let{schemaId:S}=this.opts;if(R=R||new a({schema:w,schemaId:S,root:x,baseId:P}),R.schema!==R.root.schema)return R}}),Ck=B((e,t)=>{t.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),Nb=B((e,t)=>{let r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),o=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),n=RegExp.prototype.test.bind(/^\d*$/u),s=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),i=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),a=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),c=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),u=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),l=Array(256);for(let p=0;p<256;p++)l[p]="%"+"0123456789ABCDEF"[p>>4]+"0123456789ABCDEF"[p&15];function d(b){if(b<2048)return l[192|b>>6]+l[128|b&63];if(b<65536)return l[224|b>>12]+l[128|b>>6&63]+l[128|b&63];return l[240|b>>18]+l[128|b>>12&63]+l[128|b>>6&63]+l[128|b&63]}function m(b){let p="",_=0,z=0;for(z=0;z<b.length;z++){if(_=b[z].charCodeAt(0),_===48)continue;if(!(_>=48&&_<=57||_>=65&&_<=70||_>=97&&_<=102))return"";p+=b[z];break}for(z+=1;z<b.length;z++){if(_=b[z].charCodeAt(0),!(_>=48&&_<=57||_>=65&&_<=70||_>=97&&_<=102))return"";p+=b[z]}return p}let h=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),f=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),v=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),y=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function g(b){if(b.length===0)return!1;for(let p=0;p<b.length;p++){if(v(b[p]))continue;if(b[p]==="%"&&p+2<b.length&&s(b.slice(p+1,p+3))){p+=2;continue}return!1}return!0}function P(b){let p=-1,_=0,z=-1,I=0;for(let K=0;K<b.length;K++)if(b[K]==="0"){if(z===-1)z=K;if(I++,I>_)_=I,p=z}else z=-1,I=0;if(_<2)return b.join(":");let U=b.slice(0,p).join(":"),G=b.slice(p+_).join(":");return U+"::"+G}function w(b){let p=b.indexOf("::");if(p!==-1&&b.indexOf("::",p+1)!==-1)return;let _=p===-1?b.split(":"):b.slice(0,p).split(":"),z=p===-1?[]:b.slice(p+2).split(":");if(p!==-1){if(_.length===1&&_[0]==="")_.length=0;if(z.length===1&&z[0]==="")z.length=0}let I=_.concat(z),U=0;for(let K=0;K<I.length;K++){let ue=I[K];if(ue==="")return;if(ue.indexOf(".")!==-1){if(K!==I.length-1||p!==-1&&z.length===0||!o(ue))return;U+=2;continue}if(!h(ue))return;I[K]=parseInt(ue,16).toString(16),U++}if(p===-1){if(U!==8)return;return P(I)}if(U>=8)return;let G=I.slice(0,_.length);for(let K=U;K<8;K++)G.push("0");for(let K=_.length;K<I.length;K++)G.push(I[K]);return P(G)}function x(b){let p=b[0]==="["&&b[b.length-1]==="]";if((b[0]==="["||b[b.length-1]==="]")&&!p)return{host:b,isIPV6:!1,error:!0};let _=p?b.slice(1,-1):b;if(p&&f(_))return _=_.toLowerCase(),{host:`[${_}]`,escapedHost:_,isIPV6:!1,isIPVFuture:!0};if(O(_,":")<2)return{host:b,isIPV6:!1,error:p};let z="",I=_.indexOf("%");if(I!==-1){let G=_.slice(I,I+3).toLowerCase()==="%25"?3:1;if(z=_.slice(I+G),!g(z))return{host:b,isIPV6:!1,error:!0};_=_.slice(0,I)}let U=w(_);if(U===void 0)return{host:b,isIPV6:!1,error:!0};return{host:U+(z?"%"+z:""),escapedHost:U+(z?"%25"+z:""),isIPV6:!0}}function O(b,p){let _=0;for(let z=0;z<b.length;z++)if(b[z]===p)_++;return _}function R(b){let p=b,_=[],z=-1,I=0;while(I=p.length){if(I===1)if(p===".")break;else if(p==="/"){_.push("/");break}else{_.push(p);break}else if(I===2){if(p[0]==="."){if(p[1]===".")break;else if(p[1]==="/"){p=p.slice(2);continue}}else if(p[0]==="/"){if(p[1]==="."||p[1]==="/"){_.push("/");break}}}else if(I===3){if(p==="/.."){if(_.length!==0)_.pop();_.push("/");break}}if(p[0]==="."){if(p[1]==="."){if(p[2]==="/"){p=p.slice(3);continue}}else if(p[1]==="/"){p=p.slice(2);continue}}else if(p[0]==="/"){if(p[1]==="."){if(p[2]==="/"){p=p.slice(2);continue}else if(p[2]==="."){if(p[3]==="/"){if(p=p.slice(3),_.length!==0)_.pop();continue}}}}if((z=p.indexOf("/",1))===-1){_.push(p);break}else _.push(p.slice(0,z)),p=p.slice(z)}return _.join("")}let S={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},E=/[@/?#:]/g,A=/[@/?#]/g;function H(b,p){let _=p?A:E;return _.lastIndex=0,b.replace(_,(z)=>S[z])}function j(b,p=!1){if(b.indexOf("%")===-1)return b;let _="";for(let z=0;z<b.length;z++){if(b[z]==="%"&&z+2<b.length){let I=b.slice(z+1,z+3);if(s(I)){let U=I.toUpperCase(),G=String.fromCharCode(parseInt(U,16));if(p&&i(G))_+=G;else _+="%"+U;z+=2;continue}}_+=b[z]}return _}function V(b){let p="";for(let _=0;_<b.length;_++){let z=b[_];if(z==="%"&&_+2<b.length){let I=b.slice(_+1,_+3);if(s(I)){let U=I.toUpperCase(),G=String.fromCharCode(parseInt(U,16));if(G!=="."&&i(G))p+=G;else p+="%"+U;_+=2;continue}}if(a(z))p+=z;else{let I=b.charCodeAt(_);if(I<128)p+=Ce(I)?z:l[I];else if(I<55296||I>57343)p+=d(I);else if(I<=56319&&_+1<b.length){let U=b.charCodeAt(_+1);if(U>=56320&&U<=57343)p+=d(65536+(I-55296<<10)+(U-56320)),_++;else p+=d(65533)}else p+=d(65533)}}return p}function W(b,p=!1){let _="",z=p&&b[0]!=="/";for(let I=0;I<b.length;I++){let U=b[I];if(U==="%"&&I+2<b.length){let G=b.slice(I+1,I+3);if(s(G)){_+="%"+G.toUpperCase(),I+=2;continue}}if(U==="/")z=!1;if(a(U)&&(U!==":"||!z))_+=U;else{let G=b.charCodeAt(I);if(G<128)_+=l[G];else if(G<55296||G>57343)_+=d(G);else if(G<=56319&&I+1<b.length){let K=b.charCodeAt(I+1);if(K>=56320&&K<=57343)_+=d(65536+(G-55296<<10)+(K-56320)),I++;else _+=d(65533)}else _+=d(65533)}}return _}function Y(b,p){let _="";for(let z=0;z<b.length;z++){let I=b[z];if(I==="%"&&z+2<b.length){let U=b.slice(z+1,z+3);if(s(U)){_+="%"+U.toUpperCase(),z+=2;continue}}if(p(I))_+=I;else{let U=b.charCodeAt(z);if(U<128)_+=l[U];else if(U<55296||U>57343)_+=d(U);else if(U<=56319&&z+1<b.length){let G=b.charCodeAt(z+1);if(G>=56320&&G<=57343)_+=d(65536+(U-55296<<10)+(G-56320)),z++;else _+=d(65533)}else _+=d(65533)}}return _}function ae(b){return Y(b,u)}function we(b){return Y(b,c)}function $e(b){return Y(b,c)}function Ce(b){return b>=48&&b<=57||b>=65&&b<=90||b>=97&&b<=122||b===42||b===43||b===45||b===46||b===47||b===64||b===95}function de(b){let p="";for(let _=0;_<b.length;_++){let z=b[_];if(z==="%"&&_+2<b.length){let I=b.slice(_+1,_+3);if(s(I)){let U=I.toUpperCase(),G=String.fromCharCode(parseInt(U,16));if(i(G))p+=G;else p+="%"+U;_+=2;continue}}if(c(z))p+=z;else{let I=b.charCodeAt(_);if(I<128)p+=Ce(I)?z:l[I];else if(I<55296||I>57343)p+=d(I);else if(I<=56319&&_+1<b.length){let U=b.charCodeAt(_+1);if(U>=56320&&U<=57343)p+=d(65536+(I-55296<<10)+(U-56320)),_++;else p+=d(65533)}else p+=d(65533)}}return p}function N(b){let p="";for(let _=0;_<b.length;_++){if(b[_]==="%"&&_+2<b.length){let z=b.slice(_+1,_+3);if(s(z)){p+="%"+z.toUpperCase(),_+=2;continue}}p+=escape(b[_])}return p}function M(b){let p=[];if(b.userinfo!==void 0)p.push(ae(b.userinfo)),p.push("@");if(b.host!==void 0){let _=b.host;if(!o(_)){let z=x(_);if(z.isIPV6!==!0&&z.isIPVFuture!==!0)_=j(_,!0),z=x(_);if(z.isIPV6===!0||z.isIPVFuture===!0)_=`[${z.escapedHost}]`;else _=H(_,!1)}p.push(_)}if(typeof b.port==="number"||typeof b.port==="string"){let _=String(b.port);if(!n(_))throw TypeError("URI port is malformed.");p.push(":"),p.push(_)}return p.length?p.join(""):void 0}t.exports={nonSimpleDomain:y,recomposeAuthority:M,reescapeHostDelimiters:H,normalizePercentEncoding:j,normalizePathEncoding:V,serializePathEncoding:W,normalizeQueryFragmentEncoding:de,encodeUserinfo:ae,encodeQuery:we,encodeFragment:$e,escapePreservingEscapes:N,removeDotSegments:R,isIPv4:o,isUUID:r,normalizeIPv6:x,stringArrayToHexStripped:m}}),Ik=B((e,t)=>{let{isUUID:r}=Nb(),o=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,n=["http","https","ws","wss","urn","urn:uuid"];function s(S){return n.indexOf(S)!==-1}function i(S){if(S.secure===!0)return!0;else if(S.secure===!1)return!1;else if(S.scheme)return S.scheme.length===3&&(S.scheme[0]==="w"||S.scheme[0]==="W")&&(S.scheme[1]==="s"||S.scheme[1]==="S")&&(S.scheme[2]==="s"||S.scheme[2]==="S");else return!1}function a(S){if(!S.host)S.error=S.error||"HTTP URIs must have a host.";return S}function c(S){let E=String(S.scheme).toLowerCase()==="https";if(S.port===(E?443:80)||S.port==="")S.port=void 0;if(!S.path)S.path="/";return S}function u(S){return S.secure=i(S),S.resourceName=(S.path||"/")+(S.query?"?"+S.query:""),S.path=void 0,S.query=void 0,S}function l(S){if(S.port===(i(S)?443:80)||S.port==="")S.port=void 0;if(typeof S.secure==="boolean")S.scheme=S.secure?"wss":"ws",S.secure=void 0;if(S.resourceName){let E=S.resourceName.indexOf("?"),A=E===-1?S.resourceName:S.resourceName.slice(0,E);S.path=A&&A!=="/"?A:void 0,S.query=E===-1?void 0:S.resourceName.slice(E+1),S.resourceName=void 0}return S.fragment=void 0,S}function d(S,E){if(!S.path)return S.error="URN can not be parsed",S;let A=S.path.match(o);if(A&&A[0]===S.path){let H=E.scheme||S.scheme||"urn";S.nid=A[1].toLowerCase(),S.nss=A[2];let j=R(`${H}:${E.nid||S.nid}`);if(S.path=void 0,j)S=j.parse(S,E)}else S.error=S.error||"URN can not be parsed.";return S}function m(S,E){if(S.nid===void 0)throw Error("URN without nid cannot be serialized");let A=E.scheme||S.scheme||"urn",H=S.nid.toLowerCase(),j=R(`${A}:${E.nid||H}`);if(j)S=j.serialize(S,E);let V=S,W=S.nss;return V.path=`${H||E.nid}:${W}`,E.skipEscape=!0,V}function h(S,E){let A=S;if(A.uuid=A.nss,A.nss=void 0,!E.tolerant&&(!A.uuid||!r(A.uuid)))A.error=A.error||"UUID is not valid.";return A}function f(S){let E=S;return E.nss=(S.uuid||"").toLowerCase(),E}let v={scheme:"http",domainHost:!0,parse:a,serialize:c},y={scheme:"https",domainHost:v.domainHost,parse:a,serialize:c},g={scheme:"ws",domainHost:!0,parse:u,serialize:l},P={scheme:"wss",domainHost:g.domainHost,parse:g.parse,serialize:g.serialize},O={http:v,https:y,ws:g,wss:P,urn:{scheme:"urn",parse:d,serialize:m,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:h,serialize:f,skipNormalize:!0}};Object.setPrototypeOf(O,null);function R(S){return S&&(O[S]||O[S.toLowerCase()])||void 0}t.exports={wsIsSecure:i,SCHEMES:O,isValidSchemeName:s,getSchemeHandler:R}}),Nk=B((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:n,normalizePercentEncoding:s,normalizePathEncoding:i,serializePathEncoding:a,normalizeQueryFragmentEncoding:c,encodeQuery:u,encodeFragment:l,reescapeHostDelimiters:d,isIPv4:m,nonSimpleDomain:h}=Nb(),{SCHEMES:f,getSchemeHandler:v}=Ik(),y=/^[A-Za-z][A-Za-z0-9+.-]*$/u,g="URI scheme is malformed.";function P(b){let p=unescape(String(b));if(!y.test(p))throw TypeError("URI scheme is malformed.");return p}function w(b,p){if(typeof b==="string")b=Ce(b,p);else if(typeof b==="object")b=$e(S(b,p),p);return b}function x(b,p,_){let z=_?Object.assign({scheme:"null"},_):{scheme:"null"},{parsed:I,malformedAuthorityOrPort:U,malformedPercentEncoding:G,malformedSchemeSpecific:K,malformedHost:ue,malformedScheme:Pe}=we(b,z),{parsed:T,malformedAuthorityOrPort:q,malformedPercentEncoding:F,malformedSchemeSpecific:ee,malformedHost:re,malformedScheme:se}=we(p,z);if(U||q||G||F||K||ee||ue||re||Pe||se)throw Error(I.error||T.error||"URI is malformed.");let _e=O(I,T,z,!0),Ze=v(_&&_.scheme||_e.scheme),ke=_e.host,De=ke!==void 0&&ke!==""&&(m(ke)||r(ke).isIPV6);ae(_e,_||{},Ze,De);let Ie=ke&&ke.indexOf("%")!==-1&&!/\P{ASCII}/u.test(ke);if(_e.error&&!Ie)throw Error(_e.error);return z.skipEscape=!0,S(_e,z)}function O(b,p,_,z){let I={};if(!z)b=$e(S(b,_),_),p=$e(S(p,_),_);if(_=_||{},!_.tolerant&&p.scheme)I.scheme=p.scheme,I.userinfo=p.userinfo,I.host=p.host,I.port=p.port,I.path=o(p.path||""),I.query=p.query;else{if(p.userinfo!==void 0||p.host!==void 0||p.port!==void 0)I.userinfo=p.userinfo,I.host=p.host,I.port=p.port,I.path=o(p.path||""),I.query=p.query;else{if(!p.path)if(I.path=b.path,p.query!==void 0)I.query=p.query;else I.query=b.query;else{if(p.path[0]==="/")I.path=o(p.path);else{if((b.userinfo!==void 0||b.host!==void 0||b.port!==void 0)&&!b.path)I.path="/"+p.path;else if(!b.path)I.path=p.path;else I.path=b.path.slice(0,b.path.lastIndexOf("/")+1)+p.path;I.path=o(I.path)}I.query=p.query}I.userinfo=b.userinfo,I.host=b.host,I.port=b.port}I.scheme=b.scheme}return I.fragment=p.fragment,I}function R(b,p,_){let z=N(b,_),I=N(p,_);return z!==void 0&&I!==void 0&&z===I}function S(b,p){let _={host:b.host,scheme:b.scheme,userinfo:b.userinfo,port:b.port,path:b.path,query:b.query,nid:b.nid,nss:b.nss,uuid:b.uuid,fragment:b.fragment,reference:b.reference,resourceName:b.resourceName,secure:b.secure,error:""},z=Object.assign({},p),I=[];if(_.scheme)_.scheme=P(_.scheme);let U=v(z.scheme||_.scheme);if(U&&U.serialize)U.serialize(_,z);let G=_.userinfo!==void 0||_.host!==void 0||_.port!==void 0,K=!z.skipEscape&&_.scheme===void 0&&!G;if(_.path!==void 0)if(!z.skipEscape)_.path=a(_.path,K);else _.path=s(_.path);if(z.reference!=="suffix"&&_.scheme)_.scheme=P(_.scheme),I.push(_.scheme,":");let ue=n(_);if(ue!==void 0){if(z.reference!=="suffix")I.push("//");if(I.push(ue),_.path&&_.path[0]!=="/")I.push("/")}if(_.path!==void 0){let Pe=_.path;if(!z.absolutePath&&(!U||!U.absolutePath))Pe=o(Pe);if(K)Pe=a(Pe,!0);if(ue===void 0&&Pe[0]==="/"&&Pe[1]==="/")Pe="/%2F"+Pe.slice(2);I.push(Pe)}if(_.query!==void 0)I.push("?",u(_.query));if(_.fragment!==void 0)I.push("#",l(_.fragment));return I.join("")}let E=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,A=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,H=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function j(b,p){if(p[2]!==void 0&&b.path&&b.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof b.port==="number"&&(b.port<0||b.port>65535))return"URI port is malformed."}function V(b){if(b===void 0)return!1;let p=b.indexOf("%");while(p!==-1){if(p+2>=b.length||!/^[\da-f]{2}$/iu.test(b.slice(p+1,p+3)))return!0;p=b.indexOf("%",p+3)}return!1}function W(b){return b[0]==="["&&b[b.length-1]==="]"}function Y(b){let p=b[4];return V(b[3])||p!==void 0&&!W(p)&&V(p)||V(b[6])||V(b[7])||V(b[8])}function ae(b,p,_,z){if(!p.unicodeSupport&&(!_||!_.unicodeSupport)&&b.host&&!W(b.host)&&(p.domainHost||_&&_.domainHost)&&z===!1&&h(b.host))try{b.host=new URL("http://"+b.host).hostname}catch(I){return b.error=b.error||"Host's domain name can not be converted to ASCII: "+I,!0}return!1}function we(b,p){let _=Object.assign({},p),z={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},I=!1,U=!1,G=!1,K=!1,ue=!1,Pe=!1,T=!1;if(_.reference==="suffix")if(_.scheme)b=_.scheme+":"+b;else b="//"+b;let q=b.match(A);if(q!==null&&q[1].indexOf("\\")!==-1)z.error="URI authority must not contain a literal backslash.",I=!0;let F=b.match(H);if(F!==null){let re=F[1],se=re.replace(/[\t\n\r]/g,"");if(se.length>=2){if(se.slice(0,2)!=="//")z.error=z.error||"URI authority must not contain a literal backslash.",I=!0;else if(re.length!==se.length)z.error=z.error||"URI authority introducer must not contain whitespace.",I=!0}}let ee=b.match(E);if(ee){if(z.scheme=ee[1],z.userinfo=ee[3],z.host=ee[4],z.port=parseInt(ee[5],10),z.path=ee[6]||"",z.query=ee[7],z.fragment=ee[8],z.scheme!==void 0){let _e=unescape(z.scheme);if(y.test(_e))z.scheme=_e.toLowerCase();else z.error=z.error||"URI scheme is malformed.",Pe=!0}if(U=Y(ee),U)z.error=z.error||"URI contains malformed percent-encoding.";if(isNaN(z.port))z.port=ee[5];let re=j(z,ee);if(re!==void 0)z.error=z.error||re,I=!0;if(z.host)if(m(z.host)===!1){let _e=W(z.host),Ze=z.host.indexOf("[")!==-1||z.host.indexOf("]")!==-1,ke=r(z.host);if(T=ke.isIPV6||ke.isIPVFuture===!0,ue=Ze&&(!_e||ke.error===!0),z.host=T?ke.host:ke.host.toLowerCase(),ue)z.error=z.error||"URI host is malformed.",I=!0}else T=!0;if(z.scheme===void 0&&z.userinfo===void 0&&z.host===void 0&&z.port===void 0&&z.query===void 0&&!z.path)z.reference="same-document";else if(z.scheme===void 0)z.reference="relative";else if(z.fragment===void 0)z.reference="absolute";else z.reference="uri";if(_.reference&&_.reference!=="suffix"&&_.reference!==z.reference)z.error=z.error||"URI is not a "+_.reference+" reference.";let se=v(_.scheme||z.scheme);if(!ue)K=ae(z,_,se,T);if(b.indexOf("%")!==-1&&z.host!==void 0&&!ue){let _e=T?z.host:s(z.host,!0);if(!T)_e=s(_e.toLowerCase());z.host=d(_e,T)}if(!se||se&&!se.skipNormalize){if(z.path)z.path=i(z.path);if(z.query)z.query=c(z.query);if(z.fragment)z.fragment=c(z.fragment)}if(se&&se.parse){if(se.parse(z,_),se===f.urn&&z.nid===void 0)G=!0}}else z.error=z.error||"URI can not be parsed.";return{parsed:z,malformedAuthorityOrPort:I,malformedPercentEncoding:U,malformedSchemeSpecific:G,malformedHost:K,malformedScheme:Pe}}function $e(b,p){return we(b,p).parsed}function Ce(b,p){return de(b,p).normalized}function de(b,p){let{parsed:_,malformedAuthorityOrPort:z,malformedPercentEncoding:I,malformedSchemeSpecific:U,malformedHost:G,malformedScheme:K}=we(b,p);return{normalized:z||I||U||G||K?b:S(_,p),malformedAuthorityOrPort:z,malformedPercentEncoding:I,malformedSchemeSpecific:U,malformedHost:G,malformedScheme:K}}function N(b,p){if(typeof b!=="string"&&typeof b!=="object")return;let _;try{_=typeof b==="string"?b:S(b,p)}catch{return}let{normalized:z,malformedAuthorityOrPort:I,malformedPercentEncoding:U,malformedSchemeSpecific:G,malformedHost:K,malformedScheme:ue}=de(_,p);return I||U||G||K||ue?void 0:z}let M={SCHEMES:f,normalize:w,resolve:x,resolveComponent:O,equal:R,serialize:S,parse:$e};t.exports=M,t.exports.default=M,t.exports.fastUri=M});var Ak=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Nk();t.code='require("ajv/dist/runtime/uri").default',e.default=t}),Uu=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=no();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});let o=wn(),n=so(),s=Ob(),i=Ti(),a=le(),c=Ei(),u=ki(),l=ye(),d=Ck(),m=Ak(),h=(N,M)=>new RegExp(N,M);h.code="new RegExp";let f=["removeAdditional","useDefaults","coerceTypes"],v=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},P=200;function w(N){var M,b,p,_,z,I,U,G,K,ue,Pe,T,q,F,ee,re,se,_e,Ze,ke,De,Ie,ht,Ve,jt;let zt=N.strict,Mt=(M=N.code)===null||M===void 0?void 0:M.optimize,Vt=Mt===!0||Mt===void 0?1:Mt||0,Ht=(p=(b=N.code)===null||b===void 0?void 0:b.regExp)!==null&&p!==void 0?p:h,ir=(_=N.uriResolver)!==null&&_!==void 0?_:m.default;return{strictSchema:(I=(z=N.strictSchema)!==null&&z!==void 0?z:zt)!==null&&I!==void 0?I:!0,strictNumbers:(G=(U=N.strictNumbers)!==null&&U!==void 0?U:zt)!==null&&G!==void 0?G:!0,strictTypes:(ue=(K=N.strictTypes)!==null&&K!==void 0?K:zt)!==null&&ue!==void 0?ue:"log",strictTuples:(T=(Pe=N.strictTuples)!==null&&Pe!==void 0?Pe:zt)!==null&&T!==void 0?T:"log",strictRequired:(F=(q=N.strictRequired)!==null&&q!==void 0?q:zt)!==null&&F!==void 0?F:!1,code:N.code?{...N.code,optimize:Vt,regExp:Ht}:{optimize:Vt,regExp:Ht},loopRequired:(ee=N.loopRequired)!==null&&ee!==void 0?ee:P,loopEnum:(re=N.loopEnum)!==null&&re!==void 0?re:P,meta:(se=N.meta)!==null&&se!==void 0?se:!0,messages:(_e=N.messages)!==null&&_e!==void 0?_e:!0,inlineRefs:(Ze=N.inlineRefs)!==null&&Ze!==void 0?Ze:!0,schemaId:(ke=N.schemaId)!==null&&ke!==void 0?ke:"$id",addUsedSchema:(De=N.addUsedSchema)!==null&&De!==void 0?De:!0,validateSchema:(Ie=N.validateSchema)!==null&&Ie!==void 0?Ie:!0,validateFormats:(ht=N.validateFormats)!==null&&ht!==void 0?ht:!0,unicodeRegExp:(Ve=N.unicodeRegExp)!==null&&Ve!==void 0?Ve:!0,int32range:(jt=N.int32range)!==null&&jt!==void 0?jt:!0,uriResolver:ir}}var x=class{constructor(N={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,N=this.opts={...N,...w(N)};let{es5:M,lines:b}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:v,es5:M,lines:b}),this.logger=V(N.logger);let p=N.validateFormats;if(N.validateFormats=!1,this.RULES=(0,s.getRules)(),O.call(this,y,N,"NOT SUPPORTED"),O.call(this,g,N,"DEPRECATED","warn"),this._metaOpts=H.call(this),N.formats)E.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),N.keywords)A.call(this,N.keywords);if(typeof N.meta=="object")this.addMetaSchema(N.meta);S.call(this),N.validateFormats=p}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:N,meta:M,schemaId:b}=this.opts,p=d;if(b==="id")p={...d},p.id=p.$id,delete p.$id;if(M&&N)this.addMetaSchema(p,p[b],!1)}defaultMeta(){let{meta:N,schemaId:M}=this.opts;return this.opts.defaultMeta=typeof N=="object"?N[M]||N:void 0}validate(N,M){let b;if(typeof N=="string"){if(b=this.getSchema(N),!b)throw Error(`no schema with key or ref "${N}"`)}else b=this.compile(N);let p=b(M);if(!("$async"in b))this.errors=b.errors;return p}compile(N,M){let b=this._addSchema(N,M);return b.validate||this._compileSchemaEnv(b)}compileAsync(N,M){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:b}=this.opts;return p.call(this,N,M);async function p(K,ue){await _.call(this,K.$schema);let Pe=this._addSchema(K,ue);return Pe.validate||z.call(this,Pe)}async function _(K){if(K&&!this.getSchema(K))await p.call(this,{$ref:K},!0)}async function z(K){try{return this._compileSchemaEnv(K)}catch(ue){if(!(ue instanceof n.default))throw ue;return I.call(this,ue),await U.call(this,ue.missingSchema),z.call(this,K)}}function I({missingSchema:K,missingRef:ue}){if(this.refs[K])throw Error(`AnySchema ${K} is loaded but ${ue} cannot be resolved`)}async function U(K){let ue=await G.call(this,K);if(!this.refs[K])await _.call(this,ue.$schema);if(!this.refs[K])this.addSchema(ue,K,M)}async function G(K){let ue=this._loading[K];if(ue)return ue;try{return await(this._loading[K]=b(K))}finally{delete this._loading[K]}}}addSchema(N,M,b,p=this.opts.validateSchema){if(Array.isArray(N)){for(let z of N)this.addSchema(z,void 0,b,p);return this}let _;if(typeof N==="object"){let{schemaId:z}=this.opts;if(_=N[z],_!==void 0&&typeof _!="string")throw Error(`schema ${z} must be string`)}return M=(0,c.normalizeId)(M||_),this._checkUnique(M),this.schemas[M]=this._addSchema(N,b,M,p,!0),this}addMetaSchema(N,M,b=this.opts.validateSchema){return this.addSchema(N,M,!0,b),this}validateSchema(N,M){if(typeof N=="boolean")return!0;let b;if(b=N.$schema,b!==void 0&&typeof b!="string")throw Error("$schema must be a string");if(b=b||this.opts.defaultMeta||this.defaultMeta(),!b)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let p=this.validate(b,N);if(!p&&M){let _="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(_);else throw Error(_)}return p}getSchema(N){let M;while(typeof(M=R.call(this,N))=="string")N=M;if(M===void 0){let{schemaId:b}=this.opts,p=new i.SchemaEnv({schema:{},schemaId:b});if(M=i.resolveSchema.call(this,p,N),!M)return;this.refs[N]=M}return M.validate||this._compileSchemaEnv(M)}removeSchema(N){if(N instanceof RegExp)return this._removeAllSchemas(this.schemas,N),this._removeAllSchemas(this.refs,N),this;switch(typeof N){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let M=R.call(this,N);if(typeof M=="object")this._cache.delete(M.schema);return delete this.schemas[N],delete this.refs[N],this}case"object":{let M=N;this._cache.delete(M);let b=N[this.opts.schemaId];if(b)b=(0,c.normalizeId)(b),delete this.schemas[b],delete this.refs[b];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(N){for(let M of N)this.addKeyword(M);return this}addKeyword(N,M){let b;if(typeof N=="string"){if(b=N,typeof M=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),M.keyword=b}else if(typeof N=="object"&&M===void 0){if(M=N,b=M.keyword,Array.isArray(b)&&!b.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Y.call(this,b,M),!M)return(0,l.eachItem)(b,(_)=>ae.call(this,_)),this;$e.call(this,M);let p={...M,type:(0,u.getJSONTypes)(M.type),schemaType:(0,u.getJSONTypes)(M.schemaType)};return(0,l.eachItem)(b,p.type.length===0?(_)=>ae.call(this,_,p):(_)=>p.type.forEach((z)=>ae.call(this,_,p,z))),this}getKeyword(N){let M=this.RULES.all[N];return typeof M=="object"?M.definition:!!M}removeKeyword(N){let{RULES:M}=this;delete M.keywords[N],delete M.all[N];for(let b of M.rules){let p=b.rules.findIndex((_)=>_.keyword===N);if(p>=0)b.rules.splice(p,1)}return this}addFormat(N,M){if(typeof M=="string")M=new RegExp(M);return this.formats[N]=M,this}errorsText(N=this.errors,{separator:M=", ",dataVar:b="data"}={}){if(!N||N.length===0)return"No errors";return N.map((p)=>`${b}${p.instancePath} ${p.message}`).reduce((p,_)=>p+M+_)}$dataMetaSchema(N,M){let b=this.RULES.all;N=JSON.parse(JSON.stringify(N));for(let p of M){let _=p.split("/").slice(1),z=N;for(let I of _)z=z[I];for(let I in b){let U=b[I];if(typeof U!="object")continue;let{$data:G}=U.definition,K=z[I];if(G&&K)z[I]=de(K)}}return N}_removeAllSchemas(N,M){for(let b in N){let p=N[b];if(!M||M.test(b)){if(typeof p=="string")delete N[b];else if(p&&!p.meta)this._cache.delete(p.schema),delete N[b]}}}_addSchema(N,M,b,p=this.opts.validateSchema,_=this.opts.addUsedSchema){let z,{schemaId:I}=this.opts;if(typeof N=="object")z=N[I];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof N!="boolean")throw Error("schema must be object or boolean");let U=this._cache.get(N);if(U!==void 0)return U;b=(0,c.normalizeId)(z||b);let G=c.getSchemaRefs.call(this,N,b);if(U=new i.SchemaEnv({schema:N,schemaId:I,meta:M,baseId:b,localRefs:G}),this._cache.set(U.schema,U),_&&!b.startsWith("#")){if(b)this._checkUnique(b);this.refs[b]=U}if(p)this.validateSchema(N,!0);return U}_checkUnique(N){if(this.schemas[N]||this.refs[N])throw Error(`schema with key or id "${N}" already exists`)}_compileSchemaEnv(N){if(N.meta)this._compileMetaSchema(N);else i.compileSchema.call(this,N);if(!N.validate)throw Error("ajv implementation error");return N.validate}_compileMetaSchema(N){let M=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,N)}finally{this.opts=M}}};x.ValidationError=o.default,x.MissingRefError=n.default,e.default=x;function O(N,M,b,p="error"){for(let _ in N){let z=_;if(z in M)this.logger[p](`${b}: option ${_}. ${N[z]}`)}}function R(N){return N=(0,c.normalizeId)(N),this.schemas[N]||this.refs[N]}function S(){let N=this.opts.schemas;if(!N)return;if(Array.isArray(N))this.addSchema(N);else for(let M in N)this.addSchema(N[M],M)}function E(){for(let N in this.opts.formats){let M=this.opts.formats[N];if(M)this.addFormat(N,M)}}function A(N){if(Array.isArray(N)){this.addVocabulary(N);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let M in N){let b=N[M];if(!b.keyword)b.keyword=M;this.addKeyword(b)}}function H(){let N={...this.opts};for(let M of f)delete N[M];return N}let j={log(){},warn(){},error(){}};function V(N){if(N===!1)return j;if(N===void 0)return console;if(N.log&&N.warn&&N.error)return N;throw Error("logger must implement log, warn and error methods")}let W=/^[a-z_$][a-z0-9_$:-]*$/i;function Y(N,M){let{RULES:b}=this;if((0,l.eachItem)(N,(p)=>{if(b.keywords[p])throw Error(`Keyword ${p} is already defined`);if(!W.test(p))throw Error(`Keyword ${p} has invalid name`)}),!M)return;if(M.$data&&!(("code"in M)||("validate"in M)))throw Error('$data keyword must have "code" or "validate" function')}function ae(N,M,b){var p;let _=M===null||M===void 0?void 0:M.post;if(b&&_)throw Error('keyword with "post" flag cannot have "type"');let{RULES:z}=this,I=_?z.post:z.rules.find(({type:G})=>G===b);if(!I)I={type:b,rules:[]},z.rules.push(I);if(z.keywords[N]=!0,!M)return;let U={keyword:N,definition:{...M,type:(0,u.getJSONTypes)(M.type),schemaType:(0,u.getJSONTypes)(M.schemaType)}};if(M.before)we.call(this,I,U,M.before);else I.rules.push(U);z.all[N]=U,(p=M.implements)===null||p===void 0||p.forEach((G)=>this.addKeyword(G))}function we(N,M,b){let p=N.rules.findIndex((_)=>_.keyword===b);if(p>=0)N.rules.splice(p,0,M);else N.rules.push(M),this.logger.warn(`rule ${b} is not defined`)}function $e(N){let{metaSchema:M}=N;if(M===void 0)return;if(N.$data&&this.opts.$data)M=de(M);N.validateSchema=this.compile(M,!0)}let Ce={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function de(N){return{anyOf:[N,Ce]}}}),jk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};e.default=t}),Fu=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=so(),r=xt(),o=le(),n=kt(),s=Ti(),i=ye(),a={keyword:"$ref",schemaType:"string",code(l){let{gen:d,schema:m,it:h}=l,{baseId:f,schemaEnv:v,validateName:y,opts:g,self:P}=h,{root:w}=v;if((m==="#"||m==="#/")&&f===w.baseId)return O();let x=s.resolveRef.call(P,w,f,m);if(x===void 0)throw new t.default(h.opts.uriResolver,f,m);if(x instanceof s.SchemaEnv)return R(x);return S(x);function O(){if(v===w)return u(l,y,v,v.$async);let E=d.scopeValue("root",{ref:w});return u(l,o._`${E}.validate`,w,w.$async)}function R(E){u(l,c(l,E),E,E.$async)}function S(E){let A=d.scopeValue("schema",g.code.source===!0?{ref:E,code:(0,o.stringify)(E)}:{ref:E}),H=d.name("valid"),j=l.subschema({schema:E,dataTypes:[],schemaPath:o.nil,topSchemaRef:A,errSchemaPath:m},H);l.mergeEvaluated(j),l.ok(H)}}};function c(l,d){let{gen:m}=l;return d.validate?m.scopeValue("validate",{ref:d.validate}):o._`${m.scopeValue("wrapper",{ref:d})}.validate`}e.getValidate=c;function u(l,d,m,h){let{gen:f,it:v}=l,{allErrors:y,schemaEnv:g,opts:P}=v,w=P.passContext?n.default.this:o.nil;if(h)x();else O();function x(){if(!g.$async)throw Error("async schema referenced by sync schema");let E=f.let("valid");f.try(()=>{if(f.code(o._`await ${(0,r.callValidateCode)(l,d,w)}`),S(d),!y)f.assign(E,!0)},(A)=>{if(f.if(o._`!(${A} instanceof ${v.ValidationError})`,()=>f.throw(A)),R(A),!y)f.assign(E,!1)}),l.ok(E)}function O(){l.result((0,r.callValidateCode)(l,d,w),()=>S(d),()=>R(d))}function R(E){let A=o._`${E}.errors`;f.assign(n.default.vErrors,o._`${n.default.vErrors} === null ? ${A} : ${n.default.vErrors}.concat(${A})`),f.assign(n.default.errors,o._`${n.default.vErrors}.length`)}function S(E){var A;if(!v.opts.unevaluated)return;let H=(A=m===null||m===void 0?void 0:m.validate)===null||A===void 0?void 0:A.evaluated;if(v.props!==!0)if(H&&!H.dynamicProps){if(H.props!==void 0)v.props=i.mergeEvaluated.props(f,H.props,v.props)}else{let j=f.var("props",o._`${E}.evaluated.props`);v.props=i.mergeEvaluated.props(f,j,v.props,o.Name)}if(v.items!==!0)if(H&&!H.dynamicItems){if(H.items!==void 0)v.items=i.mergeEvaluated.items(f,H.items,v.items)}else{let j=f.var("items",o._`${E}.evaluated.items`);v.items=i.mergeEvaluated.items(f,j,v.items,o.Name)}}}e.callRef=u,e.default=a}),Ab=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=jk(),r=Fu(),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default];e.default=o}),Mk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=t.operators,o={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},n={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:s,schemaCode:i})=>t.str`must be ${o[s].okStr} ${i}`,params:({keyword:s,schemaCode:i})=>t._`{comparison: ${o[s].okStr}, limit: ${i}}`},code(s){let{keyword:i,data:a,schemaCode:c}=s;s.fail$data(t._`${a} ${o[i].fail} ${c} || isNaN(${a})`)}};e.default=n}),Zk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:o})=>t.str`must be multiple of ${o}`,params:({schemaCode:o})=>t._`{multipleOf: ${o}}`},code(o){let{gen:n,data:s,schemaCode:i,it:a}=o,c=a.opts.multipleOfPrecision,u=n.let("res"),l=c?t._`Math.abs(Math.round(${u}) - ${u}) > 1e-${c}`:t._`${u} !== parseInt(${u})`;o.fail$data(t._`(${i} === 0 || (${u} = ${s}/${i}, ${l}))`)}};e.default=r}),qk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});function t(r){let o=r.length,n=0,s=0,i;while(s<o)if(n++,i=r.charCodeAt(s++),i>=55296&&i<=56319&&s<o){if(i=r.charCodeAt(s),(i&64512)===56320)s++}return n}e.default=t,t.code='require("ajv/dist/runtime/ucs2length").default'}),Lk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=ye(),o=qk(),n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:i}){let a=s==="maxLength"?"more":"fewer";return t.str`must NOT have ${a} than ${i} characters`},params:({schemaCode:s})=>t._`{limit: ${s}}`},code(s){let{keyword:i,data:a,schemaCode:c,it:u}=s,l=i==="maxLength"?t.operators.GT:t.operators.LT,d=u.opts.unicode===!1?t._`${a}.length`:t._`${(0,r.useFunc)(s.gen,o.default)}(${a})`;s.fail$data(t._`${d} ${l} ${c}`)}};e.default=n}),Dk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xt(),r=ye(),o=le(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>o.str`must match pattern "${s}"`,params:({schemaCode:s})=>o._`{pattern: ${s}}`},code(s){let{gen:i,data:a,$data:c,schema:u,schemaCode:l,it:d}=s,m=d.opts.unicodeRegExp?"u":"";if(c){let{regExp:h}=d.opts.code,f=h.code==="new RegExp"?o._`new RegExp`:(0,r.useFunc)(i,h),v=i.let("valid");i.try(()=>i.assign(v,o._`${f}(${l}, ${m}).test(${a})`),()=>i.assign(v,!1)),s.fail$data(o._`!${v}`)}else{let h=(0,t.usePattern)(s,u);s.fail$data(o._`!${h}.test(${a})`)}}};e.default=n}),Uk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let s=o==="maxProperties"?"more":"fewer";return t.str`must NOT have ${s} than ${n} properties`},params:({schemaCode:o})=>t._`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:i}=o,a=n==="maxProperties"?t.operators.GT:t.operators.LT;o.fail$data(t._`Object.keys(${s}).length ${a} ${i}`)}};e.default=r}),Fk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xt(),r=le(),o=ye(),n={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>r.str`must have required property '${s}'`,params:({params:{missingProperty:s}})=>r._`{missingProperty: ${s}}`},code(s){let{gen:i,schema:a,schemaCode:c,data:u,$data:l,it:d}=s,{opts:m}=d;if(!l&&a.length===0)return;let h=a.length>=m.loopRequired;if(d.allErrors)f();else v();if(m.strictRequired){let P=s.parentSchema.properties,{definedProperties:w}=s.it;for(let x of a)if((P===null||P===void 0?void 0:P[x])===void 0&&!w.has(x)){let O=`required property "${x}" is not defined at "${d.schemaEnv.baseId+d.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(d,O,d.opts.strictRequired)}}function f(){if(h||l)s.block$data(r.nil,y);else for(let P of a)(0,t.checkReportMissingProp)(s,P)}function v(){let P=i.let("missing");if(h||l){let w=i.let("valid",!0);s.block$data(w,()=>g(P,w)),s.ok(w)}else i.if((0,t.checkMissingProp)(s,a,P)),(0,t.reportMissingProp)(s,P),i.else()}function y(){i.forOf("prop",c,(P)=>{s.setParams({missingProperty:P}),i.if((0,t.noPropertyInData)(i,u,P,m.ownProperties),()=>s.error())})}function g(P,w){s.setParams({missingProperty:P}),i.forOf(P,c,()=>{i.assign(w,(0,t.propertyInData)(i,u,P,m.ownProperties)),i.if((0,r.not)(w),()=>{s.error(),i.break()})},r.nil)}}};e.default=n}),Vk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let s=o==="maxItems"?"more":"fewer";return t.str`must NOT have ${s} than ${n} items`},params:({schemaCode:o})=>t._`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:i}=o,a=n==="maxItems"?t.operators.GT:t.operators.LT;o.fail$data(t._`${s}.length ${a} ${i}`)}};e.default=r}),Vu=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ib();t.code='require("ajv/dist/runtime/equal").default',e.default=t}),Hk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ki(),r=le(),o=ye(),n=Vu(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i,j:a}})=>r.str`must NOT have duplicate items (items ## ${a} and ${i} are identical)`,params:({params:{i,j:a}})=>r._`{i: ${i}, j: ${a}}`},code(i){let{gen:a,data:c,$data:u,schema:l,parentSchema:d,schemaCode:m,it:h}=i;if(!u&&!l)return;let f=a.let("valid"),v=d.items?(0,t.getSchemaTypes)(d.items):[];i.block$data(f,y,r._`${m} === false`),i.ok(f);function y(){let x=a.let("i",r._`${c}.length`),O=a.let("j");i.setParams({i:x,j:O}),a.assign(f,!0),a.if(r._`${x} > 1`,()=>(g()?P:w)(x,O))}function g(){return v.length>0&&!v.some((x)=>x==="object"||x==="array")}function P(x,O){let R=a.name("item"),S=(0,t.checkDataTypes)(v,R,h.opts.strictNumbers,t.DataType.Wrong),E=a.const("indices",r._`{}`);a.for(r._`;${x}--;`,()=>{if(a.let(R,r._`${c}[${x}]`),a.if(S,r._`continue`),v.length>1)a.if(r._`typeof ${R} == "string"`,r._`${R} += "_"`);a.if(r._`typeof ${E}[${R}] == "number"`,()=>{a.assign(O,r._`${E}[${R}]`),i.error(),a.assign(f,!1).break()}).code(r._`${E}[${R}] = ${x}`)})}function w(x,O){let R=(0,o.useFunc)(a,n.default),S=a.name("outer");a.label(S).for(r._`;${x}--;`,()=>a.for(r._`${O} = ${x}; ${O}--;`,()=>a.if(r._`${R}(${c}[${x}], ${c}[${O}])`,()=>{i.error(),a.assign(f,!1).break(S)})))}}};e.default=s}),Bk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=ye(),o=Vu(),n={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>t._`{allowedValue: ${s}}`},code(s){let{gen:i,data:a,$data:c,schemaCode:u,schema:l}=s;if(c||l&&typeof l=="object")s.fail$data(t._`!${(0,r.useFunc)(i,o.default)}(${a}, ${u})`);else s.fail(t._`${l} !== ${a}`)}};e.default=n}),Jk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=ye(),o=Vu(),n={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>t._`{allowedValues: ${s}}`},code(s){let{gen:i,data:a,$data:c,schema:u,schemaCode:l,it:d}=s;if(!c&&u.length===0)throw Error("enum must have non-empty array");let m=u.length>=d.opts.loopEnum,h,f=()=>h!==null&&h!==void 0?h:h=(0,r.useFunc)(i,o.default),v;if(m||c)v=i.let("valid"),s.block$data(v,y);else{if(!Array.isArray(u))throw Error("ajv implementation error");let P=i.const("vSchema",l);v=(0,t.or)(...u.map((w,x)=>g(P,x)))}s.pass(v);function y(){i.assign(v,!1),i.forOf("v",l,(P)=>i.if(t._`${f()}(${a}, ${P})`,()=>i.assign(v,!0).break()))}function g(P,w){let x=u[w];return typeof x==="object"&&x!==null?t._`${f()}(${a}, ${P}[${w}])`:t._`${a} === ${x}`}}};e.default=n}),jb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Mk(),r=Zk(),o=Lk(),n=Dk(),s=Uk(),i=Fk(),a=Vk(),c=Hk(),u=Bk(),l=Jk(),d=[t.default,r.default,o.default,n.default,s.default,i.default,a.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,l.default];e.default=d}),Mb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=le(),r=ye(),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>t.str`must NOT have more than ${s} items`,params:({params:{len:s}})=>t._`{limit: ${s}}`},code(s){let{parentSchema:i,it:a}=s,{items:c}=i;if(!Array.isArray(c)){(0,r.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(s,c)}};function n(s,i){let{gen:a,schema:c,data:u,keyword:l,it:d}=s;d.items=!0;let m=a.const("len",t._`${u}.length`);if(c===!1)s.setParams({len:i.length}),s.pass(t._`${m} <= ${i.length}`);else if(typeof c=="object"&&!(0,r.alwaysValidSchema)(d,c)){let f=a.var("valid",t._`${m} <= ${i.length}`);a.if((0,t.not)(f),()=>h(f)),s.ok(f)}function h(f){a.forRange("i",i.length,m,(v)=>{if(s.subschema({keyword:l,dataProp:v,dataPropType:r.Type.Num},f),!d.allErrors)a.if((0,t.not)(f),()=>a.break())})}}e.validateAdditionalItems=n,e.default=o}),Zb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=le(),r=ye(),o=xt(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){let{schema:a,it:c}=i;if(Array.isArray(a))return s(i,"additionalItems",a);if(c.items=!0,(0,r.alwaysValidSchema)(c,a))return;i.ok((0,o.validateArray)(i))}};function s(i,a,c=i.schema){let{gen:u,parentSchema:l,data:d,keyword:m,it:h}=i;if(y(l),h.opts.unevaluated&&c.length&&h.items!==!0)h.items=r.mergeEvaluated.items(u,c.length,h.items);let f=u.name("valid"),v=u.const("len",t._`${d}.length`);c.forEach((g,P)=>{if((0,r.alwaysValidSchema)(h,g))return;u.if(t._`${v} > ${P}`,()=>i.subschema({keyword:m,schemaProp:P,dataProp:P},f)),i.ok(f)});function y(g){let{opts:P,errSchemaPath:w}=h,x=c.length,O=x===g.minItems&&(x===g.maxItems||g[a]===!1);if(P.strictTuples&&!O){let R=`"${m}" is ${x}-tuple, but minItems or maxItems/${a} are not specified or different at path "${w}"`;(0,r.checkStrictMode)(h,R,P.strictTuples)}}}e.validateTuple=s,e.default=n}),Kk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Zb(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(o)=>(0,t.validateTuple)(o,"items")};e.default=r}),Gk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=ye(),o=xt(),n=Mb(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:i}})=>t.str`must NOT have more than ${i} items`,params:({params:{len:i}})=>t._`{limit: ${i}}`},code(i){let{schema:a,parentSchema:c,it:u}=i,{prefixItems:l}=c;if(u.items=!0,(0,r.alwaysValidSchema)(u,a))return;if(l)(0,n.validateAdditionalItems)(i,l);else i.ok((0,o.validateArray)(i))}};e.default=s}),Wk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=ye(),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:n,max:s}})=>s===void 0?t.str`must contain at least ${n} valid item(s)`:t.str`must contain at least ${n} and no more than ${s} valid item(s)`,params:({params:{min:n,max:s}})=>s===void 0?t._`{minContains: ${n}}`:t._`{minContains: ${n}, maxContains: ${s}}`},code(n){let{gen:s,schema:i,parentSchema:a,data:c,it:u}=n,l,d,{minContains:m,maxContains:h}=a;if(u.opts.next)l=m===void 0?1:m,d=h;else l=1;let f=s.const("len",t._`${c}.length`);if(n.setParams({min:l,max:d}),d===void 0&&l===0){(0,r.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(d!==void 0&&l>d){(0,r.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,r.alwaysValidSchema)(u,i)){let w=t._`${f} >= ${l}`;if(d!==void 0)w=t._`${w} && ${f} <= ${d}`;n.pass(w);return}u.items=!0;let v=s.name("valid");if(d===void 0&&l===1)g(v,()=>s.if(v,()=>s.break()));else if(l===0){if(s.let(v,!0),d!==void 0)s.if(t._`${c}.length > 0`,y)}else s.let(v,!1),y();n.result(v,()=>n.reset());function y(){let w=s.name("_valid"),x=s.let("count",0);g(w,()=>s.if(w,()=>P(x)))}function g(w,x){s.forRange("i",0,f,(O)=>{n.subschema({keyword:"contains",dataProp:O,dataPropType:r.Type.Num,compositeRule:!0},w),x()})}function P(w){if(s.code(t._`${w}++`),d===void 0)s.if(t._`${w} >= ${l}`,()=>s.assign(v,!0).break());else if(s.if(t._`${w} > ${d}`,()=>s.assign(v,!1).break()),l===1)s.assign(v,!0);else s.if(t._`${w} >= ${l}`,()=>s.assign(v,!0))}}};e.default=o}),Hu=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=le(),r=ye(),o=xt();e.error={message:({params:{property:c,depsCount:u,deps:l}})=>{let d=u===1?"property":"properties";return t.str`must have ${d} ${l} when property ${c} is present`},params:({params:{property:c,depsCount:u,deps:l,missingProperty:d}})=>t._`{property: ${c},
|
|
125
|
+
missingProperty: ${d},
|
|
126
|
+
depsCount: ${u},
|
|
127
|
+
deps: ${l}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){let[u,l]=s(c);i(c,u),a(c,l)}};function s({schema:c}){let u={},l={};for(let d in c){if(d==="__proto__")continue;let m=Array.isArray(c[d])?u:l;m[d]=c[d]}return[u,l]}function i(c,u=c.schema){let{gen:l,data:d,it:m}=c;if(Object.keys(u).length===0)return;let h=l.let("missing");for(let f in u){let v=u[f];if(v.length===0)continue;let y=(0,o.propertyInData)(l,d,f,m.opts.ownProperties);if(c.setParams({property:f,depsCount:v.length,deps:v.join(", ")}),m.allErrors)l.if(y,()=>{for(let g of v)(0,o.checkReportMissingProp)(c,g)});else l.if(t._`${y} && (${(0,o.checkMissingProp)(c,v,h)})`),(0,o.reportMissingProp)(c,h),l.else()}}e.validatePropertyDeps=i;function a(c,u=c.schema){let{gen:l,data:d,keyword:m,it:h}=c,f=l.name("valid");for(let v in u){if((0,r.alwaysValidSchema)(h,u[v]))continue;l.if((0,o.propertyInData)(l,d,v,h.opts.ownProperties),()=>{let y=c.subschema({keyword:m,schemaProp:v},f);c.mergeValidEvaluated(y,f)},()=>l.var(f,!0)),c.ok(f)}}e.validateSchemaDeps=a,e.default=n}),Yk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=ye(),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:n})=>t._`{propertyName: ${n.propertyName}}`},code(n){let{gen:s,schema:i,data:a,it:c}=n;if((0,r.alwaysValidSchema)(c,i))return;let u=s.name("valid");s.forIn("key",a,(l)=>{n.setParams({propertyName:l}),n.subschema({keyword:"propertyNames",data:l,dataTypes:["string"],propertyName:l,compositeRule:!0},u),s.if((0,t.not)(u),()=>{if(n.error(!0),!c.allErrors)s.break()})}),n.ok(u)}};e.default=o}),qb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xt(),r=le(),o=kt(),n=ye(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:i})=>r._`{additionalProperty: ${i.additionalProperty}}`},code(i){let{gen:a,schema:c,parentSchema:u,data:l,errsCount:d,it:m}=i;if(!d)throw Error("ajv implementation error");let{allErrors:h,opts:f}=m;if(m.props=!0,f.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(m,c))return;let v=(0,t.allSchemaProperties)(u.properties),y=(0,t.allSchemaProperties)(u.patternProperties);g(),i.ok(r._`${d} === ${o.default.errors}`);function g(){a.forIn("key",l,(R)=>{if(!v.length&&!y.length)x(R);else a.if(P(R),()=>x(R))})}function P(R){let S;if(v.length>8){let E=(0,n.schemaRefOrVal)(m,u.properties,"properties");S=(0,t.isOwnProperty)(a,E,R)}else if(v.length)S=(0,r.or)(...v.map((E)=>r._`${R} === ${E}`));else S=r.nil;if(y.length)S=(0,r.or)(S,...y.map((E)=>r._`${(0,t.usePattern)(i,E)}.test(${R})`));return(0,r.not)(S)}function w(R){a.code(r._`delete ${l}[${R}]`)}function x(R){if(f.removeAdditional==="all"||f.removeAdditional&&c===!1){w(R);return}if(c===!1){if(i.setParams({additionalProperty:R}),i.error(),!h)a.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(m,c)){let S=a.name("valid");if(f.removeAdditional==="failing")O(R,S,!1),a.if((0,r.not)(S),()=>{i.reset(),w(R)});else if(O(R,S),!h)a.if((0,r.not)(S),()=>a.break())}}function O(R,S,E){let A={keyword:"additionalProperties",dataProp:R,dataPropType:n.Type.Str};if(E===!1)Object.assign(A,{compositeRule:!0,createErrors:!1,allErrors:!1});i.subschema(A,S)}}};e.default=s}),Xk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=no(),r=xt(),o=ye(),n=qb(),s={keyword:"properties",type:"object",schemaType:"object",code(i){let{gen:a,schema:c,parentSchema:u,data:l,it:d}=i;if(d.opts.removeAdditional==="all"&&u.additionalProperties===void 0)n.default.code(new t.KeywordCxt(d,n.default,"additionalProperties"));let m=(0,r.allSchemaProperties)(c);for(let g of m)d.definedProperties.add(g);if(d.opts.unevaluated&&m.length&&d.props!==!0)d.props=o.mergeEvaluated.props(a,(0,o.toHash)(m),d.props);let h=m.filter((g)=>!(0,o.alwaysValidSchema)(d,c[g]));if(h.length===0)return;let f=a.name("valid");for(let g of h){if(v(g))y(g);else{if(a.if((0,r.propertyInData)(a,l,g,d.opts.ownProperties)),y(g),!d.allErrors)a.else().var(f,!0);a.endIf()}i.it.definedProperties.add(g),i.ok(f)}function v(g){return d.opts.useDefaults&&!d.compositeRule&&c[g].default!==void 0}function y(g){i.subschema({keyword:"properties",schemaProp:g,dataProp:g},f)}}};e.default=s}),Qk=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xt(),r=le(),o=ye(),n=ye(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(i){let{gen:a,schema:c,data:u,parentSchema:l,it:d}=i,{opts:m}=d,h=(0,t.allSchemaProperties)(c),f=h.filter((O)=>(0,o.alwaysValidSchema)(d,c[O]));if(h.length===0||f.length===h.length&&(!d.opts.unevaluated||d.props===!0))return;let v=m.strictSchema&&!m.allowMatchingProperties&&l.properties,y=a.name("valid");if(d.props!==!0&&!(d.props instanceof r.Name))d.props=(0,n.evaluatedPropsToName)(a,d.props);let{props:g}=d;P();function P(){for(let O of h){if(v)w(O);if(d.allErrors)x(O);else a.var(y,!0),x(O),a.if(y)}}function w(O){for(let R in v)if(new RegExp(O).test(R))(0,o.checkStrictMode)(d,`property ${R} matches pattern ${O} (use allowMatchingProperties)`)}function x(O){a.forIn("key",u,(R)=>{a.if(r._`${(0,t.usePattern)(i,O)}.test(${R})`,()=>{let S=f.includes(O);if(!S)i.subschema({keyword:"patternProperties",schemaProp:O,dataProp:R,dataPropType:n.Type.Str},y);if(d.opts.unevaluated&&g!==!0)a.assign(r._`${g}[${R}]`,!0);else if(!S&&!d.allErrors)a.if((0,r.not)(y),()=>a.break())})})}}};e.default=s}),eE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ye(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(o){let{gen:n,schema:s,it:i}=o;if((0,t.alwaysValidSchema)(i,s)){o.fail();return}let a=n.name("valid");o.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),o.failResult(a,()=>o.reset(),()=>o.error())},error:{message:"must NOT be valid"}};e.default=r}),tE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:xt().validateUnion,error:{message:"must match a schema in anyOf"}};e.default=t}),rE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=ye(),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:n})=>t._`{passingSchemas: ${n.passing}}`},code(n){let{gen:s,schema:i,parentSchema:a,it:c}=n;if(!Array.isArray(i))throw Error("ajv implementation error");if(c.opts.discriminator&&a.discriminator)return;let u=i,l=s.let("valid",!1),d=s.let("passing",null),m=s.name("_valid");n.setParams({passing:d}),s.block(h),n.result(l,()=>n.reset(),()=>n.error(!0));function h(){u.forEach((f,v)=>{let y;if((0,r.alwaysValidSchema)(c,f))s.var(m,!0);else y=n.subschema({keyword:"oneOf",schemaProp:v,compositeRule:!0},m);if(v>0)s.if(t._`${m} && ${l}`).assign(l,!1).assign(d,t._`[${d}, ${v}]`).else();s.if(m,()=>{if(s.assign(l,!0),s.assign(d,v),y)n.mergeEvaluated(y,t.Name)})})}}};e.default=o}),oE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ye(),r={keyword:"allOf",schemaType:"array",code(o){let{gen:n,schema:s,it:i}=o;if(!Array.isArray(s))throw Error("ajv implementation error");let a=n.name("valid");s.forEach((c,u)=>{if((0,t.alwaysValidSchema)(i,c))return;let l=o.subschema({keyword:"allOf",schemaProp:u},a);o.ok(a),o.mergeEvaluated(l)})}};e.default=r}),nE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=ye(),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>t.str`must match "${s.ifClause}" schema`,params:({params:s})=>t._`{failingKeyword: ${s.ifClause}}`},code(s){let{gen:i,parentSchema:a,it:c}=s;if(a.then===void 0&&a.else===void 0)(0,r.checkStrictMode)(c,'"if" without "then" and "else" is ignored');let u=n(c,"then"),l=n(c,"else");if(!u&&!l)return;let d=i.let("valid",!0),m=i.name("_valid");if(h(),s.reset(),u&&l){let v=i.let("ifClause");s.setParams({ifClause:v}),i.if(m,f("then",v),f("else",v))}else if(u)i.if(m,f("then"));else i.if((0,t.not)(m),f("else"));s.pass(d,()=>s.error(!0));function h(){let v=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},m);s.mergeEvaluated(v)}function f(v,y){return()=>{let g=s.subschema({keyword:v},m);if(i.assign(d,m),s.mergeValidEvaluated(g,d),y)i.assign(y,t._`${v}`);else s.setParams({ifClause:v})}}}};function n(s,i){let a=s.schema[i];return a!==void 0&&!(0,r.alwaysValidSchema)(s,a)}e.default=o}),sE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ye(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:o,parentSchema:n,it:s}){if(n.if===void 0)(0,t.checkStrictMode)(s,`"${o}" without "if" is ignored`)}};e.default=r}),Lb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Mb(),r=Kk(),o=Zb(),n=Gk(),s=Wk(),i=Hu(),a=Yk(),c=qb(),u=Xk(),l=Qk(),d=eE(),m=tE(),h=rE(),f=oE(),v=nE(),y=sE();function g(P=!1){let w=[d.default,m.default,h.default,f.default,v.default,y.default,a.default,c.default,i.default,u.default,l.default];if(P)w.push(r.default,n.default);else w.push(t.default,o.default);return w.push(s.default),w}e.default=g}),iE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>t.str`must match format "${o}"`,params:({schemaCode:o})=>t._`{format: ${o}}`},code(o,n){let{gen:s,data:i,$data:a,schema:c,schemaCode:u,it:l}=o,{opts:d,errSchemaPath:m,schemaEnv:h,self:f}=l;if(!d.validateFormats)return;if(a)v();else y();function v(){let g=s.scopeValue("formats",{ref:f.formats,code:d.code.formats}),P=s.const("fDef",t._`${g}[${u}]`),w=s.let("fType"),x=s.let("format");s.if(t._`typeof ${P} == "object" && !(${P} instanceof RegExp)`,()=>s.assign(w,t._`${P}.type || "string"`).assign(x,t._`${P}.validate`),()=>s.assign(w,t._`"string"`).assign(x,P)),o.fail$data((0,t.or)(O(),R()));function O(){if(d.strictSchema===!1)return t.nil;return t._`${u} && !${x}`}function R(){let S=h.$async?t._`(${P}.async ? await ${x}(${i}) : ${x}(${i}))`:t._`${x}(${i})`,E=t._`(typeof ${x} == "function" ? ${S} : ${x}.test(${i}))`;return t._`${x} && ${x} !== true && ${w} === ${n} && !${E}`}}function y(){let g=f.formats[c];if(!g){O();return}if(g===!0)return;let[P,w,x]=R(g);if(P===n)o.pass(S());function O(){if(d.strictSchema===!1){f.logger.warn(E());return}throw Error(E());function E(){return`unknown format "${c}" ignored in schema at path "${m}"`}}function R(E){let A=E instanceof RegExp?(0,t.regexpCode)(E):d.code.formats?t._`${d.code.formats}${(0,t.getProperty)(c)}`:void 0,H=s.scopeValue("formats",{key:c,ref:E,code:A});if(typeof E=="object"&&!(E instanceof RegExp))return[E.type||"string",E.validate,t._`${H}.validate`];return["string",E,H]}function S(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!h.$async)throw Error("async format in sync schema");return t._`await ${x}(${i})`}return typeof w=="function"?t._`${x}(${i})`:t._`${x}.test(${i})`}}}};e.default=r}),Db=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[iE().default];e.default=t}),Ub=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),Fb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ab(),r=jb(),o=Lb(),n=Db(),s=Ub(),i=[t.default,r.default,(0,o.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];e.default=i}),aE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(r){r.Tag="tag",r.Mapping="mapping"})(t||(e.DiscrError=t={}))}),Bu=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=aE(),o=Ti(),n=so(),s=ye(),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:c}})=>a===r.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:a,tag:c,tagName:u}})=>t._`{error: ${a}, tag: ${u}, tagValue: ${c}}`},code(a){let{gen:c,data:u,schema:l,parentSchema:d,it:m}=a,{oneOf:h}=d;if(!m.opts.discriminator)throw Error("discriminator: requires discriminator option");let f=l.propertyName;if(typeof f!="string")throw Error("discriminator: requires propertyName");if(l.mapping)throw Error("discriminator: mapping is not supported");if(!h)throw Error("discriminator: requires oneOf keyword");let v=c.let("valid",!1),y=c.const("tag",t._`${u}${(0,t.getProperty)(f)}`);c.if(t._`typeof ${y} == "string"`,()=>g(),()=>a.error(!1,{discrError:r.DiscrError.Tag,tag:y,tagName:f})),a.ok(v);function g(){let x=w();c.if(!1);for(let O in x)c.elseIf(t._`${y} === ${O}`),c.assign(v,P(x[O]));c.else(),a.error(!1,{discrError:r.DiscrError.Mapping,tag:y,tagName:f}),c.endIf()}function P(x){let O=c.name("valid"),R=a.subschema({keyword:"oneOf",schemaProp:x},O);return a.mergeEvaluated(R,t.Name),O}function w(){var x;let O={},R=E(d),S=!0;for(let j=0;j<h.length;j++){let V=h[j];if((V===null||V===void 0?void 0:V.$ref)&&!(0,s.schemaHasRulesButRef)(V,m.self.RULES)){let Y=V.$ref;if(V=o.resolveRef.call(m.self,m.schemaEnv.root,m.baseId,Y),V instanceof o.SchemaEnv)V=V.schema;if(V===void 0)throw new n.default(m.opts.uriResolver,m.baseId,Y)}let W=(x=V===null||V===void 0?void 0:V.properties)===null||x===void 0?void 0:x[f];if(typeof W!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);S=S&&(R||E(V)),A(W,j)}if(!S)throw Error(`discriminator: "${f}" must be required`);return O;function E({required:j}){return Array.isArray(j)&&j.includes(f)}function A(j,V){if(j.const)H(j.const,V);else if(j.enum)for(let W of j.enum)H(W,V);else throw Error(`discriminator: "properties/${f}" must have "const" or "enum"`)}function H(j,V){if(typeof j!="string"||j in O)throw Error(`discriminator: "${f}" values must be unique strings`);O[j]=V}}}};e.default=i}),cE=B((e,t)=>{t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),Vb=B((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;let r=Uu(),o=Fb(),n=Bu(),s=cE(),i=["/properties"],a="http://json-schema.org/draft-07/schema";var c=class extends r.default{_addVocabularies(){if(super._addVocabularies(),o.default.forEach((h)=>this.addVocabulary(h)),this.opts.discriminator)this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let h=this.opts.$data?this.$dataMetaSchema(s,i):s;this.addMetaSchema(h,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}};e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var u=no();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var l=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var d=wn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var m=so();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return m.default}})}),Hb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=le(),r=kt(),o=Ti(),n=Fu(),s={keyword:"$dynamicAnchor",schemaType:"string",code:(c)=>i(c,c.schema)};function i(c,u){let{gen:l,it:d}=c;d.schemaEnv.root.dynamicAnchors[u]=!0;let m=t._`${r.default.dynamicAnchors}${(0,t.getProperty)(u)}`,h=d.errSchemaPath==="#"?d.validateName:a(c);l.if(t._`!${m}`,()=>l.assign(m,h))}e.dynamicAnchor=i;function a(c){let{schemaEnv:u,schema:l,self:d}=c.it,{root:m,baseId:h,localRefs:f,meta:v}=u.root,{schemaId:y}=d.opts,g=new o.SchemaEnv({schema:l,schemaId:y,root:m,baseId:h,localRefs:f,meta:v});return o.compileSchema.call(d,g),(0,n.getValidate)(c,g)}e.default=s}),Bb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=le(),r=kt(),o=Fu(),n={keyword:"$dynamicRef",schemaType:"string",code:(i)=>s(i,i.schema)};function s(i,a){let{gen:c,keyword:u,it:l}=i;if(a[0]!=="#")throw Error(`"${u}" only supports hash fragment reference`);let d=a.slice(1);if(l.allErrors)m();else{let f=c.let("valid",!1);m(f),i.ok(f)}function m(f){if(l.schemaEnv.root.dynamicAnchors[d]){let v=c.let("_v",t._`${r.default.dynamicAnchors}${(0,t.getProperty)(d)}`);c.if(v,h(v,f),h(l.validateName,f))}else h(l.validateName,f)()}function h(f,v){return v?()=>c.block(()=>{(0,o.callRef)(i,f),c.let(v,!0)}):()=>(0,o.callRef)(i,f)}}e.dynamicRef=s,e.default=n}),uE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Hb(),r=ye(),o={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){if(n.schema)(0,t.dynamicAnchor)(n,"");else(0,r.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};e.default=o}),lE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Bb(),r={keyword:"$recursiveRef",schemaType:"string",code:(o)=>(0,t.dynamicRef)(o,o.schema)};e.default=r}),Jb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Hb(),r=Bb(),o=uE(),n=lE(),s=[t.default,r.default,o.default,n.default];e.default=s}),dE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Hu(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:(o)=>(0,t.validatePropertyDeps)(o)};e.default=r}),pE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Hu(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(o)=>(0,t.validateSchemaDeps)(o)};e.default=r}),mE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ye(),r={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:o,parentSchema:n,it:s}){if(n.contains===void 0)(0,t.checkStrictMode)(s,`"${o}" without "contains" is ignored`)}};e.default=r}),Kb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dE(),r=pE(),o=mE(),n=[t.default,r.default,o.default];e.default=n}),fE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=ye(),o=kt(),n={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:s})=>t._`{unevaluatedProperty: ${s.unevaluatedProperty}}`},code(s){let{gen:i,schema:a,data:c,errsCount:u,it:l}=s;if(!u)throw Error("ajv implementation error");let{allErrors:d,props:m}=l;if(m instanceof t.Name)i.if(t._`${m} !== true`,()=>i.forIn("key",c,(y)=>i.if(f(m,y),()=>h(y))));else if(m!==!0)i.forIn("key",c,(y)=>m===void 0?h(y):i.if(v(m,y),()=>h(y)));l.props=!0,s.ok(t._`${u} === ${o.default.errors}`);function h(y){if(a===!1){if(s.setParams({unevaluatedProperty:y}),s.error(),!d)i.break();return}if(!(0,r.alwaysValidSchema)(l,a)){let g=i.name("valid");if(s.subschema({keyword:"unevaluatedProperties",dataProp:y,dataPropType:r.Type.Str},g),!d)i.if((0,t.not)(g),()=>i.break())}}function f(y,g){return t._`!${y} || !${y}[${g}]`}function v(y,g){let P=[];for(let w in y)if(y[w]===!0)P.push(t._`${g} !== ${w}`);return(0,t.and)(...P)}}};e.default=n}),hE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=ye(),o={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:n}})=>t.str`must NOT have more than ${n} items`,params:({params:{len:n}})=>t._`{limit: ${n}}`},code(n){let{gen:s,schema:i,data:a,it:c}=n,u=c.items||0;if(u===!0)return;let l=s.const("len",t._`${a}.length`);if(i===!1)n.setParams({len:u}),n.fail(t._`${l} > ${u}`);else if(typeof i=="object"&&!(0,r.alwaysValidSchema)(c,i)){let m=s.var("valid",t._`${l} <= ${u}`);s.if((0,t.not)(m),()=>d(m,u)),n.ok(m)}c.items=!0;function d(m,h){s.forRange("i",h,l,(f)=>{if(n.subschema({keyword:"unevaluatedItems",dataProp:f,dataPropType:r.Type.Num},m),!c.allErrors)s.if((0,t.not)(m),()=>s.break())})}}};e.default=o}),Gb=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fE(),r=hE(),o=[t.default,r.default];e.default=o}),gE=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}}),_E=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}}),yE=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}}),vE=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}}),SE=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}}),bE=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),zE=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),$E=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=gE(),r=_E(),o=yE(),n=vE(),s=SE(),i=bE(),a=zE(),c=["/properties"];function u(l){return[t,r,o,n,d(this,s),i,d(this,a)].forEach((m)=>this.addMetaSchema(m,void 0,!1)),this;function d(m,h){return l?m.$dataMetaSchema(h,c):h}}e.default=u}),RE=B((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2019=void 0;let r=Uu(),o=Fb(),n=Jb(),s=Kb(),i=Gb(),a=Bu(),c=$E(),u="https://json-schema.org/draft/2019-09/schema";var l=class extends r.default{constructor(v={}){super({...v,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(n.default),o.default.forEach((v)=>this.addVocabulary(v)),this.addVocabulary(s.default),this.addVocabulary(i.default),this.opts.discriminator)this.addKeyword(a.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:v,meta:y}=this.opts;if(!y)return;c.default.call(this,v),this.refs["http://json-schema.org/schema"]=u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}};e.Ajv2019=l,t.exports=e=l,t.exports.Ajv2019=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var d=no();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var m=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return m._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return m.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return m.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return m.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return m.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return m.CodeGen}});var h=wn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return h.default}});var f=so();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})}),wE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ab(),r=jb(),o=Lb(),n=Jb(),s=Kb(),i=Gb(),a=Db(),c=Ub(),u=[n.default,t.default,r.default,(0,o.default)(!0),a.default,c.metadataVocabulary,c.contentVocabulary,s.default,i.default];e.default=u}),PE=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}}),kE=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}}),xE=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}}),EE=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}}),TE=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}}),OE=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}}),CE=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),IE=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),NE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=PE(),r=kE(),o=xE(),n=EE(),s=TE(),i=OE(),a=CE(),c=IE(),u=["/properties"];function l(d){return[t,r,o,n,s,m(this,i),a,m(this,c)].forEach((h)=>this.addMetaSchema(h,void 0,!1)),this;function m(h,f){return d?h.$dataMetaSchema(f,u):f}}e.default=l}),AE=B((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let r=Uu(),o=wE(),n=Bu(),s=NE(),i="https://json-schema.org/draft/2020-12/schema";var a=class extends r.default{constructor(m={}){super({...m,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),o.default.forEach((m)=>this.addVocabulary(m)),this.opts.discriminator)this.addKeyword(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:m,meta:h}=this.opts;if(!h)return;s.default.call(this,m),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}};e.Ajv2020=a,t.exports=e=a,t.exports.Ajv2020=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var c=no();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var l=wn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return l.default}});var d=so();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})}),jE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(j,V){return{validate:j,compare:V}}e.fullFormats={date:t(s,i),time:t(c(!0),u),"date-time":t(m(!0),h),"iso-time":t(c(),l),"iso-date-time":t(m(),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:g,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:H,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:w,int32:{type:"number",validate:R},int64:{type:"number",validate:S},float:{type:"number",validate:E},double:{type:"number",validate:E},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,h),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,l),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,f),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(j){return j%4===0&&(j%100!==0||j%400===0)}let o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(j){let V=o.exec(j);if(!V)return!1;let W=+V[1],Y=+V[2],ae=+V[3];return Y>=1&&Y<=12&&ae>=1&&ae<=(Y===2&&r(W)?29:n[Y])}function i(j,V){if(!(j&&V))return;if(j>V)return 1;if(j<V)return-1;return 0}let a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(j){return function(W){let Y=a.exec(W);if(!Y)return!1;let ae=+Y[1],we=+Y[2],$e=+Y[3],Ce=Y[4],de=Y[5]==="-"?-1:1,N=+(Y[6]||0),M=+(Y[7]||0);if(N>23||M>59||j&&!Ce)return!1;if(ae<=23&&we<=59&&$e<60)return!0;let b=we-M*de,p=ae-N*de-(b<0?1:0);return(p===23||p===-1)&&(b===59||b===-1)&&$e<61}}function u(j,V){if(!(j&&V))return;let W=new Date("2020-01-01T"+j).valueOf(),Y=new Date("2020-01-01T"+V).valueOf();if(!(W&&Y))return;return W-Y}function l(j,V){if(!(j&&V))return;let W=a.exec(j),Y=a.exec(V);if(!(W&&Y))return;if(j=W[1]+W[2]+W[3],V=Y[1]+Y[2]+Y[3],j>V)return 1;if(j<V)return-1;return 0}let d=/t|\s/i;function m(j){let V=c(j);return function(Y){let ae=Y.split(d);return ae.length===2&&s(ae[0])&&V(ae[1])}}function h(j,V){if(!(j&&V))return;let W=new Date(j).valueOf(),Y=new Date(V).valueOf();if(!(W&&Y))return;return W-Y}function f(j,V){if(!(j&&V))return;let[W,Y]=j.split(d),[ae,we]=V.split(d),$e=i(W,ae);if($e===void 0)return;return $e||u(Y,we)}let v=/\/|:/,y=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function g(j){return v.test(j)&&y.test(j)}let P=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function w(j){return P.lastIndex=0,P.test(j)}let x=-2147483648,O=2147483647;function R(j){return Number.isInteger(j)&&j<=O&&j>=x}function S(j){return Number.isInteger(j)}function E(){return!0}let A=/[^\\]\\Z/;function H(j){if(A.test(j))return!1;try{return new RegExp(j),!0}catch(V){return!1}}});var ME=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=Vb(),r=le(),o=r.operators,n={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:a,schemaCode:c})=>r.str`should be ${n[a].okStr} ${c}`,params:({keyword:a,schemaCode:c})=>r._`{comparison: ${n[a].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:s,code(a){let{gen:c,data:u,schemaCode:l,keyword:d,it:m}=a,{opts:h,self:f}=m;if(!h.validateFormats)return;let v=new t.KeywordCxt(m,f.RULES.all.format.definition,"format");if(v.$data)y();else g();function y(){let w=c.scopeValue("formats",{ref:f.formats,code:h.code.formats}),x=c.const("fmt",r._`${w}[${v.schemaCode}]`);a.fail$data((0,r.or)(r._`typeof ${x} != "object"`,r._`${x} instanceof RegExp`,r._`typeof ${x}.compare != "function"`,P(x)))}function g(){let w=v.schema,x=f.formats[w];if(!x||x===!0)return;if(typeof x!="object"||x instanceof RegExp||typeof x.compare!="function")throw Error(`"${d}": format "${w}" does not define "compare" function`);let O=c.scopeValue("formats",{key:w,ref:x,code:h.code.formats?r._`${h.code.formats}${(0,r.getProperty)(w)}`:void 0});a.fail$data(P(O))}function P(w){return r._`${w}.compare(${u}, ${l}) ${n[d].fail} 0`}},dependencies:["format"]};let i=(a)=>(a.addKeyword(e.formatLimitDefinition),a);e.default=i}),ZE=B((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=jE(),o=ME(),n=le(),s=new n.Name("fullFormats"),i=new n.Name("fastFormats"),a=(u,l={keywords:!0})=>{if(Array.isArray(l))return c(u,l,r.fullFormats,s),u;let[d,m]=l.mode==="fast"?[r.fastFormats,i]:[r.fullFormats,s];if(c(u,l.formats||r.formatNames,d,m),l.keywords)(0,o.default)(u);return u};a.get=(u,l="full")=>{let d=(l==="fast"?r.fastFormats:r.fullFormats)[u];if(!d)throw Error(`Unknown format "${u}"`);return d};function c(u,l,d,m){var h,f;(h=(f=u.opts.code).formats)!==null&&h!==void 0||(f.formats=n._`require("ajv-formats/dist/formats").${m}`);for(let v of l)u.addFormat(v,d[v])}t.exports=e=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a}),Wb=Vb(),qE=RE(),LE=AE(),DE=Bn(ZE(),1),UE=DE.default;function Du(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return UE(t),t}var Ju=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=Du(LE.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=el(e,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");if(t==="2020-12")return this.ajv;if(t==="2019-09")return this._ajv2019??=Du(qE.Ajv2019);return this._ajvDraft7??=Du(Wb.Ajv)}getValidator(e){let t=this._engineFor(e),r="$id"in e&&typeof e.$id==="string"?t.getSchema(e.$id)??t.compile(e):t.compile(e);return(o)=>r(o)?{valid:!0,data:o,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:t.errorsText(r.errors)}}},mj=Wb.Ajv;import m5 from"process";var iz=Symbol.for("mcp.completable");function Yb(e){return!!e&&typeof e==="object"&&iz in e}function FE(e){return e[iz]?.complete}var sC=15000,VE=2147483647;function RF(e,t){if(!Number.isFinite(e)||e<1)return;let r=setInterval(t,Math.min(e,VE));return r.unref?.(),r}var az,f5=class{static{az=(e)=>e._classification}onclose;onerror;onmessage;_classification;_responseMode;_started=!1;_used=!1;_closed=!1;_terminalDelivered=!1;_dispatchWindowOpen=!1;_requestId;_deferredResponse;_sse;_abortCleanup;_keepAliveMs;constructor(e){this._classification=e.classification,this._responseMode=e.responseMode??"auto",this._keepAliveMs=e.keepAliveMs??sC}async start(){if(this._started)throw Error("PerRequestHTTPServerTransport is already started");this._started=!0}async handleMessage(e,t){if(this._used)throw Error("PerRequestHTTPServerTransport serves exactly one exchange; construct a new transport per request");if(!this._started||this.onmessage===void 0)throw Error("PerRequestHTTPServerTransport is not connected: connect a server to this transport before handling a message");if(this._closed)throw Error("PerRequestHTTPServerTransport is closed");this._used=!0;let r=t?.request?.signal;if(r?.aborted)throw await this.close(),new ct(gt.ConnectionClosed,"The request was aborted before it could be handled");let o={classification:this._classification,...t?.request!==void 0&&{request:t.request},...t?.authInfo!==void 0&&{authInfo:t.authInfo}};if(wm(e)){this._requestId=e.id;let n,s,i=new Promise((a,c)=>{n=a,s=c});if(this._deferredResponse={promise:i,resolve:n,reject:s,settled:!1},r!==void 0){let a=()=>void this.close();r.addEventListener("abort",a,{once:!0}),this._abortCleanup=()=>r.removeEventListener("abort",a)}this._dispatchWindowOpen=!0;try{this.onmessage(e,o)}finally{this._dispatchWindowOpen=!1}if(this._responseMode==="sse"&&!this._closed&&!this._deferredResponse.settled)this.upgradeToSse();return i}return this.onmessage(e,o),new Response(null,{status:202})}async send(e,t){if(this._closed)return;let r=Mh(e)||Nh(e),o=r?e.id:t?.relatedRequestId;if(this._requestId===void 0||o===void 0||o!==this._requestId){if(r)this.onerror?.(Error(`Received a response for an unknown request id: ${String(e.id)}`));return}if(r){if(this._terminalDelivered)return;this._terminalDelivered=!0;let n=Nh(e)?e.error.code:void 0,s=n!==void 0&&(this._dispatchWindowOpen||n===pe.MissingRequiredClientCapability)?Mu[n]:void 0;if(s!==void 0&&this._sse===void 0){this.settleResponse(Response.json(e,{status:s,headers:{"Content-Type":"application/json"}})),queueMicrotask(()=>void this.close());return}if(this._sse!==void 0||this._responseMode==="sse"){if(this._sse===void 0)this.upgradeToSse();this.writeMessageFrame(e),this.finalizeStream();return}this.settleResponse(Response.json(e,{status:200,headers:{"Content-Type":"application/json"}})),queueMicrotask(()=>void this.close());return}if(this._responseMode==="json")return;if(this._sse===void 0)this.upgradeToSse();this.writeMessageFrame(e)}writeCommentFrame(e){if(this._closed||this._sse===void 0||this._sse.closed)return;let t=e.split(`
|
|
128
|
+
`).map((r)=>`: ${r}`).join(`
|
|
129
|
+
`);this.writeFrame(`${t}
|
|
130
|
+
|
|
131
|
+
`)}async close(){if(this._closed)return;if(this._closed=!0,this._abortCleanup?.(),this._abortCleanup=void 0,this._sse?.keepAliveTimer!==void 0)clearInterval(this._sse.keepAliveTimer);if(this._sse!==void 0&&!this._sse.closed){this._sse.closed=!0;try{this._sse.controller.close()}catch{}}if(this._deferredResponse!==void 0&&!this._deferredResponse.settled)this._deferredResponse.settled=!0,this._deferredResponse.reject(new ct(gt.ConnectionClosed,"Connection closed before a response was produced"));this.onclose?.()}settleResponse(e){if(this._deferredResponse===void 0||this._deferredResponse.settled)return;this._deferredResponse.settled=!0,this._deferredResponse.resolve(e)}upgradeToSse(){let e,t=new ReadableStream({start:(r)=>{e=r},cancel:()=>{this.close()}});this._sse={controller:e,encoder:new TextEncoder,closed:!1},this._sse.keepAliveTimer=RF(this._keepAliveMs,()=>this.writeCommentFrame("keepalive")),this.settleResponse(new Response(t,{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}}))}finalizeStream(){if(this._sse?.keepAliveTimer!==void 0)clearInterval(this._sse.keepAliveTimer);if(this._sse!==void 0&&!this._sse.closed){this._sse.closed=!0;try{this._sse.controller.close()}catch{}}queueMicrotask(()=>void this.close())}writeMessageFrame(e){this.writeFrame(`event: message
|
|
132
|
+
data: ${JSON.stringify(e)}
|
|
133
|
+
|
|
134
|
+
`)}writeFrame(e){if(this._sse===void 0||this._sse.closed)return;try{this._sse.controller.enqueue(this._sse.encoder.encode(e))}catch(t){this.onerror?.(Error(`Failed to write to the response stream: ${t}`))}}};function HE(e){return e instanceof f5?az(e):void 0}function Oi(e){return e.replaceAll(/[\\"]/g,String.raw`\$&`).replaceAll(/[^\u0020-\u007E]/g," ")}function Xb(e,t,r,o){let n=`Bearer error="${Oi(e)}", error_description="${Oi(t)}"`;if(r.length>0)n+=`, scope="${Oi(r.join(" "))}"`;if(o)n+=`, resource_metadata="${Oi(o)}"`;return n}function BE(e,t){let{requiredScopes:r=[],resourceMetadataUrl:o}=t??{};if(!(e instanceof Si)){let n=new Si(oo.ServerError,"Internal Server Error");return Response.json(n.toResponseObject(),{status:500})}switch(e.code){case oo.InvalidToken:{let n=Xb(e.code,e.message,r,o);return Response.json(e.toResponseObject(),{status:401,headers:{"WWW-Authenticate":n}})}case oo.InsufficientScope:{let n=Xb(e.code,e.message,r,o);return Response.json(e.toResponseObject(),{status:403,headers:{"WWW-Authenticate":n}})}case oo.ServerError:return Response.json(e.toResponseObject(),{status:500});default:return Response.json(e.toResponseObject(),{status:400})}}function JE(e){let t=new URL(e);return t.pathname=KE(e),t.hash="",t.href}function KE(e){let t=GE(e.pathname);return`/.well-known/oauth-protected-resource${t==="/"?"":t}`}function GE(e){return e.length>1&&e.endsWith("/")?e.slice(0,-1):e}function WE(e){return typeof e==="object"&&e!==null&&"setScopeChallengeResolver"in e&&typeof e.setScopeChallengeResolver==="function"}function YE(e,t){if(typeof e!=="string"||!/^[\u0021\u0023-\u005B\u005D-\u007E]+$/.test(e))throw TypeError(`${t} must satisfy the OAuth scope-token grammar`)}function XE(e){if(e===null||typeof e!=="object"||!Array.isArray(e.scopes)||e.scopes.length===0)throw TypeError("scope challenge must contain at least one scope");for(let[t,r]of e.scopes.entries())YE(r,`scope challenge scopes[${t}]`);if(e.errorDescription!==void 0&&typeof e.errorDescription!=="string")throw TypeError("scope challenge errorDescription must be a string");if(e.errorDescription!==void 0&&!/^[\u0020-\u0021\u0023-\u005B\u005D-\u007E]+$/.test(e.errorDescription))throw TypeError("scope challenge errorDescription must satisfy the RFC 6750 error-description grammar");return e}async function h5(e,t,r){for(let o of e){let n=await r({request:o,...t!==void 0&&{authInfo:t}});if(n!==void 0)return XE(n)}}function g5(e){if(e?.resourceMetadataUrl!==void 0)return e.resourceMetadataUrl;if(e?.resource?.protocol==="https:"||e?.resource?.protocol==="http:")return JE(e.resource)}function y5(e,t){return BE(new Si(oo.InsufficientScope,e.errorDescription??"Insufficient scope"),{requiredScopes:[...e.scopes],resourceMetadataUrl:t})}var QE=8,uT=600000;function lT(e){if(e?.maxRounds!==void 0&&(!Number.isInteger(e.maxRounds)||e.maxRounds<1))throw RangeError(`inputRequired.maxRounds must be a positive integer (got ${e.maxRounds})`);if(e?.roundTimeoutMs!==void 0&&(!Number.isFinite(e.roundTimeoutMs)||e.roundTimeoutMs<=0))throw RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${e.roundTimeoutMs})`);return{maxRounds:e?.maxRounds??QE,roundTimeoutMs:e?.roundTimeoutMs??uT,legacyShim:e?.legacyShim??!0}}function cz(e,t,r){if(r===null||typeof r!=="object"||typeof r.method!=="string")throw new ge(pe.InternalError,`Handler for ${e} returned an invalid input request '${t}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let o=r,n=VS(o);if(n===void 0)throw new ge(pe.InternalError,`Handler for ${e} returned an input request '${t}' of kind '${o.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:o,required:n}}function dT(){let e=globalThis.crypto;if(e?.randomUUID!==void 0)return e.randomUUID();let t=new Uint8Array(16);e.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let r=[...t].map((o)=>o.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}function Ku(e,t){if(e==="tools/call")return{content:[{type:"text",text:t}],isError:!0};throw new ge(pe.InternalError,t)}var pT=class{constructor(e){this._host=e}async fulfill(e,t,r,o,n){let{maxRounds:s,roundTimeoutMs:i}=this._host,a=o.mcpReq.signal,c=n,u=0;while(!0){if(u+=1,u>s)return Ku(e,Sb(e,s));let l=c.inputRequests,d=l!=null&&Object.keys(l).length>0,m=typeof c.requestState==="string"?c.requestState:void 0;if(!d&&m===void 0)throw new ge(pe.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let h;if(d){let y=this._host.resolvedClientCapabilities(o),g=[];for(let[w,x]of Object.entries(l)){let{embedded:O,required:R}=cz(e,w,x);if(O.method!=="roots/list"&&O.params===void 0)throw new ge(pe.InternalError,`Handler for ${e} returned an input request '${w}' of kind '${O.method}' without params`);if(vF(R,y)!==void 0)return Ku(e,`Cannot request input '${w}' (${O.method}): the client on this 2025-era connection did not declare the required capability${y===void 0?" (no client capabilities are available on this connection \u2014 per-request legacy serving cannot receive server-to-client requests)":""}`);g.push([w,O])}let P=zb(a);try{let w={relatedRequestId:o.mcpReq.id,timeout:i,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:P.signal},x=await Promise.all(g.map(async([O,R])=>{try{return[O,await this._dispatchLeg(R,w)]}catch(S){throw P.abort(S),S}}));h=Object.fromEntries(x)}catch(w){if(a.aborted)throw w;return Ku(e,`Fulfilling input required by '${e}' failed: ${w instanceof Error?w.message:String(w)}`)}finally{P.dispose()}}else await bb(vb,a);let f={...o,mcpReq:{...o.mcpReq,inputResponses:h,droppedInputResponseKeys:void 0,requestState:Rn(m)}};if(m!==void 0){let y=await this._host.verifyRequestState(m,f,e);if(y!==void 0)f=qu(f,y)}let v=await t(r,f);if(!sr(v))return v;c=v}}async _dispatchLeg(e,t){switch(e.method){case"elicitation/create":{let r=e.params;if(r.mode==="url"&&r.elicitationId===void 0)r={...r,elicitationId:dT()};return await this._host.sendElicitation(r,t)}case"sampling/createMessage":return await this._host.sendSampling(e.params,t);case"roots/list":return await this._host.listRoots(e.params,t)}}},mT=new Set(["tools/call","prompts/get","resources/read"]),uz,lz,dz;function yee(e,t){uz(e,t)}function vee(e,t){lz(e,t)}function bee(e){return dz(e)}var fT=class extends kb{_clientCapabilities;_clientVersion;static{uz=(e,t)=>{if(t.clientCapabilities!==void 0)e._clientCapabilities=t.clientCapabilities;if(t.clientInfo!==void 0)e._clientVersion=t.clientInfo},lz=(e,t)=>{let r=t.filter((o)=>!e._supportedProtocolVersions.includes(o));if(r.length>0)e._supportedProtocolVersions=[...e._supportedProtocolVersions,...r];e.setRequestHandler("server/discover",()=>e._ondiscover())},dz=(e)=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_boundFromTransport=!1;_legacyInputRequiredShim(){return this._legacyShim??=new pT({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:(e)=>this._inputRequestCapabilityView(e),verifyRequestState:(e,t,r)=>this._verifyRequestState(e,t,r),sendElicitation:(e,t)=>this._sendElicitationLeg(e,t,{validateAcceptedContent:!1}),sendSampling:(e,t)=>this.createMessage(e,t),listRoots:(e,t)=>this.listRoots(e,t)})}oninitialized;constructor(e,t){super(t);if(this._serverInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new Ju,this._requestStateVerify=t?.requestState?.verify,this._inputRequiredServing=lT(t?.inputRequired),t?.cacheHints!==void 0){for(let[r,o]of Object.entries(t.cacheHints))if(o!==void 0)bF(o,`cacheHints['${r}']`);this._cacheHints=t.cacheHints}if(this.setRequestHandler("initialize",(r)=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),bi(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(this._capabilities.logging)this._registerLoggingHandler()}async connect(e){if(this.transport!==void 0)throw new ct(gt.AlreadyConnected,"Use a separate Server instance per connection: this instance is already connected to a transport. To connect it to a new transport, call close() first.");if(this._boundFromTransport)this._boundFromTransport=!1,this._negotiatedProtocolVersion=void 0;let t=HE(e)?.revision;if(t!==void 0&&!this._servedModernEra()&&cT.includes(t)&&bi(this._supportedProtocolVersions).includes(t))this._negotiatedProtocolVersion=t,this._boundFromTransport=!0;await super.connect(e)}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async(e,t)=>{let r=t.sessionId||t.http?.req?.headers.get("mcp-session-id")||void 0,{level:o}=e.params,n=Ri(_h,o);if(n.success)this._loggingLevels.set(r,n.data);return{}})}buildContext(e,t){let r=e.http||t?.request||t?.closeSSEStream||t?.closeStandaloneSSEStream;return{...e,mcpReq:{...e.mcpReq,log:(o,n,s)=>{if(!this._capabilities.logging)return Promise.resolve();let i;if(this._servedModernEra()){if(i=e.mcpReq.envelope?.[Qu],i===void 0)return Promise.resolve()}else i=this._loggingLevels.get(e.sessionId)??this._loggingLevels.get(void 0);if(i!==void 0&&this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(i))return Promise.resolve();return e.mcpReq.notify({method:"notifications/message",params:{level:o,data:n,logger:s}})},elicitInput:(o,n)=>this.elicitInput(o,n),requestSampling:(o,n)=>this.createMessage(o,n)},http:r?{...e.http,req:t?.request,closeSSE:t?.closeSSEStream,closeStandaloneSSE:t?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(_h.options.map((e,t)=>[e,t]));isMessageIgnored=(e,t)=>{let r=this._loggingLevels.get(t);return r?this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(r):!1};registerCapabilities(e){if(this.transport)throw new ct(gt.AlreadyConnected,"Cannot register capabilities after connecting to transport");let t=!!this._capabilities.logging;if(this._capabilities=xb(this._capabilities,e),!t&&this._capabilities.logging)this._registerLoggingHandler()}_wrapHandler(e,t){if(e!=="tools/call"){let r=this._cacheHints?.[e],o=mT.has(e);if(r===void 0&&!o)return async(n,s)=>{let i=await t(n,s);if(sr(i))throw new ge(pe.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return i};return async(n,s)=>{let i=o?await this._invokeInputRequiredCapableHandler(e,t,n,s):await t(n,s);if(sr(i)){if(!o)throw new ge(pe.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return i}return r===void 0?i:zi(i,r)}}return async(r,o)=>{let n=Ft(this._negotiatedProtocolVersion),s=n.validateRequest("tools/call",r);if(!s.ok)throw new ge(s.reason==="not-in-era"?pe.InternalError:pe.InvalidParams,s.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${s.message}`);let i=await this._invokeInputRequiredCapableHandler("tools/call",t,r,o);if(sr(i))return i;let a=xu(i),c=n.validateResult("tools/call",a);if(!c.ok)throw new ge(c.reason==="not-in-era"?pe.InternalError:pe.InvalidParams,c.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${c.message}`);return c.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&bm(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler(e,t,r,o){let n=this._servedModernEra(),s=o.mcpReq.requestState();if(s!==void 0&&typeof s!=="string")throw new ge(pe.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let i=o;if(typeof s==="string"){let d=await this._verifyRequestState(s,o,e);if(d!==void 0)i=qu(o,d)}let a;try{a=await t(r,i)}catch(d){if(d instanceof ge&&d.code===pe.UrlElicitationRequired){if(!n)throw d;throw new ge(pe.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { \u2026: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`)}throw d}if(!sr(a))return a;if(!n){if(!this._inputRequiredServing.legacyShim)throw new ge(pe.InternalError,`Handler for ${e} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??Hr}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(e,t,r,i,a)}let c=a.inputRequests,u=c!=null&&Object.keys(c).length>0,l=typeof a.requestState==="string";if(!u&&!l)throw new ge(pe.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(u){let d=this._inputRequestCapabilityView(o);for(let[m,h]of Object.entries(c)){let{embedded:f,required:v}=cz(e,m,h),y=vF(v,d);if(y!==void 0)throw new SF({requiredCapabilities:y},`Cannot request input '${m}' (${f.method}): the request's client capabilities do not declare the required capability`)}}return a}async _verifyRequestState(e,t,r){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify(e,t)}catch(o){throw this.onerror?.(Error(`requestState verification rejected ${r}: ${o instanceof Error?o.message:String(o)}`)),new ge(pe.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(e){return this._servedModernEra()?e.mcpReq.envelope?.[Tr]:this._clientCapabilities}_assertPushApiInServedEra(e){if(this._servedModernEra())throw new ct(gt.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${e}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead \u2014 the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:e,era:"2026-07-28"})}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new ct(gt.CapabilityNotSupported,`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new ct(gt.CapabilityNotSupported,`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new ct(gt.CapabilityNotSupported,`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new ct(gt.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new ct(gt.CapabilityNotSupported,`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new ct(gt.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new ct(gt.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new ct(gt.CapabilityNotSupported,`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"completion/complete":if(!this._capabilities.completions)throw new ct(gt.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new ct(gt.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new ct(gt.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new ct(gt.CapabilityNotSupported,`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new ct(gt.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case"ping":case"initialize":break}}async _oninitialize(e){let t=e.params.protocolVersion;this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo;let r=BS(this._supportedProtocolVersions),o=r.includes(t)?t:r[0]??Hr;return this._negotiatedProtocolVersion=o,this.transport?.setProtocolVersion?.(o),{protocolVersion:o,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:bi(this._supportedProtocolVersions),capabilities:hT(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(e,t){return this._wireCodec().projectCallToolResult(e,t)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(e,t){if(this._assertPushApiInServedEra("sampling/createMessage"),(e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new ct(gt.CapabilityNotSupported,"Client does not support sampling tools capability.");if(e.messages.length>0){let s=e.messages.at(-1),i=Array.isArray(s.content)?s.content:[s.content],a=i.some((d)=>d.type==="tool_result"),c=e.messages.length>1?e.messages.at(-2):void 0,u=c?Array.isArray(c.content)?c.content:[c.content]:[],l=u.some((d)=>d.type==="tool_use");if(a){if(i.some((d)=>d.type!=="tool_result"))throw new ge(pe.InvalidParams,"The last message must contain only tool_result content if any is present");if(!l)throw new ge(pe.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(l){let d=new Set(u.filter((h)=>h.type==="tool_use").map((h)=>h.id)),m=new Set(i.filter((h)=>h.type==="tool_result").map((h)=>h.toolUseId));if(d.size!==m.size||![...d].every((h)=>m.has(h)))throw new ge(pe.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let r=Boolean(e.tools||e.toolChoice),o=await this.request({method:"sampling/createMessage",params:e},t),n=this._wireCodec().samplingResultVariant(r,o);if(!n.ok)throw new ct(gt.InvalidResult,`Invalid sampling/createMessage result: ${n.reason==="invalid"?n.message:n.reason}`);return n.value}async elicitInput(e,t){switch(this._assertPushApiInServedEra("elicitation/create"),e.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new ct(gt.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new ct(gt.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(e,t)}async _sendElicitationLeg(e,t,r){let o=e.mode??"form",n=r?.validateAcceptedContent??!0;switch(o){case"url":{let s=e;return this.request({method:"elicitation/create",params:s},t)}case"form":{let s=e.mode==="form"?e:{...e,mode:"form"},i=await this.request({method:"elicitation/create",params:s},t);if(n&&i.action==="accept"&&i.content&&s.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(s.requestedSchema)(i.content);if(!a.valid)throw new ge(pe.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(a){if(a instanceof ge)throw a;throw new ge(pe.InternalError,`Error validating elicitation response: ${a instanceof Error?a.message:String(a)}`)}return i}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw new ct(gt.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:e},t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};function hT(e){return{...e}}function gT(e,t){let r=0,o=[e];while(o.length>0){let n=o.pop();if(n===null||typeof n!=="object")continue;if(Array.isArray(n))for(let s of n){if(++r>t)return r;if(s!==null&&typeof s==="object")o.push(s)}else for(let s in n){if(!Object.prototype.hasOwnProperty.call(n,s))continue;if(++r>t)return r;let i=n[s];if(i!==null&&typeof i==="object")o.push(i)}}return r}function _T(e){if(e===void 0||e===1/0)return;if(typeof e!=="number"||Number.isNaN(e)||e<1)throw RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(e)}`);return e}var Fh=class{server;_maxToolInputElements;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(e){let t=this._registeredTools[e];if(t===void 0||!t.enabled)return;if(Object.hasOwn(this._toolInputSchemaJson,e))return this._toolInputSchemaJson[e];if(t.inputSchema===void 0)return ez;try{let r=wr(t.inputSchema,"input");return this._toolInputSchemaJson[e]=r,r}catch{return}}constructor(e,t){if(this.server=new fT(e,t),this._maxToolInputElements=_T(t?.maxToolInputElements),t?.capabilities?.tools)this.setToolRequestHandlers();if(t?.capabilities?.resources)this.setResourceRequestHandlers();if(t?.capabilities?.prompts)this.setPromptRequestHandlers()}async connect(e){if(WE(e))e.setScopeChallengeResolver((t)=>this.resolveScopeChallenge(t));return await this.server.connect(e)}async close(){await this.server.close()}resolveScopeChallenge=(e)=>{switch(e.request.method){case"tools/call":{let t=e.request.params?.name;if(typeof t!=="string")return;let r=this._registeredTools[t];if(r===void 0||!r.enabled)return;return r.scopeChallenge?.(e)}case"resources/read":{let t=e.request.params?.uri;if(typeof t!=="string")return;let r;try{r=new URL(t)}catch{return}let o=this._registeredResources[r.toString()];if(o!==void 0)return o.enabled?o.scopeChallenge?.(e):void 0;for(let n of Object.values(this._registeredResourceTemplates))if(n.resourceTemplate.uriTemplate.match(r.toString()))return n.enabled?n.scopeChallenge?.(e):void 0;return}case"prompts/get":{let t=e.request.params?.name;if(typeof t!=="string")return;let r=this._registeredPrompts[t];if(r===void 0||!r.enabled)return;return r.scopeChallenge?.(e)}default:return}};_toolHandlersInitialized=!1;setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??!0}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let r={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?yT(e,t.inputSchema):ez,annotations:t.annotations,icons:t.icons,execution:t.execution,_meta:t._meta};if(t.outputSchema)r.outputSchema=wr(t.outputSchema,"output");return r})})),this.server.setRequestHandler("tools/call",async(e,t)=>{let r=this._registeredTools[e.params.name];if(!r)throw new ge(pe.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new ge(pe.InvalidParams,`Tool ${e.params.name} disabled`);try{let o=await this.validateToolInput(r,e.params.arguments,e.params.name),n=await this.executeToolHandler(r,o,t);if(await this.validateToolOutput(r,n,e.params.name),sr(n))return n;return this.server.projectCallToolResult(n,r.outputSchemaJson)}catch(o){if(o instanceof ge&&o.code===pe.UrlElicitationRequired)throw o;return this.createToolError(o instanceof Error?o.message:String(o))}}),this._toolHandlersInitialized=!0}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,r){if(this._maxToolInputElements!==void 0&&gT(t,this._maxToolInputElements)>this._maxToolInputElements)throw new ge(pe.InvalidParams,`Invalid arguments for tool ${r}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);if(!e.inputSchema)return;let o=await Rr(e.inputSchema,t??{});if(!o.success)throw new ge(pe.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${o.error}`);return o.data}async validateToolOutput(e,t,r){if(!e.outputSchema)return;if(sr(t))return;if(t.isError)return;if(t.structuredContent===void 0)throw new ge(pe.InvalidParams,`Output validation error: Tool ${r} has an output schema but no structured content was provided`);let o=await Rr(e.outputSchema,t.structuredContent);if(!o.success)throw new ge(pe.InvalidParams,`Output validation error: Invalid structured content for tool ${r}: ${o.error}`)}async executeToolHandler(e,t,r){return e.executor(t,r)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async(e)=>{switch(e.params.ref.type){case"ref/prompt":return mb(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return fb(e),this.handleResourceCompletion(e,e.params.ref);default:throw new ge(pe.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion(e,t){let r=this._registeredPrompts[t.name];if(!r)throw new ge(pe.InvalidParams,`Prompt ${t.name} not found`);if(!r.enabled)throw new ge(pe.InvalidParams,`Prompt ${t.name} disabled`);if(!r.argsSchema)return Pn;let o=sz(nz(r.argsSchema)?.[e.params.argument.name]);if(!Yb(o))return Pn;let n=FE(o);if(!n)return Pn;return oz(await n(e.params.argument.value,e.params.context))}async handleResourceCompletion(e,t){let r=Object.values(this._registeredResourceTemplates).find((n)=>n.resourceTemplate.uriTemplate.toString()===t.uri);if(!r){if(this._registeredResources[t.uri])return Pn;throw new ge(pe.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=r.resourceTemplate.completeCallback(e.params.argument.name);if(!o)return Pn;return oz(await o(e.params.argument.value,e.params.context))}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async(e,t)=>{let r=Object.entries(this._registeredResources).filter(([n,s])=>s.enabled).map(([n,s])=>({uri:n,name:s.name,...s.metadata})),o=[];for(let n of Object.values(this._registeredResourceTemplates)){if(!n.resourceTemplate.listCallback)continue;let s=await n.resourceTemplate.listCallback(t);for(let i of s.resources)o.push({...n.metadata,...i})}return{resources:[...r,...o]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,t])=>({name:e,uriTemplate:t.resourceTemplate.uriTemplate.toString(),...t.metadata}))})),this.server.setRequestHandler("resources/read",async(e,t)=>{let r;try{r=new URL(e.params.uri)}catch{throw new ge(pe.InvalidParams,`Resource URI ${e.params.uri} is invalid`,{uri:e.params.uri,reason:"invalid_uri"})}let o=this._registeredResources[r.toString()];if(o){if(!o.enabled)throw new ge(pe.InvalidParams,`Resource ${r} disabled`);return zi(await o.readCallback(r,t),o.cacheHint)}for(let n of Object.values(this._registeredResourceTemplates)){let s=n.resourceTemplate.uriTemplate.match(r.toString());if(s){if(!n.enabled)throw new ge(pe.InvalidParams,`Resource template ${n.resourceTemplate.uriTemplate} disabled`);return zi(await n.readCallback(r,s,t),n.cacheHint)}}throw new Sm(e.params.uri)}),this._resourceHandlersInitialized=!0}_promptHandlersInitialized=!1;setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??!0}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?yb(t.argsSchema):void 0,icons:t.icons,_meta:t._meta}))})),this.server.setRequestHandler("prompts/get",async(e,t)=>{let r=this._registeredPrompts[e.params.name];if(!r)throw new ge(pe.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new ge(pe.InvalidParams,`Prompt ${e.params.name} disabled`);return r.handler(e.params.arguments,t)}),this._promptHandlersInitialized=!0}registerResource(e,t,r,o){let{cacheHint:n,scopeChallenge:s,...i}=r,a=i;if(n!==void 0)bF(n,`resource ${e}`);if(typeof t==="string"){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let c=this._createRegisteredResource(e,r.title,t,a,s,o);if(n!==void 0)c.cacheHint=n;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let c=this._createRegisteredResourceTemplate(e,r.title,t,a,s,o);if(n!==void 0)c.cacheHint=n;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}}_createRegisteredResource(e,t,r,o,n,s){let i={name:e,title:t,metadata:o,readCallback:s,scopeChallenge:n,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({uri:null}),update:(a)=>{if(a.uri!==void 0&&a.uri!==r){if(delete this._registeredResources[r],a.uri)this._registeredResources[a.uri]=i}if(a.name!==void 0)i.name=a.name;if(a.metadata!==void 0)i.metadata=a.metadata;if(a.title!==void 0)i.title=a.title,i.metadata={...i.metadata,title:a.title};if(a.callback!==void 0)i.readCallback=a.callback;if(a.scopeChallenge!==void 0)i.scopeChallenge=a.scopeChallenge===null?void 0:a.scopeChallenge;if(a.enabled!==void 0)i.enabled=a.enabled;this.sendResourceListChanged()}};return this._registeredResources[r]=i,i}_createRegisteredResourceTemplate(e,t,r,o,n,s){let i={resourceTemplate:r,title:t,metadata:o,readCallback:s,scopeChallenge:n,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({name:null}),update:(c)=>{if(c.name!==void 0&&c.name!==e){if(delete this._registeredResourceTemplates[e],c.name)this._registeredResourceTemplates[c.name]=i}if(c.template!==void 0)i.resourceTemplate=c.template;if(c.metadata!==void 0)i.metadata=c.metadata;if(c.title!==void 0)i.title=c.title,i.metadata={...i.metadata,title:c.title};if(c.callback!==void 0)i.readCallback=c.callback;if(c.scopeChallenge!==void 0)i.scopeChallenge=c.scopeChallenge===null?void 0:c.scopeChallenge;if(c.enabled!==void 0)i.enabled=c.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=i;let a=r.uriTemplate.variableNames;if(Array.isArray(a)&&a.some((c)=>!!r.completeCallback(c)))this.setCompletionRequestHandler();return i}_createRegisteredPrompt(e,t,r,o,n,s,i,a){let c=o,u=n,l={title:t,description:r,argsSchema:o,icons:s,scopeChallenge:i,_meta:a,handler:rz(e,o,n),enabled:!0,disable:()=>l.update({enabled:!1}),enable:()=>l.update({enabled:!0}),remove:()=>l.update({name:null}),update:(d)=>{if(d.name!==void 0&&d.name!==e){if(delete this._registeredPrompts[e],d.name)this._registeredPrompts[d.name]=l}if(d.title!==void 0)l.title=d.title;if(d.description!==void 0)l.description=d.description;if(d.icons!==void 0)l.icons=d.icons;if(d.scopeChallenge!==void 0)l.scopeChallenge=d.scopeChallenge===null?void 0:d.scopeChallenge;if(d._meta!==void 0)l._meta=d._meta;let m=!1;if(d.argsSchema!==void 0)l.argsSchema=d.argsSchema,c=d.argsSchema,m=!0;if(d.callback!==void 0)u=d.callback,m=!0;if(m)l.handler=rz(e,c,u);if(d.enabled!==void 0)l.enabled=d.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[e]=l,o){let d=nz(o);if(d){if(Object.values(d).some((m)=>Yb(sz(m))))this.setCompletionRequestHandler()}}return l}_createRegisteredTool(e,t,r,o,n,s,i,a,c,u,l){Lu(e);let d=l,m,h={title:t,description:r,inputSchema:o,outputSchema:n,get outputSchemaJson(){return m??=tz(h.outputSchema)},set outputSchemaJson(f){m=f},annotations:s,icons:i,execution:a,scopeChallenge:c,_meta:u,handler:l,executor:Qb(o,l),enabled:!0,disable:()=>h.update({enabled:!1}),enable:()=>h.update({enabled:!0}),remove:()=>h.update({name:null}),update:(f)=>{if(f.name!==void 0&&f.name!==e){if(typeof f.name==="string")Lu(f.name);if(delete this._registeredTools[e],delete this._toolInputSchemaJson[e],f.name)delete this._toolInputSchemaJson[f.name],this._registeredTools[f.name]=h,e=f.name}if(f.title!==void 0)h.title=f.title;if(f.description!==void 0)h.description=f.description;let v=!1;if(f.paramsSchema!==void 0)h.inputSchema=f.paramsSchema,delete this._toolInputSchemaJson[e],v=!0;if(f.callback!==void 0)h.handler=f.callback,d=f.callback,v=!0;if(v)h.executor=Qb(h.inputSchema,d);if(f.outputSchema!==void 0)h.outputSchema=f.outputSchema,h.outputSchemaJson=tz(f.outputSchema);if(f.annotations!==void 0)h.annotations=f.annotations;if(f.icons!==void 0)h.icons=f.icons;if(f.scopeChallenge!==void 0)h.scopeChallenge=f.scopeChallenge===null?void 0:f.scopeChallenge;if(f._meta!==void 0)h._meta=f._meta;if(f.enabled!==void 0)h.enabled=f.enabled;this.sendToolListChanged()}};return this._registeredTools[e]=h,this.setToolRequestHandlers(),this.sendToolListChanged(),h}registerTool(e,t,r){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let{title:o,description:n,inputSchema:s,outputSchema:i,annotations:a,icons:c,scopeChallenge:u,_meta:l}=t;return this._createRegisteredTool(e,o,n,wi(s),wi(i),a,c,void 0,u,l,r)}registerPrompt(e,t,r){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let{title:o,description:n,argsSchema:s,icons:i,scopeChallenge:a,_meta:c}=t,u=this._createRegisteredPrompt(e,o,n,wi(s),r,i,a,c);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),u}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}},See=class{_uriTemplate;constructor(e,t){this._callbacks=t,this._uriTemplate=typeof e==="string"?new Eb(e):e}get uriTemplate(){return this._uriTemplate}get listCallback(){return this._callbacks.list}completeCallback(e){return this._callbacks.complete?.[e]}};function Qb(e,t){if(e){let o=t;return async(n,s)=>o(n,s)}let r=t;return async(o,n)=>r(n)}var ez={type:"object",properties:{}};function yT(e,t){let r=wr(t,"input"),o=gV(r);if(!o.valid)console.warn(`[mcp-sdk] tool '${e}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${o.reason}`);return r}function tz(e){if(e===void 0)return;try{return wr(e,"output")}catch{return}}function rz(e,t,r){if(t){let o=r;return async(n,s)=>{let i=await Rr(t,n??{});if(!i.success)throw new ge(pe.InvalidParams,`Invalid arguments for prompt ${e}: ${i.error}`);return o(i.data,s)}}else{let o=r;return async(n,s)=>o(s)}}function oz(e){return{completion:{values:e.map(String).slice(0,100),total:e.length,hasMore:e.length>100}}}var Pn={completion:{values:[],hasMore:!1}};function nz(e){let t=e;if(t.shape&&typeof t.shape==="object")return t.shape}function vT(e){return e?.type==="optional"}function sz(e){if(!vT(e))return e;return e.def?.innerType??e}var PF=class{_listeners=new Set;constructor(e){this.onerror=e}publish(e){for(let t of this._listeners)try{t(e)}catch(r){this.onerror?.(r instanceof Error?r:Error(String(r)))}}subscribe(e){this._listeners.add(e);let t=!0;return()=>{if(!t)return;t=!1,this._listeners.delete(e)}}get listenerCount(){return this._listeners.size}};function wee(e){return{toolsChanged:()=>e.publish({kind:"tools_list_changed"}),promptsChanged:()=>e.publish({kind:"prompts_list_changed"}),resourcesChanged:()=>e.publish({kind:"resources_list_changed"}),resourceUpdated:(t)=>e.publish({kind:"resource_updated",uri:t})}}function ST(e,t){switch(t.kind){case"tools_list_changed":return e.toolsListChanged===!0;case"prompts_list_changed":return e.promptsListChanged===!0;case"resources_list_changed":return e.resourcesListChanged===!0;case"resource_updated":return e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.includes(t.uri)}}function bT(e,t){let r={},o=(n)=>t===void 0||n===!0;if(e.toolsListChanged===!0&&o(t?.tools?.listChanged))r.toolsListChanged=!0;if(e.promptsListChanged===!0&&o(t?.prompts?.listChanged))r.promptsListChanged=!0;if(e.resourcesListChanged===!0&&o(t?.resources?.listChanged))r.resourcesListChanged=!0;if(e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.length>0&&o(t?.resources?.subscribe))r.resourceSubscriptions=[...e.resourceSubscriptions];return r}function zT(e){switch(e.kind){case"tools_list_changed":return{method:"notifications/tools/list_changed",...e.params!==void 0&&{params:e.params}};case"prompts_list_changed":return{method:"notifications/prompts/list_changed",...e.params!==void 0&&{params:e.params}};case"resources_list_changed":return{method:"notifications/resources/list_changed",...e.params!==void 0&&{params:e.params}};case"resource_updated":return{method:"notifications/resources/updated",params:{...e.params,uri:e.uri}}}}var v5=1024;function pz(e,t,r){return Response.json({jsonrpc:"2.0",error:{code:t,message:r},id:e},{status:200})}function mz(e,t){return{method:e.method,params:{...e.params,_meta:{...e.params?._meta,[Rh]:t}}}}function $T(e){let t=Ft($n).validateRequest("subscriptions/listen",e);return t.ok?t.value.params?.notifications:void 0}function Ree(e){let{bus:t,onerror:r}=e,o=e.maxSubscriptions??v5,n=e.keepAliveMs??sC,s=new Set;function i(a,c,u,l){if(s.size>=o)return r?.(Error(`subscriptions/listen refused: subscription limit reached (${o})`)),pz(a.id,-32603,"Subscription limit reached");let d=$T(a);if(d===void 0)return pz(a.id,-32602,"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter");let m=bT(d,u),h=a.id,f=new TextEncoder,v,y=!1,g,P,w,x=(E)=>{if(y)return;try{v.enqueue(f.encode(E))}catch(A){r?.(A instanceof Error?A:Error(String(A)))}},O=(E,A)=>{x(`event: message
|
|
135
|
+
data: ${JSON.stringify({jsonrpc:"2.0",method:E,params:A})}
|
|
136
|
+
|
|
137
|
+
`)},R=(E)=>{if(y)return;if(E)x(`event: message
|
|
138
|
+
data: ${JSON.stringify({jsonrpc:"2.0",id:h,result:{resultType:"complete",_meta:{[Rh]:h,[_a]:l}}})}
|
|
139
|
+
|
|
140
|
+
`);y=!0;try{g?.()}catch(A){r?.(A instanceof Error?A:Error(String(A)))}if(P!==void 0)clearInterval(P);w?.(),s.delete(R);try{v.close()}catch{}},S=new ReadableStream({start(E){v=E;let A=mz({method:"notifications/subscriptions/acknowledged",params:{notifications:m}},h);if(O(A.method,A.params),Object.keys(m).length===0){R(!0);return}g=t.subscribe((H)=>{if(y||!ST(m,H))return;let j=mz(zT(H),h);O(j.method,j.params)}),P=RF(n,()=>x(`: keepalive
|
|
141
|
+
|
|
142
|
+
`)),s.add(R)},cancel(){R(!1)}});if(c!==void 0)if(c.aborted)R(!1);else{let E=()=>R(!1);c.addEventListener("abort",E,{once:!0}),w=()=>c.removeEventListener("abort",E)}return new Response(S,{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}})}return{serve:i,closeAll(){for(let a of s)a(!0)},get openCount(){return s.size}}}
|
|
143
|
+
export{C,ur,Ar,Di,Re,yn,Hn,gi,hc,Ke,uV,iv,ss,iu,_a,Tr,Rh,Qu,pV,mV,fV,Ph,Hi,Y0,qA,VA,S_,w_,WA,to,ov,qi,Zs,Qs,zA,Zn,Ah,KS,GS,sv,av,ep,J0,jA,R_,KA,P_,Th,gm,YS,A_,T_,k_,E_,GA,YA,I_,__,x_,cv,JA,C_,D_,XA,ym,kh,tl,ZA,QA,eT,Eh,vm,Ih,O_,M_,N_,F_,L_,JS,B_,$_,U_,H_,q_,V_,W_,z_,tT,j_,K_,G_,Y_,J_,X_,Z_,Q_,ex,tx,rx,nx,ix,ox,XS,ZS,QS,sx,ax,cx,ew,dx,lx,ux,px,mx,rT,fx,hx,nT,X0,gx,yx,vx,iT,_h,bx,Sx,wx,Rx,Px,Ax,Tx,kx,Ex,dv,Ix,_x,xx,Cx,Dx,tw,xh,Ch,rw,nw,iw,Ox,ow,sw,Mx,Nx,aw,Dh,Fx,Lx,Bx,$x,Ux,Hx,qx,Vx,Wx,zx,jx,Kx,Gx,Yx,Jx,Z0,Xx,Oh,Q0,Zx,eF,tF,rF,nF,iF,oF,sF,aF,cF,dF,lF,uF,pF,mF,fF,Qx,oT,eC,tC,sT,rC,aT,nC,iC,oC,hF,gF,yF,lv,gt,ct,see,vF,cT,bm,bF,pe,ge,Sm,hV,SF,cw,aee,wm,Mh,Nh,l5,gV,cee,dee,lee,wF,uee,yV,pee,mee,u5,p5,fee,hee,gee,m5,sC,RF,f5,h5,g5,y5,yee,vee,bee,Fh,See,PF,wee,v5,Ree};
|
|
144
|
+
|
|
145
|
+
//# debugId=8D1A34559295338864756E2164756E21
|