@unchainedshop/admin-ui 5.0.0-alpha.6 → 5.0.0-alpha.7
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/README.md +27 -19
- package/dist/chunk-2RTX42IE.js +2083 -0
- package/dist/chunk-6UGLNLJG.js +44 -0
- package/dist/{chunk-UXG7EYHC.js → chunk-7PPOGX7R.js} +2 -35
- package/dist/{chunk-45H2WVIC.js → chunk-COV7BREX.js} +0 -1
- package/dist/{chunk-RHUFQVKL.js → chunk-F2TCVEQX.js} +1 -1
- package/dist/{chunk-UFYR5WZT.js → chunk-GY2DRQGW.js} +2 -1
- package/dist/{chunk-BGCKJQGS.js → chunk-JAVEZY3Q.js} +22 -15
- package/dist/{chunk-6TXD4TA7.js → chunk-KCN7DDPH.js} +2 -82
- package/dist/{chunk-YSKZE2KN.js → chunk-MSPWYMDY.js} +37 -24
- package/dist/chunk-RORNAN2J.js +12 -0
- package/dist/chunk-YZGQJJCD.js +37 -0
- package/dist/components/ui/Tag/TagInput.d.ts +10 -5
- package/dist/components/ui/Tag/TagInput.d.ts.map +1 -1
- package/dist/components/ui/form/TagInputField.d.ts +2 -1
- package/dist/components/ui/form/TagInputField.d.ts.map +1 -1
- package/dist/form.js +699 -2497
- package/dist/gql/operation-types.d.ts +13043 -0
- package/dist/gql/operation-types.d.ts.map +1 -0
- package/dist/gql/schema-types.d.ts +3820 -0
- package/dist/gql/schema-types.d.ts.map +1 -0
- package/dist/gql/types.d.ts +2 -17208
- package/dist/gql/types.d.ts.map +1 -1
- package/dist/hooks.js +3 -2
- package/dist/modal.js +9 -5
- package/dist/modules/accounts/fragment/UserFragment.d.ts.map +1 -1
- package/dist/modules/accounts/hooks/useCurrentUser.d.ts.map +1 -1
- package/dist/modules/accounts.js +219 -63
- package/dist/modules/assortment.js +9 -4
- package/dist/modules/common/hooks/useApp.d.ts +1 -1
- package/dist/modules/common/hooks/useBulkResultHandler.d.ts +8 -0
- package/dist/modules/common/hooks/useBulkResultHandler.d.ts.map +1 -0
- package/dist/modules/common/hooks/useBulkSelection.d.ts +12 -0
- package/dist/modules/common/hooks/useBulkSelection.d.ts.map +1 -0
- package/dist/modules/common/hooks/useScrollRestoration.d.ts +8 -0
- package/dist/modules/common/hooks/useScrollRestoration.d.ts.map +1 -0
- package/dist/modules/common/hooks/useShopInfo.d.ts +13 -13
- package/dist/modules/common/hooks/useShopInfo.d.ts.map +1 -1
- package/dist/modules/common/utils/useFormatDateTime.d.ts +10 -1
- package/dist/modules/common/utils/useFormatDateTime.d.ts.map +1 -1
- package/dist/modules/country/hooks/useCountries.d.ts +4 -4
- package/dist/modules/enrollment.js +23 -2
- package/dist/modules/event.js +1 -1
- package/dist/modules/filter.js +1 -1
- package/dist/modules/language/hooks/useLanguages.d.ts +4 -4
- package/dist/modules/modal/components/DangerMessage.d.ts +2 -1
- package/dist/modules/modal/components/DangerMessage.d.ts.map +1 -1
- package/dist/modules/order/hooks/useOrders.d.ts +20 -20
- package/dist/modules/order/hooks/useOrders.d.ts.map +1 -1
- package/dist/modules/order.js +9 -3
- package/dist/modules/product-review.js +24 -5
- package/dist/modules/product.js +12 -16
- package/dist/modules/quotation.js +22 -2
- package/dist/modules/token.js +1 -1
- package/dist/modules/work/hooks/useWork.d.ts +14 -14
- package/dist/modules/work.js +17 -5
- package/dist/plugins.js +6 -1
- package/dist/providers.js +3 -3
- package/dist/sdk/plugins.d.ts +11 -0
- package/dist/sdk/plugins.d.ts.map +1 -1
- package/dist/sdk/shims/admin-ui-plugins.d.ts +3 -0
- package/dist/sdk/shims/admin-ui-plugins.d.ts.map +1 -0
- package/dist/sdk/shims/apollo-client-react.d.ts +3 -0
- package/dist/sdk/shims/apollo-client-react.d.ts.map +1 -0
- package/dist/sdk/shims/apollo-client.d.ts +3 -0
- package/dist/sdk/shims/apollo-client.d.ts.map +1 -0
- package/dist/sdk/shims/host.d.ts +17 -0
- package/dist/sdk/shims/host.d.ts.map +1 -0
- package/dist/sdk/shims/next-head.d.ts +3 -0
- package/dist/sdk/shims/next-head.d.ts.map +1 -0
- package/dist/sdk/shims/next-image.d.ts +3 -0
- package/dist/sdk/shims/next-image.d.ts.map +1 -0
- package/dist/sdk/shims/next-link.d.ts +3 -0
- package/dist/sdk/shims/next-link.d.ts.map +1 -0
- package/dist/sdk/shims/next-router.d.ts +3 -0
- package/dist/sdk/shims/next-router.d.ts.map +1 -0
- package/dist/sdk/shims/react-dom-client.d.ts +3 -0
- package/dist/sdk/shims/react-dom-client.d.ts.map +1 -0
- package/dist/sdk/shims/react-dom.d.ts +3 -0
- package/dist/sdk/shims/react-dom.d.ts.map +1 -0
- package/dist/sdk/shims/react-hook-form.d.ts +3 -0
- package/dist/sdk/shims/react-hook-form.d.ts.map +1 -0
- package/dist/sdk/shims/react-intl.d.ts +3 -0
- package/dist/sdk/shims/react-intl.d.ts.map +1 -0
- package/dist/sdk/shims/react-jsx-runtime.d.ts +3 -0
- package/dist/sdk/shims/react-jsx-runtime.d.ts.map +1 -0
- package/dist/sdk/shims/react-toastify.d.ts +3 -0
- package/dist/sdk/shims/react-toastify.d.ts.map +1 -0
- package/dist/sdk/shims/react.d.ts +3 -0
- package/dist/sdk/shims/react.d.ts.map +1 -0
- package/dist/shims/admin-ui-plugins.js +9 -0
- package/dist/shims/apollo-client-react.js +25 -0
- package/dist/shims/apollo-client.js +55 -0
- package/dist/shims/next-head.js +9 -0
- package/dist/shims/next-image.js +9 -0
- package/dist/shims/next-link.js +9 -0
- package/dist/shims/next-router.js +13 -0
- package/dist/shims/react-dom-client.js +11 -0
- package/dist/shims/react-dom.js +22 -0
- package/dist/shims/react-hook-form.js +25 -0
- package/dist/shims/react-intl.js +37 -0
- package/dist/shims/react-jsx-runtime.js +11 -0
- package/dist/shims/react-toastify.js +16 -0
- package/dist/shims/react.js +52 -0
- package/dist/ui.js +1261 -3443
- package/out/403/index.html +2 -2
- package/out/404/index.html +2 -2
- package/out/404.html +2 -2
- package/out/423/index.html +2 -2
- package/out/500/index.html +2 -2
- package/out/_next/static/chunks/0-2b37ubdpy0o.js +7 -0
- package/out/_next/static/chunks/0-cyinqk2ne8t.js +16 -0
- package/out/_next/static/chunks/00tf1qsuwqywe.js +17 -0
- package/out/_next/static/chunks/015ge5k3o3f-r.js +226 -0
- package/out/_next/static/chunks/0208v89kdo_s9.js +13 -0
- package/out/_next/static/chunks/05-ui58k9illr.js +234 -0
- package/out/_next/static/chunks/05au-xyt__0f2.js +3 -0
- package/out/_next/static/chunks/{087a2d-0e1pvn.js → 05nn5xr3ufcsh.js} +1 -1
- package/out/_next/static/chunks/{1m5m15javwn8p.js → 05o_q7jg8wucs.js} +1 -1
- package/out/_next/static/chunks/0752goe9_9g2s.js +110 -0
- package/out/_next/static/chunks/07o7bmqljy89r.js +1 -0
- package/out/_next/static/chunks/083ylavob4a8d.js +3 -0
- package/out/_next/static/chunks/09qx8ltnvw8f2.js +12 -0
- package/out/_next/static/chunks/0_puys1lwhv9m.js +16 -0
- package/out/_next/static/chunks/0_xtedn8e1vu_.js +13 -0
- package/out/_next/static/chunks/0a_bg-ub3r2eo.js +60 -0
- package/out/_next/static/chunks/0b33bcf7x5rgy.js +20 -0
- package/out/_next/static/chunks/0ckhtcvz1kyxg.js +1 -0
- package/out/_next/static/chunks/0dewly3vo-mcq.js +20 -0
- package/out/_next/static/chunks/{19y4w6_d_qiou.js → 0dnh0kr83_tj0.js} +1 -1
- package/out/_next/static/chunks/0dxu94yin5gdn.js +35 -0
- package/out/_next/static/chunks/0e2c-jlh2q_eq.js +74 -0
- package/out/_next/static/chunks/0fv1w56e25gt5.js +14 -0
- package/out/_next/static/chunks/0i9ymn9xxs0nx.js +18 -0
- package/out/_next/static/chunks/0ij8fs6-w0pr_.js +22 -0
- package/out/_next/static/chunks/0iqjlf_9c6eo_.js +59 -0
- package/out/_next/static/chunks/0j838r-8ied1f.js +1 -0
- package/out/_next/static/chunks/0jeddko6bac8h.js +1 -0
- package/out/_next/static/chunks/0kwf2vel2xmdi.js +13 -0
- package/out/_next/static/chunks/0m6jydfuy_4o3.js +1 -0
- package/out/_next/static/chunks/0mez27zlo26ni.js +103 -0
- package/out/_next/static/chunks/0n9to89fz811b.js +3 -0
- package/out/_next/static/chunks/0nga8f0q2d0bl.js +14 -0
- package/out/_next/static/chunks/0nkkcq0-s-9fo.js +1 -0
- package/out/_next/static/chunks/0nlirgt-x5pqr.js +337 -0
- package/out/_next/static/chunks/0o7k5vanq57ch.js +807 -0
- package/out/_next/static/chunks/0om7fxf5bczpu.js +13 -0
- package/out/_next/static/chunks/0ou6gsnpn0wml.js +1 -0
- package/out/_next/static/chunks/0p09_ncs0g7m2.js +14 -0
- package/out/_next/static/chunks/0pji5t2zheb2j.js +234 -0
- package/out/_next/static/chunks/0q6-fplpae_ie.js +21 -0
- package/out/_next/static/chunks/0qh0vqpui2alf.js +9 -0
- package/out/_next/static/chunks/0qq_lp3pk8bjf.js +27 -0
- package/out/_next/static/chunks/0rgdxqr_0y-g-.js +136 -0
- package/out/_next/static/chunks/0rqjr_lmrk4pz.js +5 -0
- package/out/_next/static/chunks/0sc71p-6lnm1e.js +13 -0
- package/out/_next/static/chunks/0tej_--_qru5h.js +126 -0
- package/out/_next/static/chunks/0tnyefaaxof6-.js +247 -0
- package/out/_next/static/chunks/{1dsjo02ozub3p.js → 0ubzi2s1spm4e.js} +4 -4
- package/out/_next/static/chunks/0uecw_5mn0zvr.js +110 -0
- package/out/_next/static/chunks/0vbqa5pd_ajm5.js +1 -0
- package/out/_next/static/chunks/0w7ic_22nz92w.js +58 -0
- package/out/_next/static/chunks/0y4eg57kgif01.js +1 -0
- package/out/_next/static/chunks/0ywlba3uh1t0x.js +16 -0
- package/out/_next/static/chunks/0zoum0jzrtu0s.js +145 -0
- package/out/_next/static/chunks/1184evhxs01_c.js +11 -0
- package/out/_next/static/chunks/11oq6l46lynfn.js +22 -0
- package/out/_next/static/chunks/11zynllx8mmh5.js +15 -0
- package/out/_next/static/chunks/13__7-sf28ub5.js +17 -0
- package/out/_next/static/chunks/13u_a5l2xngm4.js +1 -0
- package/out/_next/static/chunks/13wfvr2b0-qlj.js +30 -0
- package/out/_next/static/chunks/14c_mq04p7pu0.js +171 -0
- package/out/_next/static/chunks/151puw-sc__by.js +103 -0
- package/out/_next/static/chunks/15vz50rks0o2-.js +238 -0
- package/out/_next/static/chunks/17b4rvj5k8ye2.js +807 -0
- package/out/_next/static/chunks/188l-km9dyejj.js +34 -0
- package/out/_next/static/chunks/{252n_i72ate30.js → 18juy_eauk94g.js} +2 -2
- package/out/_next/static/chunks/{0k-vf2ns330qm.js → 19eflki8bmivb.js} +1 -1
- package/out/_next/static/chunks/19eu5d-wm2hfr.js +23 -0
- package/out/_next/static/chunks/19ou9pxeiwehs.js +15 -0
- package/out/_next/static/chunks/19pi48hqksvo9.js +9 -0
- package/out/_next/static/chunks/1_5ba1obzc231.js +1 -0
- package/out/_next/static/chunks/1_lrjs51fhhko.js +807 -0
- package/out/_next/static/chunks/1am9n6exll687.js +807 -0
- package/out/_next/static/chunks/1cfjbvjo0o9fx.js +104 -0
- package/out/_next/static/chunks/1cqhbfj3zp710.js +1 -0
- package/out/_next/static/chunks/1cy-2yb5j5_9b.js +157 -0
- package/out/_next/static/chunks/1dqgs827_hiod.js +16 -0
- package/out/_next/static/chunks/{1ji44prsmhq_a.js → 1dt9_bzfioi8a.js} +3 -3
- package/out/_next/static/chunks/1fg6jbuxeuj0w.js +14 -0
- package/out/_next/static/chunks/1fvr9k_o63j_m.js +16 -0
- package/out/_next/static/chunks/1h_o__x8jw8gt.js +15 -0
- package/out/_next/static/chunks/1imv5a-ymrj2t.js +15 -0
- package/out/_next/static/chunks/1k4ep4igedo8p.js +1 -0
- package/out/_next/static/chunks/1kn74nabrpy14.js +3 -0
- package/out/_next/static/chunks/{34sm1u3s14z4b.js → 1ndk3s-aeqfej.js} +1 -1
- package/out/_next/static/chunks/1o4hor3cwzcxc.js +15 -0
- package/out/_next/static/chunks/1og09fg689_nc.js +180 -0
- package/out/_next/static/chunks/1q_sewe1wbxsk.js +54 -0
- package/out/_next/static/chunks/1qwid0d89bzpw.js +17 -0
- package/out/_next/static/chunks/1r7dh_p70r7o8.js +13 -0
- package/out/_next/static/chunks/1r_e-dk-1oicl.js +2 -0
- package/out/_next/static/chunks/1rtv3c_klo0jk.js +1 -0
- package/out/_next/static/chunks/1rw6681ieb3-5.js +8 -0
- package/out/_next/static/chunks/1srfjl1rurrm9.js +3 -0
- package/out/_next/static/chunks/1t8mb2td_pm1h.js +43 -0
- package/out/_next/static/chunks/1v-2aqdslc2g1.js +1 -0
- package/out/_next/static/chunks/1w5uao_cylgd1.js +234 -0
- package/out/_next/static/chunks/1x-t9f0f5vr10.js +329 -0
- package/out/_next/static/chunks/1ylgjha1c0ua_.js +124 -0
- package/out/_next/static/chunks/1yp98n-n4gxwy.js +15 -0
- package/out/_next/static/chunks/1yy_-xc9xthfo.js +3 -0
- package/out/_next/static/chunks/1z1esw-t8kopy.js +1 -0
- package/out/_next/static/chunks/2-7e3ttj92hfr.js +17 -0
- package/out/_next/static/chunks/200_u2ywg-be1.js +43 -0
- package/out/_next/static/chunks/224ovcn90ebcs.js +25 -0
- package/out/_next/static/chunks/24-pobk4qjjvp.js +3 -0
- package/out/_next/static/chunks/2540mqfxc7ehr.js +15 -0
- package/out/_next/static/chunks/{1rgwj4dr0k4_b.js → 270ua9t85a7ev.js} +1 -1
- package/out/_next/static/chunks/27jaailh2k450.js +879 -0
- package/out/_next/static/chunks/2_l14rwu6kgzl.js +11 -0
- package/out/_next/static/chunks/2_vu2hve2j-6g.js +5 -0
- package/out/_next/static/chunks/2cmaw01_r48ot.js +21 -0
- package/out/_next/static/chunks/2d1zehr8zc3vb.js +9 -0
- package/out/_next/static/chunks/{2tw-iq1oliu-h.js → 2dvrbmh97duba.js} +1 -1
- package/out/_next/static/chunks/{34dhtdp_8idgm.js → 2dyj8q92_k5el.js} +112 -62
- package/out/_next/static/chunks/2e0dz59httb-e.js +43 -0
- package/out/_next/static/chunks/2e47h0g7w7si3.js +7 -0
- package/out/_next/static/chunks/2fjmw94mat8m0.js +807 -0
- package/out/_next/static/chunks/{0f7z8oojvqahv.js → 2fo2ki1egxbah.js} +1 -1
- package/out/_next/static/chunks/2httcwd92at4i.js +9 -0
- package/out/_next/static/chunks/2ib6fee-nqe-z.js +23 -0
- package/out/_next/static/chunks/2l4pfo_tsvn5w.js +11 -0
- package/out/_next/static/chunks/2l629mu99aqil.js +9 -0
- package/out/_next/static/chunks/2le8e8u2nvp0j.js +16 -0
- package/out/_next/static/chunks/2lx_iig9xewfj.js +52 -0
- package/out/_next/static/chunks/2nm_wdmfjcbyc.js +25 -0
- package/out/_next/static/chunks/2o9hdz0gk1-s7.js +165 -0
- package/out/_next/static/chunks/2ork76jhxvxke.js +138 -0
- package/out/_next/static/chunks/2ou2_nhvunq72.js +13 -0
- package/out/_next/static/chunks/2pf0d3jgcae7b.js +99 -0
- package/out/_next/static/chunks/2q-mpau-4gsvd.js +1 -0
- package/out/_next/static/chunks/2qzxq2qs80c_8.js +11 -0
- package/out/_next/static/chunks/2rddaar-ns45d.js +116 -0
- package/out/_next/static/chunks/2rve5gtfjiz-p.js +100 -0
- package/out/_next/static/chunks/2rywg4dn0aeez.js +1 -0
- package/out/_next/static/chunks/2s6u8274_jzk2.js +105 -0
- package/out/_next/static/chunks/2t-_fecnp5yzr.js +15 -0
- package/out/_next/static/chunks/2tm822rgn8g7-.js +19 -0
- package/out/_next/static/chunks/{1cgliwmj52a0t.js → 2u6jwsqz0uhes.js} +3 -3
- package/out/_next/static/chunks/2u8ns-x384r3i.js +22 -0
- package/out/_next/static/chunks/{08o69avnk4qvk.js → 2v4k4vpb2id7m.js} +1 -1
- package/out/_next/static/chunks/2v57_n8he320z.js +83 -0
- package/out/_next/static/chunks/2vkqez8xx-yp9.js +807 -0
- package/out/_next/static/chunks/2ztcyhxd9w5_m.js +1 -0
- package/out/_next/static/chunks/304cl99rh8rs_.js +2 -0
- package/out/_next/static/chunks/30_ns6urg1dkn.js +41 -0
- package/out/_next/static/chunks/{0gurfn3nhm859.js → 313i1x81q2xj1.js} +1 -1
- package/out/_next/static/chunks/325a7n__tfxy_.js +61 -0
- package/out/_next/static/chunks/326rk3t0gtxp_.js +14 -0
- package/out/_next/static/chunks/32te9ivrk54l0.js +15 -0
- package/out/_next/static/chunks/339y1tm7s80tn.js +22 -0
- package/out/_next/static/chunks/33emlry70k-lv.js +2 -0
- package/out/_next/static/chunks/{202a3z9hys0o7.js → 346itdsbw-5tn.js} +2 -2
- package/out/_next/static/chunks/351jscvbk_wb9.js +13 -0
- package/out/_next/static/chunks/355nca7if7l9n.js +17 -0
- package/out/_next/static/chunks/357odtev0t245.js +59 -0
- package/out/_next/static/chunks/{2oz58zpay0wub.js → 35fjd9uhctw7y.js} +1 -1
- package/out/_next/static/chunks/36aqs7u7s-lb1.js +119 -0
- package/out/_next/static/chunks/36zrtyhmqlx_n.js +807 -0
- package/out/_next/static/chunks/{18yg2pj3hb_in.js → 37uz0njkj43tz.js} +1 -1
- package/out/_next/static/chunks/38ffn8gazqz8_.js +3 -0
- package/out/_next/static/chunks/39-19ao-xkexy.js +2 -0
- package/out/_next/static/chunks/39m5tbxzzsmn4.js +807 -0
- package/out/_next/static/chunks/3_dqxs_vhmfqd.js +14 -0
- package/out/_next/static/chunks/3bgtu00fe99yc.js +1 -0
- package/out/_next/static/chunks/3c1rc1w-xe4u7.js +39 -0
- package/out/_next/static/chunks/3cdfuacs4_0d-.js +1 -0
- package/out/_next/static/chunks/3cp9qqljcytup.js +9 -0
- package/out/_next/static/chunks/3cq123yj25_36.js +1 -0
- package/out/_next/static/chunks/3d1ofcqmlbg-5.js +52 -0
- package/out/_next/static/chunks/3dopaxkoi5px6.js +1 -0
- package/out/_next/static/chunks/3doujqxnfq19f.js +16 -0
- package/out/_next/static/chunks/3grllla8v0ctl.js +14 -0
- package/out/_next/static/chunks/3hqec4-3one07.js +15 -0
- package/out/_next/static/chunks/3ic_dagw-uvrx.js +234 -0
- package/out/_next/static/chunks/3idwjqiel9n9v.js +18 -0
- package/out/_next/static/chunks/{0qjv_q4seojfh.js → 3il9u-mfrp2sn.js} +1 -1
- package/out/_next/static/chunks/3jtzvr48aaoo0.js +13 -0
- package/out/_next/static/chunks/3k5lt5_-g36w9.js +9 -0
- package/out/_next/static/chunks/3l-9xxd1i1sya.js +1 -0
- package/out/_next/static/chunks/3l1zucp3a411p.js +50 -0
- package/out/_next/static/chunks/3ls4kv54f3x8u.js +15 -0
- package/out/_next/static/chunks/3m2yam5_cs1h7.js +13 -0
- package/out/_next/static/chunks/3mancxzz8c7hl.js +51 -0
- package/out/_next/static/chunks/3nkse7h0-kbyx.js +126 -0
- package/out/_next/static/chunks/3o23w25lfn4mo.js +27 -0
- package/out/_next/static/chunks/{3m7-q-ztmzcf5.js → 3oynij37wfjb2.js} +2 -2
- package/out/_next/static/chunks/3oz5p4rrvnew1.js +807 -0
- package/out/_next/static/chunks/{434iz38padke2.js → 3pbyo5kkko3wh.js} +1 -1
- package/out/_next/static/chunks/3qjgt-x153i6u.js +234 -0
- package/out/_next/static/chunks/3s-n0xc-vi0ww.js +31 -0
- package/out/_next/static/chunks/3t_3vlnk1ntkb.js +95 -0
- package/out/_next/static/chunks/3ti7tims6gz1j.js +234 -0
- package/out/_next/static/chunks/3tzaludii6vtu.js +54 -0
- package/out/_next/static/chunks/{01q9gliprwq-_.js → 3u504487p_y7e.js} +2 -2
- package/out/_next/static/chunks/3ufg-in2riva7.js +1 -0
- package/out/_next/static/chunks/3ugwv1vrnbivg.js +1 -0
- package/out/_next/static/chunks/3ulbhhqw8rxd8.js +15 -0
- package/out/_next/static/chunks/3uytb2p7vzafp.js +15 -0
- package/out/_next/static/chunks/3v38tvcona4gy.js +16 -0
- package/out/_next/static/chunks/3vet2a9q9rf2c.js +61 -0
- package/out/_next/static/chunks/3vz3gqmojh7sx.js +4 -0
- package/out/_next/static/chunks/3w9xrlkiztuwi.js +23 -0
- package/out/_next/static/chunks/3wy5jhrulhwb9.js +15 -0
- package/out/_next/static/chunks/3xmtbqm0gddn8.js +3 -0
- package/out/_next/static/chunks/3yqmjvx7t3t0_.js +1 -0
- package/out/_next/static/chunks/3yvmkdc088aly.js +1 -0
- package/out/_next/static/chunks/401o5bfi_90qs.js +141 -0
- package/out/_next/static/chunks/40s6ngsexc737.js +15 -0
- package/out/_next/static/chunks/40xhwnc_48o73.js +297 -0
- package/out/_next/static/chunks/41e2wlkp9_pvk.js +28 -0
- package/out/_next/static/chunks/41g7mv3yuhz6k.js +68 -0
- package/out/_next/static/chunks/429ihwc6co7u7.js +32 -0
- package/out/_next/static/chunks/42p2hm8ca34f6.js +16 -0
- package/out/_next/static/chunks/43jyzccx6x0lw.js +1 -0
- package/out/_next/static/chunks/447b5tn4-avdv.js +16 -0
- package/out/_next/static/chunks/44daaafswok67.css +1 -0
- package/out/_next/static/chunks/turbopack-02cmv-knpzk52.js +1 -0
- package/out/_next/static/chunks/{turbopack-04ukk4jyuwwfc.js → turbopack-05rmr02n9n2u0.js} +1 -1
- package/out/_next/static/chunks/{turbopack-0cwxwz82vstff.js → turbopack-07fw0g9aver98.js} +1 -1
- package/out/_next/static/chunks/turbopack-08x92457_z4ve.js +1 -0
- package/out/_next/static/chunks/{turbopack-13v4uorj3l10n.js → turbopack-0a2sfur4bx222.js} +1 -1
- package/out/_next/static/chunks/{turbopack-3b2k0p0g1mako.js → turbopack-0b-g0lpiikryt.js} +1 -1
- package/out/_next/static/chunks/turbopack-0dj-aua684j9c.js +1 -0
- package/out/_next/static/chunks/{turbopack-3p-k1txa6-4ik.js → turbopack-0h5lj7lnf9_tb.js} +1 -1
- package/out/_next/static/chunks/{turbopack-04s7-zvvb1coi.js → turbopack-0k8oea6xmzbjh.js} +1 -1
- package/out/_next/static/chunks/{turbopack-14kspgbfigjpa.js → turbopack-0m1qzkhnpuk2j.js} +1 -1
- package/out/_next/static/chunks/{turbopack-41cj0-dssfw9l.js → turbopack-0n73ad0fad4yl.js} +1 -1
- package/out/_next/static/chunks/{turbopack-2k2d3c2qq-0z0.js → turbopack-0qxkaq0f9ka24.js} +1 -1
- package/out/_next/static/chunks/{turbopack-34749rlp0_n5c.js → turbopack-0ricnx7znhztj.js} +1 -1
- package/out/_next/static/chunks/turbopack-0s-h1cgwrfgo-.js +1 -0
- package/out/_next/static/chunks/turbopack-0xgswwqf_4vrt.js +1 -0
- package/out/_next/static/chunks/{turbopack-1sllc7f9its9a.js → turbopack-1330tdm8r390q.js} +1 -1
- package/out/_next/static/chunks/{turbopack-0qa163y1bx_g6.js → turbopack-14rn07-ki7f_7.js} +1 -1
- package/out/_next/static/chunks/turbopack-1azvbmrq_bxq7.js +1 -0
- package/out/_next/static/chunks/turbopack-1bjaxey2pj8nn.js +1 -0
- package/out/_next/static/chunks/turbopack-1csu0s9cycwgo.js +1 -0
- package/out/_next/static/chunks/{turbopack-0w2ztfttfubzl.js → turbopack-1g8mmayckmfib.js} +1 -1
- package/out/_next/static/chunks/turbopack-1hty_7i5tzg63.js +1 -0
- package/out/_next/static/chunks/turbopack-1p11xfz8qe15i.js +1 -0
- package/out/_next/static/chunks/turbopack-1r_uprn020kr7.js +1 -0
- package/out/_next/static/chunks/{turbopack-29n-soxzu37jf.js → turbopack-1rdxfvyldfwrq.js} +1 -1
- package/out/_next/static/chunks/{turbopack-40xcd2mr6qovi.js → turbopack-1td004byboyz2.js} +1 -1
- package/out/_next/static/chunks/turbopack-1y3x6n223v6d1.js +1 -0
- package/out/_next/static/chunks/turbopack-2068cl63o32re.js +1 -0
- package/out/_next/static/chunks/turbopack-298vdad77pw5z.js +1 -0
- package/out/_next/static/chunks/{turbopack-1wqjl3y4c1ij-.js → turbopack-2d5v28yt0xnri.js} +1 -1
- package/out/_next/static/chunks/{turbopack-3jw01psrsjqdi.js → turbopack-2dicmowo2x4t1.js} +1 -1
- package/out/_next/static/chunks/turbopack-2gehqsln39zg1.js +1 -0
- package/out/_next/static/chunks/turbopack-2hj-ffuco6-u7.js +1 -0
- package/out/_next/static/chunks/turbopack-2it1jk212m2ud.js +1 -0
- package/out/_next/static/chunks/{turbopack-0sv7lr_kx3kdq.js → turbopack-2l-gbnaw39ht4.js} +1 -1
- package/out/_next/static/chunks/turbopack-2mbsjg411_ndq.js +1 -0
- package/out/_next/static/chunks/turbopack-2n2ksqygaakbh.js +1 -0
- package/out/_next/static/chunks/turbopack-2q65pei-ck559.js +1 -0
- package/out/_next/static/chunks/turbopack-2sqnlbl-ardf7.js +1 -0
- package/out/_next/static/chunks/turbopack-2t6ex34_bkvoe.js +1 -0
- package/out/_next/static/chunks/{turbopack-1au-y5u3wzv22.js → turbopack-2w9_vscbr0eag.js} +1 -1
- package/out/_next/static/chunks/turbopack-2z2joyd6mdhpo.js +1 -0
- package/out/_next/static/chunks/turbopack-338xrj-0fpsqu.js +1 -0
- package/out/_next/static/chunks/turbopack-3458e7jmj1e27.js +1 -0
- package/out/_next/static/chunks/turbopack-351l-va10h8kw.js +1 -0
- package/out/_next/static/chunks/turbopack-35awx_qvevnch.js +1 -0
- package/out/_next/static/chunks/{turbopack-1noe2ur-_o71n.js → turbopack-3a196kafnj312.js} +1 -1
- package/out/_next/static/chunks/turbopack-3a6igydfvv1_v.js +1 -0
- package/out/_next/static/chunks/{turbopack-1-ceqxb_000x-.js → turbopack-3bnkwdcrz_ts-.js} +1 -1
- package/out/_next/static/chunks/{turbopack-32kxihayw_v97.js → turbopack-3hsu2nw8qlox4.js} +1 -1
- package/out/_next/static/chunks/turbopack-3iiyu2cek78ut.js +1 -0
- package/out/_next/static/chunks/turbopack-3nta8sa99guti.js +1 -0
- package/out/_next/static/chunks/turbopack-3r17oio1oe7jw.js +1 -0
- package/out/_next/static/chunks/turbopack-3r9uyzwi0dtwb.js +1 -0
- package/out/_next/static/chunks/turbopack-3rgdcfralfvsa.js +1 -0
- package/out/_next/static/chunks/{turbopack-1h9u07n6a83dl.js → turbopack-3tntqotcyx6oq.js} +1 -1
- package/out/_next/static/chunks/turbopack-3uc-2ah0uehj3.js +1 -0
- package/out/_next/static/chunks/turbopack-3uvfl95p1ubqn.js +1 -0
- package/out/_next/static/chunks/turbopack-3vncwrj5x9j44.js +1 -0
- package/out/_next/static/chunks/turbopack-3ww1zabqxbxit.js +1 -0
- package/out/_next/static/chunks/{turbopack-17gr4a9fxe8he.js → turbopack-3wxlut7e7jmsi.js} +1 -1
- package/out/_next/static/chunks/turbopack-3yk72bgipb8hc.js +1 -0
- package/out/_next/static/chunks/turbopack-4025_4zwqnrk-.js +1 -0
- package/out/_next/static/chunks/{turbopack-298r66lt68r_n.js → turbopack-425nfopoa8wxd.js} +1 -1
- package/out/_next/static/{VYWUvBJY94uiS3jm4HOFN → hH8h6SzcZWEUFySYqRPbW}/_buildManifest.js +63 -63
- package/out/_offline/index.html +2 -2
- package/out/account/forgot-password/index.html +2 -2
- package/out/account/index.html +2 -2
- package/out/assortments/AssortmentDetailPage/index.html +2 -2
- package/out/assortments/index.html +2 -2
- package/out/assortments/new/index.html +2 -2
- package/out/copilot/index.html +2 -2
- package/out/country/CountryDetailPage/index.html +2 -2
- package/out/country/index.html +2 -2
- package/out/country/new/index.html +2 -2
- package/out/currency/CurrencyDetailPage/index.html +2 -2
- package/out/currency/index.html +2 -2
- package/out/currency/new/index.html +2 -2
- package/out/delivery-provider/DeliveryProviderDetailPage/index.html +2 -2
- package/out/delivery-provider/index.html +2 -2
- package/out/delivery-provider/new/index.html +2 -2
- package/out/enrollments/EnrollmentDetailPage/index.html +2 -2
- package/out/enrollments/index.html +2 -2
- package/out/events/EventDetailPage/index.html +2 -2
- package/out/events/index.html +2 -2
- package/out/exports/index.html +2 -2
- package/out/ext/[[...slug]]/index.html +2 -2
- package/out/external/index.html +2 -2
- package/out/filters/FilterDetailPage/index.html +2 -2
- package/out/filters/index.html +2 -2
- package/out/filters/new/index.html +2 -2
- package/out/index.html +2 -2
- package/out/install/index.html +2 -2
- package/out/language/LanguageDetailPage/index.html +2 -2
- package/out/language/index.html +2 -2
- package/out/language/new/index.html +2 -2
- package/out/log-in/index.html +2 -2
- package/out/orders/OrderDetailPage/index.html +2 -2
- package/out/orders/index.html +2 -2
- package/out/payment-provider/PaymentProviderDetailPage/index.html +2 -2
- package/out/payment-provider/index.html +2 -2
- package/out/payment-provider/new/index.html +2 -2
- package/out/products/ProductDetailPage/index.html +2 -2
- package/out/products/index.html +2 -2
- package/out/products/new/index.html +2 -2
- package/out/quotations/QuotationDetailPage/index.html +2 -2
- package/out/quotations/index.html +2 -2
- package/out/reset-password/index.html +2 -2
- package/out/sign-up/index.html +2 -2
- package/out/styleguide/index.html +2 -2
- package/out/tokens/TokenDetailPage/index.html +2 -2
- package/out/tokens/index.html +2 -2
- package/out/users/UserDetailPage/index.html +2 -2
- package/out/users/index.html +2 -2
- package/out/users/new/index.html +2 -2
- package/out/verify-email/index.html +2 -2
- package/out/warehousing-provider/WarehousingProviderDetailPage/index.html +2 -2
- package/out/warehousing-provider/index.html +2 -2
- package/out/warehousing-provider/new/index.html +2 -2
- package/out/works/WorkDetailPage/index.html +2 -2
- package/out/works/WorkQueueListView/index.html +2 -2
- package/out/works/index.html +2 -2
- package/out/works/management/index.html +2 -2
- package/package.json +18 -13
- package/src/sdk/README.md +195 -0
- package/src/sdk/plugin-build.mjs +81 -98
- package/src/sdk/plugin-build.test.mjs +6 -3
- package/src/sdk/plugin-runtime.cjs +66 -0
- package/src/sdk/plugin-runtime.d.mts +11 -0
- package/src/sdk/plugin-runtime.mjs +27 -0
- package/src/sdk/plugin-runtime.test.mjs +32 -0
- package/src/sdk/plugins.mjs +17 -0
- package/src/sdk/plugins.ts +17 -0
- package/src/sdk/shims/admin-ui-plugins.ts +3 -0
- package/src/sdk/shims/apollo-client-react.ts +3 -0
- package/src/sdk/shims/apollo-client.ts +3 -0
- package/src/sdk/shims/host.ts +61 -0
- package/src/sdk/shims/next-head.ts +3 -0
- package/src/sdk/shims/next-image.ts +3 -0
- package/src/sdk/shims/next-link.ts +3 -0
- package/src/sdk/shims/next-router.ts +3 -0
- package/src/sdk/shims/react-dom-client.ts +3 -0
- package/src/sdk/shims/react-dom.ts +3 -0
- package/src/sdk/shims/react-hook-form.ts +3 -0
- package/src/sdk/shims/react-intl.ts +3 -0
- package/src/sdk/shims/react-jsx-runtime.ts +3 -0
- package/src/sdk/shims/react-toastify.ts +3 -0
- package/src/sdk/shims/react.ts +3 -0
- package/out/_next/static/chunks/00zpb_zgq36h-.js +0 -14
- package/out/_next/static/chunks/02aa23atze2y4.js +0 -119
- package/out/_next/static/chunks/02u93m0n7n-q-.js +0 -12
- package/out/_next/static/chunks/03n4up296yhei.js +0 -138
- package/out/_next/static/chunks/03zrzz0sb-gy8.js +0 -14
- package/out/_next/static/chunks/044dmimivt13x.js +0 -233
- package/out/_next/static/chunks/07pwkvl-lm4vp.js +0 -24
- package/out/_next/static/chunks/08vf2wf3mxta3.js +0 -13
- package/out/_next/static/chunks/094s-grteo6tb.js +0 -31
- package/out/_next/static/chunks/0_wt7zjqgpl76.js +0 -807
- package/out/_next/static/chunks/0a81cjauoijka.js +0 -1
- package/out/_next/static/chunks/0ab_-095b34n5.js +0 -90
- package/out/_next/static/chunks/0ac9c5ecooaav.js +0 -234
- package/out/_next/static/chunks/0b--0624xswmi.js +0 -16
- package/out/_next/static/chunks/0b3hl4d_27v6q.js +0 -173
- package/out/_next/static/chunks/0braigkg4hdry.js +0 -39
- package/out/_next/static/chunks/0cdcsn87u-tzw.js +0 -1
- package/out/_next/static/chunks/0d9cf7svcpjcu.js +0 -1
- package/out/_next/static/chunks/0eooy6dat270h.js +0 -226
- package/out/_next/static/chunks/0ety-u93s5lsq.js +0 -188
- package/out/_next/static/chunks/0fb5j_lva6f8h.js +0 -19
- package/out/_next/static/chunks/0hm6-xlqw4vmr.js +0 -1
- package/out/_next/static/chunks/0im5k2e2u2uz_.js +0 -8
- package/out/_next/static/chunks/0iv288bepx0ug.js +0 -29
- package/out/_next/static/chunks/0ld2eenwz_blg.js +0 -52
- package/out/_next/static/chunks/0m9y8-nk64c1e.js +0 -12
- package/out/_next/static/chunks/0nz8nqr7k7pni.js +0 -61
- package/out/_next/static/chunks/0pyfoz6288y0f.js +0 -1
- package/out/_next/static/chunks/0qfjbvj6nn9zr.js +0 -18
- package/out/_next/static/chunks/0r0l1vs8bls6y.js +0 -1
- package/out/_next/static/chunks/0r2v5se5riad_.js +0 -227
- package/out/_next/static/chunks/0rdl1jrsef2ew.js +0 -3
- package/out/_next/static/chunks/0sutuaadm9sa2.js +0 -11
- package/out/_next/static/chunks/0tmo-o_wjgk4-.js +0 -8
- package/out/_next/static/chunks/0u-md-qpvyccn.js +0 -149
- package/out/_next/static/chunks/0u881hesm8z4s.js +0 -14
- package/out/_next/static/chunks/0u_efcr52k9v1.js +0 -15
- package/out/_next/static/chunks/0ukobsq85_to1.js +0 -135
- package/out/_next/static/chunks/0vxvcl2s96x4f.js +0 -24
- package/out/_next/static/chunks/0vyfm3usoot1p.js +0 -60
- package/out/_next/static/chunks/0wr0r7tr1jbcz.js +0 -10
- package/out/_next/static/chunks/0x_i69reqib8u.js +0 -3
- package/out/_next/static/chunks/0xxl7fb2bi8_8.js +0 -82
- package/out/_next/static/chunks/0z7jldn83dst6.js +0 -13
- package/out/_next/static/chunks/1-4f-vlpf5end.js +0 -43
- package/out/_next/static/chunks/1293ysgb8y4y3.js +0 -12
- package/out/_next/static/chunks/129pi8m3j6761.js +0 -1
- package/out/_next/static/chunks/12lbg_ctrshrg.js +0 -1
- package/out/_next/static/chunks/13f9ypdy9t6l8.js +0 -15
- package/out/_next/static/chunks/13g90lbjehcp1.js +0 -12
- package/out/_next/static/chunks/1413uu5ol2rfr.js +0 -166
- package/out/_next/static/chunks/15-duc2e3btcy.js +0 -1
- package/out/_next/static/chunks/155jjdhtr4dhn.js +0 -30
- package/out/_next/static/chunks/1679i7xv8jnle.js +0 -117
- package/out/_next/static/chunks/16a-8jlyrl0m8.js +0 -12
- package/out/_next/static/chunks/16bdu48a5vry_.js +0 -13
- package/out/_next/static/chunks/16r_t7quts1w0.js +0 -289
- package/out/_next/static/chunks/189epg0ebf7bc.js +0 -13
- package/out/_next/static/chunks/18ujb5-7bg1p4.js +0 -1
- package/out/_next/static/chunks/19fzi9f2kw8zv.js +0 -233
- package/out/_next/static/chunks/1_ov-8bomgh6c.js +0 -54
- package/out/_next/static/chunks/1axp79-x4n7i4.js +0 -242
- package/out/_next/static/chunks/1bga5_ny7avyr.js +0 -23
- package/out/_next/static/chunks/1bgsls3okrjue.js +0 -1
- package/out/_next/static/chunks/1cliieayy_gw1.js +0 -13
- package/out/_next/static/chunks/1cvyi5qu_s_d7.js +0 -10
- package/out/_next/static/chunks/1dcw-b0uqh6b0.js +0 -1
- package/out/_next/static/chunks/1drrou5kp4qdz.js +0 -1
- package/out/_next/static/chunks/1e4ue1_7qn6kz.js +0 -14
- package/out/_next/static/chunks/1emope9zm_-ch.js +0 -14
- package/out/_next/static/chunks/1f7ar56dj5j8s.js +0 -21
- package/out/_next/static/chunks/1fk9whsy-495f.js +0 -1
- package/out/_next/static/chunks/1fp7uihlvzcij.js +0 -13
- package/out/_next/static/chunks/1g0syfr6r0rj8.js +0 -111
- package/out/_next/static/chunks/1g5l7e7du4p25.js +0 -1
- package/out/_next/static/chunks/1h03py7retxw8.js +0 -13
- package/out/_next/static/chunks/1i6-vxhyp4fan.js +0 -73
- package/out/_next/static/chunks/1ihjqvn68cj5e.js +0 -36
- package/out/_next/static/chunks/1ij-bgloqrwlw.js +0 -809
- package/out/_next/static/chunks/1l1_ntden2a5-.js +0 -58
- package/out/_next/static/chunks/1m0x2mb91rv2i.js +0 -13
- package/out/_next/static/chunks/1mw35msx036qx.js +0 -66
- package/out/_next/static/chunks/1ou8q3ltdifd1.js +0 -34
- package/out/_next/static/chunks/1prx7jjoz9cq8.js +0 -3
- package/out/_next/static/chunks/1q1js93yqv2ym.js +0 -14
- package/out/_next/static/chunks/1qkgln72hya5g.js +0 -1
- package/out/_next/static/chunks/1qn6du1pk46f0.js +0 -14
- package/out/_next/static/chunks/1r_q8-_cl6_b-.js +0 -23
- package/out/_next/static/chunks/1rirgtcu6_bpa.js +0 -17
- package/out/_next/static/chunks/1rpgl9uhsj7jq.js +0 -28
- package/out/_next/static/chunks/1tzo3v9d5ccon.js +0 -15
- package/out/_next/static/chunks/1uculcrefh01f.js +0 -16
- package/out/_next/static/chunks/1uinfdu-lhddb.js +0 -1
- package/out/_next/static/chunks/1uiqmuia9hpwc.js +0 -32
- package/out/_next/static/chunks/1ukg1j06gk9j7.js +0 -233
- package/out/_next/static/chunks/1v2r-dm5xnwxd.js +0 -95
- package/out/_next/static/chunks/1x8c4f-tlz8oq.js +0 -54
- package/out/_next/static/chunks/1xic7x33en-_t.js +0 -46
- package/out/_next/static/chunks/1y-vwb0-v5xv0.js +0 -304
- package/out/_next/static/chunks/1ymswtxkxcnfi.js +0 -11
- package/out/_next/static/chunks/1yrby6v2msnio.js +0 -13
- package/out/_next/static/chunks/1yx8v1-jzs__q.js +0 -234
- package/out/_next/static/chunks/1yxsj_p-0xiav.js +0 -14
- package/out/_next/static/chunks/2-1ihmwxm5nd8.js +0 -13
- package/out/_next/static/chunks/2-hsn5zne_kbo.js +0 -18
- package/out/_next/static/chunks/20ndjd4r5l6vk.js +0 -1
- package/out/_next/static/chunks/22l-2aehes9lx.js +0 -153
- package/out/_next/static/chunks/23ju3v8ue0m8a.js +0 -8
- package/out/_next/static/chunks/23lmor9w4r767.js +0 -1
- package/out/_next/static/chunks/24p5ic154k1id.js +0 -50
- package/out/_next/static/chunks/250qu8q7duhe7.js +0 -1
- package/out/_next/static/chunks/25asi1rq6d8hb.js +0 -7
- package/out/_next/static/chunks/263u-_eyq54xn.js +0 -155
- package/out/_next/static/chunks/26ca8aneaqvre.js +0 -2
- package/out/_next/static/chunks/27_5des_qn7kz.js +0 -1
- package/out/_next/static/chunks/27ek8w2c2mk46.js +0 -15
- package/out/_next/static/chunks/28d90lqq_6ddl.js +0 -135
- package/out/_next/static/chunks/29yitf66u5w9d.js +0 -1
- package/out/_next/static/chunks/2_3qu55ddb4jo.js +0 -3
- package/out/_next/static/chunks/2b8nhs_3rpawc.js +0 -1
- package/out/_next/static/chunks/2bby8chs2h2zt.js +0 -190
- package/out/_next/static/chunks/2ch1ir5bauqm-.js +0 -41
- package/out/_next/static/chunks/2cwzq52lgg7tg.js +0 -147
- package/out/_next/static/chunks/2dbrybnhe5thu.css +0 -1
- package/out/_next/static/chunks/2dddh3jepg6r9.js +0 -22
- package/out/_next/static/chunks/2epfbio36cp2x.js +0 -13
- package/out/_next/static/chunks/2ev7bgw2foqui.js +0 -12
- package/out/_next/static/chunks/2f0e2t3pz-rua.js +0 -1
- package/out/_next/static/chunks/2ibnigbqfhrjb.js +0 -8
- package/out/_next/static/chunks/2iuu4shi025hv.js +0 -10
- package/out/_next/static/chunks/2n3x1m3a_ria_.js +0 -1
- package/out/_next/static/chunks/2ngg-2uli_wsk.js +0 -17
- package/out/_next/static/chunks/2nofj6ud99639.js +0 -2
- package/out/_next/static/chunks/2onfts3kpe9d8.js +0 -1
- package/out/_next/static/chunks/2rdh3y4-gf0r1.js +0 -7
- package/out/_next/static/chunks/2ry72x6et3uyk.js +0 -235
- package/out/_next/static/chunks/2t2zzfasof1ej.js +0 -18
- package/out/_next/static/chunks/2twd9trj9horc.js +0 -61
- package/out/_next/static/chunks/2uln0xj_hk2xv.js +0 -22
- package/out/_next/static/chunks/2x0c4v5dipld3.js +0 -13
- package/out/_next/static/chunks/2xhllcys1_u52.js +0 -14
- package/out/_next/static/chunks/3-n5bzlk225-y.js +0 -1
- package/out/_next/static/chunks/3154519pby2gj.js +0 -5
- package/out/_next/static/chunks/327jk4epgudqh.js +0 -110
- package/out/_next/static/chunks/334lcmrt6lgtz.js +0 -14
- package/out/_next/static/chunks/33bnjdrokmipf.js +0 -12
- package/out/_next/static/chunks/33g91_yljnpiw.js +0 -807
- package/out/_next/static/chunks/33getgbb1rmpa.js +0 -43
- package/out/_next/static/chunks/342etvf_c28cb.js +0 -39
- package/out/_next/static/chunks/34kqgu8bnykwx.js +0 -315
- package/out/_next/static/chunks/34zya3wqxvl8k.js +0 -19
- package/out/_next/static/chunks/35k7e1g1muu56.js +0 -5
- package/out/_next/static/chunks/399t21noeueqk.js +0 -13
- package/out/_next/static/chunks/39ze4mwy903wm.js +0 -13
- package/out/_next/static/chunks/3_8h-x8lcmhr7.js +0 -339
- package/out/_next/static/chunks/3_j5zrbyysq1g.js +0 -31
- package/out/_next/static/chunks/3a8a8fpl7-ndf.js +0 -1
- package/out/_next/static/chunks/3a9g7ouf888jt.js +0 -1
- package/out/_next/static/chunks/3anxg7pk9-h3t.js +0 -50
- package/out/_next/static/chunks/3blzs4z5wryub.js +0 -1
- package/out/_next/static/chunks/3cfkqo3t0m0es.js +0 -3
- package/out/_next/static/chunks/3coz1fo064u6a.js +0 -12
- package/out/_next/static/chunks/3cr1as0q659er.js +0 -1
- package/out/_next/static/chunks/3crdcex_nrx3o.js +0 -12
- package/out/_next/static/chunks/3crkl2ligc-kt.js +0 -14
- package/out/_next/static/chunks/3d0ic2ovyeue7.js +0 -2
- package/out/_next/static/chunks/3ddaet08eakmw.js +0 -18
- package/out/_next/static/chunks/3dh3x6thy7fef.js +0 -1
- package/out/_next/static/chunks/3e75y5wr7_vem.js +0 -327
- package/out/_next/static/chunks/3e98ykfx_vamf.js +0 -60
- package/out/_next/static/chunks/3eq-uts_yz1e5.js +0 -1
- package/out/_next/static/chunks/3ghzaufs2n8uq.js +0 -2
- package/out/_next/static/chunks/3ie60090urams.js +0 -16
- package/out/_next/static/chunks/3jffivfbeet7f.js +0 -15
- package/out/_next/static/chunks/3mskn3uvx6s77.js +0 -142
- package/out/_next/static/chunks/3oppyz2wurlv-.js +0 -329
- package/out/_next/static/chunks/3p-pioxz8jyip.js +0 -15
- package/out/_next/static/chunks/3po1wffu1pc3k.js +0 -12
- package/out/_next/static/chunks/3rvxjwpm2hkzt.js +0 -13
- package/out/_next/static/chunks/3snnfwi0hsfwy.js +0 -31
- package/out/_next/static/chunks/3so-jsqyai73m.js +0 -1
- package/out/_next/static/chunks/3voheu4m42ctw.js +0 -14
- package/out/_next/static/chunks/3x3oqxb68-ull.js +0 -7
- package/out/_next/static/chunks/3ysj3lx_q697-.js +0 -124
- package/out/_next/static/chunks/3zncjth-kop8p.js +0 -1
- package/out/_next/static/chunks/3zp4iedgev460.js +0 -35
- package/out/_next/static/chunks/40jzqlki-ix7b.js +0 -17
- package/out/_next/static/chunks/4138xi7jgdv_o.js +0 -107
- package/out/_next/static/chunks/413d2n3_vvshb.js +0 -14
- package/out/_next/static/chunks/41mslgyvxwsej.js +0 -1
- package/out/_next/static/chunks/44kw4hk598ruu.js +0 -1
- package/out/_next/static/chunks/44um3bi95nxcy.js +0 -1
- package/out/_next/static/chunks/44xj9eghssy4h.js +0 -1
- package/out/_next/static/chunks/turbopack-00bqo3amk802l.js +0 -1
- package/out/_next/static/chunks/turbopack-00xv5x2980kaw.js +0 -1
- package/out/_next/static/chunks/turbopack-07riv31885zxj.js +0 -1
- package/out/_next/static/chunks/turbopack-0_sc_n1p1bcp9.js +0 -1
- package/out/_next/static/chunks/turbopack-0a3d8s54evtiu.js +0 -1
- package/out/_next/static/chunks/turbopack-0eg08vs3s4808.js +0 -1
- package/out/_next/static/chunks/turbopack-0j5aiynif9rh6.js +0 -1
- package/out/_next/static/chunks/turbopack-0utbjxefp9fml.js +0 -1
- package/out/_next/static/chunks/turbopack-12eu9ngd0g762.js +0 -1
- package/out/_next/static/chunks/turbopack-169mif_3j2xs7.js +0 -1
- package/out/_next/static/chunks/turbopack-16y9ecuw-sg_1.js +0 -1
- package/out/_next/static/chunks/turbopack-19agtluuz9hs9.js +0 -1
- package/out/_next/static/chunks/turbopack-1qm1ao7m24ujy.js +0 -1
- package/out/_next/static/chunks/turbopack-1tefm98ftz444.js +0 -1
- package/out/_next/static/chunks/turbopack-1yd96mx8ypi2r.js +0 -1
- package/out/_next/static/chunks/turbopack-1yr-b62bnm8pn.js +0 -1
- package/out/_next/static/chunks/turbopack-20jztdd3emk_4.js +0 -1
- package/out/_next/static/chunks/turbopack-24wh5-0ze4f20.js +0 -1
- package/out/_next/static/chunks/turbopack-27e97jv6b-s-_.js +0 -1
- package/out/_next/static/chunks/turbopack-2_-s3bsa7fy5n.js +0 -1
- package/out/_next/static/chunks/turbopack-2agmtzzi93gcu.js +0 -1
- package/out/_next/static/chunks/turbopack-2krkwbmqyusjo.js +0 -1
- package/out/_next/static/chunks/turbopack-2ktr6ad7w59-u.js +0 -1
- package/out/_next/static/chunks/turbopack-2o3ztc3qxaqmv.js +0 -1
- package/out/_next/static/chunks/turbopack-2ocojyxy_6ohm.js +0 -1
- package/out/_next/static/chunks/turbopack-2p09rgir8a_rr.js +0 -1
- package/out/_next/static/chunks/turbopack-2s314huts4-ih.js +0 -1
- package/out/_next/static/chunks/turbopack-2uy0-z_9q9r-t.js +0 -1
- package/out/_next/static/chunks/turbopack-2xkr4g1kb-c30.js +0 -1
- package/out/_next/static/chunks/turbopack-38uc2-slitwye.js +0 -1
- package/out/_next/static/chunks/turbopack-3_vxq7t7y83kn.js +0 -1
- package/out/_next/static/chunks/turbopack-3b4ho7bon8y1n.js +0 -1
- package/out/_next/static/chunks/turbopack-3j07f1odh4keh.js +0 -1
- package/out/_next/static/chunks/turbopack-3ldzloccscyev.js +0 -1
- package/out/_next/static/chunks/turbopack-3o2wlpvy73vfc.js +0 -1
- package/out/_next/static/chunks/turbopack-3u8iq4uiukeh-.js +0 -1
- package/out/_next/static/chunks/turbopack-3ywen4wf3l3h-.js +0 -1
- package/out/_next/static/chunks/turbopack-3zajpzv2knbum.js +0 -1
- package/out/_next/static/chunks/turbopack-42c24-sypz5zz.js +0 -1
- /package/dist/{chunk-BYXBJQAS.js → chunk-QWQ3WJJN.js} +0 -0
- /package/out/_next/static/{VYWUvBJY94uiS3jm4HOFN → hH8h6SzcZWEUFySYqRPbW}/_clientMiddlewareManifest.js +0 -0
- /package/out/_next/static/{VYWUvBJY94uiS3jm4HOFN → hH8h6SzcZWEUFySYqRPbW}/_ssgManifest.js +0 -0
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,95377,16717,e=>{"use strict";var t,r,a,n,o,i,s,l,u,c,d,p,f,h,m,g,y,v,b,w,_,k,E,x,I,S,A,z,T,M,O,R,C,$,P,N,j,Z,L,U,D,B,F,V,q,H,J,W,G,Y,K,X,Q,ee=e.i(91398),et=e.i(91788),er=e.i(50461),ea="vercel.ai.error",en=Symbol.for(ea),eo=class e extends(r=Error,t=en,r){constructor({name:e,message:r,cause:a}){super(r),this[t]=!0,this.name=e,this.cause=a}static isInstance(t){return e.hasMarker(t,ea)}static hasMarker(e,t){let r=Symbol.for(t);return null!=e&&"object"==typeof e&&r in e&&"boolean"==typeof e[r]&&!0===e[r]}},ei="AI_APICallError",es=`vercel.ai.error.${ei}`,el=Symbol.for(es),eu=class extends(n=eo,a=el,n){constructor({message:e,url:t,requestBodyValues:r,statusCode:n,responseHeaders:o,responseBody:i,cause:s,isRetryable:l=null!=n&&(408===n||409===n||429===n||n>=500),data:u}){super({name:ei,message:e,cause:s}),this[a]=!0,this.url=t,this.requestBodyValues=r,this.statusCode=n,this.responseHeaders=o,this.responseBody=i,this.isRetryable=l,this.data=u}static isInstance(e){return eo.hasMarker(e,es)}},ec="AI_EmptyResponseBodyError",ed=`vercel.ai.error.${ec}`,ep=Symbol.for(ed),ef=class extends(i=eo,o=ep,i){constructor({message:e="Empty response body"}={}){super({name:ec,message:e}),this[o]=!0}static isInstance(e){return eo.hasMarker(e,ed)}};function eh(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.toString():JSON.stringify(e)}var em="AI_InvalidArgumentError",eg=`vercel.ai.error.${em}`,ey=Symbol.for(eg),ev=class extends(l=eo,s=ey,l){constructor({message:e,cause:t,argument:r}){super({name:em,message:e,cause:t}),this[s]=!0,this.argument=r}static isInstance(e){return eo.hasMarker(e,eg)}},eb=Symbol.for("vercel.ai.error.AI_InvalidPromptError");Symbol.for("vercel.ai.error.AI_InvalidResponseDataError");var ew="AI_JSONParseError",e_=`vercel.ai.error.${ew}`,ek=Symbol.for(e_),eE=class extends(c=eo,u=ek,c){constructor({text:e,cause:t}){super({name:ew,message:`JSON parsing failed: Text: ${e}.
|
|
2
|
-
Error message: ${eh(t)}`,cause:t}),this[u]=!0,this.text=e}static isInstance(e){return eo.hasMarker(e,e_)}},ex=Symbol.for("vercel.ai.error.AI_LoadAPIKeyError");Symbol.for("vercel.ai.error.AI_LoadSettingError");Symbol.for("vercel.ai.error.AI_NoContentGeneratedError");Symbol.for("vercel.ai.error.AI_NoSuchModelError");Symbol.for("vercel.ai.error.AI_NoSuchProviderReferenceError");Symbol.for("vercel.ai.error.AI_TooManyEmbeddingValuesForCallError");var eI="AI_TypeValidationError",eS=`vercel.ai.error.${eI}`,eA=Symbol.for(eS),ez=class e extends(p=eo,d=eA,p){constructor({value:e,cause:t,context:r}){let a="Type validation failed";if((null==r?void 0:r.field)&&(a+=` for ${r.field}`),(null==r?void 0:r.entityName)||(null==r?void 0:r.entityId)){a+=" (";const e=[];r.entityName&&e.push(r.entityName),r.entityId&&e.push(`id: "${r.entityId}"`),a+=e.join(", "),a+=")"}super({name:eI,message:`${a}: Value: ${JSON.stringify(e)}.
|
|
3
|
-
Error message: ${eh(t)}`,cause:t}),this[d]=!0,this.value=e,this.context=r}static isInstance(e){return eo.hasMarker(e,eS)}static wrap({value:t,cause:r,context:a}){var n,o,i;return e.isInstance(r)&&r.value===t&&(null==(n=r.context)?void 0:n.field)===(null==a?void 0:a.field)&&(null==(o=r.context)?void 0:o.entityName)===(null==a?void 0:a.entityName)&&(null==(i=r.context)?void 0:i.entityId)===(null==a?void 0:a.entityId)?r:new e({value:t,cause:r,context:a})}},eT=Symbol.for("vercel.ai.error.AI_UnsupportedFunctionalityError");function eM(e,t,r){function a(r,a){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:a,constr:i,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,a);let n=i.prototype,o=Object.keys(n);for(let e=0;e<o.length;e++){let t=o[e];t in r||(r[t]=n[t].bind(r))}}let n=r?.Parent??Object;class o extends n{}function i(e){var t;let n=r?.Parent?new o:this;for(let r of(a(n,e),(t=n._zod).deferred??(t.deferred=[]),n._zod.deferred))r();return n}return Object.defineProperty(o,"name",{value:e}),Object.defineProperty(i,"init",{value:a}),Object.defineProperty(i,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}Symbol("zod_brand");class eO extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class eR extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(f=globalThis).__zod_globalConfig??(f.__zod_globalConfig={});let eC=globalThis.__zod_globalConfig;function e$(e){return e&&Object.assign(eC,e),eC}function eP(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function eN(e,t){return"bigint"==typeof t?t.toString():t}function ej(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function eZ(e){return null==e}function eL(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function eU(e,t){let r=e/t,a=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-a)<n?0:r-a}let eD=Symbol("evaluating");function eB(e,t,r){let a;Object.defineProperty(e,t,{get(){if(a!==eD)return void 0===a&&(a=eD,a=r()),a},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function eF(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function eV(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function eq(e){return JSON.stringify(e)}function eH(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}let eJ="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function eW(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let eG=ej(()=>{if(eC.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function eY(e){if(!1===eW(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==eW(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}let eK=new Set(["string","number","symbol"]),eX=new Set(["string","number","bigint","boolean","symbol","undefined"]);function eQ(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function e0(e,t,r){let a=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(a._zod.parent=e),a}function e1(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function e2(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function e5(e){return Object.keys(e).filter(t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let e4={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},e3={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function e8(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function e6(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function e9(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function e7(e){return"string"==typeof e?e:e?.message}function te(e,t,r){let a=e.message?e.message:e7(e.inst?._zod.def?.error?.(e))??e7(t?.error?.(e))??e7(r.customError?.(e))??e7(r.localeError?.(e))??"Invalid input",{inst:n,continue:o,input:i,...s}=e;return s.path??(s.path=[]),s.message=a,t?.reportInput&&(s.input=i),s}function tt(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function tr(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function ta(...e){let[t,r,a]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:a}:{...t}}function tn(e){let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}function to(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}e.s(["BIGINT_FORMAT_RANGES",0,e3,"Class",0,class{constructor(...e){}},"NUMBER_FORMAT_RANGES",0,e4,"aborted",0,e8,"allowsEval",0,eG,"assert",0,function(e){},"assertEqual",0,function(e){return e},"assertIs",0,function(e){},"assertNever",0,function(e){throw Error("Unexpected value in exhaustive check")},"assertNotEqual",0,function(e){return e},"assignProp",0,eF,"base64ToUint8Array",0,tn,"base64urlToUint8Array",0,function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return tn(t+r)},"cached",0,ej,"captureStackTrace",0,eJ,"cleanEnum",0,function(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])},"cleanRegex",0,eL,"clone",0,e0,"cloneDef",0,function(e){return eV(e._zod.def)},"createTransparentProxy",0,function(e){let t;return new Proxy({},{get:(r,a,n)=>(t??(t=e()),Reflect.get(t,a,n)),set:(r,a,n,o)=>(t??(t=e()),Reflect.set(t,a,n,o)),has:(r,a)=>(t??(t=e()),Reflect.has(t,a)),deleteProperty:(r,a)=>(t??(t=e()),Reflect.deleteProperty(t,a)),ownKeys:r=>(t??(t=e()),Reflect.ownKeys(t)),getOwnPropertyDescriptor:(r,a)=>(t??(t=e()),Reflect.getOwnPropertyDescriptor(t,a)),defineProperty:(r,a,n)=>(t??(t=e()),Reflect.defineProperty(t,a,n))})},"defineLazy",0,eB,"esc",0,eq,"escapeRegex",0,eQ,"explicitlyAborted",0,e6,"extend",0,function(e,t){if(!eY(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let r=e._zod.def.shape;for(let e in t)if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let a=eV(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return eF(this,"shape",r),r}});return e0(e,a)},"finalizeIssue",0,te,"floatSafeRemainder",0,eU,"getElementAtPath",0,function(e,t){return t?t.reduce((e,t)=>e?.[t],e):e},"getEnumValues",0,eP,"getLengthableOrigin",0,tr,"getParsedType",0,e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return"promise";if("u">typeof Map&&e instanceof Map)return"map";if("u">typeof Set&&e instanceof Set)return"set";if("u">typeof Date&&e instanceof Date)return"date";if("u">typeof File&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},"getSizableOrigin",0,tt,"hexToUint8Array",0,function(e){let t=e.replace(/^0x/,"");if(t.length%2!=0)throw Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)r[e/2]=Number.parseInt(t.slice(e,e+2),16);return r},"isObject",0,eW,"isPlainObject",0,eY,"issue",0,ta,"joinValues",0,function(e,t="|"){return e.map(e=>e2(e)).join(t)},"jsonStringifyReplacer",0,eN,"merge",0,function(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=eV(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return eF(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return e0(e,r)},"mergeDefs",0,eV,"normalizeParams",0,e1,"nullish",0,eZ,"numKeys",0,function(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t},"objectClone",0,function(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))},"omit",0,function(e,t){let r=e._zod.def,a=r.checks;if(a&&a.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let n=eV(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete a[e]}return eF(this,"shape",a),a},checks:[]});return e0(e,n)},"optionalKeys",0,e5,"parsedType",0,function(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t},"partial",0,function(e,t,r){let a=t._zod.def.checks;if(a&&a.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let n=eV(t._zod.def,{get shape(){let a=t._zod.def.shape,n={...a};if(r)for(let t in r){if(!(t in a))throw Error(`Unrecognized key: "${t}"`);r[t]&&(n[t]=e?new e({type:"optional",innerType:a[t]}):a[t])}else for(let t in a)n[t]=e?new e({type:"optional",innerType:a[t]}):a[t];return eF(this,"shape",n),n},checks:[]});return e0(t,n)},"pick",0,function(e,t){let r=e._zod.def,a=r.checks;if(a&&a.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let n=eV(e._zod.def,{get shape(){let e={};for(let a in t){if(!(a in r.shape))throw Error(`Unrecognized key: "${a}"`);t[a]&&(e[a]=r.shape[a])}return eF(this,"shape",e),e},checks:[]});return e0(e,n)},"prefixIssues",0,e9,"primitiveTypes",0,eX,"promiseAllObject",0,function(e){let t=Object.keys(e);return Promise.all(t.map(t=>e[t])).then(e=>{let r={};for(let a=0;a<t.length;a++)r[t[a]]=e[a];return r})},"propertyKeyTypes",0,eK,"randomString",0,function(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let a=0;a<e;a++)r+=t[Math.floor(Math.random()*t.length)];return r},"required",0,function(e,t,r){let a=eV(t._zod.def,{get shape(){let a=t._zod.def.shape,n={...a};if(r)for(let t in r){if(!(t in n))throw Error(`Unrecognized key: "${t}"`);r[t]&&(n[t]=new e({type:"nonoptional",innerType:a[t]}))}else for(let t in a)n[t]=new e({type:"nonoptional",innerType:a[t]});return eF(this,"shape",n),n}});return e0(t,a)},"safeExtend",0,function(e,t){if(!eY(t))throw Error("Invalid input to safeExtend: expected a plain object");let r=eV(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return eF(this,"shape",r),r}});return e0(e,r)},"shallowClone",0,function(e){return eY(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e},"slugify",0,eH,"stringifyPrimitive",0,e2,"uint8ArrayToBase64",0,to,"uint8ArrayToBase64url",0,function(e){return to(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},"uint8ArrayToHex",0,function(e){return Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")},"unwrapMessage",0,e7],39604);let ti=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,eN,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ts=eM("$ZodError",ti),tl=eM("$ZodError",ti,{Parent:Error}),tu=e=>(t,r,a,n)=>{let o=a?{...a,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new eO;if(i.issues.length){let t=new(n?.Err??e)(i.issues.map(e=>te(e,o,e$())));throw eJ(t,n?.callee),t}return i.value},tc=tu(tl),td=e=>async(t,r,a,n)=>{let o=a?{...a,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise&&(i=await i),i.issues.length){let t=new(n?.Err??e)(i.issues.map(e=>te(e,o,e$())));throw eJ(t,n?.callee),t}return i.value},tp=td(tl),tf=e=>(t,r,a)=>{let n=a?{...a,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new eO;return o.issues.length?{success:!1,error:new(e??ts)(o.issues.map(e=>te(e,n,e$())))}:{success:!0,data:o.value}},th=tf(tl),tm=e=>async(t,r,a)=>{let n=a?{...a,async:!0}:{async:!0},o=t._zod.run({value:r,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>te(e,n,e$())))}:{success:!0,data:o.value}},tg=tm(tl),ty=eM("ZodError",(e,t)=>{ts.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>(function(e,t=e=>e.message){let r={_errors:[]},a=(e,n=[])=>{for(let o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>a({issues:e},[...n,...o.path]));else if("invalid_key"===o.code)a({issues:o.issues},[...n,...o.path]);else if("invalid_element"===o.code)a({issues:o.issues},[...n,...o.path]);else{let e=[...n,...o.path];if(0===e.length)r._errors.push(t(o));else{let a=r,n=0;for(;n<e.length;){let r=e[n];n===e.length-1?(a[r]=a[r]||{_errors:[]},a[r]._errors.push(t(o))):a[r]=a[r]||{_errors:[]},a=a[r],n++}}}};return a(e),r})(e,t)},flatten:{value:t=>(function(e,t=e=>e.message){let r={},a=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):a.push(t(n));return{formErrors:a,fieldErrors:r}})(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,eN,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,eN,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),tv=tu(ty),tb=td(ty),tw=tf(ty),t_=tm(ty),tk=(e,t,r)=>{let a=r?{...r,direction:"backward"}:{direction:"backward"};return tu(ty)(e,t,a)},tE=(e,t,r)=>tu(ty)(e,t,r),tx=async(e,t,r)=>{let a=r?{...r,direction:"backward"}:{direction:"backward"};return td(ty)(e,t,a)},tI=async(e,t,r)=>td(ty)(e,t,r),tS=(e,t,r)=>{let a=r?{...r,direction:"backward"}:{direction:"backward"};return tf(ty)(e,t,a)},tA=(e,t,r)=>tf(ty)(e,t,r),tz=async(e,t,r)=>{let a=r?{...r,direction:"backward"}:{direction:"backward"};return tm(ty)(e,t,a)},tT=async(e,t,r)=>tm(ty)(e,t,r);Symbol("ZodOutput"),Symbol("ZodInput");(h=globalThis).__zod_globalRegistry??(h.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let a={...r,...this._map.get(e)};return Object.keys(a).length?a:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let tM=globalThis.__zod_globalRegistry;function tO(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??tM,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function tR(e,t,r={path:[],schemaPath:[]}){var a;let n=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;let i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);let s=e._zod.toJSONSchema?.();if(s)i.schema=s;else{let a={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,a);else{let r=i.schema,o=t.processors[n.type];if(!o)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);o(e,t,r,a)}let o=e._zod.parent;o&&(i.ref||(i.ref=o),tR(o,t,a),t.seen.get(o).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(i.schema,l),"input"===t.io&&function e(t,r){let a=r??{seen:new Set};if(a.seen.has(t))return!1;a.seen.add(t);let n=t._zod.def;if("transform"===n.type)return!0;if("array"===n.type)return e(n.element,a);if("set"===n.type)return e(n.valueType,a);if("lazy"===n.type)return e(n.getter(),a);if("promise"===n.type||"optional"===n.type||"nonoptional"===n.type||"nullable"===n.type||"readonly"===n.type||"default"===n.type||"prefault"===n.type)return e(n.innerType,a);if("intersection"===n.type)return e(n.left,a)||e(n.right,a);if("record"===n.type||"map"===n.type)return e(n.keyType,a)||e(n.valueType,a);if("pipe"===n.type)return!!t._zod.traits.has("$ZodCodec")||e(n.in,a)||e(n.out,a);if("object"===n.type){for(let t in n.shape)if(e(n.shape[t],a))return!0;return!1}if("union"===n.type){for(let t of n.options)if(e(t,a))return!0;return!1}if("tuple"===n.type){for(let t of n.items)if(e(t,a))return!0;if(n.rest&&e(n.rest,a))return!0}return!1}(e)&&(delete i.schema.examples,delete i.schema.default),"input"===t.io&&"_prefault"in i.schema&&((a=i.schema).default??(a.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function tC(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let a=new Map;for(let t of e.seen.entries()){let r=e.metadataRegistry.get(t[0])?.id;if(r){let e=a.get(r);if(e&&e!==t[0])throw Error(`Duplicate schema id "${r}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(r,t[0])}}let n=t=>{if(t[1].schema.$ref)return;let a=t[1],{ref:n,defId:o}=(t=>{let a="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let r=e.external.registry.get(t[0])?.id,n=e.external.uri??(e=>e);if(r)return{ref:n(r)};let o=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=o,{defId:o,ref:`${n("__shared")}#/${a}/${o}`}}if(t[1]===r)return{ref:"#"};let n=`#/${a}/`,o=t[1].schema.id??`__schema${e.counter++}`;return{defId:o,ref:n+o}})(t);a.def={...a.schema},o&&(a.defId=o);let i=a.schema;for(let e in i)delete i[e];i.$ref=n};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
|
|
4
|
-
|
|
5
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let r of e.seen.entries()){let a=r[1];if(t===r[0]){n(r);continue}if(e.external){let a=e.external.registry.get(r[0])?.id;if(t!==r[0]&&a){n(r);continue}}if(e.metadataRegistry.get(r[0])?.id||a.cycle||a.count>1&&"ref"===e.reused){n(r);continue}}}function t$(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let a=t=>{let r=e.seen.get(t);if(null===r.ref)return;let n=r.def??r.schema,o={...n},i=r.ref;if(r.ref=null,i){a(i);let r=e.seen.get(i),s=r.schema;if(s.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(n.allOf=n.allOf??[],n.allOf.push(s)):Object.assign(n,s),Object.assign(n,o),t._zod.parent===i)for(let e in n)"$ref"!==e&&"allOf"!==e&&(e in o||delete n[e]);if(s.$ref&&r.def)for(let e in n)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(n[e])===JSON.stringify(r.def[e])&&delete n[e]}let s=t._zod.parent;if(s&&s!==i){a(s);let t=e.seen.get(s);if(t?.schema.$ref&&(n.$ref=t.schema.$ref,t.def))for(let e in n)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(n[e])===JSON.stringify(t.def[e])&&delete n[e]}e.override({zodSchema:t,jsonSchema:n,path:r.path??[]})};for(let t of[...e.seen.entries()].reverse())a(t[0]);let n={};if("draft-2020-12"===e.target?n.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?n.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let r=e.external.registry.get(t)?.id;if(!r)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(r)}Object.assign(n,r.def??r.schema);let o=e.metadataRegistry.get(t)?.id;void 0!==o&&n.id===o&&delete n.id;let i=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,i[e.defId]=e.def)}e.external||Object.keys(i).length>0&&("draft-2020-12"===e.target?n.$defs=i:n.definitions=i);try{let r=JSON.parse(JSON.stringify(n));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:tP(t,"input",e.processors),output:tP(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw Error("Error converting schema to JSON.")}}let tP=(e,t,r={})=>a=>{let{libraryOptions:n,target:o}=a??{},i=tO({...n??{},target:o,io:t,processors:r});return tR(e,i),tC(i,e),t$(i,e)},tN={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},tj=(e,t,r,a)=>{r.type="string";let{minimum:n,maximum:o,format:i,patterns:s,contentEncoding:l}=e._zod.bag;if("number"==typeof n&&(r.minLength=n),"number"==typeof o&&(r.maxLength=o),i&&(r.format=tN[i]??i,""===r.format&&delete r.format,"time"===i&&delete r.format),l&&(r.contentEncoding=l),s&&s.size>0){let e=[...s];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}},tZ=(e,t,r,a)=>{let{minimum:n,maximum:o,format:i,multipleOf:s,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;"string"==typeof i&&i.includes("int")?r.type="integer":r.type="number";let c="number"==typeof u&&u>=(n??-1/0),d="number"==typeof l&&l<=(o??1/0),p="draft-04"===t.target||"openapi-3.0"===t.target;c?p?(r.minimum=u,r.exclusiveMinimum=!0):r.exclusiveMinimum=u:"number"==typeof n&&(r.minimum=n),d?p?(r.maximum=l,r.exclusiveMaximum=!0):r.exclusiveMaximum=l:"number"==typeof o&&(r.maximum=o),"number"==typeof s&&(r.multipleOf=s)},tL=(e,t,r,a)=>{r.type="boolean"},tU=(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("BigInt cannot be represented in JSON Schema")},tD=(e,t,r,a)=>{"openapi-3.0"===t.target?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},tB=(e,t,r,a)=>{r.not={}},tF=(e,t,r,a)=>{},tV=(e,t,r,a)=>{},tq=(e,t,r,a)=>{let n=eP(e._zod.def.entries);n.every(e=>"number"==typeof e)&&(r.type="number"),n.every(e=>"string"==typeof e)&&(r.type="string"),r.enum=n},tH=(e,t,r,a)=>{let n=e._zod.def,o=[];for(let e of n.values)if(void 0===e){if("throw"===t.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e)if("throw"===t.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");else o.push(Number(e));else o.push(e);if(0===o.length);else if(1===o.length){let e=o[0];r.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?r.enum=[e]:r.const=e}else o.every(e=>"number"==typeof e)&&(r.type="number"),o.every(e=>"string"==typeof e)&&(r.type="string"),o.every(e=>"boolean"==typeof e)&&(r.type="boolean"),o.every(e=>null===e)&&(r.type="null"),r.enum=o},tJ=(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")},tW=(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")},tG=(e,t,r,a)=>{let n=e._zod.def,{minimum:o,maximum:i}=e._zod.bag;"number"==typeof o&&(r.minItems=o),"number"==typeof i&&(r.maxItems=i),r.type="array",r.items=tR(n.element,t,{...a,path:[...a.path,"items"]})},tY=(e,t,r,a)=>{let n=e._zod.def;r.type="object",r.properties={};let o=n.shape;for(let e in o)r.properties[e]=tR(o[e],t,{...a,path:[...a.path,"properties",e]});let i=new Set([...new Set(Object.keys(o))].filter(e=>{let r=n.shape[e]._zod;return"input"===t.io?void 0===r.optin:void 0===r.optout}));i.size>0&&(r.required=Array.from(i)),n.catchall?._zod.def.type==="never"?r.additionalProperties=!1:n.catchall?n.catchall&&(r.additionalProperties=tR(n.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)},tK=(e,t,r,a)=>{let n=e._zod.def,o=!1===n.inclusive,i=n.options.map((e,r)=>tR(e,t,{...a,path:[...a.path,o?"oneOf":"anyOf",r]}));o?r.oneOf=i:r.anyOf=i},tX=(e,t,r,a)=>{let n=e._zod.def,o=tR(n.left,t,{...a,path:[...a.path,"allOf",0]}),i=tR(n.right,t,{...a,path:[...a.path,"allOf",1]}),s=e=>"allOf"in e&&1===Object.keys(e).length;r.allOf=[...s(o)?o.allOf:[o],...s(i)?i.allOf:[i]]},tQ=(e,t,r,a)=>{let n=e._zod.def;r.type="object";let o=n.keyType,i=o._zod.bag,s=i?.patterns;if("loose"===n.mode&&s&&s.size>0){let e=tR(n.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});for(let t of(r.patternProperties={},s))r.patternProperties[t.source]=e}else("draft-07"===t.target||"draft-2020-12"===t.target)&&(r.propertyNames=tR(n.keyType,t,{...a,path:[...a.path,"propertyNames"]})),r.additionalProperties=tR(n.valueType,t,{...a,path:[...a.path,"additionalProperties"]});let l=o._zod.values;if(l){let e=[...l].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(r.required=e)}},t0=(e,t,r,a)=>{let n=e._zod.def,o=tR(n.innerType,t,a),i=t.seen.get(e);"openapi-3.0"===t.target?(i.ref=n.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},t1=(e,t,r,a)=>{let n=e._zod.def;tR(n.innerType,t,a),t.seen.get(e).ref=n.innerType},t2=(e,t,r,a)=>{let n=e._zod.def;tR(n.innerType,t,a),t.seen.get(e).ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},t5=(e,t,r,a)=>{let n=e._zod.def;tR(n.innerType,t,a),t.seen.get(e).ref=n.innerType,"input"===t.io&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},t4=(e,t,r,a)=>{let n,o=e._zod.def;tR(o.innerType,t,a),t.seen.get(e).ref=o.innerType;try{n=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=n},t3=(e,t,r,a)=>{let n=e._zod.def,o=n.in._zod.traits.has("$ZodTransform"),i="input"===t.io?o?n.out:n.in:n.out;tR(i,t,a),t.seen.get(e).ref=i},t8=(e,t,r,a)=>{let n=e._zod.def;tR(n.innerType,t,a),t.seen.get(e).ref=n.innerType,r.readOnly=!0},t6=(e,t,r,a)=>{let n=e._zod.def;tR(n.innerType,t,a),t.seen.get(e).ref=n.innerType},t9=(e,t,r,a)=>{let n=e._zod.innerType;tR(n,t,a),t.seen.get(e).ref=n},t7={string:tj,number:tZ,boolean:tL,bigint:tU,symbol:(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("Symbols cannot be represented in JSON Schema")},null:tD,undefined:(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("Undefined cannot be represented in JSON Schema")},void:(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("Void cannot be represented in JSON Schema")},never:tB,any:tF,unknown:tV,date:(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("Date cannot be represented in JSON Schema")},enum:tq,literal:tH,nan:(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("NaN cannot be represented in JSON Schema")},template_literal:(e,t,r,a)=>{let n=e._zod.pattern;if(!n)throw Error("Pattern not found in template literal");r.type="string",r.pattern=n.source},file:(e,t,r,a)=>{let n={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:i,mime:s}=e._zod.bag;void 0!==o&&(n.minLength=o),void 0!==i&&(n.maxLength=i),s?1===s.length?(n.contentMediaType=s[0],Object.assign(r,n)):(Object.assign(r,n),r.anyOf=s.map(e=>({contentMediaType:e}))):Object.assign(r,n)},success:(e,t,r,a)=>{r.type="boolean"},custom:tJ,function:(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("Function types cannot be represented in JSON Schema")},transform:tW,map:(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("Map cannot be represented in JSON Schema")},set:(e,t,r,a)=>{if("throw"===t.unrepresentable)throw Error("Set cannot be represented in JSON Schema")},array:tG,object:tY,union:tK,intersection:tX,tuple:(e,t,r,a)=>{let n=e._zod.def;r.type="array";let o="draft-2020-12"===t.target?"prefixItems":"items",i="draft-2020-12"===t.target||"openapi-3.0"===t.target?"items":"additionalItems",s=n.items.map((e,r)=>tR(e,t,{...a,path:[...a.path,o,r]})),l=n.rest?tR(n.rest,t,{...a,path:[...a.path,i,..."openapi-3.0"===t.target?[n.items.length]:[]]}):null;"draft-2020-12"===t.target?(r.prefixItems=s,l&&(r.items=l)):"openapi-3.0"===t.target?(r.items={anyOf:s},l&&r.items.anyOf.push(l),r.minItems=s.length,l||(r.maxItems=s.length)):(r.items=s,l&&(r.additionalItems=l));let{minimum:u,maximum:c}=e._zod.bag;"number"==typeof u&&(r.minItems=u),"number"==typeof c&&(r.maxItems=c)},record:tQ,nullable:t0,nonoptional:t1,default:t2,prefault:t5,catch:t4,pipe:t3,readonly:t8,promise:(e,t,r,a)=>{let n=e._zod.def;tR(n.innerType,t,a),t.seen.get(e).ref=n.innerType},optional:t6,lazy:t9};class re extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}function rt(e){}function rr(e,t,r){return 100===r&&97===e.charCodeAt(t+1)&&116===e.charCodeAt(t+2)&&97===e.charCodeAt(t+3)&&58===e.charCodeAt(t+4)}function ra(e,t,r){return 101===r&&118===e.charCodeAt(t+1)&&101===e.charCodeAt(t+2)&&110===e.charCodeAt(t+3)&&116===e.charCodeAt(t+4)&&58===e.charCodeAt(t+5)}class rn extends TransformStream{constructor({onError:e,onRetry:t,onComment:r,maxBufferSize:a}={}){let n;super({start(o){n=function(e){if("function"==typeof e)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=rt,onError:r=rt,onRetry:a=rt,onComment:n,maxBufferSize:o}=e,i=[],s=0,l=!0,u,c="",d=0,p,f=!1;function h(){void 0!==o&&(s+c.length<=o||(f=!0,i.length=0,s=0,u=void 0,c="",d=0,p=void 0,r(new re(`Buffered data exceeded max buffer size of ${o} characters`,{type:"max-buffer-size-exceeded"}))))}function m(e){let r=0;if(-1===e.indexOf("\r")){let a=e.indexOf(`
|
|
6
|
-
`,r);for(;-1!==a;){if(r===a){d>0&&t({id:u,event:p,data:c}),u=void 0,c="",d=0,p=void 0,r=a+1,a=e.indexOf(`
|
|
7
|
-
`,r);continue}let n=e.charCodeAt(r);if(rr(e,r,n)){let n=32===e.charCodeAt(r+5)?r+6:r+5,o=e.slice(n,a);if(0===d&&10===e.charCodeAt(a+1)){t({id:u,event:p,data:o}),u=void 0,c="",p=void 0,r=a+2,a=e.indexOf(`
|
|
8
|
-
`,r);continue}c=0===d?o:`${c}
|
|
9
|
-
${o}`,d++}else ra(e,r,n)?p=e.slice(32===e.charCodeAt(r+6)?r+7:r+6,a)||void 0:g(e,r,a);r=a+1,a=e.indexOf(`
|
|
10
|
-
`,r)}return e.slice(r)}for(;r<e.length;){let t=e.indexOf("\r",r),a=e.indexOf(`
|
|
11
|
-
`,r),n=-1;if(-1!==t&&-1!==a?n=t<a?t:a:-1!==t?n=t===e.length-1?-1:t:-1!==a&&(n=a),-1===n)break;g(e,r,n),r=n+1,13===e.charCodeAt(r-1)&&10===e.charCodeAt(r)&&r++}return e.slice(r)}function g(e,r,a){if(r===a)return void(d>0&&t({id:u,event:p,data:c}),u=void 0,c="",d=0,p=void 0);let o=e.charCodeAt(r);if(rr(e,r,o)){let t=32===e.charCodeAt(r+5)?r+6:r+5,n=e.slice(t,a);c=0===d?n:`${c}
|
|
12
|
-
${n}`,d++;return}if(ra(e,r,o)){p=e.slice(32===e.charCodeAt(r+6)?r+7:r+6,a)||void 0;return}if(105===o&&100===e.charCodeAt(r+1)&&58===e.charCodeAt(r+2)){let t=e.slice(32===e.charCodeAt(r+3)?r+4:r+3,a);t.includes("\0")||(u=t);return}if(58===o){n&&n(e.slice(r,a).slice(32===e.charCodeAt(r+1)?2:1));return}let i=e.slice(r,a),s=i.indexOf(":");if(-1===s)return void y(i,"",i);let l=i.slice(0,s),f=32===i.charCodeAt(s+1)?2:1;y(l,i.slice(s+f),i)}function y(e,t,n){switch(e){case"event":p=t||void 0;break;case"data":c=0===d?t:`${c}
|
|
13
|
-
${t}`,d++;break;case"id":t.includes("\0")||(u=t);break;case"retry":/^\d+$/.test(t)?a(parseInt(t,10)):r(new re(`Invalid \`retry\` value: "${t}"`,{type:"invalid-retry",value:t,line:n}));break;default:r(new re(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:"unknown-field",field:e,value:t,line:n}))}}return{feed:function(e){if(f)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(l&&(l=!1,239===e.charCodeAt(0)&&187===e.charCodeAt(1)&&191===e.charCodeAt(2)&&(e=e.slice(3))),0===i.length){let t=m(e);""!==t&&(i.push(t),s=t.length),h();return}if(-1===e.indexOf(`
|
|
14
|
-
`)&&-1===e.indexOf("\r")){i.push(e),s+=e.length,h();return}i.push(e);let t=i.join("");i.length=0,s=0;let r=m(t);""!==r&&(i.push(r),s=r.length),h()},reset:function(e={}){if(e.consume&&i.length>0){let e=i.join("");g(e,0,e.length)}l=!0,u=void 0,c="",d=0,p=void 0,i.length=0,s=0,f=!1}}}({onEvent:e=>{o.enqueue(e)},onError(t){"function"==typeof e&&e(t),("terminate"===e||"max-buffer-size-exceeded"===t.type)&&o.error(t)},onRetry:t,onComment:r,maxBufferSize:a})},transform(e){n.feed(e)}})}}let ro=Symbol.for("workflow-serialize"),ri=Symbol.for("workflow-deserialize");function rs(...e){return e.reduce((e,t)=>({...e,...null!=t?t:{}}),{})}async function rl(e,t){if(null==e)return Promise.resolve();let r=null==t?void 0:t.abortSignal;return new Promise((t,a)=>{if(null==r?void 0:r.aborted)return void a(ru());let n=setTimeout(()=>{o(),t()},e),o=()=>{clearTimeout(n),null==r||r.removeEventListener("abort",i)},i=()=>{o(),a(ru())};null==r||r.addEventListener("abort",i)})}function ru(){return new DOMException("Delay was aborted","AbortError")}var rc=new TextDecoder;async function rd(e){return"string"==typeof e?e:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?rc.decode(e):"u">typeof Blob&&e instanceof Blob?e.text():String(e)}async function rp(e,{highWaterMark:t=1048576,pollIntervalMs:r=20,abortSignal:a}={}){for(var n;1===e.readyState&&(null!=(n=e.bufferedAmount)?n:0)>t;){if((null==a?void 0:a.aborted)===!0)return;await rl(r)}}var{btoa:rf,atob:rh}=globalThis;function rm(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCodePoint(e[r]);return rf(t)}async function rg(e){var t;try{await (null==(t=e.body)?void 0:t.cancel())}catch(e){}}var ry="AI_DownloadError",rv=`vercel.ai.error.${ry}`,rb=Symbol.for(rv),rw=class extends(g=eo,m=rb,g){constructor({url:e,statusCode:t,statusText:r,cause:a,message:n=null==a?`Failed to download ${e}: ${t} ${r}`:`Failed to download ${e}: ${a}`}){super({name:ry,message:n,cause:a}),this[m]=!0,this.url=e,this.statusCode=t,this.statusText=r}static isInstance(e){return eo.hasMarker(e,rv)}};function r_(e,t){try{return new URL(e).origin===new URL(t).origin}catch(e){return!1}}function rk(e){let t=e.split(".");return 4===t.length&&t.every(e=>{let t=Number(e);return Number.isInteger(t)&&t>=0&&t<=255&&String(t)===e})}function rE(e){let[t,r,a]=e.split(".").map(Number);return 0===t||10===t||100===t&&r>=64&&r<=127||127===t||169===t&&254===r||172===t&&r>=16&&r<=31||192===t&&0===r&&0===a||192===t&&0===r&&2===a||192===t&&168===r||198===t&&(18===r||19===r)||198===t&&51===r&&100===a||203===t&&0===r&&113===a||t>=224||!1}function rx(e){let t=function(e){let t=e.toLowerCase(),r=t.indexOf("%");-1!==r&&(t=t.slice(0,r));let a=t.split("::");if(a.length>2)return null;let n=e=>{if(""===e)return[];let t=[],r=e.split(":");for(let e=0;e<r.length;e++){let a=r[e];if(a.includes(".")){if(e!==r.length-1||!rk(a))return null;let[n,o,i,s]=a.split(".").map(Number);t.push(n<<8|o,i<<8|s);continue}if(!/^[0-9a-f]{1,4}$/.test(a))return null;t.push(parseInt(a,16))}return t},o=n(a[0]);if(null===o)return null;if(2===a.length){let e=n(a[1]);if(null===e)return null;let t=8-o.length-e.length;return t<0?null:[...o,...Array(t).fill(0),...e]}return 8===o.length?o:null}(e);if(null===t)return!0;let r=e=>t.slice(0,e).every(e=>0===e);if(r(7)&&(0===t[7]||1===t[7])||(65024&t[0])==64512||(65472&t[0])==65152||(65472&t[0])==65216||(65280&t[0])==65280||8193===t[0]&&3512===t[1]||16383===t[0]&&(61440&t[1])==0)return!0;if(r(6)||r(5)&&65535===t[5]||r(4)&&65535===t[4]&&0===t[5]||100===t[0]&&65435===t[1]&&0===t[2]&&0===t[3]&&0===t[4]&&0===t[5]||100===t[0]&&65435===t[1]&&1===t[2]){let e=t[6]>>8&255,r=255&t[6],a=t[7]>>8&255,n=255&t[7];return rE(`${e}.${r}.${a}.${n}`)}return!1}var rI=globalThis.fetch,rS=function(e){if("function"!=typeof e)return!1;let t=Function.prototype.toString.call(e);return t.includes("internal/deps/undici")||t.includes("lazy loading of undici")}(rI);async function rA(){var e,t;let r;return(null==(e=null==(r=globalThis.process)?void 0:r.release)?void 0:e.name)==="node"&&(null==(t=r.versions)?void 0:t.bun)==null&&rS&&globalThis.fetch===rI?null!=y?y:y=Promise.resolve().then(rz):globalThis.fetch}function rz(){let{createRequire:e}=rT("node:module"),{lookup:t}=rT("node:dns"),{Agent:r,fetch:a}=e(function e(){let t=Error.prepareStackTrace;try{Error.prepareStackTrace=(e,t)=>t;let t=Error("Capture current module path");Error.captureStackTrace(t,e);let[r]=t.stack,a=null==r?void 0:r.getFileName();if(null==a)throw Error("Unable to determine the current module path");return a}finally{Error.prepareStackTrace=t}}())("undici"),n=new r({connect:{lookup:(e,r,a)=>{t(e,{...r,all:!0},(t,n)=>{if(t)return void a(t);try{let[t]=n;if(null==t)throw Error(`Hostname ${e} did not resolve to an address`);for(let{address:t,family:r}of n)!function({address:e,family:t,hostname:r}){if(4===t?!rk(e)||rE(e):6!==t||rx(e))throw new rw({url:r,message:`Hostname ${r} resolved to disallowed IP address ${e}`})}({address:t,family:r,hostname:e});!0===r.all?a(null,n):a(null,t.address,t.family)}catch(e){a(e instanceof Error?e:Error(String(e)))}})}}});return(e,t)=>a(e,{...t,dispatcher:n})}function rT(e){var t;let r=globalThis.process,a=null==(t=null==r?void 0:r.getBuiltinModule)?void 0:t.call(r,e);if(null==a)throw Error(`Node.js built-in module ${e} is unavailable`);return a}var rM=["connection","keep-alive","te","trailer","transfer-encoding","upgrade","host","forwarded","proxy-authorization","via","x-forwarded-for","x-forwarded-host","x-forwarded-proto","x-real-ip","metadata","metadata-flavor","x-aws-ec2-metadata-token","x-metadata-token","cookie","set-cookie"],rO=new Set([301,302,303,307,308]);async function rR({url:e,headers:t,abortSignal:r,maxRedirects:a=10,fetch:n,trustedOrigin:o}){let i=void 0===t?void 0:function(e){let t=new Headers(e);for(let e of rM)t.delete(e);return t}(t),s=e=>{let t={signal:r,redirect:e};return void 0!==i&&(t.headers=new Headers(i)),t},l=e;for(let t=0;t<=a;t++){let t=void 0!==o&&r_(l,o);t||function(e){let t;try{t=new URL(e)}catch(t){throw new rw({url:e,message:`Invalid URL: ${e}`})}if("data:"===t.protocol)return;if("http:"!==t.protocol&&"https:"!==t.protocol)throw new rw({url:e,message:`URL scheme must be http, https, or data, got ${t.protocol}`});let r=t.hostname.toLowerCase().replace(/\.+$/,"");if(!r)throw new rw({url:e,message:"URL must have a hostname"});if("localhost"===r||r.endsWith(".local")||r.endsWith(".localhost"))throw new rw({url:e,message:`URL with hostname ${r} is not allowed`});if(r.startsWith("[")&&r.endsWith("]")){if(rx(r.slice(1,-1)))throw new rw({url:e,message:`URL with IPv6 address ${r} is not allowed`});return}if(rk(r)&&rE(r))throw new rw({url:e,message:`URL with IP address ${r} is not allowed`})}(l);let r=null!=n?n:t?globalThis.fetch:await rA(),a=await r(l,s("manual"));if("opaqueredirect"===a.type){if(!function(e=globalThis){return null!=e.window}())throw new rw({url:e,message:`Redirect from ${l} could not be validated and was blocked`});return await r(l,s("follow"))}let u=a.headers.get("location");if(rO.has(a.status)&&u){await rg(a);let e=new URL(u,l).toString();if(void 0!==i&&!r_(e,l)){let e=i.get("user-agent");i=new Headers(null==e?void 0:{"user-agent":e})}l=e;continue}return a}throw new rw({url:e,message:`Too many redirects (max ${a})`})}async function rC({response:e,url:t,maxBytes:r=0x80000000}){let a=e.headers.get("content-length");if(null!=a){let n=parseInt(a,10);if(!isNaN(n)&&n>r)throw await rg(e),new rw({url:t,message:`Download of ${t} exceeded maximum size of ${r} bytes (Content-Length: ${n}).`})}let n=e.body;if(null==n)return new Uint8Array(0);let o=n.getReader(),i=[],s=0;try{for(;;){let{done:e,value:a}=await o.read();if(e)break;if((s+=a.length)>r)throw new rw({url:t,message:`Download of ${t} exceeded maximum size of ${r} bytes.`});i.push(a)}}finally{try{await o.cancel()}catch(e){}finally{o.releaseLock()}}let l=new Uint8Array(s),u=0;for(let e of i)l.set(e,u),u+=e.length;return l}function r$(e){return Object.fromEntries([...e.headers])}var rP=({prefix:e,size:t=16,alphabet:r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:a="-"}={})=>{let n=()=>{let e=r.length,a=Array(t);for(let n=0;n<t;n++)a[n]=r[Math.random()*e|0];return a.join("")};if(null==e)return n;if(r.includes(a))throw new ev({argument:"separator",message:`The separator "${a}" must not be part of the alphabet "${r}".`});return()=>`${e}${a}${n()}`},rN=rP();function rj(e){return(e instanceof Error||e instanceof DOMException)&&("AbortError"===e.name||"ResponseAborted"===e.name||"TimeoutError"===e.name)}var rZ=["fetch failed","failed to fetch"],rL=["ConnectionRefused","ConnectionClosed","FailedToOpenSocket","ECONNRESET","ECONNREFUSED","ETIMEDOUT","EPIPE"];function rU({error:e,url:t,requestBodyValues:r}){if(rj(e))return e;if(e instanceof TypeError&&rZ.includes(e.message.toLowerCase())){let a=e.cause;if(null!=a)return new eu({message:`Cannot connect to API: ${a.message}`,cause:a,url:t,requestBodyValues:r,isRetryable:!0})}return!function(e){if(!(e instanceof Error))return!1;let t=e.code;return!!("string"==typeof t&&rL.includes(t))}(e)?e:new eu({message:`Cannot connect to API: ${e.message}`,cause:e,url:t,requestBodyValues:r,isRetryable:!0})}function rD(e=globalThis){var t,r,a;return e.window?"runtime/browser":(null==(t=e.navigator)?void 0:t.userAgent)?`runtime/${e.navigator.userAgent.toLowerCase()}`:(null==(a=null==(r=e.process)?void 0:r.versions)?void 0:a.node)?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function rB(e){if(null==e)return{};let t={};if(e instanceof Headers)e.forEach((e,r)=>{t[r.toLowerCase()]=e});else for(let[r,a]of(Array.isArray(e)||(e=Object.entries(e)),e))null!=a&&(t[r.toLowerCase()]=a);return t}function rF(e,...t){let r=new Headers(rB(e)),a=r.get("user-agent")||"";return r.set("user-agent",[a,...t].filter(Boolean).join(" ")),Object.fromEntries(r.entries())}var rV="5.0.32",rq=async({url:e,headers:t={},successfulResponseHandler:r,failedResponseHandler:a,abortSignal:n,fetch:o,validateUrl:i,credentialedOrigin:s,trustedOrigin:l})=>{try{let u=null!=o?o:globalThis.fetch,c=void 0===s||r_(e,s)?t:{},d=rF(c,`ai-sdk/provider-utils/${rV}`,rD()),p=i?await rR({url:e,headers:d,abortSignal:n,fetch:o,trustedOrigin:l}):await u(e,{method:"GET",headers:d,signal:n}),f=r$(p);if(!p.ok){let t;try{t=await a({response:p,url:e,requestBodyValues:{}})}catch(t){if(rj(t)||eu.isInstance(t))throw t;throw new eu({message:"Failed to process error response",cause:t,statusCode:p.status,url:e,responseHeaders:f,requestBodyValues:{}})}throw t.value}try{return await r({response:p,url:e,requestBodyValues:{}})}catch(t){if(t instanceof Error&&(rj(t)||eu.isInstance(t)))throw t;throw new eu({message:"Failed to process successful response",cause:t,statusCode:p.status,url:e,responseHeaders:f,requestBodyValues:{}})}}catch(t){throw rU({error:t,url:e,requestBodyValues:{}})}};function rH(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}function rJ({settingValue:e,environmentVariableName:t}){return"string"==typeof e?e:null!=e||void 0===er.default?void 0:null!=(e=er.default.env[t])&&"string"==typeof e?e:void 0}function rW(e){return null!=e&&Number.isSafeInteger(e)&&e>=0}var rG=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,rY=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function rK(e){let t=JSON.parse(e);return null===t||"object"!=typeof t||!1===rG.test(e)&&!1===rY.test(e)?t:function(e){let t=[e];for(;t.length;){let e=t;for(let r of(t=[],e)){if(Object.prototype.hasOwnProperty.call(r,"__proto__")||Object.prototype.hasOwnProperty.call(r,"constructor")&&null!==r.constructor&&"object"==typeof r.constructor&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw SyntaxError("Object contains forbidden prototype property");for(let e in r){let a=r[e];a&&"object"==typeof a&&t.push(a)}}}return e}(t)}function rX(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch(t){return rK(e)}try{return rK(e)}finally{Error.stackTraceLimit=t}}function rQ(e){if("object"===e.type||Array.isArray(e.type)&&e.type.includes("object")){let{additionalProperties:t}=e;e.additionalProperties=null!=t&&"boolean"!=typeof t&&r0(t);let{properties:r}=e;if(null!=r)for(let e of Object.keys(r))r[e]=r0(r[e])}null!=e.items&&(e.items=Array.isArray(e.items)?e.items.map(r0):r0(e.items)),null!=e.anyOf&&(e.anyOf=e.anyOf.map(r0)),null!=e.allOf&&(e.allOf=e.allOf.map(r0)),null!=e.oneOf&&(e.oneOf=e.oneOf.map(r0));let{definitions:t}=e;if(null!=t)for(let e of Object.keys(t))t[e]=r0(t[e]);return e}function r0(e){return"boolean"==typeof e?e:rQ(e)}var r1=Symbol("Let zodToJsonSchema decide on which parser to use"),r2={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"};function r5(e,t){return ah(e.type._def,t)}var r4=void 0,r3=/^[cC][^\s-]{8,}$/,r8=/^[0-9a-z]+$/,r6=/^[0-9A-HJKMNP-TV-Z]{26}$/,r9=/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,r7=()=>(void 0===r4&&(r4=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),r4),ae=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,at=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ar=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,aa=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,an=/^[a-zA-Z0-9_-]{21}$/,ao=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;function ai(e,t){let r={type:"string"};if(e.checks)for(let a of e.checks)switch(a.kind){case"min":r.minLength="number"==typeof r.minLength?Math.max(r.minLength,a.value):a.value;break;case"max":r.maxLength="number"==typeof r.maxLength?Math.min(r.maxLength,a.value):a.value;break;case"email":switch(t.emailStrategy){case"format:email":au(r,"email",a.message,t);break;case"format:idn-email":au(r,"idn-email",a.message,t);break;case"pattern:zod":ac(r,r9,a.message,t)}break;case"url":au(r,"uri",a.message,t);break;case"uuid":au(r,"uuid",a.message,t);break;case"regex":ac(r,a.regex,a.message,t);break;case"cuid":ac(r,r3,a.message,t);break;case"cuid2":ac(r,r8,a.message,t);break;case"startsWith":ac(r,RegExp(`^${as(a.value,t)}`),a.message,t);break;case"endsWith":ac(r,RegExp(`${as(a.value,t)}$`),a.message,t);break;case"datetime":au(r,"date-time",a.message,t);break;case"date":au(r,"date",a.message,t);break;case"time":au(r,"time",a.message,t);break;case"duration":au(r,"duration",a.message,t);break;case"length":r.minLength="number"==typeof r.minLength?Math.max(r.minLength,a.value):a.value,r.maxLength="number"==typeof r.maxLength?Math.min(r.maxLength,a.value):a.value;break;case"includes":ac(r,RegExp(as(a.value,t)),a.message,t);break;case"ip":"v6"!==a.version&&au(r,"ipv4",a.message,t),"v4"!==a.version&&au(r,"ipv6",a.message,t);break;case"base64url":ac(r,aa,a.message,t);break;case"jwt":ac(r,ao,a.message,t);break;case"cidr":"v6"!==a.version&&ac(r,ae,a.message,t),"v4"!==a.version&&ac(r,at,a.message,t);break;case"emoji":ac(r,r7(),a.message,t);break;case"ulid":ac(r,r6,a.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":au(r,"binary",a.message,t);break;case"contentEncoding:base64":r.contentEncoding="base64";break;case"pattern:zod":ac(r,ar,a.message,t)}break;case"nanoid":ac(r,an,a.message,t)}return r}function as(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let r=0;r<e.length;r++)al.has(e[r])||(t+="\\"),t+=e[r];return t}(e):e}var al=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function au(e,t,r,a){var n;e.format||(null==(n=e.anyOf)?void 0:n.some(e=>e.format))?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...r&&a.errorMessages&&{errorMessage:{format:r}}})):e.format=t}function ac(e,t,r,a){var n;e.pattern||(null==(n=e.allOf)?void 0:n.some(e=>e.pattern))?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:ad(t,a),...r&&a.errorMessages&&{errorMessage:{pattern:r}}})):e.pattern=ad(t,a)}function ad(e,t){var r;if(!t.applyRegexFlags||!e.flags)return e.source;let a={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},n=a.i?e.source.toLowerCase():e.source,o="",i=!1,s=!1,l=!1;for(let e=0;e<n.length;e++){if(i){o+=n[e],i=!1;continue}if(a.i){if(s){if(n[e].match(/[a-z]/)){l?(o+=n[e],o+=`${n[e-2]}-${n[e]}`.toUpperCase(),l=!1):"-"===n[e+1]&&(null==(r=n[e+2])?void 0:r.match(/[a-z]/))?(o+=n[e],l=!0):o+=`${n[e]}${n[e].toUpperCase()}`;continue}}else if(n[e].match(/[a-z]/)){o+=`[${n[e]}${n[e].toUpperCase()}]`;continue}}if(a.m){if("^"===n[e]){o+=`(^|(?<=[\r
|
|
15
|
-
]))`;continue}else if("$"===n[e]){o+=`($|(?=[\r
|
|
16
|
-
]))`;continue}}if(a.s&&"."===n[e]){o+=s?`${n[e]}\r
|
|
17
|
-
`:`[${n[e]}\r
|
|
18
|
-
]`;continue}o+=n[e],"\\"===n[e]?i=!0:s&&"]"===n[e]?s=!1:s||"["!==n[e]||(s=!0)}try{new RegExp(o)}catch(r){return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function ap(e,t){var r,a,n,o,i,s;let l={type:"object",additionalProperties:null!=(r=ah(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))?r:t.allowedAdditionalProperties};if((null==(a=e.keyType)?void 0:a._def.typeName)==="ZodString"&&(null==(n=e.keyType._def.checks)?void 0:n.length)){let{type:r,...a}=ai(e.keyType._def,t);return{...l,propertyNames:a}}if((null==(o=e.keyType)?void 0:o._def.typeName)==="ZodEnum")return{...l,propertyNames:{enum:e.keyType._def.values}};if((null==(i=e.keyType)?void 0:i._def.typeName)==="ZodBranded"&&"ZodString"===e.keyType._def.type._def.typeName&&(null==(s=e.keyType._def.type._def.checks)?void 0:s.length)){let{type:r,...a}=r5(e.keyType._def,t);return{...l,propertyNames:a}}return l}var af={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function ah(e,t,r=!1){var a;let n=t.seen.get(e);if(t.override){let o=null==(a=t.override)?void 0:a.call(t,e,t,n,r);if(o!==r1)return o}if(n&&!r){let e=am(n,t);if(void 0!==e)return e}let o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);let i=((e,t,r)=>{var a,n,o,i,s,l;switch(t){case"ZodString":return ai(e,r);case"ZodNumber":let u={type:"number"};if(!e.checks)return u;for(let t of e.checks)switch(t.kind){case"int":u.type="integer";break;case"min":t.inclusive?u.minimum=t.value:u.exclusiveMinimum=t.value;break;case"max":t.inclusive?u.maximum=t.value:u.exclusiveMaximum=t.value;break;case"multipleOf":u.multipleOf=t.value}return u;case"ZodObject":return function(e,t){let r={type:"object",properties:{}},a=[],n=e.shape();for(let e in n){let o=n[e];if(void 0===o||void 0===o._def)continue;let i=function(e){try{return e.isOptional()}catch(e){return!0}}(o),s=ah(o._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==s&&(r.properties[e]=s,i||a.push(e))}a.length&&(r.required=a);let o=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return ah(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==o&&(r.additionalProperties=o),r}(e,r);case"ZodBigInt":let c={type:"integer",format:"int64"};if(!e.checks)return c;for(let t of e.checks)switch(t.kind){case"min":t.inclusive?c.minimum=t.value:c.exclusiveMinimum=t.value;break;case"max":t.inclusive?c.maximum=t.value:c.exclusiveMaximum=t.value;break;case"multipleOf":c.multipleOf=t.value}return c;case"ZodBoolean":return{type:"boolean"};case"ZodDate":return function e(t,r,a){let n=null!=a?a:r.dateStrategy;if(Array.isArray(n))return{anyOf:n.map(a=>e(t,r,a))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":var o=t;let i={type:"integer",format:"unix-time"};for(let e of o.checks)switch(e.kind){case"min":i.minimum=e.value;break;case"max":i.maximum=e.value}return i}}(e,r);case"ZodUndefined":case"ZodNaN":case"ZodNever":return{not:{}};case"ZodNull":return{type:"null"};case"ZodArray":let d;return d={type:"array"},(null==(o=e.type)?void 0:o._def)&&(null==(s=null==(i=e.type)?void 0:i._def)?void 0:s.typeName)!=="ZodAny"&&(d.items=ah(e.type._def,{...r,currentPath:[...r.currentPath,"items"]})),e.minLength&&(d.minItems=e.minLength.value),e.maxLength&&(d.maxItems=e.maxLength.value),e.exactLength&&(d.minItems=e.exactLength.value,d.maxItems=e.exactLength.value),d;case"ZodUnion":case"ZodDiscriminatedUnion":let p,f=e.options instanceof Map?Array.from(e.options.values()):e.options;if(f.every(e=>e._def.typeName in af&&(!e._def.checks||!e._def.checks.length))){let e=f.reduce((e,t)=>{let r=af[t._def.typeName];return r&&!e.includes(r)?[...e,r]:e},[]);return{type:e.length>1?e:e[0]}}if(f.every(e=>"ZodLiteral"===e._def.typeName&&!e.description)){let e=f.reduce((e,t)=>{let r=typeof t._def.value;switch(r){case"string":case"number":case"boolean":return[...e,r];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}},[]);if(e.length===f.length){let t=e.filter((e,t,r)=>r.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:f.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(f.every(e=>"ZodEnum"===e._def.typeName))return{type:"string",enum:f.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return a=e,n=r,(p=(a.options instanceof Map?Array.from(a.options.values()):a.options).map((e,t)=>ah(e._def,{...n,currentPath:[...n.currentPath,"anyOf",`${t}`]})).filter(e=>!!e&&(!n.strictUnions||"object"==typeof e&&Object.keys(e).length>0))).length?{anyOf:p}:void 0;case"ZodIntersection":let h,m;return h=[ah(e.left._def,{...r,currentPath:[...r.currentPath,"allOf","0"]}),ah(e.right._def,{...r,currentPath:[...r.currentPath,"allOf","1"]})].filter(e=>!!e),m=[],h.forEach(e=>{if((!("type"in e)||"string"!==e.type)&&"allOf"in e)m.push(...e.allOf);else{let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){let{additionalProperties:r,...a}=e;t=a}m.push(t)}}),m.length?{allOf:m}:void 0;case"ZodTuple":return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((e,t)=>ah(e._def,{...r,currentPath:[...r.currentPath,"items",`${t}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[]),additionalItems:ah(e.rest._def,{...r,currentPath:[...r.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,t)=>ah(e._def,{...r,currentPath:[...r.currentPath,"items",`${t}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[])};case"ZodRecord":return ap(e,r);case"ZodLiteral":let g;return"bigint"!=(g=typeof e.value)&&"number"!==g&&"boolean"!==g&&"string"!==g?{type:Array.isArray(e.value)?"array":"object"}:{type:"bigint"===g?"integer":g,const:e.value};case"ZodEnum":return{type:"string",enum:Array.from(e.values)};case"ZodNativeEnum":let y,v,b;return y=e.values,{type:1===(b=Array.from(new Set((v=Object.keys(e.values).filter(e=>"number"!=typeof y[y[e]]).map(e=>y[e])).map(e=>typeof e)))).length?"string"===b[0]?"string":"number":["string","number"],enum:v};case"ZodNullable":if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[af[e.innerType._def.typeName],"null"]};let w=ah(e.innerType._def,{...r,currentPath:[...r.currentPath,"anyOf","0"]});return w&&{anyOf:[w,{type:"null"}]};case"ZodOptional":if(r.currentPath.toString()===(null==(l=r.propertyPath)?void 0:l.toString()))return ah(e.innerType._def,r);let _=ah(e.innerType._def,{...r,currentPath:[...r.currentPath,"anyOf","1"]});return _?{anyOf:[{not:{}},_]}:{};case"ZodMap":if("record"===r.mapStrategy)return ap(e,r);return{type:"array",maxItems:125,items:{type:"array",items:[ah(e.keyType._def,{...r,currentPath:[...r.currentPath,"items","items","0"]})||{},ah(e.valueType._def,{...r,currentPath:[...r.currentPath,"items","items","1"]})||{}],minItems:2,maxItems:2}};case"ZodSet":let k;return k={type:"array",uniqueItems:!0,items:ah(e.valueType._def,{...r,currentPath:[...r.currentPath,"items"]})},e.minSize&&(k.minItems=e.minSize.value),e.maxSize&&(k.maxItems=e.maxSize.value),k;case"ZodLazy":return()=>e.getter()._def;case"ZodPromise":return ah(e.type._def,r);case"ZodEffects":return"input"===r.effectStrategy?ah(e.schema._def,r):{};case"ZodAny":case"ZodUnknown":return{};case"ZodDefault":return{...ah(e.innerType._def,r),default:e.defaultValue()};case"ZodBranded":return r5(e,r);case"ZodReadonly":case"ZodCatch":return ah(e.innerType._def,r);case"ZodPipeline":if("input"===r.pipeStrategy)return ah(e.in._def,r);if("output"===r.pipeStrategy)return ah(e.out._def,r);let E=ah(e.in._def,{...r,currentPath:[...r.currentPath,"allOf","0"]}),x=ah(e.out._def,{...r,currentPath:[...r.currentPath,"allOf",E?"1":"0"]});return{allOf:[E,x].filter(e=>void 0!==e)};default:return}})(e,e.typeName,t),s="function"==typeof i?ah(i(),t):i;if(s&&ag(e,t,s),t.postProcess){let r=t.postProcess(s,e,t);return o.jsonSchema=s,r}return o.jsonSchema=s,s}var am=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:((e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")})(t.currentPath,e.path)};case"none":case"seen":if(e.path.length<t.currentPath.length&&e.path.every((e,r)=>t.currentPath[r]===e))return console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{};return"seen"===t.$refStrategy?{}:void 0}},ag=(e,t,r)=>(e.description&&(r.description=e.description),r),ay=Symbol.for("vercel.ai.schema");function av(e){let t;return()=>(null==t&&(t=e()),t)}function ab(e,{validate:t}={}){return{[ay]:!0,_type:void 0,get jsonSchema(){return"function"==typeof e&&(e=e()),e},validate:t}}function aw(e){var t;return null==e?ab({type:"object",properties:{},additionalProperties:!1}):"object"==typeof e&&null!==e&&ay in e&&!0===e[ay]&&"jsonSchema"in e&&"validate"in e?e:"~standard"in e?"zod"===e["~standard"].vendor?a_(e):(t=e,ab(()=>{if(null==t["~standard"].jsonSchema)throw Error(`Standard schema vendor '${t["~standard"].vendor}' does not support JSON Schema conversion.`);return rQ(t["~standard"].jsonSchema.input({target:"draft-07"}))},{validate:async e=>{let r=await t["~standard"].validate(e);return"value"in r?{success:!0,value:r.value}:{success:!1,error:new ez({value:e,cause:r.issues})}}})):e()}function a_(e,t){var r,a;let n;if("_zod"in e){let a;return a=null!=(r=null==t?void 0:t.useReferences)&&r,ab(()=>rQ(function(e,t){if("_idmap"in e){let r=tO({...t,processors:t7}),a={};for(let t of e._idmap.entries()){let[e,a]=t;tR(a,r)}let n={};for(let o of(r.external={registry:e,uri:t?.uri,defs:a},e._idmap.entries())){let[e,t]=o;tC(r,t),n[e]=t$(r,t)}return Object.keys(a).length>0&&(n.__shared={["draft-2020-12"===r.target?"$defs":"definitions"]:a}),{schemas:n}}let r=tO({...t,processors:t7});return tR(e,r),tC(r,e),t$(r,e)}(e,{target:"draft-7",io:"input",reused:a?"ref":"inline"})),{validate:async t=>{let r=await t_(e,t);return r.success?{success:!0,value:r.data}:{success:!1,error:r.error}}})}return n=null!=(a=null==t?void 0:t.useReferences)&&a,ab(()=>((e,t)=>{var r;let a,n,o=(n=void 0!==(a="string"==typeof t?{...r2,name:t}:{...r2,...t}).name?[...a.basePath,a.definitionPath,a.name]:a.basePath,{...a,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(a.definitions).map(([e,t])=>[t._def,{def:t._def,path:[...a.basePath,a.definitionPath,e],jsonSchema:void 0}]))}),i="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce((e,[t,r])=>{var a;return{...e,[t]:null!=(a=ah(r._def,{...o,currentPath:[...o.basePath,o.definitionPath,t]},!0))?a:{}}},{}):void 0,s="string"==typeof t?t:(null==t?void 0:t.nameStrategy)==="title"||null==t?void 0:t.name,l=null!=(r=ah(e._def,void 0===s?o:{...o,currentPath:[...o.basePath,o.definitionPath,s]},!1))?r:{},u="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==u&&(l.title=u);let c=void 0===s?i?{...l,[o.definitionPath]:i}:l:{$ref:[..."relative"===o.$refStrategy?[]:o.basePath,o.definitionPath,s].join("/"),[o.definitionPath]:{...i,[s]:l}};return c.$schema="http://json-schema.org/draft-07/schema#",c})(e,{$refStrategy:n?"root":"none"}),{validate:async t=>{let r=await e.safeParseAsync(t);return r.success?{success:!0,value:r.data}:{success:!1,error:r.error}}})}async function ak({value:e,schema:t,context:r}){let a=await aE({value:e,schema:t,context:r});if(!a.success)throw ez.wrap({value:e,cause:a.error,context:r});return a.value}async function aE({value:e,schema:t,context:r}){let a=aw(t);try{if(null==a.validate)return{success:!0,value:e,rawValue:e};let t=await a.validate(e);if(t.success)return{success:!0,value:t.value,rawValue:e};return{success:!1,error:ez.wrap({value:e,cause:t.error,context:r}),rawValue:e}}catch(t){return{success:!1,error:ez.wrap({value:e,cause:t,context:r}),rawValue:e}}}async function ax({text:e,schema:t}){try{let r=rX(e);if(null==t)return r;return await ak({value:r,schema:t})}catch(t){if(eE.isInstance(t)||ez.isInstance(t))throw t;throw new eE({text:e,cause:t})}}async function aI({text:e,schema:t}){try{let r=rX(e);if(null==t)return{success:!0,value:r,rawValue:r};return await aE({value:r,schema:t})}catch(t){return{success:!1,error:eE.isInstance(t)?t:new eE({text:e,cause:t}),rawValue:void 0}}}function aS({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new rn).pipeThrough(new TransformStream({async transform({data:e},r){"[DONE]"!==e&&r.enqueue(await aI({text:e,schema:t}))}}))}var aA=()=>globalThis.fetch,az=async({url:e,headers:t,body:r,failedResponseHandler:a,successfulResponseHandler:n,abortSignal:o,fetch:i})=>await aT({url:e,headers:{"Content-Type":"application/json",...t},body:{content:JSON.stringify(r),values:r},failedResponseHandler:a,successfulResponseHandler:n,abortSignal:o,fetch:i}),aT=async({url:e,headers:t={},body:r,successfulResponseHandler:a,failedResponseHandler:n,abortSignal:o,fetch:i=aA()})=>{try{let s=await i(e,{method:"POST",headers:rF(t,`ai-sdk/provider-utils/${rV}`,rD()),body:r.content,signal:o}),l=r$(s);if(!s.ok){let t;try{t=await n({response:s,url:e,requestBodyValues:r.values})}catch(t){if(rj(t)||eu.isInstance(t))throw t;throw new eu({message:"Failed to process error response",cause:t,statusCode:s.status,url:e,responseHeaders:l,requestBodyValues:r.values})}throw t.value}try{return await a({response:s,url:e,requestBodyValues:r.values})}catch(t){if(t instanceof Error&&(rj(t)||eu.isInstance(t)))throw t;throw new eu({message:"Failed to process successful response",cause:t,statusCode:s.status,url:e,responseHeaders:l,requestBodyValues:r.values})}}catch(t){throw rU({error:t,url:e,requestBodyValues:r.values})}};function aM({id:e,inputSchema:t,outputSchema:r,supportsDeferredResults:a}){return({onInputStart:n,onInputDelta:o,onInputAvailable:i,...s})=>({type:"provider",isProviderExecuted:!0,id:e,args:s,inputSchema:t,outputSchema:r,onInputStart:n,onInputDelta:o,onInputAvailable:i,supportsDeferredResults:a})}async function aO(e){return"function"==typeof e&&(e=e()),Promise.resolve(e)}var aR=new TextDecoder;async function aC({response:e,url:t}){return aR.decode(await rC({response:e,url:t}))}var a$=({errorSchema:e,errorToMessage:t,isRetryable:r})=>async({response:a,url:n,requestBodyValues:o})=>{let i=await aC({response:a,url:n}),s=r$(a);if(""===i.trim())return{responseHeaders:s,value:new eu({message:a.statusText,url:n,requestBodyValues:o,statusCode:a.status,responseHeaders:s,responseBody:i,isRetryable:null==r?void 0:r(a)})};try{let l=await ax({text:i,schema:e});return{responseHeaders:s,value:new eu({message:t(l),url:n,requestBodyValues:o,statusCode:a.status,responseHeaders:s,responseBody:i,data:l,isRetryable:null==r?void 0:r(a,l)})}}catch(e){return{responseHeaders:s,value:new eu({message:a.statusText,url:n,requestBodyValues:o,statusCode:a.status,responseHeaders:s,responseBody:i,isRetryable:null==r?void 0:r(a)})}}},aP=e=>async({response:t,url:r,requestBodyValues:a})=>{let n=await aC({response:t,url:r}),o=await aI({text:n,schema:e}),i=r$(t);if(!o.success)throw new eu({message:"Invalid JSON response",cause:o.error,statusCode:t.status,responseHeaders:i,responseBody:n,url:r,requestBodyValues:a});return{responseHeaders:i,value:o.value,rawValue:o.rawValue}};async function*aN({stream:e,schema:t}){let r=e.getReader(),a=new TextDecoder,n="",o=!1;try{for(;;){let{done:e,value:i}=await r.read();if(e){o=!0,n+=a.decode();break}let s=(n+=a.decode(i,{stream:!0})).indexOf("\n");for(;-1!==s;){let e=n.slice(0,s).replace(/\r$/,"");n=n.slice(s+1),e.trim().length>0&&(yield await ax({text:e,schema:t})),s=n.indexOf("\n")}}let e=n.replace(/\r$/,"");e.trim().length>0&&(yield await ax({text:e,schema:t}))}finally{o||await r.cancel().catch(()=>{}),r.releaseLock()}}function aj(e){if(null==e)return!0;let t=typeof e;return"string"===t||"number"===t||"boolean"===t||"function"!==t&&"symbol"!==t&&"bigint"!==t&&(Array.isArray(e)?e.every(aj):Object.getPrototypeOf(e)===Object.prototype&&Object.values(e).every(aj))}var aZ="AI_SerializationError",aL=`vercel.ai.error.${aZ}`,aU=Symbol.for(aL),aD=class extends(b=eo,v=aU,b){constructor({message:e="Failed to serialize value.",cause:t}={}){super({name:aZ,message:e,cause:t}),this[v]=!0}static isInstance(e){return eo.hasMarker(e,aL)}};function aB(e){let t={};for(let[r,a]of Object.entries(e.config))if("headers"===r){let e=function(e){let t=e;if("function"==typeof e&&(t=e()),t instanceof Promise)throw new aD({message:"Cannot serialize asynchronous model options."});return t}(a);aj(e)&&(t[r]=e)}else aj(a)&&(t[r]=a);return{modelId:e.modelId,config:t}}function aF(e){return"string"==typeof e}function aV(e){return"number"==typeof e}function aq(e,t){return void 0===e||t(e)}function aH(e){return rH(e)&&aF(e.type)}function aJ(e){return rH(e)&&aF(e.text)&&aV(e.startSecond)&&aV(e.endSecond)}var aW=e.i(21168);let aG=/^[cC][0-9a-z]{6,}$/,aY=/^[0-9a-z]+$/,aK=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,aX=/^[0-9a-vA-V]{20}$/,aQ=/^[A-Za-z0-9]{27}$/,a0=/^[a-zA-Z0-9_-]{21}$/,a1=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,a2=/^([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})$/,a5=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,a4=a5(4),a3=a5(6),a8=a5(7),a6=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,a9=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u;function a7(){return RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}let ne=/^(?:(?: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])$/,nt=/^(([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}|:))$/,nr=e=>{let t=eQ(e??":");return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},na=/^((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])$/,nn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,no=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ni=/^[A-Za-z0-9_-]*$/,ns=/^https?$/,nl=/^\+[1-9]\d{6,14}$/,nu="(?:(?:\\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])))",nc=RegExp(`^${nu}$`);function nd(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function np(e){return RegExp(`^${nd(e)}$`)}function nf(e){let t=nd({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let a=`${t}(?:${r.join("|")})`;return RegExp(`^${nu}T(?:${a})$`)}let nh=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},nm=/^-?\d+n?$/,ng=/^-?\d+$/,ny=/^-?\d+(?:\.\d+)?$/,nv=/^(?:true|false)$/i,nb=/^null$/i,nw=/^undefined$/i,n_=/^[^A-Z]*$/,nk=/^[^a-z]*$/;function nE(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function nx(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}let nI=nE(22,"=="),nS=nx(22),nA=nE(27,"="),nz=nx(27),nT=nE(43,"="),nM=nx(43),nO=nE(64,""),nR=nx(64),nC=nE(86,"=="),n$=nx(86);e.s(["base64",0,no,"base64url",0,ni,"bigint",0,nm,"boolean",0,nv,"browserEmail",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"cidrv4",0,na,"cidrv6",0,nn,"cuid",0,aG,"cuid2",0,aY,"date",0,nc,"datetime",0,nf,"domain",0,/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,"duration",0,a1,"e164",0,nl,"email",0,a6,"emoji",0,a7,"extendedDuration",0,/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,"guid",0,a2,"hex",0,/^[0-9a-fA-F]*$/,"hostname",0,/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,"html5Email",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"httpProtocol",0,ns,"idnEmail",0,a9,"integer",0,ng,"ipv4",0,ne,"ipv6",0,nt,"ksuid",0,aQ,"lowercase",0,n_,"mac",0,nr,"md5_base64",0,nI,"md5_base64url",0,nS,"md5_hex",0,/^[0-9a-fA-F]{32}$/,"nanoid",0,a0,"null",0,nb,"number",0,ny,"rfc5322Email",0,/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,"sha1_base64",0,nA,"sha1_base64url",0,nz,"sha1_hex",0,/^[0-9a-fA-F]{40}$/,"sha256_base64",0,nT,"sha256_base64url",0,nM,"sha256_hex",0,/^[0-9a-fA-F]{64}$/,"sha384_base64",0,nO,"sha384_base64url",0,nR,"sha384_hex",0,/^[0-9a-fA-F]{96}$/,"sha512_base64",0,nC,"sha512_base64url",0,n$,"sha512_hex",0,/^[0-9a-fA-F]{128}$/,"string",0,nh,"time",0,np,"ulid",0,aK,"undefined",0,nw,"unicodeEmail",0,a9,"uppercase",0,nk,"uuid",0,a5,"uuid4",0,a4,"uuid6",0,a3,"uuid7",0,a8,"xid",0,aX],59217);let nP=eM("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),nN={number:"number",bigint:"bigint",object:"date"},nj=eM("$ZodCheckLessThan",(e,t)=>{nP.init(e,t);let r=nN[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,a=(t.inclusive?r.maximum:r.exclusiveMaximum)??1/0;t.value<a&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),nZ=eM("$ZodCheckGreaterThan",(e,t)=>{nP.init(e,t);let r=nN[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,a=(t.inclusive?r.minimum:r.exclusiveMinimum)??-1/0;t.value>a&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),nL=eM("$ZodCheckMultipleOf",(e,t)=>{nP.init(e,t),e._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?r.value%t.value===BigInt(0):0===eU(r.value,t.value))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),nU=eM("$ZodCheckNumberFormat",(e,t)=>{nP.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),a=r?"int":"number",[n,o]=e4[t.format];e._zod.onattach.push(e=>{let a=e._zod.bag;a.format=t.format,a.minimum=n,a.maximum=o,r&&(a.pattern=ng)}),e._zod.check=i=>{let s=i.value;if(r){if(!Number.isInteger(s))return void i.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?i.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):i.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}))}s<n&&i.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>o&&i.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),nD=eM("$ZodCheckBigIntFormat",(e,t)=>{nP.init(e,t);let[r,a]=e3[t.format];e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,n.minimum=r,n.maximum=a}),e._zod.check=n=>{let o=n.value;o<r&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),o>a&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),nB=eM("$ZodCheckMaxSize",(e,t)=>{var r;nP.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!eZ(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let a=r.value;a.size<=t.maximum||r.issues.push({origin:tt(a),code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),nF=eM("$ZodCheckMinSize",(e,t)=>{var r;nP.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!eZ(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let a=r.value;a.size>=t.minimum||r.issues.push({origin:tt(a),code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),nV=eM("$ZodCheckSizeEquals",(e,t)=>{var r;nP.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!eZ(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=r=>{let a=r.value,n=a.size;if(n===t.size)return;let o=n>t.size;r.issues.push({origin:tt(a),...o?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),nq=eM("$ZodCheckMaxLength",(e,t)=>{var r;nP.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!eZ(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let a=r.value;if(a.length<=t.maximum)return;let n=tr(a);r.issues.push({origin:n,code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),nH=eM("$ZodCheckMinLength",(e,t)=>{var r;nP.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!eZ(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let a=r.value;if(a.length>=t.minimum)return;let n=tr(a);r.issues.push({origin:n,code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),nJ=eM("$ZodCheckLengthEquals",(e,t)=>{var r;nP.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!eZ(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{let a=r.value,n=a.length;if(n===t.length)return;let o=tr(a),i=n>t.length;r.issues.push({origin:o,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),nW=eM("$ZodCheckStringFormat",(e,t)=>{var r,a;nP.init(e,t),e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),nG=eM("$ZodCheckRegex",(e,t)=>{nW.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),nY=eM("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=n_),nW.init(e,t)}),nK=eM("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=nk),nW.init(e,t)}),nX=eM("$ZodCheckIncludes",(e,t)=>{nP.init(e,t);let r=eQ(t.includes),a=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=a,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(a)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),nQ=eM("$ZodCheckStartsWith",(e,t)=>{nP.init(e,t);let r=RegExp(`^${eQ(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),n0=eM("$ZodCheckEndsWith",(e,t)=>{nP.init(e,t);let r=RegExp(`.*${eQ(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});(e,t)=>{nP.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=a=>{r.has(a.value.type)||a.issues.push({code:"invalid_value",values:t.mime,input:a.value.type,inst:e,continue:!t.abort})}};let n1=eM("$ZodCheckOverwrite",(e,t)=>{nP.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class n2{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}let n5={major:4,minor:4,patch:3},n4=eM("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=n5;let a=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&a.unshift(e),a))for(let r of t._zod.onattach)r(e);if(0===a.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let a,n=e8(e);for(let o of t){if(o._zod.def.when){if(e6(e)||!o._zod.def.when(e))continue}else if(n)continue;let t=e.issues.length,i=o._zod.check(e);if(i instanceof Promise&&r?.async===!1)throw new eO;if(a||i instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await i,e.issues.length!==t&&(n||(n=e8(e,t)))});else{if(e.issues.length===t)continue;n||(n=e8(e,t))}}return a?a.then(()=>e):e},r=(r,n,o)=>{if(e8(r))return r.aborted=!0,r;let i=t(n,a,o);if(i instanceof Promise){if(!1===o.async)throw new eO;return i.then(t=>e._zod.parse(t,o))}return e._zod.parse(i,o)};e._zod.run=(n,o)=>{if(o.skipChecks)return e._zod.parse(n,o);if("backward"===o.direction){let t=e._zod.parse({value:n.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,n,o)):r(t,n,o)}let i=e._zod.parse(n,o);if(i instanceof Promise){if(!1===o.async)throw new eO;return i.then(e=>t(e,a,o))}return t(i,a,o)}}eB(e,"~standard",()=>({validate:t=>{try{let r=th(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return tg(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),n3=eM("$ZodString",(e,t)=>{n4.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??nh(e._zod.bag),e._zod.parse=(r,a)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),n8=eM("$ZodStringFormat",(e,t)=>{nW.init(e,t),n3.init(e,t)}),n6=eM("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=a2),n8.init(e,t)}),n9=eM("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=a5(e))}else t.pattern??(t.pattern=a5());n8.init(e,t)}),n7=eM("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=a6),n8.init(e,t)}),oe=eM("$ZodURL",(e,t)=>{n8.init(e,t),e._zod.check=r=>{try{let a=r.value.trim();if(!t.normalize&&t.protocol?.source===ns.source&&!/^https?:\/\//i.test(a))return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});let n=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=a;return}catch(a){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),ot=eM("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=a7()),n8.init(e,t)}),or=eM("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=a0),n8.init(e,t)}),oa=eM("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=aG),n8.init(e,t)}),on=eM("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=aY),n8.init(e,t)}),oo=eM("$ZodULID",(e,t)=>{t.pattern??(t.pattern=aK),n8.init(e,t)}),oi=eM("$ZodXID",(e,t)=>{t.pattern??(t.pattern=aX),n8.init(e,t)}),os=eM("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=aQ),n8.init(e,t)}),ol=eM("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=nf(t)),n8.init(e,t)}),ou=eM("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=nc),n8.init(e,t)}),oc=eM("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=np(t)),n8.init(e,t)}),od=eM("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=a1),n8.init(e,t)}),op=eM("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ne),n8.init(e,t),e._zod.bag.format="ipv4"}),of=eM("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=nt),n8.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),oh=((e,t)=>{t.pattern??(t.pattern=nr(t.delimiter)),n8.init(e,t),e._zod.bag.format="mac"},eM("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=na),n8.init(e,t)})),om=eM("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=nn),n8.init(e,t),e._zod.check=r=>{let a=r.value.split("/");try{if(2!==a.length)throw Error();let[e,t]=a;if(!t)throw Error();let r=Number(t);if(`${r}`!==t||r<0||r>128)throw Error();new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function og(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let oy=eM("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=no),n8.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{og(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),ov=eM("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ni),n8.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{!function(e){if(!ni.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return og(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),ob=eM("$ZodE164",(e,t)=>{t.pattern??(t.pattern=nl),n8.init(e,t)}),ow=eM("$ZodJWT",(e,t)=>{n8.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[a]=r;if(!a)return!1;let n=JSON.parse(atob(a));if("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),o_=((e,t)=>{n8.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}},eM("$ZodNumber",(e,t)=>{n4.init(e,t),e._zod.pattern=e._zod.bag.pattern??ny,e._zod.parse=(r,a)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let n=r.value;if("number"==typeof n&&!Number.isNaN(n)&&Number.isFinite(n))return r;let o="number"==typeof n?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...o?{received:o}:{}}),r}})),ok=eM("$ZodNumberFormat",(e,t)=>{nU.init(e,t),o_.init(e,t)}),oE=eM("$ZodBoolean",(e,t)=>{n4.init(e,t),e._zod.pattern=nv,e._zod.parse=(r,a)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let n=r.value;return"boolean"==typeof n||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),ox=eM("$ZodBigInt",(e,t)=>{n4.init(e,t),e._zod.pattern=nm,e._zod.parse=(r,a)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch(e){}return"bigint"==typeof r.value||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),oI=((e,t)=>{nD.init(e,t),ox.init(e,t)},eM("$ZodNull",(e,t)=>{n4.init(e,t),e._zod.pattern=nb,e._zod.values=new Set([null]),e._zod.parse=(t,r)=>{let a=t.value;return null===a||t.issues.push({expected:"null",code:"invalid_type",input:a,inst:e}),t}})),oS=eM("$ZodAny",(e,t)=>{n4.init(e,t),e._zod.parse=e=>e}),oA=eM("$ZodUnknown",(e,t)=>{n4.init(e,t),e._zod.parse=e=>e}),oz=eM("$ZodNever",(e,t)=>{n4.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function oT(e,t,r){e.issues.length&&t.issues.push(...e9(r,e.issues)),t.value[r]=e.value}(e,t)=>{n4.init(e,t),e._zod.parse=(t,r)=>{let a=t.value;return void 0===a||t.issues.push({expected:"void",code:"invalid_type",input:a,inst:e}),t}},(e,t)=>{n4.init(e,t),e._zod.parse=(r,a)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(e){}let n=r.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:e}),r}};let oM=eM("$ZodArray",(e,t)=>{n4.init(e,t),e._zod.parse=(r,a)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let o=[];for(let e=0;e<n.length;e++){let i=n[e],s=t.element._zod.run({value:i,issues:[]},a);s instanceof Promise?o.push(s.then(t=>oT(t,r,e))):oT(s,r,e)}return o.length?Promise.all(o).then(()=>r):r}});function oO(e,t,r,a,n,o){let i=r in a;if(e.issues.length){if(n&&o&&!i)return;t.issues.push(...e9(r,e.issues))}if(!i&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?i&&(t.value[r]=void 0):t.value[r]=e.value}function oR(e){let t=Object.keys(e.shape);for(let r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${r}": expected a Zod schema`);let r=e5(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function oC(e,t,r,a,n,o){let i=[],s=n.keySet,l=n.catchall._zod,u=l.def.type,c="optional"===l.optin,d="optional"===l.optout;for(let n in t){if("__proto__"===n||s.has(n))continue;if("never"===u){i.push(n);continue}let o=l.run({value:t[n],issues:[]},a);o instanceof Promise?e.push(o.then(e=>oO(e,r,n,t,c,d))):oO(o,r,n,t,c,d)}return(i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:o}),e.length)?Promise.all(e).then(()=>r):r}let o$=eM("$ZodObject",(e,t)=>{let r;n4.init(e,t);let a=Object.getOwnPropertyDescriptor(t,"shape");if(!a?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let r={...e};return Object.defineProperty(t,"shape",{value:r}),r}})}let n=ej(()=>oR(t));eB(e._zod,"propValues",()=>{let e=t.shape,r={};for(let t in e){let a=e[t]._zod;if(a.values)for(let e of(r[t]??(r[t]=new Set),a.values))r[t].add(e)}return r});let o=t.catchall;e._zod.parse=(t,a)=>{r??(r=n.value);let i=t.value;if(!eW(i))return t.issues.push({expected:"object",code:"invalid_type",input:i,inst:e}),t;t.value={};let s=[],l=r.shape;for(let e of r.keys){let r=l[e],n="optional"===r._zod.optin,o="optional"===r._zod.optout,u=r._zod.run({value:i[e],issues:[]},a);u instanceof Promise?s.push(u.then(r=>oO(r,t,e,i,n,o))):oO(u,t,e,i,n,o)}return o?oC(s,i,t,a,n.value,e):s.length?Promise.all(s).then(()=>t):t}}),oP=eM("$ZodObjectJIT",(e,t)=>{let r,a;o$.init(e,t);let n=e._zod.parse,o=ej(()=>oR(t)),i=!eC.jitless,s=i&&eG.value,l=t.catchall;e._zod.parse=(u,c)=>{a??(a=o.value);let d=u.value;return eW(d)?i&&s&&c?.async===!1&&!0!==c.jitless?(r||(r=(e=>{let t=new n2(["shape","payload","ctx"]),r=o.value,a=e=>{let t=eq(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let n=Object.create(null),i=0;for(let e of r.keys)n[e]=`key_${i++}`;for(let o of(t.write("const newResult = {};"),r.keys)){let r=n[o],i=eq(o),s=e[o],l=s?._zod?.optin==="optional",u=s?._zod?.optout==="optional";t.write(`const ${r} = ${a(o)};`),l&&u?t.write(`
|
|
19
|
-
if (${r}.issues.length) {
|
|
20
|
-
if (${i} in input) {
|
|
21
|
-
payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
|
|
22
|
-
...iss,
|
|
23
|
-
path: iss.path ? [${i}, ...iss.path] : [${i}]
|
|
24
|
-
})));
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (${r}.value === undefined) {
|
|
29
|
-
if (${i} in input) {
|
|
30
|
-
newResult[${i}] = undefined;
|
|
31
|
-
}
|
|
32
|
-
} else {
|
|
33
|
-
newResult[${i}] = ${r}.value;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
`):l?t.write(`
|
|
37
|
-
if (${r}.issues.length) {
|
|
38
|
-
payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
|
|
39
|
-
...iss,
|
|
40
|
-
path: iss.path ? [${i}, ...iss.path] : [${i}]
|
|
41
|
-
})));
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (${r}.value === undefined) {
|
|
45
|
-
if (${i} in input) {
|
|
46
|
-
newResult[${i}] = undefined;
|
|
47
|
-
}
|
|
48
|
-
} else {
|
|
49
|
-
newResult[${i}] = ${r}.value;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
`):t.write(`
|
|
53
|
-
const ${r}_present = ${i} in input;
|
|
54
|
-
if (${r}.issues.length) {
|
|
55
|
-
payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
|
|
56
|
-
...iss,
|
|
57
|
-
path: iss.path ? [${i}, ...iss.path] : [${i}]
|
|
58
|
-
})));
|
|
59
|
-
}
|
|
60
|
-
if (!${r}_present && !${r}.issues.length) {
|
|
61
|
-
payload.issues.push({
|
|
62
|
-
code: "invalid_type",
|
|
63
|
-
expected: "nonoptional",
|
|
64
|
-
input: undefined,
|
|
65
|
-
path: [${i}]
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (${r}_present) {
|
|
70
|
-
if (${r}.value === undefined) {
|
|
71
|
-
newResult[${i}] = undefined;
|
|
72
|
-
} else {
|
|
73
|
-
newResult[${i}] = ${r}.value;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
`)}t.write("payload.value = newResult;"),t.write("return payload;");let s=t.compile();return(t,r)=>s(e,t,r)})(t.shape)),u=r(u,c),l)?oC([],d,u,c,a,e):u:n(u,c):(u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u)}});function oN(e,t,r,a){for(let r of e)if(0===r.issues.length)return t.value=r.value,t;let n=e.filter(e=>!e8(e));return 1===n.length?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>te(e,a,e$())))}),t)}let oj=eM("$ZodUnion",(e,t)=>{n4.init(e,t),eB(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),eB(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),eB(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),eB(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>eL(e.source)).join("|")})$`)}});let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(a,n)=>{if(r)return r(a,n);let o=!1,i=[];for(let e of t.options){let t=e._zod.run({value:a.value,issues:[]},n);if(t instanceof Promise)i.push(t),o=!0;else{if(0===t.issues.length)return t;i.push(t)}}return o?Promise.all(i).then(t=>oN(t,a,e,n)):oN(i,a,e,n)}});function oZ(e,t,r,a){let n=e.filter(e=>0===e.issues.length);return 1===n.length?t.value=n[0].value:0===n.length?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>te(e,a,e$())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t}(e,t)=>{oj.init(e,t),t.inclusive=!1;let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(a,n)=>{if(r)return r(a,n);let o=!1,i=[];for(let e of t.options){let t=e._zod.run({value:a.value,issues:[]},n);t instanceof Promise?(i.push(t),o=!0):i.push(t)}return o?Promise.all(i).then(t=>oZ(t,a,e,n)):oZ(i,a,e,n)}};let oL=eM("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,oj.init(e,t);let r=e._zod.parse;eB(e._zod,"propValues",()=>{let e={};for(let r of t.options){let a=r._zod.propValues;if(!a||0===Object.keys(a).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let[t,r]of Object.entries(a))for(let a of(e[t]||(e[t]=new Set),r))e[t].add(a)}return e});let a=ej(()=>{let e=t.options,r=new Map;for(let a of e){let e=a._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let t of e){if(r.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);r.set(t,a)}}return r});e._zod.parse=(n,o)=>{let i=n.value;if(!eW(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),n;let s=a.value.get(i?.[t.discriminator]);return s?s._zod.run(n,o):t.unionFallback||"backward"===o.direction?r(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(a.value.keys()),input:i,path:[t.discriminator],inst:e}),n)}}),oU=eM("$ZodIntersection",(e,t)=>{n4.init(e,t),e._zod.parse=(e,r)=>{let a=e.value,n=t.left._zod.run({value:a,issues:[]},r),o=t.right._zod.run({value:a,issues:[]},r);return n instanceof Promise||o instanceof Promise?Promise.all([n,o]).then(([t,r])=>oD(e,t,r)):oD(e,n,o)}});function oD(e,t,r){let a,n=new Map;for(let r of t.issues)if("unrecognized_keys"===r.code)for(let e of(a??(a=r),r.keys))n.has(e)||n.set(e,{}),n.get(e).l=!0;else e.issues.push(r);for(let t of r.issues)if("unrecognized_keys"===t.code)for(let e of t.keys)n.has(e)||n.set(e,{}),n.get(e).r=!0;else e.issues.push(t);let o=[...n].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(o.length&&a&&e.issues.push({...a,keys:o}),e8(e))return e;let i=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(eY(t)&&eY(r)){let a=Object.keys(r),n=Object.keys(t).filter(e=>-1!==a.indexOf(e)),o={...t,...r};for(let a of n){let n=e(t[a],r[a]);if(!n.valid)return{valid:!1,mergeErrorPath:[a,...n.mergeErrorPath]};o[a]=n.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let a=[];for(let n=0;n<t.length;n++){let o=e(t[n],r[n]);if(!o.valid)return{valid:!1,mergeErrorPath:[n,...o.mergeErrorPath]};a.push(o.data)}return{valid:!0,data:a}}return{valid:!1,mergeErrorPath:[]}}(t.value,r.value);if(!i.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}let oB=eM("$ZodTuple",(e,t)=>{n4.init(e,t);let r=t.items;e._zod.parse=(a,n)=>{let o=a.value;if(!Array.isArray(o))return a.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),a;a.value=[];let i=[],s=oF(r,"optin"),l=oF(r,"optout");if(!t.rest){if(o.length<s)return a.issues.push({code:"too_small",minimum:s,inclusive:!0,input:o,inst:e,origin:"array"}),a;o.length>r.length&&a.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:o,inst:e,origin:"array"})}let u=Array(r.length);for(let e=0;e<r.length;e++){let t=r[e]._zod.run({value:o[e],issues:[]},n);t instanceof Promise?i.push(t.then(t=>{u[e]=t})):u[e]=t}if(t.rest){let e=r.length-1;for(let s of o.slice(r.length)){e++;let r=t.rest._zod.run({value:s,issues:[]},n);r instanceof Promise?i.push(r.then(t=>oV(t,a,e))):oV(r,a,e)}}return i.length?Promise.all(i).then(()=>oq(u,a,r,o,l)):oq(u,a,r,o,l)}});function oF(e,t){for(let r=e.length-1;r>=0;r--)if("optional"!==e[r]._zod[t])return r+1;return 0}function oV(e,t,r){e.issues.length&&t.issues.push(...e9(r,e.issues)),t.value[r]=e.value}function oq(e,t,r,a,n){for(let o=0;o<r.length;o++){let r=e[o],i=o<a.length;if(r.issues.length){if(!i&&o>=n){t.value.length=o;break}t.issues.push(...e9(o,r.issues))}t.value[o]=r.value}for(let e=t.value.length-1;e>=a.length;e--)if("optional"===r[e]._zod.optout&&void 0===t.value[e])t.value.length=e;else break;return t}let oH=eM("$ZodRecord",(e,t)=>{n4.init(e,t),e._zod.parse=(r,a)=>{let n=r.value;if(!eY(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let o=[],i=t.keyType._zod.values;if(i){let s;r.value={};let l=new Set;for(let s of i)if("string"==typeof s||"number"==typeof s||"symbol"==typeof s){l.add("number"==typeof s?s.toString():s);let i=t.keyType._zod.run({value:s,issues:[]},a);if(i instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(i.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:i.issues.map(e=>te(e,a,e$())),input:s,path:[s],inst:e});continue}let u=i.value,c=t.valueType._zod.run({value:n[s],issues:[]},a);c instanceof Promise?o.push(c.then(e=>{e.issues.length&&r.issues.push(...e9(s,e.issues)),r.value[u]=e.value})):(c.issues.length&&r.issues.push(...e9(s,c.issues)),r.value[u]=c.value)}for(let e in n)l.has(e)||(s=s??[]).push(e);s&&s.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:s})}else for(let i of(r.value={},Reflect.ownKeys(n))){if("__proto__"===i||!Object.prototype.propertyIsEnumerable.call(n,i))continue;let s=t.keyType._zod.run({value:i,issues:[]},a);if(s instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof i&&ny.test(i)&&s.issues.length){let e=t.keyType._zod.run({value:Number(i),issues:[]},a);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(s=e)}if(s.issues.length){"loose"===t.mode?r.value[i]=n[i]:r.issues.push({code:"invalid_key",origin:"record",issues:s.issues.map(e=>te(e,a,e$())),input:i,path:[i],inst:e});continue}let l=t.valueType._zod.run({value:n[i],issues:[]},a);l instanceof Promise?o.push(l.then(e=>{e.issues.length&&r.issues.push(...e9(i,e.issues)),r.value[s.value]=e.value})):(l.issues.length&&r.issues.push(...e9(i,l.issues)),r.value[s.value]=l.value)}return o.length?Promise.all(o).then(()=>r):r}});function oJ(e,t,r,a,n,o,i){e.issues.length&&(eK.has(typeof a)?r.issues.push(...e9(a,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:e.issues.map(e=>te(e,i,e$()))})),t.issues.length&&(eK.has(typeof a)?r.issues.push(...e9(a,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:a,issues:t.issues.map(e=>te(e,i,e$()))})),r.value.set(e.value,t.value)}function oW(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}(e,t)=>{n4.init(e,t),e._zod.parse=(r,a)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let o=[];for(let[i,s]of(r.value=new Map,n)){let l=t.keyType._zod.run({value:i,issues:[]},a),u=t.valueType._zod.run({value:s,issues:[]},a);l instanceof Promise||u instanceof Promise?o.push(Promise.all([l,u]).then(([t,o])=>{oJ(t,o,r,i,n,e,a)})):oJ(l,u,r,i,n,e,a)}return o.length?Promise.all(o).then(()=>r):r}},(e,t)=>{n4.init(e,t),e._zod.parse=(r,a)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let o=[];for(let e of(r.value=new Set,n)){let n=t.valueType._zod.run({value:e,issues:[]},a);n instanceof Promise?o.push(n.then(e=>oW(e,r))):oW(n,r)}return o.length?Promise.all(o).then(()=>r):r}};let oG=eM("$ZodEnum",(e,t)=>{n4.init(e,t);let r=eP(t.entries),a=new Set(r);e._zod.values=a,e._zod.pattern=RegExp(`^(${r.filter(e=>eK.has(typeof e)).map(e=>"string"==typeof e?eQ(e):e.toString()).join("|")})$`),e._zod.parse=(t,n)=>{let o=t.value;return a.has(o)||t.issues.push({code:"invalid_value",values:r,input:o,inst:e}),t}}),oY=eM("$ZodLiteral",(e,t)=>{if(n4.init(e,t),0===t.values.length)throw Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?eQ(e):e?eQ(e.toString()):String(e)).join("|")})$`),e._zod.parse=(a,n)=>{let o=a.value;return r.has(o)||a.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),a}}),oK=((e,t)=>{n4.init(e,t),e._zod.parse=(t,r)=>{let a=t.value;return a instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:a,inst:e}),t}},eM("$ZodTransform",(e,t)=>{n4.init(e,t),e._zod.optin="optional",e._zod.parse=(r,a)=>{if("backward"===a.direction)throw new eR(e.constructor.name);let n=t.transform(r.value,r);if(a.async)return(n instanceof Promise?n:Promise.resolve(n)).then(e=>(r.value=e,r.fallback=!0,r));if(n instanceof Promise)throw new eO;return r.value=n,r.fallback=!0,r}}));function oX(e,t){return void 0===t&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let oQ=eM("$ZodOptional",(e,t)=>{n4.init(e,t),e._zod.optin="optional",e._zod.optout="optional",eB(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),eB(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${eL(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if("optional"===t.innerType._zod.optin){let a=e.value,n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>oX(e,a)):oX(n,a)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),o0=eM("$ZodExactOptional",(e,t)=>{oQ.init(e,t),eB(e._zod,"values",()=>t.innerType._zod.values),eB(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),o1=eM("$ZodNullable",(e,t)=>{n4.init(e,t),eB(e._zod,"optin",()=>t.innerType._zod.optin),eB(e._zod,"optout",()=>t.innerType._zod.optout),eB(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${eL(e.source)}|null)$`):void 0}),eB(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),o2=eM("$ZodDefault",(e,t)=>{n4.init(e,t),e._zod.optin="optional",eB(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;let a=t.innerType._zod.run(e,r);return a instanceof Promise?a.then(e=>o5(e,t)):o5(a,t)}});function o5(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let o4=eM("$ZodPrefault",(e,t)=>{n4.init(e,t),e._zod.optin="optional",eB(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),o3=eM("$ZodNonOptional",(e,t)=>{n4.init(e,t),eB(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,a)=>{let n=t.innerType._zod.run(r,a);return n instanceof Promise?n.then(t=>o8(t,e)):o8(n,e)}});function o8(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}(e,t)=>{n4.init(e,t),e._zod.parse=(e,r)=>{if("backward"===r.direction)throw new eR("ZodSuccess");let a=t.innerType._zod.run(e,r);return a instanceof Promise?a.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===a.issues.length,e)}};let o6=eM("$ZodCatch",(e,t)=>{n4.init(e,t),e._zod.optin="optional",eB(e._zod,"optout",()=>t.innerType._zod.optout),eB(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let a=t.innerType._zod.run(e,r);return a instanceof Promise?a.then(a=>(e.value=a.value,a.issues.length&&(e.value=t.catchValue({...e,error:{issues:a.issues.map(e=>te(e,r,e$()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=a.value,a.issues.length&&(e.value=t.catchValue({...e,error:{issues:a.issues.map(e=>te(e,r,e$()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),o9=((e,t)=>{n4.init(e,t),e._zod.parse=(t,r)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)},eM("$ZodPipe",(e,t)=>{n4.init(e,t),eB(e._zod,"values",()=>t.in._zod.values),eB(e._zod,"optin",()=>t.in._zod.optin),eB(e._zod,"optout",()=>t.out._zod.optout),eB(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){let a=t.out._zod.run(e,r);return a instanceof Promise?a.then(e=>o7(e,t.in,r)):o7(a,t.in,r)}let a=t.in._zod.run(e,r);return a instanceof Promise?a.then(e=>o7(e,t.out,r)):o7(a,t.out,r)}}));function o7(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}function ie(e,t,r){if(e.issues.length)return e.aborted=!0,e;if("forward"===(r.direction||"forward")){let a=t.transform(e.value,e);return a instanceof Promise?a.then(a=>it(e,a,t.out,r)):it(e,a,t.out,r)}{let a=t.reverseTransform(e.value,e);return a instanceof Promise?a.then(a=>it(e,a,t.in,r)):it(e,a,t.in,r)}}function it(e,t,r,a){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},a)}(e,t)=>{n4.init(e,t),eB(e._zod,"values",()=>t.in._zod.values),eB(e._zod,"optin",()=>t.in._zod.optin),eB(e._zod,"optout",()=>t.out._zod.optout),eB(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("forward"===(r.direction||"forward")){let a=t.in._zod.run(e,r);return a instanceof Promise?a.then(e=>ie(e,t,r)):ie(a,t,r)}{let a=t.out._zod.run(e,r);return a instanceof Promise?a.then(e=>ie(e,t,r)):ie(a,t,r)}}},(e,t)=>{o9.init(e,t)};let ir=eM("$ZodReadonly",(e,t)=>{n4.init(e,t),eB(e._zod,"propValues",()=>t.innerType._zod.propValues),eB(e._zod,"values",()=>t.innerType._zod.values),eB(e._zod,"optin",()=>t.innerType?._zod?.optin),eB(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let a=t.innerType._zod.run(e,r);return a instanceof Promise?a.then(ia):ia(a)}});function ia(e){return e.value=Object.freeze(e.value),e}(e,t)=>{n4.init(e,t);let r=[];for(let e of t.parts)if("object"==typeof e&&null!==e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let a=+!!t.startsWith("^"),n=t.endsWith("$")?t.length-1:t.length;r.push(t.slice(a,n))}else if(null===e||eX.has(typeof e))r.push(eQ(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${r.join("")}$`),e._zod.parse=(r,a)=>("string"!=typeof r.value?r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source})),r)},(e,t)=>{n4.init(e,t),e._zod.parse=(e,r)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},r))};let io=eM("$ZodLazy",(e,t)=>{n4.init(e,t),eB(e._zod,"innerType",()=>(t._cachedInner||(t._cachedInner=t.getter()),t._cachedInner)),eB(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),eB(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),eB(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),eB(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,r)=>e._zod.innerType._zod.run(t,r)}),ii=eM("$ZodCustom",(e,t)=>{nP.init(e,t),n4.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{let a=r.value,n=t.fn(a);if(n instanceof Promise)return n.then(t=>is(t,r,a,e));is(n,r,a,e)}});function is(e,t,r,a){if(!e){let e={code:"custom",input:r,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(e.params=a._zod.def.params),t.issues.push(ta(e))}}function il(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...e1(t)})}function iu(e,t){return new nj({check:"less_than",...e1(t),value:e,inclusive:!1})}function ic(e,t){return new nj({check:"less_than",...e1(t),value:e,inclusive:!0})}function id(e,t){return new nZ({check:"greater_than",...e1(t),value:e,inclusive:!1})}function ip(e,t){return new nZ({check:"greater_than",...e1(t),value:e,inclusive:!0})}function ih(e,t){return new nL({check:"multiple_of",...e1(t),value:e})}function im(e,t){return new nq({check:"max_length",...e1(t),maximum:e})}function ig(e,t){return new nH({check:"min_length",...e1(t),minimum:e})}function iy(e,t){return new nJ({check:"length_equals",...e1(t),length:e})}function iv(e){return new n1({check:"overwrite",tx:e})}e.i(59217);var ib=e.i(39604),ib=ib;let iw=eM("ZodISODateTime",(e,t)=>{ol.init(e,t),iM.init(e,t)}),i_=eM("ZodISODate",(e,t)=>{ou.init(e,t),iM.init(e,t)}),ik=eM("ZodISOTime",(e,t)=>{oc.init(e,t),iM.init(e,t)}),iE=eM("ZodISODuration",(e,t)=>{od.init(e,t),iM.init(e,t)}),ix=new WeakMap;function iI(e,t,r){let a=Object.getPrototypeOf(e),n=ix.get(a);if(n||(n=new Set,ix.set(a,n)),!n.has(t))for(let e in n.add(t),r){let t=r[e];Object.defineProperty(a,e,{configurable:!0,enumerable:!1,get(){let r=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:r}),r},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}let iS=eM("ZodType",(e,t)=>(n4.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:tP(e,"input"),output:tP(e,"output")}}),e.toJSONSchema=((e,t={})=>r=>{let a=tO({...r,processors:t});return tR(e,a),tC(a,e),t$(a,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,r)=>tv(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>tw(e,t,r),e.parseAsync=async(t,r)=>tb(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>t_(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>tk(e,t,r),e.decode=(t,r)=>tE(e,t,r),e.encodeAsync=async(t,r)=>tx(e,t,r),e.decodeAsync=async(t,r)=>tI(e,t,r),e.safeEncode=(t,r)=>tS(e,t,r),e.safeDecode=(t,r)=>tA(e,t,r),e.safeEncodeAsync=async(t,r)=>tz(e,t,r),e.safeDecodeAsync=async(t,r)=>tT(e,t,r),iI(e,"ZodType",{check(...e){let t=this.def;return this.clone(ib.mergeDefs(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return e0(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new sA({type:"custom",check:"custom",fn:e,...e1(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var r;let a,n;return r=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(ta(e,t.value,a._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=t.value),e.inst??(e.inst=a),e.continue??(e.continue=!a._zod.def.abort),t.issues.push(ta(e)))},e(t.value,t)),(n=new nP({check:"custom",...e1(t)}))._zod.check=r,a=n}(e,t))},overwrite(e){return this.check(iv(e))},optional(){return sm(this)},exactOptional(){var e;return e=this,new sg({type:"optional",innerType:e})},nullable(){return sv(this)},nullish(){return sm(sv(this))},nonoptional(e){var t,r;return t=this,r=e,new s_({type:"nonoptional",innerType:t,...ib.normalizeParams(r)})},array(){return i7(this)},or(e){return sa([this,e])},and(e){var t;return t=this,new si({type:"intersection",left:t,right:e})},transform(e){return sx(this,new sf({type:"transform",transform:e}))},default(e){var t,r;return t=this,r=e,new sb({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():ib.shallowClone(r)}})},prefault(e){var t,r;return t=this,r=e,new sw({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof r?r():ib.shallowClone(r)}})},catch(e){var t,r;return t=this,new sk({type:"catch",innerType:t,catchValue:"function"==typeof(r=e)?r:()=>r})},pipe(e){return sx(this,e)},readonly(){var e;return e=this,new sI({type:"readonly",innerType:e})},describe(e){let t=this.clone();return tM.add(t,{description:e}),t},meta(...e){if(0===e.length)return tM.get(this);let t=this.clone();return tM.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>tM.get(e)?.description,configurable:!0}),e)),iA=eM("_ZodString",(e,t)=>{n3.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>tj(e,t,r,a);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,iI(e,"_ZodString",{regex(...e){return this.check(function(e,t){return new nG({check:"string_format",format:"regex",...e1(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new nX({check:"string_format",format:"includes",...e1(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new nQ({check:"string_format",format:"starts_with",...e1(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new n0({check:"string_format",format:"ends_with",...e1(t),suffix:e})}(...e))},min(...e){return this.check(ig(...e))},max(...e){return this.check(im(...e))},length(...e){return this.check(iy(...e))},nonempty(...e){return this.check(ig(1,...e))},lowercase(e){return this.check(new nY({check:"string_format",format:"lowercase",...e1(e)}))},uppercase(e){return this.check(new nK({check:"string_format",format:"uppercase",...e1(e)}))},trim(){return this.check(iv(e=>e.trim()))},normalize(...e){return this.check(function(e){return iv(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(iv(e=>e.toLowerCase()))},toUpperCase(){return this.check(iv(e=>e.toUpperCase()))},slugify(){return this.check(iv(e=>eH(e)))}})}),iz=eM("ZodString",(e,t)=>{n3.init(e,t),iA.init(e,t),e.email=t=>e.check(new iO({type:"string",format:"email",check:"string_format",abort:!1,...e1(t)})),e.url=t=>e.check(new i$({type:"string",format:"url",check:"string_format",abort:!1,...e1(t)})),e.jwt=t=>e.check(new iG({type:"string",format:"jwt",check:"string_format",abort:!1,...e1(t)})),e.emoji=t=>e.check(new iP({type:"string",format:"emoji",check:"string_format",abort:!1,...e1(t)})),e.guid=t=>e.check(il(iR,t)),e.uuid=t=>e.check(new iC({type:"string",format:"uuid",check:"string_format",abort:!1,...e1(t)})),e.uuidv4=t=>e.check(new iC({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...e1(t)})),e.uuidv6=t=>e.check(new iC({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...e1(t)})),e.uuidv7=t=>e.check(new iC({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...e1(t)})),e.nanoid=t=>e.check(new iN({type:"string",format:"nanoid",check:"string_format",abort:!1,...e1(t)})),e.guid=t=>e.check(il(iR,t)),e.cuid=t=>e.check(new ij({type:"string",format:"cuid",check:"string_format",abort:!1,...e1(t)})),e.cuid2=t=>e.check(new iZ({type:"string",format:"cuid2",check:"string_format",abort:!1,...e1(t)})),e.ulid=t=>e.check(new iL({type:"string",format:"ulid",check:"string_format",abort:!1,...e1(t)})),e.base64=t=>e.check(new iH({type:"string",format:"base64",check:"string_format",abort:!1,...e1(t)})),e.base64url=t=>e.check(new iJ({type:"string",format:"base64url",check:"string_format",abort:!1,...e1(t)})),e.xid=t=>e.check(new iU({type:"string",format:"xid",check:"string_format",abort:!1,...e1(t)})),e.ksuid=t=>e.check(new iD({type:"string",format:"ksuid",check:"string_format",abort:!1,...e1(t)})),e.ipv4=t=>e.check(new iB({type:"string",format:"ipv4",check:"string_format",abort:!1,...e1(t)})),e.ipv6=t=>e.check(new iF({type:"string",format:"ipv6",check:"string_format",abort:!1,...e1(t)})),e.cidrv4=t=>e.check(new iV({type:"string",format:"cidrv4",check:"string_format",abort:!1,...e1(t)})),e.cidrv6=t=>e.check(new iq({type:"string",format:"cidrv6",check:"string_format",abort:!1,...e1(t)})),e.e164=t=>e.check(new iW({type:"string",format:"e164",check:"string_format",abort:!1,...e1(t)})),e.datetime=t=>e.check(new iw({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...e1(t)})),e.date=t=>e.check(new i_({type:"string",format:"date",check:"string_format",...e1(t)})),e.time=t=>e.check(new ik({type:"string",format:"time",check:"string_format",precision:null,...e1(t)})),e.duration=t=>e.check(new iE({type:"string",format:"duration",check:"string_format",...e1(t)}))});function iT(e){return new iz({type:"string",...e1(e)})}let iM=eM("ZodStringFormat",(e,t)=>{n8.init(e,t),iA.init(e,t)}),iO=eM("ZodEmail",(e,t)=>{n7.init(e,t),iM.init(e,t)}),iR=eM("ZodGUID",(e,t)=>{n6.init(e,t),iM.init(e,t)}),iC=eM("ZodUUID",(e,t)=>{n9.init(e,t),iM.init(e,t)}),i$=eM("ZodURL",(e,t)=>{oe.init(e,t),iM.init(e,t)}),iP=eM("ZodEmoji",(e,t)=>{ot.init(e,t),iM.init(e,t)}),iN=eM("ZodNanoID",(e,t)=>{or.init(e,t),iM.init(e,t)}),ij=eM("ZodCUID",(e,t)=>{oa.init(e,t),iM.init(e,t)}),iZ=eM("ZodCUID2",(e,t)=>{on.init(e,t),iM.init(e,t)}),iL=eM("ZodULID",(e,t)=>{oo.init(e,t),iM.init(e,t)}),iU=eM("ZodXID",(e,t)=>{oi.init(e,t),iM.init(e,t)}),iD=eM("ZodKSUID",(e,t)=>{os.init(e,t),iM.init(e,t)}),iB=eM("ZodIPv4",(e,t)=>{op.init(e,t),iM.init(e,t)}),iF=eM("ZodIPv6",(e,t)=>{of.init(e,t),iM.init(e,t)}),iV=eM("ZodCIDRv4",(e,t)=>{oh.init(e,t),iM.init(e,t)}),iq=eM("ZodCIDRv6",(e,t)=>{om.init(e,t),iM.init(e,t)}),iH=eM("ZodBase64",(e,t)=>{oy.init(e,t),iM.init(e,t)}),iJ=eM("ZodBase64URL",(e,t)=>{ov.init(e,t),iM.init(e,t)}),iW=eM("ZodE164",(e,t)=>{ob.init(e,t),iM.init(e,t)}),iG=eM("ZodJWT",(e,t)=>{ow.init(e,t),iM.init(e,t)}),iY=eM("ZodNumber",(e,t)=>{o_.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>tZ(e,t,r,a),iI(e,"ZodNumber",{gt(e,t){return this.check(id(e,t))},gte(e,t){return this.check(ip(e,t))},min(e,t){return this.check(ip(e,t))},lt(e,t){return this.check(iu(e,t))},lte(e,t){return this.check(ic(e,t))},max(e,t){return this.check(ic(e,t))},int(e){return this.check(iQ(e))},safe(e){return this.check(iQ(e))},positive(e){return this.check(id(0,e))},nonnegative(e){return this.check(ip(0,e))},negative(e){return this.check(iu(0,e))},nonpositive(e){return this.check(ic(0,e))},multipleOf(e,t){return this.check(ih(e,t))},step(e,t){return this.check(ih(e,t))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??-1/0,r.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(r.maximum??1/0,r.exclusiveMaximum??1/0)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function iK(e){return new iY({type:"number",checks:[],...e1(e)})}let iX=eM("ZodNumberFormat",(e,t)=>{ok.init(e,t),iY.init(e,t)});function iQ(e){return new iX({type:"number",check:"number_format",abort:!1,format:"safeint",...e1(e)})}let i0=eM("ZodBoolean",(e,t)=>{oE.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>tL(e,t,r,a)});function i1(e){return new i0({type:"boolean",...e1(e)})}(e,t)=>{ox.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>tU(e,t,r,a),e.gte=(t,r)=>e.check(ip(t,r)),e.min=(t,r)=>e.check(ip(t,r)),e.gt=(t,r)=>e.check(id(t,r)),e.gte=(t,r)=>e.check(ip(t,r)),e.min=(t,r)=>e.check(ip(t,r)),e.lt=(t,r)=>e.check(iu(t,r)),e.lte=(t,r)=>e.check(ic(t,r)),e.max=(t,r)=>e.check(ic(t,r)),e.positive=t=>e.check(id(BigInt(0),t)),e.negative=t=>e.check(iu(BigInt(0),t)),e.nonpositive=t=>e.check(ic(BigInt(0),t)),e.nonnegative=t=>e.check(ip(BigInt(0),t)),e.multipleOf=(t,r)=>e.check(ih(t,r));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null};let i2=eM("ZodNull",(e,t)=>{oI.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>tD(e,t,r,a)}),i5=eM("ZodAny",(e,t)=>{oS.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>tF(e,t,r,a)}),i4=eM("ZodUnknown",(e,t)=>{oA.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>tV(e,t,r,a)});function i3(){return new i4({type:"unknown"})}let i8=eM("ZodNever",(e,t)=>{oz.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>tB(e,t,r,a)});function i6(e){return new i8({type:"never",...e1(e)})}let i9=eM("ZodArray",(e,t)=>{oM.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>tG(e,t,r,a),e.element=t.element,iI(e,"ZodArray",{min(e,t){return this.check(ig(e,t))},nonempty(e){return this.check(ig(1,e))},max(e,t){return this.check(im(e,t))},length(e,t){return this.check(iy(e,t))},unwrap(){return this.element}})});function i7(e,t){return new i9({type:"array",element:e,...e1(t)})}let se=eM("ZodObject",(e,t)=>{oP.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>tY(e,t,r,a),ib.defineLazy(e,"shape",()=>t.shape),iI(e,"ZodObject",{keyof(){return sc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:i3()})},loose(){return this.clone({...this._zod.def,catchall:i3()})},strict(){return this.clone({...this._zod.def,catchall:i6()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return ib.extend(this,e)},safeExtend(e){return ib.safeExtend(this,e)},merge(e){return ib.merge(this,e)},pick(e){return ib.pick(this,e)},omit(e){return ib.omit(this,e)},partial(...e){return ib.partial(sh,this,e[0])},required(...e){return ib.required(s_,this,e[0])}})});function st(e,t){return new se({type:"object",shape:e??{},...ib.normalizeParams(t)})}let sr=eM("ZodUnion",(e,t)=>{oj.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>tK(e,t,r,a),e.options=t.options});function sa(e,t){return new sr({type:"union",options:e,...ib.normalizeParams(t)})}let sn=eM("ZodDiscriminatedUnion",(e,t)=>{sr.init(e,t),oL.init(e,t)});function so(e,t,r){return new sn({type:"union",options:t,discriminator:e,...ib.normalizeParams(r)})}let si=eM("ZodIntersection",(e,t)=>{oU.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>tX(e,t,r,a)}),ss=eM("ZodRecord",(e,t)=>{oH.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>tQ(e,t,r,a),e.keyType=t.keyType,e.valueType=t.valueType});function sl(e,t,r){return new ss(t&&t._zod?{type:"record",keyType:e,valueType:t,...ib.normalizeParams(r)}:{type:"record",keyType:iT(),valueType:e,...ib.normalizeParams(t)})}let su=eM("ZodEnum",(e,t)=>{oG.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>tq(e,t,r,a),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(e,a)=>{let n={};for(let a of e)if(r.has(a))n[a]=t.entries[a];else throw Error(`Key ${a} not found in enum`);return new su({...t,checks:[],...ib.normalizeParams(a),entries:n})},e.exclude=(e,a)=>{let n={...t.entries};for(let t of e)if(r.has(t))delete n[t];else throw Error(`Key ${t} not found in enum`);return new su({...t,checks:[],...ib.normalizeParams(a),entries:n})}});function sc(e,t){return new su({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...ib.normalizeParams(t)})}let sd=eM("ZodLiteral",(e,t)=>{oY.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>tH(e,t,r,a),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 sp(e,t){return new sd({type:"literal",values:Array.isArray(e)?e:[e],...ib.normalizeParams(t)})}let sf=eM("ZodTransform",(e,t)=>{oK.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>tW(e,t,r,a),e._zod.parse=(r,a)=>{if("backward"===a.direction)throw new eR(e.constructor.name);r.addIssue=a=>{"string"==typeof a?r.issues.push(ib.issue(a,r.value,t)):(a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(ib.issue(a)))};let n=t.transform(r.value,r);return n instanceof Promise?n.then(e=>(r.value=e,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}}),sh=eM("ZodOptional",(e,t)=>{oQ.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>t6(e,t,r,a),e.unwrap=()=>e._zod.def.innerType});function sm(e){return new sh({type:"optional",innerType:e})}let sg=eM("ZodExactOptional",(e,t)=>{o0.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>t6(e,t,r,a),e.unwrap=()=>e._zod.def.innerType}),sy=eM("ZodNullable",(e,t)=>{o1.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>t0(e,t,r,a),e.unwrap=()=>e._zod.def.innerType});function sv(e){return new sy({type:"nullable",innerType:e})}let sb=eM("ZodDefault",(e,t)=>{o2.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>t2(e,t,r,a),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),sw=eM("ZodPrefault",(e,t)=>{o4.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>t5(e,t,r,a),e.unwrap=()=>e._zod.def.innerType}),s_=eM("ZodNonOptional",(e,t)=>{o3.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>t1(e,t,r,a),e.unwrap=()=>e._zod.def.innerType}),sk=eM("ZodCatch",(e,t)=>{o6.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>t4(e,t,r,a),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),sE=eM("ZodPipe",(e,t)=>{o9.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>t3(e,t,r,a),e.in=t.in,e.out=t.out});function sx(e,t){return new sE({type:"pipe",in:e,out:t})}let sI=eM("ZodReadonly",(e,t)=>{ir.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>t8(e,t,r,a),e.unwrap=()=>e._zod.def.innerType}),sS=eM("ZodLazy",(e,t)=>{io.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>t9(e,t,r,a),e.unwrap=()=>e._zod.def.getter()}),sA=eM("ZodCustom",(e,t)=>{ii.init(e,t),iS.init(e,t),e._zod.processJSONSchema=(t,r,a)=>tJ(e,t,r,a)});var sz=e.i(52897),sT="ai-gateway-transcription.v1";function sM(e,t,r){let a=[e,`ai-gateway-auth.${t}`];return(null==r?void 0:r.teamIdOrSlug)&&a.push(`ai-gateway-team.${function(e){let t=new TextEncoder().encode(e),r="";for(let e of t)r+=String.fromCharCode(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/u,"")}(r.teamIdOrSlug)}`),a}var sO=function(){return new i5({type:"any"})},sR=i7,sC=sc,s$=sa,sP=Symbol.for("vercel.ai.gateway.error"),sN=class e extends(_=Error,w=sP,_){constructor({message:e,statusCode:t=500,cause:r,generationId:a,isRetryable:n=null!=t&&(408===t||409===t||429===t||t>=500)}){super(a?`${e} [${a}]`:e),this[w]=!0,this.statusCode=t,this.cause=r,this.generationId=a,this.isRetryable=n}static isInstance(t){return e.hasMarker(t)}static hasMarker(e){return"object"==typeof e&&null!==e&&sP in e&&!0===e[sP]}},sj="GatewayAuthenticationError",sZ=Symbol.for(`vercel.ai.gateway.error.${sj}`),sL=class e extends(E=sN,k=sZ,E){constructor({message:e="Authentication failed",statusCode:t=401,cause:r,generationId:a}={}){super({message:e,statusCode:t,cause:r,generationId:a}),this[k]=!0,this.name=sj,this.type="authentication_error"}static isInstance(e){return sN.hasMarker(e)&&sZ in e}static createContextualError({apiKeyProvided:t,oidcTokenProvided:r,statusCode:a=401,cause:n,generationId:o}){return new e({message:t?`AI Gateway authentication failed: Invalid API key or token.
|
|
78
|
-
|
|
79
|
-
Create a new API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys
|
|
80
|
-
|
|
81
|
-
Provide an API key or Vercel access token via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.`:r?`AI Gateway authentication failed: Invalid OIDC token.
|
|
82
|
-
|
|
83
|
-
Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.
|
|
84
|
-
|
|
85
|
-
Alternatively, use an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys
|
|
86
|
-
or pass a Vercel access token via the 'apiKey' option.`:`AI Gateway authentication failed: No authentication provided.
|
|
87
|
-
|
|
88
|
-
Option 1 - API key:
|
|
89
|
-
Create an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys
|
|
90
|
-
Provide via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.
|
|
91
|
-
|
|
92
|
-
Option 2 - Vercel access token:
|
|
93
|
-
Pass a Vercel personal access token or Vercel app access token via the 'apiKey' option.
|
|
94
|
-
|
|
95
|
-
Option 3 - OIDC token:
|
|
96
|
-
Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.`,statusCode:a,cause:n,generationId:o})}},sU="GatewayInvalidRequestError",sD=Symbol.for(`vercel.ai.gateway.error.${sU}`),sB=class extends(I=sN,x=sD,I){constructor({message:e="Invalid request",statusCode:t=400,cause:r,generationId:a}={}){super({message:e,statusCode:t,cause:r,generationId:a}),this[x]=!0,this.name=sU,this.type="invalid_request_error"}static isInstance(e){return sN.hasMarker(e)&&sD in e}},sF="GatewayRateLimitError",sV=Symbol.for(`vercel.ai.gateway.error.${sF}`),sq=class extends(A=sN,S=sV,A){constructor({message:e="Rate limit exceeded",statusCode:t=429,cause:r,generationId:a}={}){super({message:e,statusCode:t,cause:r,generationId:a}),this[S]=!0,this.name=sF,this.type="rate_limit_exceeded"}static isInstance(e){return sN.hasMarker(e)&&sV in e}},sH="GatewayModelNotFoundError",sJ=Symbol.for(`vercel.ai.gateway.error.${sH}`),sW=av(()=>a_(st({modelId:iT()}))),sG=class extends(T=sN,z=sJ,T){constructor({message:e="Model not found",statusCode:t=404,modelId:r,cause:a,generationId:n}={}){super({message:e,statusCode:t,cause:a,generationId:n}),this[z]=!0,this.name=sH,this.type="model_not_found",this.modelId=r}static isInstance(e){return sN.hasMarker(e)&&sJ in e}},sY="GatewayNotFoundError",sK=Symbol.for(`vercel.ai.gateway.error.${sY}`),sX=class extends(O=sN,M=sK,O){constructor({message:e="Resource not found",statusCode:t=404,cause:r,generationId:a}={}){super({message:e,statusCode:t,cause:r,generationId:a}),this[M]=!0,this.name=sY,this.type="not_found"}static isInstance(e){return sN.hasMarker(e)&&sK in e}},sQ="GatewayInternalServerError",s0=Symbol.for(`vercel.ai.gateway.error.${sQ}`),s1=class extends(C=sN,R=s0,C){constructor({message:e="Internal server error",statusCode:t=500,cause:r,generationId:a}={}){super({message:e,statusCode:t,cause:r,generationId:a}),this[R]=!0,this.name=sQ,this.type="internal_server_error"}static isInstance(e){return sN.hasMarker(e)&&s0 in e}},s2="GatewayFailedDependencyError",s5=Symbol.for(`vercel.ai.gateway.error.${s2}`),s4=class extends(P=sN,$=s5,P){constructor({message:e="Failed dependency",statusCode:t=424,cause:r,generationId:a}={}){super({message:e,statusCode:t,cause:r,generationId:a}),this[$]=!0,this.name=s2,this.type="failed_dependency"}static isInstance(e){return sN.hasMarker(e)&&s5 in e}},s3="GatewayForbiddenError",s8=Symbol.for(`vercel.ai.gateway.error.${s3}`),s6=av(()=>a_(st({ruleId:iT()}))),s9=class extends(j=sN,N=s8,j){constructor({message:e="Forbidden",statusCode:t=403,cause:r,generationId:a,ruleId:n}={}){super({message:e,statusCode:t,cause:r,generationId:a}),this[N]=!0,this.name=s3,this.type="forbidden",this.ruleId=n}static isInstance(e){return sN.hasMarker(e)&&s8 in e}},s7="GatewayResponseError",le=Symbol.for(`vercel.ai.gateway.error.${s7}`),lt=class extends(L=sN,Z=le,L){constructor({message:e="Invalid response from Gateway",statusCode:t=502,response:r,validationError:a,cause:n,generationId:o}={}){super({message:e,statusCode:t,cause:n,generationId:o}),this[Z]=!0,this.name=s7,this.type="response_error",this.response=r,this.validationError=a}static isInstance(e){return sN.hasMarker(e)&&le in e}};async function lr({response:e,statusCode:t,defaultMessage:r="Gateway request failed",cause:a,authMethod:n}){var o;let i=await aE({value:e,schema:la});if(!i.success){let n="object"==typeof e&&null!==e&&"generationId"in e?e.generationId:void 0;return new lt({message:`Invalid error response format: ${r}`,statusCode:t,response:e,validationError:i.error,cause:a,generationId:n})}let s=i.value,l=s.error.type,u=s.error.message,c=null!=(o=s.generationId)?o:void 0;switch(l){case"authentication_error":return sL.createContextualError({apiKeyProvided:"api-key"===n,oidcTokenProvided:"oidc"===n,statusCode:t,cause:a,generationId:c});case"invalid_request_error":return new sB({message:u,statusCode:t,cause:a,generationId:c});case"rate_limit_exceeded":return new sq({message:u,statusCode:t,cause:a,generationId:c});case"model_not_found":{let e=await aE({value:s.error.param,schema:sW});return new sG({message:u,statusCode:t,modelId:e.success?e.value.modelId:void 0,cause:a,generationId:c})}case"not_found":return new sX({message:u,statusCode:t,cause:a,generationId:c});case"internal_server_error":default:return new s1({message:u,statusCode:t,cause:a,generationId:c});case"failed_dependency":return new s4({message:u,statusCode:t,cause:a,generationId:c});case"forbidden":{let e=await aE({value:s.error.param,schema:s6});return new s9({message:u,statusCode:t,cause:a,generationId:c,ruleId:e.success?e.value.ruleId:void 0})}}}var la=av(()=>a_(st({error:st({message:iT(),type:iT().nullish(),param:i3().nullish(),code:s$([iT(),iK()]).nullish()}),generationId:iT().nullish()}))),ln="GatewayTimeoutError",lo=Symbol.for(`vercel.ai.gateway.error.${ln}`),li=class e extends(D=sN,U=lo,D){constructor({message:e="Request timed out",statusCode:t=408,cause:r,generationId:a}={}){super({message:e,statusCode:t,cause:r,generationId:a}),this[U]=!0,this.name=ln,this.type="timeout_error"}static isInstance(e){return sN.hasMarker(e)&&lo in e}static createTimeoutError({originalMessage:t,statusCode:r=408,cause:a,generationId:n}){return new e({message:`Gateway request timed out: ${t}
|
|
97
|
-
|
|
98
|
-
This is a client-side timeout. To resolve this, increase your timeout configuration: https://vercel.com/docs/ai-gateway/capabilities/video-generation#extending-timeouts-for-node.js`,statusCode:r,cause:a,generationId:n})}};function ls(e){if(!(e instanceof Error))return!1;let t=e.code;return"string"==typeof t&&["UND_ERR_HEADERS_TIMEOUT","UND_ERR_BODY_TIMEOUT","UND_ERR_CONNECT_TIMEOUT"].includes(t)}async function ll(e,t){var r;return sN.isInstance(e)?e:ls(e)?li.createTimeoutError({originalMessage:e instanceof Error?e.message:"Unknown error",cause:e}):eu.isInstance(e)?e.cause&&ls(e.cause)?li.createTimeoutError({originalMessage:e.message,cause:e}):await lr({response:function(e){if(void 0!==e.data)return e.data;if(null!=e.responseBody)try{return rX(e.responseBody)}catch(t){return e.responseBody}return{}}(e),statusCode:null!=(r=e.statusCode)?r:500,defaultMessage:"Gateway request failed",cause:e,authMethod:t}):await lr({response:{},statusCode:500,defaultMessage:e instanceof Error?`Gateway request failed: ${e.message}`:"Unknown Gateway error",cause:e,authMethod:t})}var lu="ai-gateway-auth-method",lc="x-vercel-ai-gateway-team";async function ld(e){let t=await aE({value:e[lu],schema:lp});return t.success?t.value:void 0}var lp=av(()=>a_(s$([sp("api-key"),sp("oidc")]))),lf=["embedding","image","language","realtime","reranking","speech","transcription","video"],lh=class{constructor(e){this.config=e}async getAvailableModels(){try{let{value:e}=await rq({url:`${this.config.baseURL}/config`,validateUrl:!1,headers:this.config.headers?await aO(this.config.headers):void 0,successfulResponseHandler:aP(lm),failedResponseHandler:a$({errorSchema:sO(),errorToMessage:e=>{var t;return null!=(t=eh(e))?t:"unknown error"}}),fetch:this.config.fetch});return e}catch(e){throw await ll(e)}}async getCredits(){try{let e=new URL(this.config.baseURL),{value:t}=await rq({url:`${e.origin}/v1/credits`,validateUrl:!1,headers:this.config.headers?await aO(this.config.headers):void 0,successfulResponseHandler:aP(lg),failedResponseHandler:a$({errorSchema:sO(),errorToMessage:e=>{var t;return null!=(t=eh(e))?t:"unknown error"}}),fetch:this.config.fetch});return t}catch(e){throw await ll(e)}}},lm=av(()=>a_(st({models:sR(st({id:iT(),name:iT(),description:iT().nullish(),pricing:st({input:iT(),output:iT(),input_cache_read:iT().nullish(),input_cache_write:iT().nullish()}).transform(({input:e,output:t,input_cache_read:r,input_cache_write:a})=>({input:e,output:t,...r?{cachedInputTokens:r}:{},...a?{cacheCreationInputTokens:a}:{}})).nullish(),specification:st({specificationVersion:sp("v4"),provider:iT(),modelId:iT()}),modelType:iT().nullish()})).transform(e=>e.filter(e=>null==e.modelType||lf.includes(e.modelType)))}))),lg=av(()=>a_(st({balance:iT(),total_used:iT()}).transform(({balance:e,total_used:t})=>({balance:e,totalUsed:t})))),ly=class{constructor(e){this.config=e}async getSpendReport(e){try{let t=new URL(this.config.baseURL),r=new URLSearchParams;r.set("start_date",e.startDate),r.set("end_date",e.endDate),e.groupBy&&r.set("group_by",e.groupBy),e.datePart&&r.set("date_part",e.datePart),e.userId&&r.set("user_id",e.userId),e.model&&r.set("model",e.model),e.provider&&r.set("provider",e.provider),e.credentialType&&r.set("credential_type",e.credentialType),e.tags&&e.tags.length>0&&r.set("tags",e.tags.join(","));let{value:a}=await rq({url:`${t.origin}/v1/report?${r.toString()}`,validateUrl:!1,headers:this.config.headers?await aO(this.config.headers):void 0,successfulResponseHandler:aP(lv),failedResponseHandler:a$({errorSchema:sO(),errorToMessage:e=>{var t;return null!=(t=eh(e))?t:"unknown error"}}),fetch:this.config.fetch});return a}catch(e){throw await ll(e)}}},lv=av(()=>a_(st({results:sR(st({day:iT().optional(),hour:iT().optional(),user:iT().optional(),model:iT().optional(),tag:iT().optional(),provider:iT().optional(),credential_type:sC(["byok","system"]).optional(),total_cost:iK(),market_cost:iK().optional(),input_tokens:iK().optional(),output_tokens:iK().optional(),cached_input_tokens:iK().optional(),cache_creation_input_tokens:iK().optional(),reasoning_tokens:iK().optional(),request_count:iK().optional()}).transform(({credential_type:e,total_cost:t,market_cost:r,input_tokens:a,output_tokens:n,cached_input_tokens:o,cache_creation_input_tokens:i,reasoning_tokens:s,request_count:l,...u})=>({...u,...void 0!==e?{credentialType:e}:{},totalCost:t,...void 0!==r?{marketCost:r}:{},...void 0!==a?{inputTokens:a}:{},...void 0!==n?{outputTokens:n}:{},...void 0!==o?{cachedInputTokens:o}:{},...void 0!==i?{cacheCreationInputTokens:i}:{},...void 0!==s?{reasoningTokens:s}:{},...void 0!==l?{requestCount:l}:{}})))}))),lb=class{constructor(e){this.config=e}async getGenerationInfo(e){try{let t=new URL(this.config.baseURL),{value:r}=await rq({url:`${t.origin}/v1/generation?id=${encodeURIComponent(e.id)}`,validateUrl:!1,headers:this.config.headers?await aO(this.config.headers):void 0,successfulResponseHandler:aP(lw),failedResponseHandler:a$({errorSchema:sO(),errorToMessage:e=>{var t;return null!=(t=eh(e))?t:"unknown error"}}),fetch:this.config.fetch});return r}catch(e){throw await ll(e)}}},lw=av(()=>a_(st({data:st({id:iT(),total_cost:iK(),upstream_inference_cost:iK(),usage:iK(),created_at:iT(),model:iT(),is_byok:i1(),provider_name:iT(),streamed:i1(),finish_reason:iT(),latency:iK(),generation_time:iK(),native_tokens_prompt:iK(),native_tokens_completion:iK(),native_tokens_reasoning:iK(),native_tokens_cached:iK(),native_tokens_cache_creation:iK(),billable_web_search_calls:iK()}).transform(({total_cost:e,upstream_inference_cost:t,created_at:r,is_byok:a,provider_name:n,finish_reason:o,generation_time:i,native_tokens_prompt:s,native_tokens_completion:l,native_tokens_reasoning:u,native_tokens_cached:c,native_tokens_cache_creation:d,billable_web_search_calls:p,...f})=>({...f,totalCost:e,upstreamInferenceCost:t,createdAt:r,isByok:a,providerName:n,finishReason:o,generationTime:i,promptTokens:s,completionTokens:l,reasoningTokens:u,cachedTokens:c,cacheCreationTokens:d,billableWebSearchCalls:p}))}).transform(({data:e})=>e))),l_=class e{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v4",this.supportedUrls={"*/*":[/.*/]}}static[ro](e){return aB({modelId:e.modelId,config:e.config})}static[ri](t){return new e(t.modelId,t.config)}get provider(){return this.config.provider}async getArgs(e){let{abortSignal:t,...r}=e;return{args:this.maybeEncodeFileParts(r),warnings:[]}}async doGenerate(e){let{args:t,warnings:r}=await this.getArgs(e),{abortSignal:a}=e,n=this.config.headers?await aO(this.config.headers):void 0;try{let{responseHeaders:o,value:i,rawValue:s}=await az({url:this.getUrl(),headers:rs(n,e.headers,this.getModelConfigHeaders(this.modelId,!1),await aO(this.config.o11yHeaders)),body:t,successfulResponseHandler:aP(sO()),failedResponseHandler:a$({errorSchema:sO(),errorToMessage:e=>{var t;return null!=(t=eh(e))?t:"unknown error"}}),...a&&{abortSignal:a},fetch:this.config.fetch});return{...i,request:{body:t},response:{headers:o,body:s},warnings:r}}catch(e){throw await ll(e,await ld(null!=n?n:{}))}}async doStream(e){let{args:t,warnings:r}=await this.getArgs(e),{abortSignal:a}=e,n=this.config.headers?await aO(this.config.headers):void 0;try{let o,{value:i,responseHeaders:s}=await az({url:this.getUrl(),headers:rs(n,e.headers,this.getModelConfigHeaders(this.modelId,!0),await aO(this.config.o11yHeaders)),body:t,successfulResponseHandler:(o=sO(),async({response:e})=>{let t=r$(e);if(null==e.body)throw new ef({});return{responseHeaders:t,value:aS({stream:e.body,schema:o})}}),failedResponseHandler:a$({errorSchema:sO(),errorToMessage:e=>{var t;return null!=(t=eh(e))?t:"unknown error"}}),...a&&{abortSignal:a},fetch:this.config.fetch});return{stream:i.pipeThrough(new TransformStream({start(e){r.length>0&&e.enqueue({type:"stream-start",warnings:r})},transform(t,r){if(t.success){let a=t.value;("raw"!==a.type||e.includeRawChunks)&&("response-metadata"===a.type&&a.timestamp&&"string"==typeof a.timestamp&&(a.timestamp=new Date(a.timestamp)),r.enqueue(a))}else r.error(t.error)}})),request:{body:t},response:{headers:s}}}catch(e){throw await ll(e,await ld(null!=n?n:{}))}}maybeEncodeFileParts(e){for(let t of e.prompt)if(Array.isArray(t.content)){for(let e of t.content)if("file"===e.type||"reasoning-file"===e.type)e.data=lk(e.data);else if("tool-result"===e.type&&"content"===e.output.type)for(let t of e.output.value)"file"===t.type&&(t.data=lk(t.data))}return e}getUrl(){return`${this.config.baseURL}/language-model`}getModelConfigHeaders(e,t){return{"ai-language-model-specification-version":"4","ai-language-model-id":e,"ai-language-model-streaming":String(t)}}};function lk(e){if("data"===e.type){let t=e.data;if(t instanceof Uint8Array)return{...e,data:aW.Buffer.from(t).toString("base64")}}return e}var lE=class e extends l_{static[ro](e){return l_[ro](e)}static[ri](t){return new e(t.modelId,t.config)}constructor(e,t){super(e,t)}async experimental_doStartBatch({requests:e,providerOptions:t,headers:r,abortSignal:a,webhookUrl:n}){var o;let i=this.config.headers?await aO(this.config.headers):void 0,s=function(e){let t=null==e?void 0:e.gateway;if(null==t||"object"!=typeof t||Array.isArray(t))return;let r=t.idempotencyKey;return"string"==typeof r&&r.length>0?r:void 0}(t),l=function(e){let t=null==e?void 0:e.gateway;if(null==t||"object"!=typeof t||Array.isArray(t)||!("idempotencyKey"in t))return e;let{idempotencyKey:r,...a}=t,n={...e};if(0===Object.keys(a).length?delete n.gateway:n.gateway=a,0!==Object.keys(n).length)return n}(t);try{let{value:t}=await az({url:this.getBatchUrl("start"),headers:rs(i,r,this.getBatchConfigHeaders(),await aO(this.config.o11yHeaders),null!=s?{"idempotency-key":s}:void 0),body:{...null!=n&&{callbackUrl:n},modelId:this.modelId,requests:e.map(e=>({id:e.id,options:this.maybeEncodeFileParts(e.options)})),...null!=l&&{providerOptions:l}},successfulResponseHandler:aP(lR),failedResponseHandler:a$({errorSchema:sO(),errorToMessage:e=>{var t;return null!=(t=eh(e))?t:"unknown error"}}),...a&&{abortSignal:a},fetch:this.config.fetch});return{batchId:t.batchId,...lI(t),warnings:null!=(o=t.warnings)?o:[]}}catch(e){if(lx(e))throw e;throw await ll(e,await ld(null!=i?i:{}))}}async experimental_doGetBatchStatus({batchId:e,headers:t,abortSignal:r}){let a=this.config.headers?await aO(this.config.headers):void 0;try{let{value:n}=await az({url:this.getBatchUrl("status"),headers:rs(a,t,this.getBatchConfigHeaders(),await aO(this.config.o11yHeaders)),body:{batchId:e},successfulResponseHandler:aP(lC),failedResponseHandler:a$({errorSchema:sO(),errorToMessage:e=>{var t;return null!=(t=eh(e))?t:"unknown error"}}),...r&&{abortSignal:r},fetch:this.config.fetch});return lI(n)}catch(e){if(lx(e))throw e;throw await ll(e,await ld(null!=a?a:{}))}}async experimental_doGetBatchResults({batchId:e,headers:t,abortSignal:r}){let a=this.config.headers?await aO(this.config.headers):void 0;try{var n;let o,{value:i}=await az({url:this.getBatchUrl("results"),headers:rs(a,t,this.getBatchConfigHeaders(),await aO(this.config.o11yHeaders)),body:{batchId:e},successfulResponseHandler:async({response:e})=>{let t=r$(e);if(null==e.body)throw new ef({});return{responseHeaders:t,value:aN({stream:e.body,schema:lA})}},failedResponseHandler:a$({errorSchema:sO(),errorToMessage:e=>{var t;return null!=(t=eh(e))?t:"unknown error"}}),...r&&{abortSignal:r},fetch:this.config.fetch});return n=lS(i),o=!1,new ReadableStream({async pull(e){if(!o)try{let{value:t,done:r}=await n.next();r?e.close():e.enqueue(t)}catch(t){e.error(t)}},async cancel(e){if(o=!0,n.return)try{await n.return(e)}catch(e){}}})}catch(e){if(lx(e))throw e;throw await ll(e,await ld(null!=a?a:{}))}}getBatchUrl(e){return`${this.config.baseURL}/batch/${e}`}getBatchConfigHeaders(){return{"ai-model-id":this.modelId}}};function lx(e){return!!(e instanceof Error||e instanceof DOMException)&&("AbortError"===e.name||"TimeoutError"===e.name)}function lI(e){var t,r,a,n;let o=function({total:e,pending:t,completed:r,failed:a}){if(rW(e)&&rW(t)&&rW(r)&&rW(a)&&t+r+a===e)return{total:e,pending:t,completed:r,failed:a}}({total:null==(t=e.requestCounts)?void 0:t.total,pending:null==(r=e.requestCounts)?void 0:r.pending,completed:null==(a=e.requestCounts)?void 0:a.completed,failed:null==(n=e.requestCounts)?void 0:n.failed});return{status:e.status,...null!=e.rawStatus&&{rawStatus:e.rawStatus},...null!=o&&{requestCounts:o},...null!=e.error&&{error:{message:e.error.message,...null!=e.error.type&&{type:e.error.type},...null!=e.error.code&&{code:e.error.code},...null!=e.error.statusCode&&{statusCode:e.error.statusCode}}},...null!=e.createdAt&&{createdAt:e.createdAt},...null!=e.expiresAt&&{expiresAt:e.expiresAt},...null!=e.providerMetadata&&{providerMetadata:e.providerMetadata}}}async function*lS(e){var t;for await(let r of e){if("succeeded"===r.status){let e=null==(t=r.result)?void 0:t.response;void 0!==e&&"string"==typeof e.timestamp&&(e.timestamp=new Date(e.timestamp))}yield r}}var lA=st({id:iT(),status:sC(["cancelled","expired","failed","succeeded"])}).catchall(i3()),lz=st({message:iT(),type:iT().nullish(),code:iT().nullish(),statusCode:iK().nullish()}),lT=st({total:iK().nullish(),pending:iK().nullish(),completed:iK().nullish(),failed:iK().nullish()}),lM=sl(iT(),sl(iT(),i3())),lO=st({status:sC(["completed","failed","pending"]),rawStatus:iT().nullish(),requestCounts:lT.nullish(),error:lz.nullish(),createdAt:iT().nullish(),expiresAt:iT().nullish(),providerMetadata:lM.nullish()}),lR=lO.extend({batchId:iT(),warnings:sR(st({requestId:iT().nullish(),warning:i3()}).catchall(i3())).nullish()}),lC=lO,l$=class e{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v4",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0}static[ro](e){return aB({modelId:e.modelId,config:e.config})}static[ri](t){return new e(t.modelId,t.config)}get provider(){return this.config.provider}async doEmbed({values:e,headers:t,abortSignal:r,providerOptions:a}){var n,o;let i=this.config.headers?await aO(this.config.headers):void 0;try{let{responseHeaders:s,value:l,rawValue:u}=await az({url:this.getUrl(),headers:rs(i,null!=t?t:{},this.getModelConfigHeaders(),await aO(this.config.o11yHeaders)),body:{values:e,...a?{providerOptions:a}:{}},successfulResponseHandler:aP(lN),failedResponseHandler:a$({errorSchema:sO(),errorToMessage:e=>{var t;return null!=(t=eh(e))?t:"unknown error"}}),...r&&{abortSignal:r},fetch:this.config.fetch});return{embeddings:l.embeddings,usage:null!=(n=l.usage)?n:void 0,providerMetadata:l.providerMetadata,response:{headers:s,body:u},warnings:null!=(o=l.warnings)?o:[]}}catch(e){throw await ll(e,await ld(null!=i?i:{}))}}getUrl(){return`${this.config.baseURL}/embedding-model`}getModelConfigHeaders(){return{"ai-embedding-model-specification-version":"4","ai-model-id":this.modelId}}},lP=so("type",[st({type:sp("unsupported"),feature:iT(),details:iT().optional()}),st({type:sp("compatibility"),feature:iT(),details:iT().optional()}),st({type:sp("deprecated"),setting:iT(),message:iT()}),st({type:sp("other"),message:iT()})]),lN=av(()=>a_(st({embeddings:sR(sR(iK())),usage:st({tokens:iK()}).nullish(),warnings:sR(lP).optional(),providerMetadata:sl(iT(),sl(iT(),i3())).optional()}))),lj=class e{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v4",this.maxImagesPerCall=Number.MAX_SAFE_INTEGER}static[ro](e){return aB({modelId:e.modelId,config:e.config})}static[ri](t){return new e(t.modelId,t.config)}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,size:r,aspectRatio:a,seed:n,files:o,mask:i,providerOptions:s,headers:l,abortSignal:u}){var c,d,p,f;let h=this.config.headers?await aO(this.config.headers):void 0;try{let{responseHeaders:m,value:g}=await az({url:this.getUrl(),headers:rs(h,null!=l?l:{},this.getModelConfigHeaders(),await aO(this.config.o11yHeaders)),body:{prompt:e,n:t,...r&&{size:r},...a&&{aspectRatio:a},...n&&{seed:n},...s&&{providerOptions:s},...o&&{files:o.map(e=>lZ(e))},...i&&{mask:lZ(i)}},successfulResponseHandler:aP(lB),failedResponseHandler:a$({errorSchema:sO(),errorToMessage:e=>{var t;return null!=(t=eh(e))?t:"unknown error"}}),...u&&{abortSignal:u},fetch:this.config.fetch});return{images:g.images,warnings:null!=(c=g.warnings)?c:[],providerMetadata:g.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:m},...null!=g.usage&&{usage:{inputTokens:null!=(d=g.usage.inputTokens)?d:void 0,outputTokens:null!=(p=g.usage.outputTokens)?p:void 0,totalTokens:null!=(f=g.usage.totalTokens)?f:void 0}}}}catch(e){throw await ll(e,await ld(null!=h?h:{}))}}getUrl(){return`${this.config.baseURL}/image-model`}getModelConfigHeaders(){return{"ai-image-model-specification-version":"4","ai-model-id":this.modelId}}};function lZ(e){return"file"===e.type&&e.data instanceof Uint8Array?{...e,data:rm(e.data)}:e}var lL=st({images:sR(i3()).optional()}).catchall(i3()),lU=so("type",[st({type:sp("unsupported"),feature:iT(),details:iT().optional()}),st({type:sp("compatibility"),feature:iT(),details:iT().optional()}),st({type:sp("deprecated"),setting:iT(),message:iT()}),st({type:sp("other"),message:iT()})]),lD=st({inputTokens:iK().nullish(),outputTokens:iK().nullish(),totalTokens:iK().nullish()}),lB=st({images:sR(iT()),warnings:sR(lU).optional(),providerMetadata:sl(iT(),lL).optional(),usage:lD.optional()}),lF=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v4",this.maxVideosPerCall=Number.MAX_SAFE_INTEGER}get provider(){return this.config.provider}async doGenerate(e){var t,r;let{headers:a,abortSignal:n}=e,o=this.config.headers?await aO(this.config.headers):void 0;try{let{responseHeaders:i,value:s}=await az({url:this.getUrl(),headers:rs(o,null!=a?a:{},this.getModelConfigHeaders(),await aO(this.config.o11yHeaders),{accept:"text/event-stream"}),body:this.buildRequestBody(e),successfulResponseHandler:async({response:e,url:t,requestBodyValues:r})=>{if(null==e.body)throw new eu({message:"SSE response body is empty",url:t,requestBodyValues:r,statusCode:e.status});let a=aS({stream:e.body,schema:lW}).getReader(),{done:n,value:o}=await a.read();if(a.releaseLock(),n||!o)throw new eu({message:"SSE stream ended without a data event",url:t,requestBodyValues:r,statusCode:e.status});if(!o.success)throw new eu({message:"Failed to parse video SSE event",cause:o.error,url:t,requestBodyValues:r,statusCode:e.status});let i=o.value;if("error"===i.type)throw new eu({message:i.message,statusCode:i.statusCode,url:t,requestBodyValues:r,responseHeaders:Object.fromEntries([...e.headers]),responseBody:JSON.stringify(i),data:{error:{message:i.message,type:i.errorType,param:i.param}}});return{value:{videos:i.videos,warnings:i.warnings,providerMetadata:i.providerMetadata},responseHeaders:Object.fromEntries([...e.headers])}},failedResponseHandler:a$({errorSchema:sO(),errorToMessage:e=>{var t;return null!=(t=eh(e))?t:"unknown error"}}),...n&&{abortSignal:n},fetch:this.config.fetch});return{videos:s.videos,warnings:null!=(t=s.warnings)?t:[],providerMetadata:null!=(r=s.providerMetadata)?r:void 0,response:{timestamp:new Date,modelId:this.modelId,headers:i}}}catch(e){throw await ll(e,await ld(null!=o?o:{}))}}async handleWebhookOption({webhook:e}){let{url:t,received:r}=await e();return{webhookUrl:t,received:r}}async doStart(e){var t,r;let{headers:a,abortSignal:n,webhookUrl:o}=e,i=this.config.headers?await aO(this.config.headers):void 0;try{let{responseHeaders:s,value:l}=await az({url:this.getStartUrl(),headers:rs(i,null!=a?a:{},this.getModelConfigHeaders(),await aO(this.config.o11yHeaders)),body:{...this.buildRequestBody(e),...o&&{callbackUrl:o}},successfulResponseHandler:aP(lG),failedResponseHandler:a$({errorSchema:sO(),errorToMessage:e=>{var t;return null!=(t=eh(e))?t:"unknown error"}}),...n&&{abortSignal:n},fetch:this.config.fetch});return{operation:l.operation,warnings:null!=(t=l.warnings)?t:[],providerMetadata:null!=(r=l.providerMetadata)?r:void 0,response:{timestamp:new Date,modelId:this.modelId,headers:s}}}catch(e){throw await ll(e,await ld(null!=i?i:{}))}}async doStatus({operation:e,abortSignal:t,headers:r}){var a,n,o,i,s,l;let u=this.config.headers?await aO(this.config.headers):void 0;try{let{responseHeaders:c,value:d}=await az({url:this.getStatusUrl(),headers:rs(u,null!=r?r:{},this.getModelConfigHeaders(),await aO(this.config.o11yHeaders)),body:{operation:e},successfulResponseHandler:aP(lY),failedResponseHandler:a$({errorSchema:sO(),errorToMessage:e=>{var t;return null!=(t=eh(e))?t:"unknown error"}}),...t&&{abortSignal:t},fetch:this.config.fetch}),p={timestamp:new Date,modelId:this.modelId,headers:c};if("completed"===d.status)return{status:"completed",videos:d.videos,warnings:null!=(a=d.warnings)?a:[],providerMetadata:null!=(n=d.providerMetadata)?n:void 0,response:p};if("error"===d.status)return{status:"error",error:d.error,providerMetadata:null!=(o=d.providerMetadata)?o:void 0,response:p};if("cancelled"===d.status)return{status:"error",error:"Video generation was cancelled.",providerMetadata:null!=(i=d.providerMetadata)?i:void 0,response:p};return{status:"pending",warnings:null!=(s=d.warnings)?s:[],providerMetadata:null!=(l=d.providerMetadata)?l:void 0,response:p}}catch(e){throw await ll(e,await ld(null!=u?u:{}))}}buildRequestBody({prompt:e,n:t,aspectRatio:r,resolution:a,duration:n,fps:o,seed:i,generateAudio:s,image:l,frameImages:u,inputReferences:c,providerOptions:d}){return{prompt:e,n:t,...r&&{aspectRatio:r},...a&&{resolution:a},...n&&{duration:n},...o&&{fps:o},...i&&{seed:i},...void 0!==s&&{generateAudio:s},...d&&{providerOptions:d},...l&&{image:lV(l)},...u&&{frameImages:u.map(e=>({...e,image:lV(e.image)}))},...c&&{inputReferences:c.map(e=>lV(e))}}}getUrl(){return`${this.config.baseURL}/video-model`}getStartUrl(){return`${this.config.baseURL}/video-model/start`}getStatusUrl(){return`${this.config.baseURL}/video-model/status`}getModelConfigHeaders(){return{"ai-video-model-specification-version":"4","ai-model-id":this.modelId}}};function lV(e){return"file"===e.type&&e.data instanceof Uint8Array?{...e,data:rm(e.data)}:e}var lq=st({videos:sR(i3()).optional()}).catchall(i3()),lH=s$([st({type:sp("url"),url:iT(),mediaType:iT()}),st({type:sp("base64"),data:iT(),mediaType:iT()})]),lJ=so("type",[st({type:sp("unsupported"),feature:iT(),details:iT().optional()}),st({type:sp("compatibility"),feature:iT(),details:iT().optional()}),st({type:sp("deprecated"),setting:iT(),message:iT()}),st({type:sp("other"),message:iT()})]),lW=so("type",[st({type:sp("result"),videos:sR(lH),warnings:sR(lJ).optional(),providerMetadata:sl(iT(),lq).optional()}),st({type:sp("error"),message:iT(),errorType:iT(),statusCode:iK(),param:i3().nullable()})]),lG=st({operation:i3(),warnings:sR(lJ).nullish(),providerMetadata:sl(iT(),lq).nullish()}),lY=so("status",[st({status:sp("pending"),warnings:sR(lJ).nullish(),providerMetadata:sl(iT(),lq).nullish()}),st({status:sp("completed"),videos:sR(lH),warnings:sR(lJ).nullish(),providerMetadata:sl(iT(),lq).nullish()}),st({status:sp("error"),error:iT(),providerMetadata:sl(iT(),lq).nullish()}),st({status:sp("cancelled"),providerMetadata:sl(iT(),lq).nullish()})]),lK=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v4"}get provider(){return this.config.provider}async doRerank({documents:e,query:t,topN:r,headers:a,abortSignal:n,providerOptions:o}){var i;let s=this.config.headers?await aO(this.config.headers):void 0;try{let{responseHeaders:l,value:u,rawValue:c}=await az({url:this.getUrl(),headers:rs(s,null!=a?a:{},this.getModelConfigHeaders(),await aO(this.config.o11yHeaders)),body:{documents:e,query:t,...null!=r?{topN:r}:{},...o?{providerOptions:o}:{}},successfulResponseHandler:aP(lQ),failedResponseHandler:a$({errorSchema:sO(),errorToMessage:e=>{var t;return null!=(t=eh(e))?t:"unknown error"}}),...n&&{abortSignal:n},fetch:this.config.fetch});return{ranking:u.ranking,providerMetadata:u.providerMetadata,response:{headers:l,body:c},warnings:null!=(i=u.warnings)?i:[]}}catch(e){throw await ll(e,await ld(null!=s?s:{}))}}getUrl(){return`${this.config.baseURL}/reranking-model`}getModelConfigHeaders(){return{"ai-reranking-model-specification-version":"4","ai-model-id":this.modelId}}},lX=so("type",[st({type:sp("unsupported"),feature:iT(),details:iT().optional()}),st({type:sp("compatibility"),feature:iT(),details:iT().optional()}),st({type:sp("deprecated"),setting:iT(),message:iT()}),st({type:sp("other"),message:iT()})]),lQ=av(()=>a_(st({ranking:sR(st({index:iK(),relevanceScore:iK()})),warnings:sR(lX).optional(),providerMetadata:sl(iT(),sl(iT(),i3())).optional()}))),l0=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v4"}get provider(){return this.config.provider}async doGenerate({text:e,voice:t,outputFormat:r,instructions:a,speed:n,language:o,providerOptions:i,headers:s,abortSignal:l}){var u;let c=this.config.headers?await aO(this.config.headers):void 0;try{let{responseHeaders:d,value:p,rawValue:f}=await az({url:this.getUrl(),headers:rs(c,null!=s?s:{},this.getModelConfigHeaders(),await aO(this.config.o11yHeaders)),body:{text:e,...t&&{voice:t},...r&&{outputFormat:r},...a&&{instructions:a},...null!=n&&{speed:n},...o&&{language:o},...i&&{providerOptions:i}},successfulResponseHandler:aP(l5),failedResponseHandler:a$({errorSchema:sO(),errorToMessage:e=>{var t;return null!=(t=eh(e))?t:"unknown error"}}),...l&&{abortSignal:l},fetch:this.config.fetch});return{audio:p.audio,warnings:null!=(u=p.warnings)?u:[],providerMetadata:p.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:d,body:f}}}catch(e){throw await ll(e,await ld(null!=c?c:{}))}}getUrl(){return`${this.config.baseURL}/speech-model`}getModelConfigHeaders(){return{"ai-speech-model-specification-version":"4","ai-model-id":this.modelId}}},l1=st({}).catchall(i3()),l2=so("type",[st({type:sp("unsupported"),feature:iT(),details:iT().optional()}),st({type:sp("compatibility"),feature:iT(),details:iT().optional()}),st({type:sp("deprecated"),setting:iT(),message:iT()}),st({type:sp("other"),message:iT()})]),l5=st({audio:iT(),warnings:sR(l2).optional(),providerMetadata:sl(iT(),l1).optional()}),l4=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v4"}get provider(){return this.config.provider}async doGenerate({audio:e,mediaType:t,providerOptions:r,headers:a,abortSignal:n}){var o,i,s,l;let u=this.config.headers?await aO(this.config.headers):void 0;try{let{responseHeaders:c,value:d,rawValue:p}=await az({url:this.getUrl(),headers:rs(u,null!=a?a:{},this.getModelConfigHeaders(),await aO(this.config.o11yHeaders)),body:{audio:e instanceof Uint8Array?rm(e):e,mediaType:t,...r&&{providerOptions:r}},successfulResponseHandler:aP(l9),failedResponseHandler:a$({errorSchema:sO(),errorToMessage:e=>{var t;return null!=(t=eh(e))?t:"unknown error"}}),...n&&{abortSignal:n},fetch:this.config.fetch});return{text:d.text,segments:null!=(o=d.segments)?o:[],language:null!=(i=d.language)?i:void 0,durationInSeconds:null!=(s=d.durationInSeconds)?s:void 0,warnings:null!=(l=d.warnings)?l:[],providerMetadata:d.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:c,body:p}}}catch(e){throw await ll(e,await ld(null!=u?u:{}))}}async doStream(e){var t,r,a,n,o;let i,s,l,u=null!=(a=null==(r=null==(t=this.config._internal)?void 0:t.currentDate)?void 0:r.call(t))?a:new Date,c=rs(await aO(null!=(n=this.config.headers)?n:{}),null!=(o=e.headers)?o:{},this.getModelConfigHeaders(),await aO(this.config.o11yHeaders)),d=await ld(c),p={type:"transcription-stream.start",inputAudioFormat:e.inputAudioFormat,...null!=e.providerOptions&&{providerOptions:e.providerOptions},...null!=e.includeRawChunks&&{includeRawChunks:e.includeRawChunks}};return{stream:function({webSocket:e,url:t,protocols:r,headers:a,startFrame:n,audio:o,abortSignal:i,authMethod:s}){let l=!1,u=()=>{};return new ReadableStream({start:c=>{let d,p,f,h=!1,m=!1;u=e=>{null!=d?d.cancel().catch(()=>{}):o.cancel().catch(()=>{}),null==f||f.close(e)};let g=e=>{l||(l=!0,u(),l7(c,e,s))},y=async e=>{let t=o.getReader();d=t;try{for(;;){let{done:r,value:a}=await t.read();if(r||l)break;let n="string"==typeof a?function(e){let t=rh(e.replace(/-/g,"+").replace(/_/g,"/"));return Uint8Array.from(t,e=>e.codePointAt(0))}(a):a;for(let t=0;t<n.length&&!l;t+=65536)e.send(n.subarray(t,t+65536)),await rp(e)}}finally{t.releaseLock(),d===t&&(d=void 0)}l||m||e.send(JSON.stringify({type:"transcription-stream.audio-done"}))};f=function({url:e,protocols:t,headers:r,webSocket:a,abortSignal:n,onOpen:o,onMessageText:i,onProcessingError:s,onSocketError:l,onClose:u,onAbort:c}){var d,p;let f,h,m=e=>{null!=h&&(null==n||n.removeEventListener("abort",h),h=void 0);try{null==f||f.close(e)}catch(e){}};if(null==n?void 0:n.aborted)return null==c||c(null!=(d=n.reason)?d:Error("Aborted")),{socket:void 0,close:m};try{f=new(function(e){let t=null!=e?e:globalThis.WebSocket;if(null==t)throw Error("No WebSocket implementation available.");return t}(a))(e,t,{headers:(p=null!=r?r:{},Object.fromEntries(Object.entries(p).filter(([e,t])=>null!=t)))})}catch(e){return s(e),{socket:void 0,close:m}}null!=n&&null!=c&&(h=()=>{var e;return c(null!=(e=n.reason)?e:Error("Aborted"))},n.addEventListener("abort",h,{once:!0}));let g=f;f.onopen=()=>{try{null==o||o(g)}catch(e){s(e)}};let y=Promise.resolve();return f.onmessage=e=>{y=y.then(()=>rd(e.data)).then(e=>i(e)).catch(s)},f.onerror=()=>{y=y.then(()=>null==l?void 0:l()).catch(s)},f.onclose=e=>{let t="number"==typeof(null==e?void 0:e.code)?e.code:void 0,r="string"==typeof(null==e?void 0:e.reason)?e.reason:void 0;y=y.then(()=>null==u?void 0:u({code:t,reason:r})).catch(s)},{socket:f,close:m}}({url:t,protocols:r,headers:a,webSocket:e,abortSignal:i,onAbort:e=>{l||(l=!0,u(),c.error(e))},onProcessingError:g,onOpen:e=>{e.send(JSON.stringify(n)),y(e).catch(g)},onMessageText:e=>{if(l)return;let t=function(e){let t;try{t=rX(e)}catch(e){return}if(null==t||"object"!=typeof t||Array.isArray(t))return;let r=t;switch(r.type){case"stream-start":return Array.isArray(r.warnings)&&r.warnings.every(aH)?r:void 0;case"transcript-delta":return aF(r.delta)&&aq(r.id,aF)&&aq(r.providerMetadata,rH)?r:void 0;case"transcript-partial":return aF(r.text)&&aq(r.id,aF)&&aq(r.startSecond,aV)&&aq(r.durationInSeconds,aV)&&aq(r.channelIndex,aV)&&aq(r.providerMetadata,rH)?r:void 0;case"transcript-final":return aF(r.text)&&aq(r.id,aF)&&aq(r.startSecond,aV)&&aq(r.endSecond,aV)&&aq(r.channelIndex,aV)&&aq(r.providerMetadata,rH)?r:void 0;case"finish":return aF(r.text)&&Array.isArray(r.segments)&&r.segments.every(aJ)&&aq(r.language,aF)&&aq(r.durationInSeconds,aV)&&aq(r.providerMetadata,rH)?r:void 0;case"response-metadata":{if(!(aq(r.modelId,aF)&&aq(r.headers,rH)))return;let e=r.timestamp;if(null==e)return{...r,timestamp:void 0};if("string"!=typeof e)return;let t=new Date(e);return Number.isNaN(t.getTime())?void 0:{...r,timestamp:t}}case"raw":return"rawValue"in r?r:void 0;case"error":return"error"in r?r:void 0;default:return}}(e);if(null!=t){if("finish"===t.type){l=!0,c.enqueue(t),c.close(),u(1e3);return}"error"===t.type&&(h=!0,p=t.error,m=!0,null!=d?(d.cancel().catch(()=>{}),d=void 0):o.cancel().catch(()=>{})),c.enqueue(t)}},onSocketError:()=>{g(Error("Connection error on AI Gateway transcription stream"))},onClose:()=>{if(h){if(l)return;ut(p,s).then(g);return}g(Error("AI Gateway transcription stream closed before a finish part was received"))}})},cancel:()=>{l||(l=!0,u())}})}({webSocket:this.config.webSocket,url:l3(this.config.baseURL,this.modelId),protocols:null==(l=(null==(s=(i=rB(c)).authorization)?void 0:s.startsWith("Bearer "))?s.slice(7):void 0)?[sT]:sM(sT,l,{teamIdOrSlug:i[lc]}),headers:c,startFrame:p,audio:e.audio,abortSignal:e.abortSignal,authMethod:d}),request:{body:p},response:{timestamp:u,modelId:this.modelId}}}getUrl(){return`${this.config.baseURL}/transcription-model`}getModelConfigHeaders(){return{"ai-transcription-model-specification-version":"4","ai-model-id":this.modelId}}};function l3(e,t){let r=new URL(`${e.replace(/^http/,"ws")}/transcription-model`);return r.searchParams.set("ai-model-id",t),r.toString()}var l8=st({}).catchall(i3()),l6=so("type",[st({type:sp("unsupported"),feature:iT(),details:iT().optional()}),st({type:sp("compatibility"),feature:iT(),details:iT().optional()}),st({type:sp("deprecated"),setting:iT(),message:iT()}),st({type:sp("other"),message:iT()})]),l9=st({text:iT(),segments:sR(st({text:iT(),startSecond:iK(),endSecond:iK()})).optional(),language:iT().nullish(),durationInSeconds:iK().nullish(),warnings:sR(l6).optional(),providerMetadata:sl(iT(),l8).optional()});async function l7(e,t,r){e.error(await ll(t,r))}var ue={authentication_error:401,failed_dependency:424,forbidden:403,internal_server_error:500,invalid_request_error:400,model_not_found:404,rate_limit_exceeded:429};async function ut(e,t){return"object"==typeof e&&null!=e&&"message"in e&&"string"==typeof e.message&&"type"in e&&"string"==typeof e.type&&e.type in ue?lr({response:{error:{message:e.message,type:e.type}},statusCode:ue[e.type],authMethod:t}):Error(`AI Gateway transcription stream failed: ${null!=e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message?e.message:eh(e)}`)}var ur=class{constructor(e,t){this.specificationVersion="v4",this.modelId=e,this.provider=t.provider,this.config=t}async doCreateClientSecret(e){var t,r;let a,n=await this.config.createClientSecret({modelId:this.modelId,...(null==e?void 0:e.expiresAfterSeconds)!=null&&{expiresAfterSeconds:e.expiresAfterSeconds}});return{token:n.token,url:(t=this.config.baseURL,r=this.modelId,(a=new URL(`${t.replace(/^http/,"ws")}/realtime-model`)).searchParams.set("ai-model-id",r),a.toString()),...null!=n.expiresAt&&{expiresAt:n.expiresAt}}}getWebSocketConfig(e){return{url:e.url,protocols:sM("ai-gateway-realtime.v1",e.token,{teamIdOrSlug:this.config.teamIdOrSlug})}}parseServerEvent(e){return e}serializeClientEvent(e){return e}buildSessionConfig(e){return e}},ua=aM({id:"gateway.exa_search",inputSchema:av(()=>a_(st({query:iT().describe("Natural-language web search query. This is required."),type:sC(["auto","fast","instant"]).optional().describe("Search method. Use auto for the default balance of speed and quality."),num_results:iK().optional().describe("Maximum number of results to return (1-100, default: 10)."),category:sC(["company","people","research paper","news","personal site","financial report"]).optional().describe("Optional content category to focus results."),user_location:iT().optional().describe("Two-letter ISO country code such as 'US'."),include_domains:sR(iT()).optional().describe("Only return results from these domains."),exclude_domains:sR(iT()).optional().describe("Exclude results from these domains."),start_published_date:iT().optional().describe("Only return links published after this ISO 8601 date."),end_published_date:iT().optional().describe("Only return links published before this ISO 8601 date."),contents:st({text:s$([i1(),st({max_characters:iK().optional(),include_html_tags:i1().optional(),verbosity:sC(["compact","standard","full"]).optional(),include_sections:sR(sC(["header","navigation","banner","body","sidebar","footer","metadata"])).optional(),exclude_sections:sR(sC(["header","navigation","banner","body","sidebar","footer","metadata"])).optional()})]).optional(),highlights:s$([i1(),st({query:iT().optional(),max_characters:iK().optional()})]).optional(),max_age_hours:iK().optional(),livecrawl_timeout:iK().optional(),subpages:iK().optional(),subpage_target:s$([iT(),sR(iT())]).optional(),extras:st({links:iK().optional(),image_links:iK().optional()}).optional()}).optional().describe("Controls extracted page content and freshness.")}))),outputSchema:av(()=>a_(s$([st({requestId:iT(),searchType:iT().optional(),resolvedSearchType:iT().optional(),results:sR(st({title:iT(),url:iT(),id:iT(),publishedDate:iT().nullable().optional(),author:iT().nullable().optional(),image:iT().nullable().optional(),favicon:iT().nullable().optional(),text:iT().optional(),highlights:sR(iT()).optional(),highlightScores:sR(iK()).optional(),summary:iT().optional(),subpages:sR(sO()).optional(),extras:st({links:sR(iT()).optional(),imageLinks:sR(iT()).optional()}).optional()})),costDollars:st({total:iK().optional(),search:sl(iT(),iK()).optional()}).optional()}),st({error:sC(["api_error","rate_limit","timeout","invalid_input","configuration_error","execution_error","unknown"]),statusCode:iK().optional(),message:iT()})])))}),un=aM({id:"gateway.parallel_search",inputSchema:av(()=>a_(st({objective:iT().describe("Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."),search_queries:sR(iT()).optional().describe("Optional search queries to supplement the objective. Maximum 200 characters per query."),mode:sC(["one-shot","agentic"]).optional().describe('Mode preset: "one-shot" for comprehensive results with longer excerpts (default), "agentic" for concise, token-efficient results for multi-step workflows.'),max_results:iK().optional().describe("Maximum number of results to return (1-20). Defaults to 10 if not specified."),source_policy:st({include_domains:sR(iT()).optional().describe("Limit results to these domains. Use plain domain names only — e.g. example.com or sub.example.gov, or a bare extension like .edu. Do not include a scheme, path, or port (e.g. not https://example.com/page)."),exclude_domains:sR(iT()).optional().describe("Exclude results from these domains. Use plain domain names only — e.g. example.com or sub.example.gov, or a bare extension like .edu. Do not include a scheme, path, or port (e.g. not https://example.com/page)."),after_date:iT().optional().describe("Only include results published after this date. Use an ISO 8601 calendar date formatted YYYY-MM-DD (e.g. 2025-01-01); do not include a time.")}).optional().describe("Source policy for controlling which domains to include/exclude and freshness."),excerpts:st({max_chars_per_result:iK().optional().describe("Maximum characters per result."),max_chars_total:iK().optional().describe("Maximum total characters across all results.")}).optional().describe("Excerpt configuration for controlling result length."),fetch_policy:st({max_age_seconds:iK().optional().describe("Maximum age in seconds for cached content. Set to 0 to always fetch fresh content.")}).optional().describe("Fetch policy for controlling content freshness.")}))),outputSchema:av(()=>a_(s$([st({searchId:iT(),results:sR(st({url:iT(),title:iT(),excerpt:iT(),publishDate:iT().nullable().optional(),relevanceScore:iK().optional()}))}),st({error:sC(["api_error","rate_limit","timeout","invalid_input","configuration_error","unknown"]),statusCode:iK().optional(),message:iT()})])))}),uo=aM({id:"gateway.perplexity_search",inputSchema:av(()=>a_(st({query:s$([iT(),sR(iT())]).describe("Search query (string) or multiple queries (array of up to 5 strings). Multi-query searches return combined results from all queries."),max_results:iK().optional().describe("Maximum number of search results to return (1-20, default: 10)"),max_tokens_per_page:iK().optional().describe("Maximum number of tokens to extract per search result page (256-2048, default: 2048)"),max_tokens:iK().optional().describe("Maximum total tokens across all search results (default: 25000, max: 1000000)"),country:iT().optional().describe("Two-letter ISO 3166-1 alpha-2 country code for regional search results (e.g., 'US', 'GB', 'FR')"),search_domain_filter:sR(iT()).optional().describe("List of domains to include or exclude from search results (max 20). To include: ['nature.com', 'science.org']. To exclude: ['-example.com', '-spam.net']"),search_language_filter:sR(iT()).optional().describe("List of ISO 639-1 language codes to filter results (max 10, lowercase). Examples: ['en', 'fr', 'de']"),search_after_date:iT().optional().describe("Include only results published after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),search_before_date:iT().optional().describe("Include only results published before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),last_updated_after_filter:iT().optional().describe("Include only results last updated after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),last_updated_before_filter:iT().optional().describe("Include only results last updated before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),search_recency_filter:sC(["day","week","month","year"]).optional().describe("Filter results by relative time period. Cannot be used with search_after_date or search_before_date.")}))),outputSchema:av(()=>a_(s$([st({results:sR(st({title:iT(),url:iT(),snippet:iT(),date:iT().optional(),lastUpdated:iT().optional()})),id:iT()}),st({error:sC(["api_error","rate_limit","timeout","invalid_input","unknown"]),statusCode:iK().optional(),message:iT()})])))}),ui=st({count:iK().optional().describe("Maximum number of data results to return (1-20). When include_contents is true, each additional result adds its own data surcharge."),include_contents:i1().optional().describe("Inline rows for each data result. This adds a data surcharge based on row count and dataset source. To estimate cost, search with include_contents disabled and inspect cards.content.export_pricing. This applies to every returned card; limit sources.data.count and sources.data.max_rows to control cost."),mode:sC(["inline","url"]).optional().describe("Requested data delivery mode. Search card data is always inline."),content_format:sC(["card_json","csv","json_compact","json_records"]).optional().describe("Serialization for inlined card data."),max_rows:iK().optional().describe("Maximum rows to inline per result. Omit to use the allowance in cards.content.export_pricing. A data surcharge applies per 1,000 exported rows; lower values reduce cost."),node_ids:sR(iT()).optional().describe("Data Graph node IDs to prioritize. Maximum 20."),strict:i1().optional().describe("Only return cards matching node_ids. Requires a non-empty node_ids.")}),us=st({count:iK().optional().describe("Maximum number of web results to return (1-20)."),include_contents:i1().optional().describe("Inline extracted web page text. This can add a data charge."),category:sC(["finance","news","sports"]).optional().describe("Optional web-result category filter."),include_domains:sR(iT()).optional().describe("Only return results from these bare domains."),exclude_domains:sR(iT()).optional().describe("Exclude results from these bare domains."),snippet_max_chars:iK().optional().describe("Maximum characters in each web-result snippet."),highlights:i1().optional().describe("Include highlighted passages in web results. Defaults to true in AI Gateway."),article_content_max_chars:iK().optional().describe("Maximum extracted characters per web page when including contents."),published_after:iT().optional().describe("Keep results published on or after this ISO date (YYYY-MM-DD)."),published_before:iT().optional().describe("Keep results published on or before this ISO date (YYYY-MM-DD).")}),ul=av(()=>a_(st({query:iT().describe('Natural-language search query. Include the entity, metric, and time period. Quote a phrase to force it to one entity, for example "Tesla":PRODUCT price.'),effort:sC(["deep","fast","instant"]).optional().describe("Search effort. fast is the balanced default, instant favors cached results and low latency, and deep broadens retrieval with reranking at higher cost and latency."),sources:st({data:ui.optional(),web:us.optional()}).optional().describe("Sources to search. Omit to search both curated data and the web. When provided, only keys present are searched."),location:st({latitude:iK().describe("Latitude between -90 and 90."),longitude:iK().describe("Longitude between -180 and 180.")}).optional().describe("End-user coordinates for localized results."),country_code:iT().optional().describe("Two-letter ISO 3166-1 country code, such as 'US'."),locale:iT().optional().describe("BCP-47 locale, such as 'en-US'."),timezone:iT().optional().describe("IANA timezone, such as 'America/New_York'."),output_settings:st({image_dark_mode:i1().optional().describe("Render card preview images in dark mode."),force_refresh:i1().optional().describe("Instant-effort only. Request a refreshed instant result.")}).optional().describe("Controls card rendering in the search response."),include_related:iK().optional().describe("Maximum related search suggestions to include (1-20).")}))),uu=s$([i1(),iK(),iT()]).nullable(),uc=st({content_format:sC(["card_json","csv","json_compact","json_records"]).nullish(),cost:iK().optional(),data:iT().nullish(),records:sR(sl(iT(),uu)).nullish(),dataset:st({columns:sR(st({name:iT(),type:sC(["boolean","date","datetime","number","string"]),unit:iT().nullish()})),rows:sR(sR(uu)),total_rows:iK(),truncated:i1(),ref:iT(),sources:sR(st({name:iT(),index:sC(["data","web"]).optional()})),provenance:sC(["query","web_extraction"]).optional()}).nullish(),card_data:st({}).passthrough().nullish(),card_data_schema:st({}).passthrough().nullish(),url:iT().nullish(),expires_at:iT().nullish(),total_rows:iK().nullish(),truncated:i1().optional(),export_pricing:st({baseline_usd:iK(),free_rows:iK(),max_rows_ceiling:iK(),row_cpm_usd:iK()}).nullish(),manifest:sR(st({dtype:sC(["boolean","date","datetime","number","string"]).nullish(),entity:iT().nullish(),metric:iT().nullish(),name:iT().nullish(),unit:iT().nullish()})).nullish()}).passthrough(),ud=st({card_id:iT().nullish(),title:iT().nullish(),description:iT().nullish(),semantic_description:iT().nullish(),webpage_url:iT().nullish(),image_url:iT().nullish(),embed_url:iT().nullish(),sources:sR(st({source_name:iT().nullish(),source_description:iT().nullish(),source_index:sC(["data","web"]),source_text:iT().nullish(),url:iT().nullish()})).nullish(),methodologies:sR(st({methodology_name:iT().nullable(),methodology_description:iT().nullable()})).nullish(),source_indexes:sR(sC(["data","web"])).nullish(),card_type:iT().nullish(),relevance:sC(["High","Low","Medium"]).nullish(),content:uc.nullish(),exportable:i1().optional(),nodes:sR(st({id:iT(),type:sC(["entity","metric"]),name:iT(),description:iT().nullish()})).nullish(),metric_definitions:sR(st({name:iT(),definition:iT()})).nullish(),data_freshness:st({coverage_end:iT().nullish(),data_as_of:iT().nullish(),last_updated:iT().nullish()}).nullish()}).passthrough(),up=st({title:iT(),url:iT(),snippet:iT().nullish(),source_name:iT().nullish(),publish_date:iT().nullish(),content:uc.nullish()}).passthrough(),uf=aM({id:"gateway.tako_search",inputSchema:ul,outputSchema:av(()=>a_(s$([st({request_id:iT(),cards:sR(ud).optional(),web_results:sR(up).optional(),usage:st({total_cost_usd:iK(),compute:st({cost_usd:iK()}).nullish(),data:st({cost_usd:iK(),datasets:iK()}).nullish()}).nullish(),related:sR(st({}).passthrough()).nullish()}).passthrough(),st({error:sC(["api_error","configuration_error","execution_error","invalid_input","rate_limit","timeout","unknown_tool"]),statusCode:iK().optional(),message:iT()})])))}),uh={exaSearch:(e={})=>ua(e),parallelSearch:(e={})=>un(e),perplexitySearch:(e={})=>uo(e),takoSearch:(e={})=>uf(e)};async function um(){var e;return null==(e=(0,sz.getContext)().headers)?void 0:e["x-vercel-id"]}var ug=st({token:iT(),expiresAt:iK().nullish()});async function uy(e){let t=rJ({settingValue:e.apiKey,environmentVariableName:"AI_GATEWAY_API_KEY"});return t?{token:t,authMethod:"api-key"}:{token:await (0,sz.getVercelOidcToken)(),authMethod:"oidc"}}!function(e={}){var t,r,a;let n=null,o=null,i=null!=(t=e.metadataCacheRefreshMillis)?t:3e5,s=0,l=null!=(r=null==(a=e.baseURL)?void 0:a.replace(/\/$/,""))?r:"https://ai-gateway.vercel.sh/v4/ai",u=t=>rF({Authorization:`Bearer ${t.token}`,"ai-gateway-protocol-version":"0.0.1",[lu]:t.authMethod,...null!=e.teamIdOrSlug?{[lc]:e.teamIdOrSlug}:{},...e.headers},"ai-sdk/gateway/4.0.67"),c=async()=>{try{return u(await uy(e))}catch(e){throw sL.createContextualError({apiKeyProvided:!1,oidcTokenProvided:!1,statusCode:401,cause:e})}},d=async()=>{try{return await uy(e)}catch(e){throw sL.createContextualError({apiKeyProvided:!1,oidcTokenProvided:!1,statusCode:401,cause:e})}},p=async t=>{if(void 0!==globalThis.window)throw Error("AI Gateway client secrets must be minted server-side: minting needs your Gateway credential, which must never reach the browser. Call gateway.experimental_realtime.getToken() or gateway.experimental_transcription.getToken() from your server and pass the returned token to the client.");let r=u(await d()),a=new URL("/v1/realtime/client-secrets",l).toString();try{let{value:n}=await az({url:a,headers:r,body:{model:t.modelId,...null!=t.routeKind&&{routeKind:t.routeKind},...null!=t.expiresAfterSeconds&&{expiresIn:t.expiresAfterSeconds}},successfulResponseHandler:aP(ug),failedResponseHandler:a$({errorSchema:sO(),errorToMessage:e=>{var t;return null!=(t=eh(e))?t:"unknown error"}}),fetch:e.fetch});return{token:n.token,...null!=n.expiresAt&&{expiresAt:n.expiresAt}}}catch(e){throw await ll(e,await ld(r))}},f=()=>{let e=rJ({settingValue:void 0,environmentVariableName:"VERCEL_DEPLOYMENT_ID"}),t=rJ({settingValue:void 0,environmentVariableName:"VERCEL_ENV"}),r=rJ({settingValue:void 0,environmentVariableName:"VERCEL_REGION"}),a=rJ({settingValue:void 0,environmentVariableName:"VERCEL_PROJECT_ID"});return async()=>{let n=await um();return{...e&&{"ai-o11y-deployment-id":e},...t&&{"ai-o11y-environment":t},...r&&{"ai-o11y-region":r},...n&&{"ai-o11y-request-id":n},...a&&{"ai-o11y-project-id":a}}}},h=t=>new lE(t,{provider:"gateway",baseURL:l,headers:c,fetch:e.fetch,o11yHeaders:f()}),m=async()=>{var t,r,a;let u=null!=(a=null==(r=null==(t=e._internal)?void 0:t.currentDate)?void 0:r.call(t).getTime())?a:Date.now();return(!n||u-s>i)&&(s=u,n=new lh({baseURL:l,headers:c,fetch:e.fetch}).getAvailableModels().then(e=>(o=e,e)).catch(async e=>{throw await ll(e,await ld(await c()))})),o?Promise.resolve(o):n},g=async()=>new lh({baseURL:l,headers:c,fetch:e.fetch}).getCredits().catch(async e=>{throw await ll(e,await ld(await c()))}),y=async t=>new ly({baseURL:l,headers:c,fetch:e.fetch}).getSpendReport(t).catch(async e=>{throw await ll(e,await ld(await c()))}),v=async t=>new lb({baseURL:l,headers:c,fetch:e.fetch}).getGenerationInfo(t).catch(async e=>{throw await ll(e,await ld(await c()))}),b=function(e){if(new.target)throw Error("The Gateway Provider model function cannot be called with the new keyword.");return h(e)};b.specificationVersion="v4",b.getAvailableModels=m,b.getCredits=g,b.getSpendReport=y,b.getGenerationInfo=v,b.imageModel=t=>new lj(t,{provider:"gateway",baseURL:l,headers:c,fetch:e.fetch,o11yHeaders:f()}),b.languageModel=h;let w=t=>new l$(t,{provider:"gateway",baseURL:l,headers:c,fetch:e.fetch,o11yHeaders:f()});b.embeddingModel=w,b.textEmbeddingModel=w,b.videoModel=t=>new lF(t,{provider:"gateway",baseURL:l,headers:c,fetch:e.fetch,o11yHeaders:f()});let _=t=>new lK(t,{provider:"gateway",baseURL:l,headers:c,fetch:e.fetch,o11yHeaders:f()});b.rerankingModel=_,b.reranking=_;let k=t=>new l0(t,{provider:"gateway",baseURL:l,headers:c,fetch:e.fetch,o11yHeaders:f()});b.speechModel=k,b.speech=k;let E=t=>new l4(t,{provider:"gateway",baseURL:l,headers:c,fetch:e.fetch,o11yHeaders:f(),webSocket:e.webSocket});b.transcriptionModel=E,b.transcription=E,b.experimental_transcription=Object.assign(e=>E(e),{getToken:async e=>{let t=await p({modelId:e.model,routeKind:"transcription",...null!=e.expiresAfterSeconds&&{expiresAfterSeconds:e.expiresAfterSeconds}});return{token:t.token,url:l3(l,e.model),...null!=t.expiresAt&&{expiresAt:t.expiresAt}}}});let x=t=>new ur(t,{provider:"gateway.realtime",baseURL:l,teamIdOrSlug:e.teamIdOrSlug,createClientSecret:p});b.experimental_realtime=Object.assign(e=>x(e),{getToken:async e=>{let{model:t,...r}=e,a=x(t),n=await a.doCreateClientSecret(r);return{token:n.token,url:n.url,...null!=n.expiresAt&&{expiresAt:n.expiresAt}}}}),b.chat=b.languageModel,b.embedding=b.embeddingModel,b.image=b.imageModel,b.video=b.videoModel,b.tools=uh}();var uv=Object.defineProperty,ub=(Symbol.for("vercel.ai.error.AI_InvalidArgumentError"),Symbol.for("vercel.ai.error.AI_InvalidStreamPartError"),Symbol.for("vercel.ai.error.AI_InvalidToolApprovalError"),Symbol.for("vercel.ai.error.AI_InvalidToolApprovalSignatureError"),Symbol.for("vercel.ai.error.AI_InvalidToolInputError"),Symbol.for("vercel.ai.error.AI_ToolCallNotFoundForApprovalError"),Symbol.for("vercel.ai.error.AI_MissingToolResultsError"),Symbol.for("vercel.ai.error.AI_NoImageGeneratedError"),"AI_NoObjectGeneratedError"),uw=`vercel.ai.error.${ub}`,u_=Symbol.for(uw),uk=class extends eo{constructor({message:e="No object generated.",cause:t,text:r,response:a,usage:n,finishReason:o}){super({name:ub,message:e,cause:t}),this[B]=!0,this.text=r,this.response=a,this.usage=n,this.finishReason=o}static isInstance(e){return eo.hasMarker(e,uw)}};B=u_,Symbol.for("vercel.ai.error.AI_NoOutputGeneratedError"),Symbol.for("vercel.ai.error.AI_NoSpeechGeneratedError"),Symbol.for("vercel.ai.error.AI_NoTranscriptGeneratedError"),Symbol.for("vercel.ai.error.AI_NoTranslationGeneratedError"),Symbol.for("vercel.ai.error.AI_NoVideoGeneratedError"),Symbol.for("vercel.ai.error.AI_NoSuchToolError"),Symbol.for("vercel.ai.error.AI_StreamProviderError"),Symbol.for("vercel.ai.error.AI_ToolCallRepairError");var uE="AI_UIMessageStreamError",ux=`vercel.ai.error.${uE}`,uI=Symbol.for(ux),uS=class extends eo{constructor({chunkType:e,chunkId:t,message:r}){super({name:uE,message:r}),this[F]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return eo.hasMarker(e,ux)}};F=uI,Symbol.for("vercel.ai.error.AI_InvalidDataContentError"),Symbol.for("vercel.ai.error.AI_InvalidMessageRoleError"),Symbol.for("vercel.ai.error.AI_MessageConversionError"),Symbol.for("vercel.ai.error.AI_RetryError");var uA=async({url:e,maxBytes:t,abortSignal:r})=>{var a;let n=e.toString();try{let e=rF({},"ai-sdk/7.0.83",rD()),o=await rR({url:n,headers:e,abortSignal:r});if(!o.ok)throw await rg(o),new rw({url:n,statusCode:o.status,statusText:o.statusText});return{data:await rC({response:o,url:n,maxBytes:null!=t?t:0x80000000}),mediaType:null!=(a=o.headers.get("content-type"))?a:void 0}}catch(e){if(rw.isInstance(e))throw e;throw new rw({url:n,cause:e})}},uz=i7,uT=function(e,t){var r;let a;return r=e??(()=>!0),(a=e1(t)).abort??(a.abort=!0),new sA({type:"custom",check:"custom",fn:r,...a})},uM=sc,uO=function(e,t={}){let r=new sA({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...ib.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=t=>{t.value instanceof e||t.issues.push({code:"invalid_type",expected:e.name,input:t.value,inst:r,path:[...r._zod.def.path??[]]})},r},uR=function(e,t){return new se({type:"object",shape:e,catchall:i3(),...ib.normalizeParams(t)})},uC=sa,u$=new sS({type:"lazy",getter:()=>uC([new i2({type:"null",...e1(void 0)}),iT(),iK(),i1(),sl(iT(),u$.optional()),uz(u$)])}),uP=sl(iT(),sl(iT(),u$.optional())),uN=uC([iT(),uO(Uint8Array),uO(ArrayBuffer),uT(function(e){var t,r;return null!=(r=null==(t=globalThis.Buffer)?void 0:t.isBuffer(e))&&r},{message:"Must be a Buffer"})]),uj=sl(iT(),iT()),uZ=st({type:sp("text"),text:iT(),providerOptions:uP.optional()}),uL=st({type:sp("image"),image:uC([uN,uO(URL),uj]),mediaType:iT().optional(),providerOptions:uP.optional()}),uU=so("type",[st({type:sp("data"),data:uN}),st({type:sp("url"),url:uO(URL)}),st({type:sp("reference"),reference:uj}),st({type:sp("text"),text:iT()})]),uD=so("type",[st({type:sp("data"),data:uN}),st({type:sp("url"),url:uO(URL)})]),uB=st({type:sp("file"),data:uC([uU,uN,uO(URL),uj]),filename:iT().optional(),mediaType:iT(),providerOptions:uP.optional()}),uF=st({type:sp("reasoning"),text:iT(),providerOptions:uP.optional()}),uV=st({type:sp("custom"),kind:iT().transform(e=>e),providerOptions:uP.optional()}),uq=st({type:sp("reasoning-file"),data:uC([uD,uN,uO(URL)]),mediaType:iT(),providerOptions:uP.optional()}),uH=st({type:sp("tool-call"),toolCallId:iT(),toolName:iT(),input:i3(),providerOptions:uP.optional(),providerExecuted:i1().optional()}),uJ=so("type",[st({type:sp("text"),value:iT(),providerOptions:uP.optional()}),st({type:sp("json"),value:u$,providerOptions:uP.optional()}),st({type:sp("execution-denied"),reason:iT().optional(),providerOptions:uP.optional()}),st({type:sp("error-text"),value:iT(),providerOptions:uP.optional()}),st({type:sp("error-json"),value:u$,providerOptions:uP.optional()}),st({type:sp("content"),value:uz(uC([st({type:sp("text"),text:iT(),providerOptions:uP.optional()}),st({type:sp("file"),data:uU,mediaType:iT(),filename:iT().optional(),providerOptions:uP.optional()}),st({type:sp("file-data"),data:iT(),mediaType:iT(),filename:iT().optional(),providerOptions:uP.optional()}),st({type:sp("file-url"),url:iT(),mediaType:iT().optional(),providerOptions:uP.optional()}),st({type:sp("file-id"),fileId:uC([iT(),sl(iT(),iT())]),providerOptions:uP.optional()}),st({type:sp("file-reference"),providerReference:sl(iT(),iT()),providerOptions:uP.optional()}),st({type:sp("image-data"),data:iT(),mediaType:iT(),providerOptions:uP.optional()}),st({type:sp("image-url"),url:iT(),providerOptions:uP.optional()}),st({type:sp("image-file-id"),fileId:uC([iT(),sl(iT(),iT())]),providerOptions:uP.optional()}),st({type:sp("image-file-reference"),providerReference:sl(iT(),iT()),providerOptions:uP.optional()}),st({type:sp("custom"),providerOptions:uP.optional()})]))})]),uW=st({type:sp("tool-result"),toolCallId:iT(),toolName:iT(),output:uJ,providerOptions:uP.optional()}),uG=st({type:sp("tool-approval-request"),approvalId:iT(),toolCallId:iT(),reason:iT().optional()}),uY=st({type:sp("tool-approval-response"),approvalId:iT(),approved:i1(),reason:iT().optional()}),uK=st({role:sp("system"),content:iT(),providerOptions:uP.optional()}),uX=st({role:sp("user"),content:uC([iT(),uz(uC([uZ,uL,uB]))]),providerOptions:uP.optional()}),uQ=st({role:sp("assistant"),content:uC([iT(),uz(uC([uZ,uV,uB,uF,uq,uH,uW,uG]))]),providerOptions:uP.optional()}),u0=st({role:sp("tool"),content:uz(uC([uW,uY])),providerOptions:uP.optional()});uC([uK,uX,uQ,u0]);var u1={},u2={array:()=>u6,choice:()=>u9,json:()=>u7,object:()=>u8,text:()=>u3};for(var u5 in u2)uv(u1,u5,{get:u2[u5],enumerable:!0});async function u4(e){if(void 0===e)return{value:void 0,state:"undefined-input"};let t=await aI({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await aI({text:function(e){let t=["ROOT"],r=-1,a=null,n=0;function o(e,n,o){switch(e){case'"':r=n,t.pop(),t.push(o),t.push("INSIDE_STRING");break;case"f":case"t":case"n":r=n,a=n,t.pop(),t.push(o),t.push("INSIDE_LITERAL");break;case"-":t.pop(),t.push(o),t.push("INSIDE_NUMBER");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r=n,t.pop(),t.push(o),t.push("INSIDE_NUMBER");break;case"{":r=n,t.pop(),t.push(o),t.push("INSIDE_OBJECT_START");break;case"[":r=n,t.pop(),t.push(o),t.push("INSIDE_ARRAY_START")}}function i(e,a){switch(e){case",":t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break;case"}":r=a,t.pop()}}function s(e,a){switch(e){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":r=a,t.pop()}}for(let l=0;l<e.length;l++){let u=e[l];switch(t[t.length-1]){case"ROOT":o(u,l,"FINISH");break;case"INSIDE_OBJECT_START":switch(u){case'"':t.pop(),t.push("INSIDE_OBJECT_KEY");break;case"}":r=l,t.pop()}break;case"INSIDE_OBJECT_AFTER_COMMA":'"'===u&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break;case"INSIDE_OBJECT_KEY":'"'===u&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break;case"INSIDE_OBJECT_AFTER_KEY":":"===u&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break;case"INSIDE_OBJECT_BEFORE_VALUE":o(u,l,"INSIDE_OBJECT_AFTER_VALUE");break;case"INSIDE_OBJECT_AFTER_VALUE":i(u,l);break;case"INSIDE_STRING":switch(u){case'"':t.pop(),r=l;break;case"\\":t.push("INSIDE_STRING_ESCAPE");break;default:r=l}break;case"INSIDE_ARRAY_START":"]"===u?(r=l,t.pop()):(r=l,o(u,l,"INSIDE_ARRAY_AFTER_VALUE"));break;case"INSIDE_ARRAY_AFTER_VALUE":switch(u){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":r=l,t.pop();break;default:r=l}break;case"INSIDE_ARRAY_AFTER_COMMA":o(u,l,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_STRING_ESCAPE":t.pop(),"u"===u?(n=0,t.push("INSIDE_STRING_UNICODE_ESCAPE")):r=l;break;case"INSIDE_STRING_UNICODE_ESCAPE":(u>="0"&&u<="9"||u>="A"&&u<="F"||u>="a"&&u<="f")&&4==++n&&(t.pop(),r=l);break;case"INSIDE_NUMBER":switch(u){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r=l;break;case"e":case"E":case"-":case".":break;case",":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&s(u,l),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&i(u,l);break;case"}":t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&i(u,l);break;case"]":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&s(u,l);break;default:t.pop()}break;case"INSIDE_LITERAL":{let n=e.substring(a,l+1);"false".startsWith(n)||"true".startsWith(n)||"null".startsWith(n)?r=l:(t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]?i(u,l):"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&s(u,l))}}}let l=e.slice(0,r+1);for(let r=t.length-1;r>=0;r--)switch(t[r]){case"INSIDE_STRING":l+='"';break;case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":l+="}";break;case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":l+="]";break;case"INSIDE_LITERAL":{let t=e.substring(a,e.length);"true".startsWith(t)?l+="true".slice(t.length):"false".startsWith(t)?l+="false".slice(t.length):"null".startsWith(t)&&(l+="null".slice(t.length))}}return l}(e)})).success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"}}var u3=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),parseCompleteOutput:async({text:e})=>e,parsePartialOutput:async({text:e})=>({partial:e}),createElementStreamTransform(){}}),u8=({schema:e,name:t,description:r})=>{let a=aw(e);return{name:"object",responseFormat:aO(a.jsonSchema).then(e=>({type:"json",schema:e,...null!=t&&{name:t},...null!=r&&{description:r}})),async parseCompleteOutput({text:e},t){let r=await aI({text:e});if(!r.success)throw new uk({message:"No object generated: could not parse the response.",cause:r.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let n=await aE({value:r.value,schema:a});if(!n.success)throw new uk({message:"No object generated: response did not match schema.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return n.value},async parsePartialOutput({text:e}){let t=await u4(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:t.value}}},createElementStreamTransform(){}}},u6=({element:e,name:t,description:r})=>{let a=aw(e);return{name:"array",responseFormat:aO(a.jsonSchema).then(e=>{let{$schema:a,definitions:n,$defs:o,...i}=e;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",...null!=n&&{definitions:n},...null!=o&&{$defs:o},type:"object",properties:{elements:{type:"array",items:i}},required:["elements"],additionalProperties:!1},...null!=t&&{name:t},...null!=r&&{description:r}}}),async parseCompleteOutput({text:e},t){let r=await aI({text:e});if(!r.success)throw new uk({message:"No object generated: could not parse the response.",cause:r.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let n=r.value;if(null==n||"object"!=typeof n||!("elements"in n)||!Array.isArray(n.elements))throw new uk({message:"No object generated: response did not match schema.",cause:new ez({value:n,cause:"response must be an object with an elements array"}),text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let o=[];for(let r of n.elements){let n=await aE({value:r,schema:a});if(!n.success)throw new uk({message:"No object generated: response did not match schema.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});o.push(n.value)}return o},async parsePartialOutput({text:e}){let t=await u4(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let e=t.value;if(null==e||"object"!=typeof e||!("elements"in e)||!Array.isArray(e.elements))return;let r="repaired-parse"===t.state&&e.elements.length>0?e.elements.slice(0,-1):e.elements,n=[];for(let e of r){let t=await aE({value:e,schema:a});t.success&&n.push(t.value)}return{partial:n}}}},createElementStreamTransform(){let e=0;return new TransformStream({transform({partialOutput:t},r){if(null!=t)for(;e<t.length;e++)r.enqueue(t[e])}})}}},u9=({options:e,name:t,description:r})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...null!=t&&{name:t},...null!=r&&{description:r}}),async parseCompleteOutput({text:t},r){let a=await aI({text:t});if(!a.success)throw new uk({message:"No object generated: could not parse the response.",cause:a.error,text:t,response:r.response,usage:r.usage,finishReason:r.finishReason});let n=a.value;if(null==n||"object"!=typeof n||!("result"in n)||"string"!=typeof n.result||!e.includes(n.result))throw new uk({message:"No object generated: response did not match schema.",cause:new ez({value:n,cause:"response must be an object that contains a choice value."}),text:t,response:r.response,usage:r.usage,finishReason:r.finishReason});return n.result},async parsePartialOutput({text:t}){let r=await u4(t);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let t=r.value;if(null==t||"object"!=typeof t||!("result"in t)||"string"!=typeof t.result)return;let a=e.filter(e=>e.startsWith(t.result));if("successful-parse"===r.state)return a.includes(t.result)?{partial:t.result}:void 0;return 1===a.length?{partial:a[0]}:void 0}}},createElementStreamTransform(){}}),u7=({name:e,description:t}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...null!=e&&{name:e},...null!=t&&{description:t}}),async parseCompleteOutput({text:e},t){let r=await aI({text:e});if(!r.success)throw new uk({message:"No object generated: could not parse the response.",cause:r.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return r.value},async parsePartialOutput({text:e}){let t=await u4(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return void 0===t.value?void 0:{partial:t.value}}},createElementStreamTransform(){}});new TextEncoder,new TextEncoder,rP({prefix:"aitxt",size:24}),rP({prefix:"call",size:24}),TransformStream;var ce=sl(iT(),u$.optional()),ct=av(()=>a_(uC([uR({type:sp("text-start"),id:iT(),providerMetadata:uP.optional()}),uR({type:sp("text-delta"),id:iT(),delta:iT(),providerMetadata:uP.optional()}),uR({type:sp("text-end"),id:iT(),providerMetadata:uP.optional()}),uR({type:sp("error"),errorText:iT()}),uR({type:sp("tool-input-start"),toolCallId:iT(),toolName:iT(),providerExecuted:i1().optional(),providerMetadata:uP.optional(),toolMetadata:ce.optional(),dynamic:i1().optional(),title:iT().optional()}),uR({type:sp("tool-input-delta"),toolCallId:iT(),inputTextDelta:iT()}),uR({type:sp("tool-input-available"),toolCallId:iT(),toolName:iT(),input:i3(),providerExecuted:i1().optional(),providerMetadata:uP.optional(),toolMetadata:ce.optional(),dynamic:i1().optional(),title:iT().optional()}),uR({type:sp("tool-input-error"),toolCallId:iT(),toolName:iT(),input:i3(),providerExecuted:i1().optional(),providerMetadata:uP.optional(),toolMetadata:ce.optional(),dynamic:i1().optional(),errorText:iT(),title:iT().optional()}),uR({type:sp("tool-approval-request"),approvalId:iT(),toolCallId:iT(),reason:iT().optional(),isAutomatic:i1().optional(),signature:iT().optional()}),uR({type:sp("tool-approval-response"),approvalId:iT(),approved:i1(),reason:iT().optional(),providerExecuted:i1().optional(),providerMetadata:uP.optional()}),uR({type:sp("tool-output-available"),toolCallId:iT(),output:i3(),providerExecuted:i1().optional(),providerMetadata:uP.optional(),toolMetadata:ce.optional(),dynamic:i1().optional(),preliminary:i1().optional()}),uR({type:sp("tool-output-error"),toolCallId:iT(),errorText:iT(),providerExecuted:i1().optional(),providerMetadata:uP.optional(),toolMetadata:ce.optional(),dynamic:i1().optional()}),uR({type:sp("tool-output-denied"),toolCallId:iT()}),uR({type:sp("reasoning-start"),id:iT(),providerMetadata:uP.optional()}),uR({type:sp("reasoning-delta"),id:iT(),delta:iT(),providerMetadata:uP.optional()}),uR({type:sp("reasoning-end"),id:iT(),providerMetadata:uP.optional()}),uR({type:sp("custom"),kind:iT().transform(e=>e),providerMetadata:uP.optional()}),uR({type:sp("source-url"),sourceId:iT(),url:iT(),title:iT().optional(),providerMetadata:uP.optional()}),uR({type:sp("source-document"),sourceId:iT(),mediaType:iT(),title:iT(),filename:iT().optional(),providerMetadata:uP.optional()}),uR({type:sp("file"),url:iT(),mediaType:iT(),providerMetadata:uP.optional()}),uR({type:sp("reasoning-file"),url:iT(),mediaType:iT(),providerMetadata:uP.optional()}),uR({type:uT(e=>"string"==typeof e&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:iT().optional(),data:i3(),transient:i1().optional()}),uR({type:sp("start-step")}),uR({type:sp("finish-step")}),uR({type:sp("reset-step")}),uR({type:sp("start"),messageId:iT().optional(),messageMetadata:i3().optional()}),uR({type:sp("finish"),finishReason:uM(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:i3().optional()}),uR({type:sp("abort"),reason:iT().optional()}),uR({type:sp("message-metadata"),messageMetadata:i3()})])));function cr(){return Object.create(null)}function ca(e){return e.type.startsWith("tool-")}function cn(e){return ca(e)||"dynamic-tool"===e.type}function co(e){return e.type.split("-").slice(1).join("-")}async function ci({stream:e,onError:t,abortSignal:r}){let a=e.getReader(),n=()=>{a.cancel().catch(()=>{})};(null==r?void 0:r.aborted)?n():null==r||r.addEventListener("abort",n,{once:!0});try{for(;;){let{done:e}=await a.read();if(e)break}}catch(e){null==t||t(e)}finally{null==r||r.removeEventListener("abort",n),a.releaseLock()}}rP({prefix:"aitxt",size:24}),rP({prefix:"call",size:24}),rP({prefix:"aitxt",size:24}),rP({prefix:"call",size:24});var cs=sl(iT(),u$.optional()),cl=sl(iT(),iT());function cu(e){return({url:t,abortSignal:r})=>uA({url:t,maxBytes:null==e?void 0:e.maxBytes,abortSignal:r})}av(()=>a_(uz(st({id:iT(),role:uM(["system","user","assistant"]),metadata:i3().optional(),parts:uz(uC([st({type:sp("text"),text:iT(),state:uM(["streaming","done"]).optional(),providerMetadata:uP.optional()}),st({type:sp("reasoning"),id:iT().optional(),text:iT(),state:uM(["streaming","done"]).optional(),providerMetadata:uP.optional()}),st({type:sp("custom"),kind:iT(),providerMetadata:uP.optional()}),st({type:sp("source-url"),sourceId:iT(),url:iT(),title:iT().optional(),providerMetadata:uP.optional()}),st({type:sp("source-document"),sourceId:iT(),mediaType:iT(),title:iT(),filename:iT().optional(),providerMetadata:uP.optional()}),st({type:sp("file"),mediaType:iT(),filename:iT().optional(),url:iT(),providerReference:cl.optional(),providerMetadata:uP.optional()}),st({type:sp("reasoning-file"),mediaType:iT(),url:iT(),providerMetadata:uP.optional()}),st({type:sp("step-start")}),st({type:iT().startsWith("data-"),id:iT().optional(),data:i3()}),st({type:sp("dynamic-tool"),toolName:iT(),toolCallId:iT(),toolMetadata:cs.optional(),state:sp("input-streaming"),input:i3().optional(),providerExecuted:i1().optional(),callProviderMetadata:uP.optional(),output:i6().optional(),errorText:i6().optional(),approval:i6().optional()}),st({type:sp("dynamic-tool"),toolName:iT(),toolCallId:iT(),toolMetadata:cs.optional(),state:sp("input-available"),input:i3(),providerExecuted:i1().optional(),output:i6().optional(),errorText:i6().optional(),callProviderMetadata:uP.optional(),approval:i6().optional()}),st({type:sp("dynamic-tool"),toolName:iT(),toolCallId:iT(),toolMetadata:cs.optional(),state:sp("approval-requested"),input:i3(),providerExecuted:i1().optional(),output:i6().optional(),errorText:i6().optional(),callProviderMetadata:uP.optional(),approval:st({id:iT(),approved:i6().optional(),requestReason:iT().optional(),reason:i6().optional(),isAutomatic:i1().optional(),signature:iT().optional()})}),st({type:sp("dynamic-tool"),toolName:iT(),toolCallId:iT(),toolMetadata:cs.optional(),state:sp("approval-responded"),input:i3(),providerExecuted:i1().optional(),output:i6().optional(),errorText:i6().optional(),callProviderMetadata:uP.optional(),approval:st({id:iT(),approved:i1(),requestReason:iT().optional(),reason:iT().optional(),isAutomatic:i1().optional(),signature:iT().optional()})}),st({type:sp("dynamic-tool"),toolName:iT(),toolCallId:iT(),toolMetadata:cs.optional(),state:sp("output-available"),input:i3(),providerExecuted:i1().optional(),output:i3(),errorText:i6().optional(),callProviderMetadata:uP.optional(),resultProviderMetadata:uP.optional(),preliminary:i1().optional(),approval:st({id:iT(),approved:sp(!0),requestReason:iT().optional(),reason:iT().optional(),isAutomatic:i1().optional(),signature:iT().optional()}).optional()}),st({type:sp("dynamic-tool"),toolName:iT(),toolCallId:iT(),toolMetadata:cs.optional(),state:sp("output-error"),input:i3().optional(),rawInput:i3().optional(),providerExecuted:i1().optional(),output:i6().optional(),errorText:iT(),callProviderMetadata:uP.optional(),resultProviderMetadata:uP.optional(),approval:st({id:iT(),approved:sp(!0),requestReason:iT().optional(),reason:iT().optional(),isAutomatic:i1().optional(),signature:iT().optional()}).optional()}),st({type:sp("dynamic-tool"),toolName:iT(),toolCallId:iT(),toolMetadata:cs.optional(),state:sp("output-denied"),input:i3(),providerExecuted:i1().optional(),output:i6().optional(),errorText:i6().optional(),callProviderMetadata:uP.optional(),approval:st({id:iT(),approved:sp(!1),requestReason:iT().optional(),reason:iT().optional(),isAutomatic:i1().optional(),signature:iT().optional()})}),st({type:iT().startsWith("tool-"),toolCallId:iT(),toolMetadata:cs.optional(),state:sp("input-streaming"),providerExecuted:i1().optional(),callProviderMetadata:uP.optional(),input:i3().optional(),output:i6().optional(),errorText:i6().optional(),approval:i6().optional()}),st({type:iT().startsWith("tool-"),toolCallId:iT(),toolMetadata:cs.optional(),state:sp("input-available"),providerExecuted:i1().optional(),input:i3(),output:i6().optional(),errorText:i6().optional(),callProviderMetadata:uP.optional(),approval:i6().optional()}),st({type:iT().startsWith("tool-"),toolCallId:iT(),toolMetadata:cs.optional(),state:sp("approval-requested"),input:i3(),providerExecuted:i1().optional(),output:i6().optional(),errorText:i6().optional(),callProviderMetadata:uP.optional(),approval:st({id:iT(),approved:i6().optional(),requestReason:iT().optional(),reason:i6().optional(),isAutomatic:i1().optional(),signature:iT().optional()})}),st({type:iT().startsWith("tool-"),toolCallId:iT(),toolMetadata:cs.optional(),state:sp("approval-responded"),input:i3(),providerExecuted:i1().optional(),output:i6().optional(),errorText:i6().optional(),callProviderMetadata:uP.optional(),approval:st({id:iT(),approved:i1(),requestReason:iT().optional(),reason:iT().optional(),isAutomatic:i1().optional(),signature:iT().optional()})}),st({type:iT().startsWith("tool-"),toolCallId:iT(),toolMetadata:cs.optional(),state:sp("output-available"),providerExecuted:i1().optional(),input:i3(),output:i3(),errorText:i6().optional(),callProviderMetadata:uP.optional(),resultProviderMetadata:uP.optional(),preliminary:i1().optional(),approval:st({id:iT(),approved:sp(!0),requestReason:iT().optional(),reason:iT().optional(),isAutomatic:i1().optional(),signature:iT().optional()}).optional()}),st({type:iT().startsWith("tool-"),toolCallId:iT(),toolMetadata:cs.optional(),state:sp("output-error"),providerExecuted:i1().optional(),input:i3().optional(),rawInput:i3().optional(),output:i6().optional(),errorText:iT(),callProviderMetadata:uP.optional(),resultProviderMetadata:uP.optional(),approval:st({id:iT(),approved:sp(!0),requestReason:iT().optional(),reason:iT().optional(),isAutomatic:i1().optional(),signature:iT().optional()}).optional()}),st({type:iT().startsWith("tool-"),toolCallId:iT(),toolMetadata:cs.optional(),state:sp("output-denied"),providerExecuted:i1().optional(),input:i3(),output:i6().optional(),errorText:i6().optional(),callProviderMetadata:uP.optional(),approval:st({id:iT(),approved:sp(!1),requestReason:iT().optional(),reason:iT().optional(),isAutomatic:i1().optional(),signature:iT().optional()})})]))}).superRefine((e,t)=>{"assistant"!==e.role&&0===e.parts.length&&t.addIssue({origin:"array",code:"too_small",minimum:1,inclusive:!0,input:e.parts,path:["parts"],message:"Message must contain at least one part"})})).nonempty("Messages array must not be empty"))),rP({prefix:"call",size:24}),rP({prefix:"call",size:24}),new TextEncoder,rP({prefix:"aiobj",size:24});var cc=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise((t,r)=>{this.queue.push(async()=>{try{await e(),t()}catch(e){r(e)}}),this.processQueue()})}};async function cd(e){if(null==e)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw Error("FileList is not supported in the current environment");return Promise.all(Array.from(e).map(async e=>{let{name:t,type:r}=e;return{type:"file",mediaType:r,filename:t,url:await new Promise((t,r)=>{let a=new FileReader;a.onload=e=>{var r;t(null==(r=e.target)?void 0:r.result)},a.onerror=e=>r(e),a.readAsDataURL(e)})}}))}rP({prefix:"aiobj",size:24}),cu(),Symbol.for("vercel.ai.error.AI_NoSuchProviderError"),rP({prefix:"call",size:24}),cu();var cp=class{constructor({api:e="/api/chat",credentials:t,headers:r,body:a,fetch:n,prepareSendMessagesRequest:o,prepareReconnectToStreamRequest:i}){this.api=e,this.credentials=t,this.headers=r,this.body=a,this.fetch=n,this.prepareSendMessagesRequest=o,this.prepareReconnectToStreamRequest=i}async sendMessages({abortSignal:e,...t}){var r,a,n,o,i;let s=await aO(this.body),l=await aO(this.headers),u=await aO(this.credentials),c={...rB(l),...rB(t.headers)},d=await (null==(r=this.prepareSendMessagesRequest)?void 0:r.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...s,...t.body},headers:c,credentials:u,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),p=null!=(a=null==d?void 0:d.api)?a:this.api,f=(null==d?void 0:d.headers)!==void 0?rB(d.headers):c,h=(null==d?void 0:d.body)!==void 0?d.body:{...s,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},m=null!=(n=null==d?void 0:d.credentials)?n:u,g=null!=(o=this.fetch)?o:globalThis.fetch,y=await g(p,{method:"POST",headers:{"Content-Type":"application/json",...f},body:JSON.stringify(h),credentials:m,signal:e});if(!y.ok)throw Error(null!=(i=await y.text())?i:"Failed to fetch the chat response.");if(!y.body)throw Error("The response body is empty.");return this.processResponseStream(y.body)}async reconnectToStream(e){var t,r,a,n,o;let i=await aO(this.body),s=await aO(this.headers),l=await aO(this.credentials),u={...rB(s),...rB(e.headers)},c=await (null==(t=this.prepareReconnectToStreamRequest)?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...i,...e.body},headers:u,credentials:l,requestMetadata:e.metadata})),d=null!=(r=null==c?void 0:c.api)?r:`${this.api}/${e.chatId}/stream`,p=(null==c?void 0:c.headers)!==void 0?rB(c.headers):u,f=null!=(a=null==c?void 0:c.credentials)?a:l,h=null!=(n=this.fetch)?n:globalThis.fetch,m=await h(d,{method:"GET",headers:p,credentials:f,signal:e.abortSignal});if(204===m.status)return null;if(!m.ok)throw Error(null!=(o=await m.text())?o:"Failed to fetch the chat response.");if(!m.body)throw Error("The response body is empty.");return this.processResponseStream(m.body)}},cf=class extends cp{constructor(e={}){super(e)}processResponseStream(e){return aS({stream:e,schema:ct}).pipeThrough(new TransformStream({async transform(e,t){if(!e.success)throw e.error;t.enqueue(e.value)}}))}},ch=class{constructor({generateId:e=rN,id:t=e(),transport:r=new cf,messageMetadataSchema:a,dataPartSchemas:n,state:o,onError:i,onToolCall:s,onFinish:l,onData:u,sendAutomaticallyWhen:c}){this.pendingMessagePreparations=new Set,this.activeResponse=void 0,this.activeResumeRequest=void 0,this.jobExecutor=new cc,this.sendMessage=async(e,t)=>{var r,a,n,o;let i;if(null==e)return void await this.makeRequest({trigger:"submit-message",messageId:null==(r=this.lastMessage)?void 0:r.id,...t});if("text"in e||"files"in e){let t,r=new AbortController;this.pendingMessagePreparations.add(r);try{t=Array.isArray(e.files)?e.files:await cd(e.files)}finally{this.pendingMessagePreparations.delete(r)}if(r.signal.aborted)return;i={parts:[...t,..."text"in e&&null!=e.text?[{type:"text",text:e.text}]:[]]}}else i=e;if(null!=e.messageId){let t=this.state.messages.findIndex(t=>t.id===e.messageId);if(-1===t)throw Error(`message with id ${e.messageId} not found`);if("user"!==this.state.messages[t].role)throw Error(`message with id ${e.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,t+1),this.state.replaceMessage(t,{...i,id:e.messageId,role:null!=(a=i.role)?a:"user",metadata:e.metadata})}else this.state.pushMessage({...i,id:null!=(n=i.id)?n:this.generateId(),role:null!=(o=i.role)?o:"user",metadata:e.metadata});await this.makeRequest({trigger:"submit-message",messageId:e.messageId,...t})},this.regenerate=async({messageId:e,...t}={})=>{let r=null==e?this.state.messages.length-1:this.state.messages.findIndex(t=>t.id===e);if(-1===r)throw Error(`message ${e} not found`);this.state.messages=this.state.messages.slice(0,"assistant"===this.messages[r].role?r:r+1),await this.makeRequest({trigger:"regenerate-message",messageId:e,...t})},this.resumeStream=async(e={})=>{await this.makeRequest({trigger:"resume-stream",...e})},this.clearError=()=>{"error"===this.status&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:e,approved:t,reason:r,options:a})=>this.jobExecutor.run(async()=>{let n=this.state.messages,o=n[n.length-1],i=a=>cn(a)&&"approval-requested"===a.state&&a.approval.id===e?{...a,state:"approval-responded",approval:{...a.approval,id:e,approved:t,reason:r}}:a;this.state.replaceMessage(n.length-1,{...o,parts:o.parts.map(i)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(i)),"streaming"!==this.status&&"submitted"!==this.status&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(e=>{var t;e&&this.makeRequest({trigger:"submit-message",messageId:null==(t=this.lastMessage)?void 0:t.id,...a})})}),this.addToolOutput=async({state:e="output-available",toolCallId:t,output:r,errorText:a,options:n})=>this.jobExecutor.run(async()=>{let o=this.state.messages,i=o[o.length-1],s=n=>cn(n)&&n.toolCallId===t?{...n,state:e,output:r,errorText:a}:n;this.state.replaceMessage(o.length-1,{...i,parts:i.parts.map(s)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(s)),"streaming"!==this.status&&"submitted"!==this.status&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(e=>{var t;e&&this.makeRequest({trigger:"submit-message",messageId:null==(t=this.lastMessage)?void 0:t.id,...n})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var e,t;for(let e of this.pendingMessagePreparations)e.abort();null==(e=this.activeResumeRequest)||e.abortController.abort(),null==(t=this.activeResponse)||t.abortController.abort()},this.id=t,this.transport=r,this.generateId=e,this.messageMetadataSchema=a,this.dataPartSchemas=n,this.state=o,this.onError=i,this.onToolCall=s,this.onFinish=l,this.onData=u,this.sendAutomaticallyWhen=c}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;let e=this.sendAutomaticallyWhen({messages:this.state.messages});return e&&"object"==typeof e&&"then"in e?await e:e}async makeRequest({trigger:e,metadata:t,headers:r,body:a,messageId:n}){var o,i,s;let l,u,c=new AbortController,d="resume-stream"===e?{abortController:c}:void 0;d&&(null==(o=this.activeResumeRequest)||o.abortController.abort(),this.activeResumeRequest=d);let p=()=>null==d||this.activeResumeRequest===d,f=()=>{this.activeResumeRequest===d&&(this.activeResumeRequest=void 0)};if("resume-stream"===e)try{let e=await this.transport.reconnectToStream({chatId:this.id,abortSignal:c.signal,metadata:t,headers:r,body:a});if(c.signal.aborted||!p()){await (null==e?void 0:e.cancel().catch(()=>{})),p()&&this.setStatus({status:"ready"}),f();return}if(null==e){this.setStatus({status:"ready"}),f();return}l=e}catch(e){if(c.signal.aborted||"AbortError"===e.name){p()&&this.setStatus({status:"ready"}),f();return}if(!p())return;this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:"error",error:e}),f();return}this.setStatus({status:"submitted",error:void 0});let h=this.lastMessage,m=!1,g=!1,y=!1;try{let o,i={state:function({lastMessage:e,messageId:t}){return{message:(null==e?void 0:e.role)==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:cr(),activeReasoningParts:cr(),partialToolCalls:cr()}}({lastMessage:"resume-stream"===e||"regenerate-message"===e?void 0:this.state.snapshot(h),messageId:this.generateId()}),abortController:c};u=i,i.abortController.signal.addEventListener("abort",()=>{m=!0}),this.activeResponse=i,o="resume-stream"===e?l:await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:i.abortController.signal,metadata:t,headers:r,body:a,trigger:e,messageId:n});let s=e=>this.jobExecutor.run(()=>i.abortController.signal.aborted?Promise.resolve():e({state:i.state,write:({updateStatus:e=!0}={})=>{var t;i.abortController.signal.aborted||(e&&this.setStatus({status:"streaming"}),i.state.message.id===(null==(t=this.lastMessage)?void 0:t.id)?this.state.replaceMessage(this.state.messages.length-1,i.state.message):this.state.pushMessage(i.state.message))}}));if(await ci({stream:function({stream:e,messageMetadataSchema:t,dataPartSchemas:r,runUpdateMessageJob:a,onError:n,onToolCall:o,onData:i}){return e.pipeThrough(new TransformStream({async transform(e,s){await a(async({state:a,write:l})=>{var u,c,d,p;function f(){let e=a.message.parts,t=e.length-1;for(;t>=0&&"step-start"!==e[t].type;)t--;return e.slice(t+1)}function h(e){let t=f().filter(cn).find(t=>t.toolCallId===e);if(null==t){let r=a.message.parts;for(let a=r.length-1;a>=0;a--){let n=r[a];if(cn(n)&&n.toolCallId===e){t=n;break}}}if(null==t)throw new uS({chunkType:"tool-invocation",chunkId:e,message:`No tool invocation found for tool call ID "${e}".`});return t}function m(e,t){var r;let n=null!=t?t:f().find(t=>ca(t)&&t.toolCallId===e.toolCallId);if(null!=n){n.state=e.state,n.input=e.input,n.output=e.output,n.errorText=e.errorText,n.rawInput=e.rawInput,n.preliminary=e.preliminary,void 0!==e.title&&(n.title=e.title),void 0!==e.toolMetadata&&(n.toolMetadata=e.toolMetadata),n.providerExecuted=null!=(r=e.providerExecuted)?r:n.providerExecuted;let t=e.providerMetadata;null!=t&&("output-available"===e.state||"output-error"===e.state?n.resultProviderMetadata=t:n.callProviderMetadata=t)}else a.message.parts.push({type:`tool-${e.toolName}`,toolCallId:e.toolCallId,state:e.state,title:e.title,...void 0!==e.toolMetadata?{toolMetadata:e.toolMetadata}:{},input:e.input,output:e.output,rawInput:e.rawInput,errorText:e.errorText,providerExecuted:e.providerExecuted,preliminary:e.preliminary,...null!=e.providerMetadata&&("output-available"===e.state||"output-error"===e.state)?{resultProviderMetadata:e.providerMetadata}:{},...null!=e.providerMetadata&&"output-available"!==e.state&&"output-error"!==e.state?{callProviderMetadata:e.providerMetadata}:{}})}function g(e,t){var r,n;let o=null!=t?t:f().find(t=>"dynamic-tool"===t.type&&t.toolCallId===e.toolCallId);if(null!=o){o.state=e.state,o.toolName=e.toolName,o.input=e.input,o.output=e.output,o.errorText=e.errorText,o.rawInput=null!=(r=e.rawInput)?r:o.rawInput,o.preliminary=e.preliminary,void 0!==e.title&&(o.title=e.title),void 0!==e.toolMetadata&&(o.toolMetadata=e.toolMetadata),o.providerExecuted=null!=(n=e.providerExecuted)?n:o.providerExecuted;let t=e.providerMetadata;null!=t&&("output-available"===e.state||"output-error"===e.state?o.resultProviderMetadata=t:o.callProviderMetadata=t)}else a.message.parts.push({type:"dynamic-tool",toolName:e.toolName,toolCallId:e.toolCallId,state:e.state,input:e.input,output:e.output,errorText:e.errorText,preliminary:e.preliminary,providerExecuted:e.providerExecuted,title:e.title,...void 0!==e.toolMetadata?{toolMetadata:e.toolMetadata}:{},...null!=e.providerMetadata&&("output-available"===e.state||"output-error"===e.state)?{resultProviderMetadata:e.providerMetadata}:{},...null!=e.providerMetadata&&"output-available"!==e.state&&"output-error"!==e.state?{callProviderMetadata:e.providerMetadata}:{}})}async function y(e){if(null!=e){let r=null!=a.message.metadata?function e(t,r){if(void 0===t&&void 0===r)return;if(void 0===t)return r;if(void 0===r)return t;let a={...t};for(let n in r)if("__proto__"!==n&&"constructor"!==n&&"prototype"!==n&&Object.prototype.hasOwnProperty.call(r,n)){let o=r[n];if(void 0===o)continue;let i=n in t?t[n]:void 0,s=null!==o&&"object"==typeof o&&!Array.isArray(o)&&!(o instanceof Date)&&!(o instanceof RegExp),l=null!=i&&"object"==typeof i&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp);s&&l?a[n]=e(i,o):a[n]=o}return a}(a.message.metadata,e):e;null!=t&&await ak({value:r,schema:t,context:{field:"message.metadata",entityId:a.message.id}}),a.message.metadata=r}}switch(e.type){case"text-start":{let t={type:"text",text:"",providerMetadata:e.providerMetadata,state:"streaming"};a.activeTextParts[e.id]=t,a.message.parts.push(t),l();break}case"text-delta":{let t=a.activeTextParts[e.id];if(null==t)throw new uS({chunkType:"text-delta",chunkId:e.id,message:`Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});t.text+=e.delta,t.providerMetadata=null!=(u=e.providerMetadata)?u:t.providerMetadata,l();break}case"text-end":{let t=a.activeTextParts[e.id];if(null==t)throw new uS({chunkType:"text-end",chunkId:e.id,message:`Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});t.state="done",t.providerMetadata=null!=(c=e.providerMetadata)?c:t.providerMetadata,delete a.activeTextParts[e.id],l();break}case"custom":{let t={type:"custom",kind:e.kind,providerMetadata:e.providerMetadata};a.message.parts.push(t),l();break}case"reasoning-start":{let t={type:"reasoning",id:e.id,text:"",providerMetadata:e.providerMetadata,state:"streaming"};a.activeReasoningParts[e.id]=t,a.message.parts.push(t),l();break}case"reasoning-delta":{let t=a.activeReasoningParts[e.id];if(null==t)throw new uS({chunkType:"reasoning-delta",chunkId:e.id,message:`Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});t.text+=e.delta,t.providerMetadata=null!=(d=e.providerMetadata)?d:t.providerMetadata,l();break}case"reasoning-end":{let t=a.activeReasoningParts[e.id];if(null==t)throw new uS({chunkType:"reasoning-end",chunkId:e.id,message:`Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});t.providerMetadata=null!=(p=e.providerMetadata)?p:t.providerMetadata,t.state="done",delete a.activeReasoningParts[e.id],l();break}case"file":case"reasoning-file":a.message.parts.push({type:e.type,mediaType:e.mediaType,url:e.url,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}}),l();break;case"source-url":a.message.parts.push({type:"source-url",sourceId:e.sourceId,url:e.url,title:e.title,providerMetadata:e.providerMetadata}),l();break;case"source-document":a.message.parts.push({type:"source-document",sourceId:e.sourceId,mediaType:e.mediaType,title:e.title,filename:e.filename,providerMetadata:e.providerMetadata}),l();break;case"tool-input-start":{let t=f().filter(ca);a.partialToolCalls[e.toolCallId]={text:"",toolName:e.toolName,index:t.length,dynamic:e.dynamic,title:e.title,toolMetadata:e.toolMetadata},e.dynamic?g({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0,providerExecuted:e.providerExecuted,title:e.title,toolMetadata:e.toolMetadata,providerMetadata:e.providerMetadata}):m({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0,providerExecuted:e.providerExecuted,title:e.title,toolMetadata:e.toolMetadata,providerMetadata:e.providerMetadata}),l();break}case"tool-input-delta":{let t=a.partialToolCalls[e.toolCallId];if(null==t)throw new uS({chunkType:"tool-input-delta",chunkId:e.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${e.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});t.text+=e.inputTextDelta;let{value:r}=await u4(t.text);t.dynamic?g({toolCallId:e.toolCallId,toolName:t.toolName,state:"input-streaming",input:r,title:t.title,toolMetadata:t.toolMetadata}):m({toolCallId:e.toolCallId,toolName:t.toolName,state:"input-streaming",input:r,title:t.title,toolMetadata:t.toolMetadata}),l();break}case"tool-input-available":e.dynamic?g({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title,toolMetadata:e.toolMetadata}):m({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title,toolMetadata:e.toolMetadata}),l(),o&&!e.providerExecuted&&await o({toolCall:e});break;case"tool-input-error":{let t=f().filter(cn).find(t=>t.toolCallId===e.toolCallId);(null!=t?"dynamic-tool"===t.type:e.dynamic)?g({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,toolMetadata:e.toolMetadata}):m({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:void 0,rawInput:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,toolMetadata:e.toolMetadata}),l();break}case"tool-approval-request":{let t=h(e.toolCallId);t.state="approval-requested",t.approval={id:e.approvalId,...null!=e.reason?{requestReason:e.reason}:{},...!0===e.isAutomatic?{isAutomatic:!0}:{},...null!=e.signature?{signature:e.signature}:{}},l();break}case"tool-approval-response":{let t=function(e){let t=a.message.parts.filter(cn).find(t=>{var r;return(null==(r=t.approval)?void 0:r.id)===e});if(null==t)throw new uS({chunkType:"tool-approval-response",chunkId:e,message:`No tool invocation found for approval ID "${e}".`});return t}(e.approvalId),r=null==t.approval?{id:e.approvalId}:t.approval;t.state="approval-responded",t.approval={id:e.approvalId,approved:e.approved,...null!=r.requestReason?{requestReason:r.requestReason}:{},...null!=e.reason?{reason:e.reason}:{},...!0===r.isAutomatic?{isAutomatic:!0}:{},...null!=r.signature?{signature:r.signature}:{}},null!=e.providerExecuted&&(t.providerExecuted=e.providerExecuted),null!=e.providerMetadata&&(t.callProviderMetadata=e.providerMetadata),l();break}case"tool-output-denied":h(e.toolCallId).state="output-denied",l();break;case"tool-output-available":{let t=h(e.toolCallId);"dynamic-tool"===t.type?g({toolCallId:e.toolCallId,toolName:t.toolName,state:"output-available",input:t.input,output:e.output,preliminary:e.preliminary,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:t.toolMetadata},t):m({toolCallId:e.toolCallId,toolName:co(t),state:"output-available",input:t.input,output:e.output,providerExecuted:e.providerExecuted,preliminary:e.preliminary,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:t.toolMetadata},t),l();break}case"tool-output-error":{let t=h(e.toolCallId);"dynamic-tool"===t.type?g({toolCallId:e.toolCallId,toolName:t.toolName,state:"output-error",input:t.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:t.toolMetadata},t):m({toolCallId:e.toolCallId,toolName:co(t),state:"output-error",input:t.input,rawInput:t.rawInput,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:t.toolMetadata},t),l();break}case"start-step":a.message.parts.push({type:"step-start"});break;case"finish-step":break;case"reset-step":{let e=f();a.activeTextParts=cr(),a.activeReasoningParts=cr(),a.partialToolCalls=cr(),e.length>0&&(a.message.parts.splice(a.message.parts.length-e.length,e.length),l());break}case"start":null!=e.messageId&&(a.message.id=e.messageId),await y(e.messageMetadata),(null!=e.messageId||null!=e.messageMetadata)&&l({updateStatus:!1});break;case"finish":null!=e.finishReason&&(a.finishReason=e.finishReason),await y(e.messageMetadata),null!=e.messageMetadata&&l();break;case"message-metadata":await y(e.messageMetadata),null!=e.messageMetadata&&l();break;case"error":null==n||n(Error(e.errorText));break;default:if(e.type.startsWith("data-")){if((null==r?void 0:r[e.type])!=null){let t=a.message.parts.findIndex(t=>"id"in t&&"data"in t&&t.id===e.id&&t.type===e.type),n=t>=0?t:a.message.parts.length;await ak({value:e.data,schema:r[e.type],context:{field:`message.parts[${n}].data`,entityName:e.type,entityId:e.id}})}if(e.transient){null==i||i(e);break}let t=null!=e.id?a.message.parts.find(t=>e.type===t.type&&e.id===t.id):void 0;null!=t?t.data=e.data:a.message.parts.push(e),null==i||i(e),l()}}s.enqueue(e)})}}))}({stream:o,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:s,onError:e=>{throw e}}),abortSignal:i.abortController.signal,onError:e=>{throw e}}),m)return p()&&this.setStatus({status:"ready"}),null;p()&&this.setStatus({status:"ready"})}catch(e){if(m||"AbortError"===e.name)return m=!0,p()&&this.setStatus({status:"ready"}),null;if(!p())return null;y=!0,e instanceof TypeError&&(e.message.toLowerCase().includes("fetch")||e.message.toLowerCase().includes("network"))&&(g=!0),this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:"error",error:e})}finally{try{u&&(null==(i=this.onFinish)||i.call(this,{message:u.state.message,messages:this.state.messages,isAbort:m,isDisconnect:g,isError:y,finishReason:u.state.finishReason}))}finally{this.activeResponse===u&&(this.activeResponse=void 0),f()}}!y&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:null==(s=this.lastMessage)?void 0:s.id,metadata:t,headers:r,body:a})}},cm=e.i(90979),cg=Object.prototype.hasOwnProperty;let cy=new WeakMap,cv=()=>{},cb=cv(),cw=Object,c_=e=>e===cb,ck=(e,t)=>({...e,...t}),cE={},cx={},cI="undefined",cS=typeof window!=cI,cA=typeof document!=cI,cz=cS&&"Deno"in window,cT=(e,t)=>{let r=cy.get(e);return[()=>!c_(t)&&e.get(t)||cE,a=>{if(!c_(t)){let n=e.get(t);t in cx||(cx[t]=n),r[5](t,ck(n,a),n||cE)}},r[6],()=>!c_(t)&&t in cx?cx[t]:!c_(t)&&e.get(t)||cE]},cM=!0,[cO,cR]=cS&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[cv,cv],cC={initFocus:e=>(cA&&document.addEventListener("visibilitychange",e),cO("focus",e),()=>{cA&&document.removeEventListener("visibilitychange",e),cR("focus",e)}),initReconnect:e=>{let t=()=>{cM=!0,e()},r=()=>{cM=!1};return cO("online",t),cO("offline",r),()=>{cR("online",t),cR("offline",r)}}},c$=!et.default.useId,cP=!cS||cz,cN=cP?et.useEffect:et.useLayoutEffect,cj="u">typeof navigator&&navigator.connection,cZ=!cP&&cj&&(["slow-2g","2g"].includes(cj.effectiveType)||cj.saveData),cL=new WeakMap,cU=(e,t)=>e===`[object ${t}]`,cD=0,cB=e=>{let t,r,a=typeof e,n=cw.prototype.toString.call(e),o=cU(n,"Date"),i=cU(n,"RegExp"),s=cU(n,"Object");if(cw(e)!==e||o||i)t=o?e.toJSON():"symbol"==a?e.toString():"string"==a?JSON.stringify(e):""+e;else{if(t=cL.get(e))return t;if(t=++cD+"~",cL.set(e,t),Array.isArray(e)){for(r=0,t="@";r<e.length;r++)t+=cB(e[r])+",";cL.set(e,t)}if(s){t="#";let a=cw.keys(e).sort();for(;!c_(r=a.pop());)c_(e[r])||(t+=r+":"+cB(e[r])+",");cL.set(e,t)}}return t},cF=e=>{if("function"==typeof e)try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?cB(e):"",t]},cV=0,cq=()=>++cV;async function cH(...e){let[t,r,a,n]=e,o=ck({populateCache:!0,throwOnError:!0},"boolean"==typeof n?{revalidate:n}:n||{}),i=o.populateCache,s=o.rollbackOnError,l=o.optimisticData,u=o.throwOnError;if("function"==typeof r){let e=[];for(let a of t.keys())!/^\$(inf|sub)\$/.test(a)&&r(t.get(a)._k)&&e.push(a);return Promise.all(e.map(c))}return c(r);async function c(r){let n,[c]=cF(r);if(!c)return;let[d,p]=cT(t,c),[f,h,m,g]=cy.get(t),y=()=>{let e=f[c];return("function"==typeof o.revalidate?o.revalidate(d().data,r):!1!==o.revalidate)&&(delete m[c],delete g[c],e&&e[0])?e[0](2).then(()=>d().data):d().data};if(e.length<3)return y();let v=a,b=!1,w=cq();h[c]=[w,0];let _=!c_(l),k=d(),E=k.data,x=k._c,I=c_(x)?E:x;if(_&&p({data:l="function"==typeof l?l(I,E):l,_c:I}),"function"==typeof v)try{v=v(I)}catch(e){n=e,b=!0}if(v&&"function"==typeof v.then){let e;if(v=await v.catch(e=>{n=e,b=!0}),w!==h[c][0]){if(b)throw n;return v}b&&_&&(e=n,"function"==typeof s?s(e):!1!==s)&&(i=!0,p({data:I,_c:cb}))}if(i&&!b&&("function"==typeof i?p({data:i(v,I),error:cb,_c:cb}):p({data:v,error:cb,_c:cb})),h[c][1]=cq(),Promise.resolve(y()).then(()=>{p({_c:cb})}),b){if(u)throw n;return}return v}}let cJ=(e,t)=>{for(let r in e)e[r][0]&&e[r][0](t)},cW=(e,t)=>{if(!cy.has(e)){let r=ck(cC,t),a=Object.create(null),n=cH.bind(cb,e),o=cv,i=Object.create(null),s=(e,t)=>{let r=i[e]||[];return i[e]=r,r.push(t),()=>{let e=r.indexOf(t);e>=0&&(r[e]=r[r.length-1],r.pop())}},l=(t,r,a)=>{e.set(t,r);let n=i[t];if(n)for(let e of n)e(r,a)},u=t=>{let r=cy.get(e),[,n,o,s]=r,l=cq();for(let e in r[8]++,o)delete o[e];for(let e in s)delete s[e];for(let e in n)n[e]=[l,l];let u={};for(let t of[...e.keys()]){let r=e.get(t);e.delete(t);let a=i[t];if(a)for(let e of a)e(u,r)}let c=!t||!1!==t.revalidate;for(let e in a){let t=a[e];for(let e=0;e<t.length;e++)t[e](4,{revalidate:c&&!e})}},c=()=>{if(!cy.has(e)&&(cy.set(e,[a,Object.create(null),Object.create(null),Object.create(null),n,l,s,u,0]),!cP)){let t=r.initFocus(setTimeout.bind(cb,cJ.bind(cb,a,0))),n=r.initReconnect(setTimeout.bind(cb,cJ.bind(cb,a,1)));o=()=>{t&&t(),n&&n(),cy.delete(e)}}};return c(),[e,n,c,o,u]}let r=cy.get(e);return[e,r[4],cb,cb,r[7]]},[cG,cY,,,cK]=cW(new Map),cX=ck({onLoadingSlow:cv,onSuccess:cv,onError:cv,onErrorRetry:(e,t,r,a,n)=>{let o=r.errorRetryCount,i=n.retryCount,s=~~((Math.random()+.5)*(1<<(i<8?i:8)))*r.errorRetryInterval;(c_(o)||!(i>o))&&setTimeout(a,s,n)},onDiscarded:cv,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:cZ?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:cZ?5e3:3e3,compare:function e(t,r){var a,n;if(t===r)return!0;if(t&&r&&(a=t.constructor)===r.constructor){if(a===Date)return t.getTime()===r.getTime();if(a===RegExp)return t.toString()===r.toString();if(a===Array){if((n=t.length)===r.length)for(;n--&&e(t[n],r[n]););return -1===n}if(!a||"object"==typeof t){for(a in n=0,t)if(cg.call(t,a)&&++n&&!cg.call(r,a)||!(a in r)||!e(t[a],r[a]))return!1;return Object.keys(r).length===n}}return t!=t&&r!=r},isPaused:()=>!1,cache:cG,mutate:cY,unload:cK,fallback:{}},{isOnline:()=>cM,isVisible:()=>{let e=cA&&document.visibilityState;return c_(e)||"hidden"!==e}}),cQ=(0,et.createContext)({}),c0=cS&&window.__SWR_DEVTOOLS_USE__;(c0?window.__SWR_DEVTOOLS_USE__:[]).concat(e=>(t,r,a)=>{let n=r&&((...e)=>{let[a]=cF(t),[,,,n]=cy.get(cG);if(a.startsWith("$inf$"))return r(...e);let o=n[a];return c_(o)?r(...e):(delete n[a],o)});return e(t,n,a)}),c0&&(window.__SWR_DEVTOOLS_REACT__=et.default);let c1=et.default.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),c2={dedupe:!0},c5=Promise.resolve(cb);c5.status="fulfilled",c5.value=cb;cw.defineProperty(e=>{let{value:t}=e,r=(0,et.useContext)(cQ),a="function"==typeof t,n=(0,et.useMemo)(()=>a?t(r):t,[a,r,t]),o=(0,et.useMemo)(()=>a?n:((e,t)=>{let r=ck(e,t);if(t){let{use:a,fallback:n,cacheData:o}=e,{use:i,fallback:s,cacheData:l}=t;a&&i&&(r.use=a.concat(i)),n&&s&&(r.fallback=ck(n,s)),o&&l&&(r.cacheData=ck(o,l))}return r})(r,n),[a,r,n]),i=n&&n.provider,s=(0,et.useRef)(cb);i&&!s.current&&(s.current=cW(i(o.cache||cG),n));let l=s.current;return l&&(o.cache=l[0],o.mutate=l[1],o.unload=l[4]),cN(()=>{if(l)return l[2]&&l[2](),l[3]},[]),(0,et.createElement)(cQ.Provider,ck(e,{value:o}))},"defaultValue",{value:cX});var c4=e.i(26167),c3=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},c8=(e,t,r)=>(c3(e,t,"read from private field"),r?r.call(e):t.get(e)),c6=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},c9=(e,t,r,a)=>(c3(e,t,"write to private field"),a?a.call(e,r):t.set(e,r),r),c7=class{constructor(e=[]){c6(this,V,void 0),c6(this,q,"ready"),c6(this,H,void 0),c6(this,J,new Set),c6(this,W,new Set),c6(this,G,new Set),this.pushMessage=e=>{c9(this,V,c8(this,V).concat(e)),c8(this,Y).call(this)},this.popMessage=()=>{c9(this,V,c8(this,V).slice(0,-1)),c8(this,Y).call(this)},this.replaceMessage=(e,t)=>{c9(this,V,[...c8(this,V).slice(0,e),this.snapshot(t),...c8(this,V).slice(e+1)]),c8(this,Y).call(this)},this.snapshot=e=>{var t;if(null==e||"object"!=typeof e||!("parts"in e)||!Array.isArray(e.parts))return e;let r={...e,parts:e.parts.map(e=>({...e}))};return"metadata"in e&&(r.metadata=Array.isArray(t=e.metadata)?[...t]:null!=t&&"object"==typeof t&&(Object.getPrototypeOf(t)===Object.prototype||null===Object.getPrototypeOf(t))?{...t}:t),r},this["~registerMessagesCallback"]=(e,t)=>{let r=t?null!=t?(0,c4.default)(e,t):e:e;return c8(this,J).add(r),()=>{c8(this,J).delete(r)}},this["~registerStatusCallback"]=e=>(c8(this,W).add(e),()=>{c8(this,W).delete(e)}),this["~registerErrorCallback"]=e=>(c8(this,G).add(e),()=>{c8(this,G).delete(e)}),c6(this,Y,()=>{c8(this,J).forEach(e=>e())}),c6(this,K,()=>{c8(this,W).forEach(e=>e())}),c6(this,X,()=>{c8(this,G).forEach(e=>e())}),c9(this,V,e)}get status(){return c8(this,q)}set status(e){c9(this,q,e),c8(this,K).call(this)}get error(){return c8(this,H)}set error(e){c9(this,H,e),c8(this,X).call(this)}get messages(){return c8(this,V)}set messages(e){c9(this,V,[...e]),c8(this,Y).call(this)}};V=new WeakMap,q=new WeakMap,H=new WeakMap,J=new WeakMap,W=new WeakMap,G=new WeakMap,Y=new WeakMap,K=new WeakMap,X=new WeakMap;var de=class extends ch{constructor({messages:e,...t}){const r=new c7(e);super({...t,state:r}),c6(this,Q,void 0),this["~registerMessagesCallback"]=(e,t)=>c8(this,Q)["~registerMessagesCallback"](e,t),this["~registerStatusCallback"]=e=>c8(this,Q)["~registerStatusCallback"](e),this["~registerErrorCallback"]=e=>c8(this,Q)["~registerErrorCallback"](e),c9(this,Q,r)}};Q=new WeakMap;var dt=e.i(69322);let dr={createInterruptionMessage:e=>({id:`interruption-${Date.now()}`,role:"assistant",content:`⚠️ **Operation Interrupted**
|
|
99
|
-
|
|
100
|
-
The current operation was stopped by user request.
|
|
101
|
-
|
|
102
|
-
**Status at interruption:**
|
|
103
|
-
- Current phase: ${({submitted:"request processing",streaming:"response generation",error:"error handling",ready:"idle state"})[e]||e}
|
|
104
|
-
- Remaining tasks may not have been completed
|
|
105
|
-
- You can start a new request at any time
|
|
106
|
-
|
|
107
|
-
*The system is ready for your next command.*`}),hasIncompleteToolInvocations:e=>"assistant"===e.role&&!!e.parts&&e.parts.some(e=>"tool-invocation"===e.type&&e.toolInvocation&&(!e.toolInvocation.result||"call"===e.toolInvocation.state)),filterCompleteMessages(e){return e.filter(e=>!this.hasIncompleteToolInvocations(e))}};var da=e.i(79684);function dn(e){return["png","jpg","jpeg","gif","webp","bmp","svg"].includes(e.split(".").pop()?.toLowerCase().split("?")[0]||"")?``:`[${e.split("/").pop()||"file"}](${e})`}let di=()=>{let e=(0,dt.useIntl)(),[t,r]=(0,da.default)("copilot-chat-history",[]),a=(0,et.useRef)(!1),{messages:n,error:o,resumeStream:i,status:s,setMessages:l,stop:u,regenerate:c,sendMessage:d}=function({throttle:e,experimental_throttle:t,resume:r=!1,...a}={}){let n,o=null!=e?e:t,i=(0,et.useRef)({});"chat"in a||(i.current={onToolCall:a.onToolCall,onData:a.onData,onFinish:a.onFinish,onError:a.onError,sendAutomaticallyWhen:a.sendAutomaticallyWhen,transport:a.transport});let s=()=>{var e;return null!=(e=i.current.transport)?e:null!=n?n:n=new cf},l={...a,transport:{sendMessages:e=>s().sendMessages(e),reconnectToStream:e=>s().reconnectToStream(e)},onToolCall:e=>{var t,r;return null==(r=(t=i.current).onToolCall)?void 0:r.call(t,e)},onData:e=>{var t,r;return null==(r=(t=i.current).onData)?void 0:r.call(t,e)},onFinish:e=>{var t,r;return null==(r=(t=i.current).onFinish)?void 0:r.call(t,e)},onError:e=>{var t,r;return null==(r=(t=i.current).onError)?void 0:r.call(t,e)},sendAutomaticallyWhen:e=>{var t,r,a;return null!=(a=null==(r=(t=i.current).sendAutomaticallyWhen)?void 0:r.call(t,e))&&a}},u=(0,et.useRef)("chat"in a?a.chat:new de(l));("chat"in a&&a.chat!==u.current||"id"in a&&null!=a.id&&u.current.id!==a.id)&&(u.current="chat"in a?a.chat:new de(l));let c=u.current,d=(0,et.useRef)({chat:c,messages:c.messages});d.current.chat!==c&&(d.current={chat:c,messages:c.messages});let p=(0,et.useCallback)(e=>{let t=!0,r=c["~registerMessagesCallback"](()=>{t&&d.current.chat===c&&(d.current={chat:c,messages:c.messages},e())},o);return d.current={chat:c,messages:c.messages},()=>{t=!1,r()}},[c,o]),f=(0,et.useCallback)(()=>d.current.messages,[]),h=(0,et.useSyncExternalStore)(p,f,f),m=(0,et.useCallback)(e=>c["~registerStatusCallback"](()=>{d.current.chat===c&&(("ready"===c.status||"error"===c.status)&&(d.current={chat:c,messages:c.messages}),e())}),[c]),g=(0,et.useCallback)(()=>c.status,[c]),y=(0,et.useSyncExternalStore)(m,g,g),v=(0,et.useSyncExternalStore)(u.current["~registerErrorCallback"],()=>u.current.error,()=>u.current.error),b=(0,et.useCallback)(e=>{"function"==typeof e&&(e=e(u.current.messages)),u.current.messages=e},[u]);return(0,et.useEffect)(()=>{r&&u.current.resumeStream()},[r,u]),{id:u.current.id,messages:h,setMessages:b,sendMessage:u.current.sendMessage,regenerate:u.current.regenerate,clearError:u.current.clearError,stop:u.current.stop,error:v,resumeStream:u.current.resumeStream,status:y,addToolResult:u.current.addToolOutput,addToolOutput:u.current.addToolOutput,addToolApprovalResponse:u.current.addToolApprovalResponse}}({transport:new cf({api:"/chat",credentials:"include"}),messages:t,onError:t=>{let r;r=t.message?.includes("401")||t.message?.includes("invalid_token")||t.message?.includes("Unauthorized")?e.formatMessage({id:"chat.error.auth",defaultMessage:"🔐 **Authentication Error**\n\nYour session has expired or the authentication token is invalid.\n\n**To fix this:**\n1. Refresh the page (Ctrl+R / Cmd+R)\n2. Log out and log back in\n3. Check your permissions\n\n*This happens when your session expires after being idle too long.*"}):t.message?.includes("fetch")||t.message?.includes("Failed to fetch")||t.message?.includes("NetworkError")?e.formatMessage({id:"chat.error.connection",defaultMessage:"🚫 **Connection Error**\n\nCannot connect to the chat API server at {chatUrl}.\n\n**To enable chat:**\n1. Start the backend\n2. Ensure chat/MCP endpoint is configured\n3. Check NEXT_PUBLIC_CHAT_URL\n\n**Current configuration:**\n- Chat URL: {chatUrl}\n\n*Please start the backend.*"},{chatUrl:"/chat"}):t.message?.includes("stream")||t.message?.includes("process")?e.formatMessage({id:"chat.error.stream",defaultMessage:"⚠️ **Stream Processing Error**\n\nThere was an error processing the AI response stream.\n\n**Possible causes:**\n1. Backend not running\n2. MCP server not responding\n3. Missing/invalid API keys\n4. Network issues\n\n**Error details:** {details}"},{details:t.message}):e.formatMessage({id:"chat.error.unexpected",defaultMessage:"❌ **Chat Error**\n\nAn unexpected error occurred: {details}\n\n*Please try again or check the console for details.*"},{details:t.message});let a={id:`error-${Date.now()}`,role:"assistant",parts:[{type:"text",text:r}]};l(e=>[...e,a])}});return(0,et.useEffect)(()=>{"streaming"!==s&&r(n)},[s]),{messages:n,handleSubmit:async(t,r)=>{try{let e=r?.map(dn).join("\n")??"",a=[t,e].filter(Boolean).join("\n");t&&d({text:a})}catch(n){console.error("Error in handleSubmit:",n);let t=n instanceof Error?n.message:"Unknown error",r=t.includes("401")||t.includes("Unauthorized")?e.formatMessage({id:"chat.error.auth",defaultMessage:"🔐 **Authentication Error**\n\nYour session has expired or the authentication token is invalid.\n\n*Please refresh or log in again.*"}):e.formatMessage({id:"chat.error.submission",defaultMessage:"❌ **Submission Error**\n\nFailed to send your message.\n\n**Error:** {details}\n\n*Please ensure the backend is running.*"},{details:t}),a={id:`error-${Date.now()}`,role:"assistant",parts:[{type:"text",text:r}]};l(e=>[...e,a])}},error:o,status:s,clearHistory:()=>{l([]),r([]),a.current=!1},stop:u,addInterruptionMessage:e=>{let t=dr.createInterruptionMessage(e);l(e=>[...e,t])},sendMessage:d,reload:c,resumeStream:i}};e.s(["useChatManager",0,di],16717);let ds=(0,et.createContext)(void 0);e.s(["ChatProvider",0,({children:e})=>{let t=di(),r=(0,et.useMemo)(()=>({messages:t.messages,handleSubmit:t.handleSubmit,error:t.error,clearHistory:t.clearHistory,stop:t.stop,addInterruptionMessage:t.addInterruptionMessage,status:t.status,reload:t.reload,sendMessage:t.sendMessage,resumeStream:t.resumeStream}),[t.messages,t.handleSubmit,t.error,t.clearHistory,t.stop,t.addInterruptionMessage,t.status,t.reload,t.sendMessage,t.resumeStream]);return(0,ee.jsx)(ds.Provider,{value:r,children:e})},"useChatContext",0,()=>{let e=(0,et.useContext)(ds);if(!e)throw Error("useChatContext must be used within a ChatProvider");return e}],95377)},99525,e=>{"use strict";var t=e.i(91788);let r=t.forwardRef(function({title:e,titleId:r,...a},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":r},a),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 18.75a60.07 60.07 0 0 1 15.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 0 1 3 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 0 0-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 0 1-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 0 0 3 15h-.75M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm3 0h.008v.008H18V10.5Zm-12 0h.008v.008H6V10.5Z"}))});e.s(["default",0,r])},80902,e=>{"use strict";var t=e.i(91788);let r=t.forwardRef(function({title:e,titleId:r,...a},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":r},a),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 15.75V18m-7.5-6.75h.008v.008H8.25v-.008Zm0 2.25h.008v.008H8.25V13.5Zm0 2.25h.008v.008H8.25v-.008Zm0 2.25h.008v.008H8.25V18Zm2.498-6.75h.007v.008h-.007v-.008Zm0 2.25h.007v.008h-.007V13.5Zm0 2.25h.007v.008h-.007v-.008Zm0 2.25h.007v.008h-.007V18Zm2.504-6.75h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V13.5Zm0 2.25h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V18Zm2.498-6.75h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V13.5ZM8.25 6h7.5v2.25h-7.5V6ZM12 2.25c-1.892 0-3.758.11-5.593.322C5.307 2.7 4.5 3.65 4.5 4.757V19.5a2.25 2.25 0 0 0 2.25 2.25h10.5a2.25 2.25 0 0 0 2.25-2.25V4.757c0-1.108-.806-2.057-1.907-2.185A48.507 48.507 0 0 0 12 2.25Z"}))});e.s(["default",0,r])},35750,30770,e=>{"use strict";var t=e.i(91788);let r=t.forwardRef(function({title:e,titleId:r,...a},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":r},a),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5"}))});e.s(["default",0,r],30770),e.s(["CalendarIcon",0,r],35750)},79337,e=>{"use strict";var t=e.i(91788);let r=t.forwardRef(function({title:e,titleId:r,...a},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":r},a),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.827 6.175A2.31 2.31 0 0 1 5.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 0 0-1.134-.175 2.31 2.31 0 0 1-1.64-1.055l-.822-1.316a2.192 2.192 0 0 0-1.736-1.039 48.774 48.774 0 0 0-5.232 0 2.192 2.192 0 0 0-1.736 1.039l-.821 1.316Z"}),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 12.75a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0ZM18.75 10.5h.008v.008h-.008V10.5Z"}))});e.s(["default",0,r])},87999,e=>{"use strict";var t=e.i(91788);let r=t.forwardRef(function({title:e,titleId:r,...a},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":r},a),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 0 1 1.037-.443 48.282 48.282 0 0 0 5.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"}))});e.s(["default",0,r])},22576,e=>{"use strict";var t=e.i(91788);let r=t.forwardRef(function({title:e,titleId:r,...a},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":r},a),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 0 1-.825-.242m9.345-8.334a2.126 2.126 0 0 0-.476-.095 48.64 48.64 0 0 0-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0 0 11.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"}))});e.s(["default",0,r])},95677,e=>{"use strict";var t=e.i(91788);let r=t.forwardRef(function({title:e,titleId:r,...a},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":r},a),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))});e.s(["default",0,r])},1672,18488,e=>{"use strict";var t=e.i(91788);let r=t.forwardRef(function({title:e,titleId:r,...a},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":r},a),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 0 1 1.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.559.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.894.149c-.424.07-.764.383-.929.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 0 1-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.398.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 0 1-.12-1.45l.527-.737c.25-.35.272-.806.108-1.204-.165-.397-.506-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.108-1.204l-.526-.738a1.125 1.125 0 0 1 .12-1.45l.773-.773a1.125 1.125 0 0 1 1.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894Z"}),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))});e.s(["default",0,r],18488),e.s(["Cog8ToothIcon",0,r],1672)},24271,46073,e=>{"use strict";var t=e.i(91788);let r=t.forwardRef(function({title:e,titleId:r,...a},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":r},a),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"}))});e.s(["default",0,r],46073),e.s(["CommandLineIcon",0,r],24271)},92248,e=>{"use strict";var t=e.i(91788);let r=t.forwardRef(function({title:e,titleId:r,...a},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":r},a),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"}))});e.s(["default",0,r])},1943,e=>{"use strict";var t=e.i(91788);let r=t.forwardRef(function({title:e,titleId:r,...a},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":r},a),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 6.75h12M8.25 12h12m-12 5.25h12M3.75 6.75h.007v.008H3.75V6.75Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0ZM3.75 12h.007v.008H3.75V12Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm-.375 5.25h.007v.008H3.75v-.008Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"}))});e.s(["default",0,r])},226,e=>{"use strict";var t=e.i(91788);let r=t.forwardRef(function({title:e,titleId:r,...a},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":r},a),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))});e.s(["default",0,r])},26915,e=>{"use strict";var t=e.i(91788);let r=t.forwardRef(function({title:e,titleId:r,...a},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":r},a),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18v-2.25Z"}))});e.s(["default",0,r])},3954,e=>{"use strict";var t=e.i(91788);let r=t.forwardRef(function({title:e,titleId:r,...a},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":r},a),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9Z"}))});e.s(["default",0,r])},75325,e=>{"use strict";var t=e.i(91788);let r=t.forwardRef(function({title:e,titleId:r,...a},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":r},a),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z"}))});e.s(["default",0,r])},21168,(e,t,r)=>{var a={872:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],a=t[1];return(r+a)*3/4-a},t.toByteArray=function(e){var t,r,o=l(e),i=o[0],s=o[1],u=new n((i+s)*3/4-s),c=0,d=s>0?i-4:i;for(r=0;r<d;r+=4)t=a[e.charCodeAt(r)]<<18|a[e.charCodeAt(r+1)]<<12|a[e.charCodeAt(r+2)]<<6|a[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===s&&(t=a[e.charCodeAt(r)]<<2|a[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===s&&(t=a[e.charCodeAt(r)]<<10|a[e.charCodeAt(r+1)]<<4|a[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,a=e.length,n=a%3,o=[],i=0,s=a-n;i<s;i+=16383)o.push(function(e,t,a){for(var n,o=[],i=t;i<a;i+=3)n=(e[i]<<16&0xff0000)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(r[n>>18&63]+r[n>>12&63]+r[n>>6&63]+r[63&n]);return o.join("")}(e,i,i+16383>s?s:i+16383));return 1===n?o.push(r[(t=e[a-1])>>2]+r[t<<4&63]+"=="):2===n&&o.push(r[(t=(e[a-2]<<8)+e[a-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")};for(var r=[],a=[],n="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=o.length;i<s;++i)r[i]=o[i],a[o.charCodeAt(i)]=i;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var a=r===t?0:4-r%4;return[r,a]}a[45]=62,a[95]=63},230:function(e,t,r){"use strict";var a=r(872),n=r(321),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function i(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e){var a=e,n=t;if(("string"!=typeof n||""===n)&&(n="utf8"),!s.isEncoding(n))throw TypeError("Unknown encoding: "+n);var o=0|f(a,n),l=i(o),u=l.write(a,n);return u!==o&&(l=l.slice(0,u)),l}if(ArrayBuffer.isView(e))return d(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(T(e,ArrayBuffer)||e&&T(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(T(e,SharedArrayBuffer)||e&&T(e.buffer,SharedArrayBuffer)))return function(e,t,r){var a;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(a=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),s.prototype),a}(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var c=e.valueOf&&e.valueOf();if(null!=c&&c!==e)return s.from(c,t,r);var h=function(e){if(s.isBuffer(e)){var t=0|p(e.length),r=i(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?i(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(h)return h;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),i(e<0?0:0|p(e))}function d(e){for(var t=e.length<0?0:0|p(e.length),r=i(t),a=0;a<t;a+=1)r[a]=255&e[a];return r}t.Buffer=s,t.SlowBuffer=function(e){return+e!=e&&(e=0),s.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,s.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!s.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(e,t,r){return(u(e),e<=0)?i(e):void 0!==t?"string"==typeof r?i(e).fill(t,r):i(e).fill(t):i(e)},s.allocUnsafe=function(e){return c(e)},s.allocUnsafeSlow=function(e){return c(e)};function p(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function f(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||T(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,a=arguments.length>2&&!0===arguments[2];if(!a&&0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return I(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return A(e).length;default:if(n)return a?-1:I(e).length;t=(""+t).toLowerCase(),n=!0}}function h(e,t,r){var n,o,i,s=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var a=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>a)&&(r=a);for(var n="",o=t;o<r;++o)n+=M[e[o]];return n}(this,t,r);case"utf8":case"utf-8":return v(this,t,r);case"ascii":return function(e,t,r){var a="";r=Math.min(e.length,r);for(var n=t;n<r;++n)a+=String.fromCharCode(127&e[n]);return a}(this,t,r);case"latin1":case"binary":return function(e,t,r){var a="";r=Math.min(e.length,r);for(var n=t;n<r;++n)a+=String.fromCharCode(e[n]);return a}(this,t,r);case"base64":return n=this,o=t,i=r,0===o&&i===n.length?a.fromByteArray(n):a.fromByteArray(n.slice(o,i));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var a=e.slice(t,r),n="",o=0;o<a.length;o+=2)n+=String.fromCharCode(a[o]+256*a[o+1]);return n}(this,t,r);default:if(s)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),s=!0}}function m(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function g(e,t,r,a,n){var o;if(0===e.length)return -1;if("string"==typeof r?(a=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(o=r*=1)!=o&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(n)return -1;else r=e.length-1;else if(r<0)if(!n)return -1;else r=0;if("string"==typeof t&&(t=s.from(t,a)),s.isBuffer(t))return 0===t.length?-1:y(e,t,r,a,n);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(n)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return y(e,[t],r,a,n)}throw TypeError("val must be string, number or Buffer")}function y(e,t,r,a,n){var o,i=1,s=e.length,l=t.length;if(void 0!==a&&("ucs2"===(a=String(a).toLowerCase())||"ucs-2"===a||"utf16le"===a||"utf-16le"===a)){if(e.length<2||t.length<2)return -1;i=2,s/=2,l/=2,r/=2}function u(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(n){var c=-1;for(o=r;o<s;o++)if(u(e,o)===u(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*i}else -1!==c&&(o-=o-c),c=-1}else for(r+l>s&&(r=s-l),o=r;o>=0;o--){for(var d=!0,p=0;p<l;p++)if(u(e,o+p)!==u(t,p)){d=!1;break}if(d)return o}return -1}s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(T(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),T(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,a=t.length,n=0,o=Math.min(r,a);n<o;++n)if(e[n]!==t[n]){r=e[n],a=t[n];break}return r<a?-1:+(a<r)},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,a=s.allocUnsafe(t),n=0;for(r=0;r<e.length;++r){var o=e[r];if(T(o,Uint8Array)&&(o=s.from(o)),!s.isBuffer(o))throw TypeError('"list" argument must be an Array of Buffers');o.copy(a,n),n+=o.length}return a},s.byteLength=f,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},s.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?v(this,0,e):h.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(s.prototype[o]=s.prototype.inspect),s.prototype.compare=function(e,t,r,a,n){if(T(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===a&&(a=0),void 0===n&&(n=this.length),t<0||r>e.length||a<0||n>this.length)throw RangeError("out of range index");if(a>=n&&t>=r)return 0;if(a>=n)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,a>>>=0,n>>>=0,this===e)return 0;for(var o=n-a,i=r-t,l=Math.min(o,i),u=this.slice(a,n),c=e.slice(t,r),d=0;d<l;++d)if(u[d]!==c[d]){o=u[d],i=c[d];break}return o<i?-1:+(i<o)},s.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},s.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},s.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)};function v(e,t,r){r=Math.min(e.length,r);for(var a=[],n=t;n<r;){var o,i,s,l,u=e[n],c=null,d=u>239?4:u>223?3:u>191?2:1;if(n+d<=r)switch(d){case 1:u<128&&(c=u);break;case 2:(192&(o=e[n+1]))==128&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=e[n+1],i=e[n+2],(192&o)==128&&(192&i)==128&&(l=(15&u)<<12|(63&o)<<6|63&i)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[n+1],i=e[n+2],s=e[n+3],(192&o)==128&&(192&i)==128&&(192&s)==128&&(l=(15&u)<<18|(63&o)<<12|(63&i)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,d=1):c>65535&&(c-=65536,a.push(c>>>10&1023|55296),c=56320|1023&c),a.push(c),n+=d}var p=a,f=p.length;if(f<=4096)return String.fromCharCode.apply(String,p);for(var h="",m=0;m<f;)h+=String.fromCharCode.apply(String,p.slice(m,m+=4096));return h}function b(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function w(e,t,r,a,n,o){if(!s.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<o)throw RangeError('"value" argument is out of bounds');if(r+a>e.length)throw RangeError("Index out of range")}function _(e,t,r,a,n,o){if(r+a>e.length||r<0)throw RangeError("Index out of range")}function k(e,t,r,a,o){return t*=1,r>>>=0,o||_(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,a,23,4),r+4}function E(e,t,r,a,o){return t*=1,r>>>=0,o||_(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,a,52,8),r+8}s.prototype.write=function(e,t,r,a){if(void 0===t)a="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)a=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===a&&(a="utf8")):(a=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var n,o,i,s,l,u,c,d,p=this.length-t;if((void 0===r||r>p)&&(r=p),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var f=!1;;)switch(a){case"hex":return function(e,t,r,a){r=Number(r)||0;var n=e.length-r;a?(a=Number(a))>n&&(a=n):a=n;var o=t.length;a>o/2&&(a=o/2);for(var i=0;i<a;++i){var s,l=parseInt(t.substr(2*i,2),16);if((s=l)!=s)break;e[r+i]=l}return i}(this,e,t,r);case"utf8":case"utf-8":return n=t,o=r,z(I(e,this.length-n),this,n,o);case"ascii":return i=t,s=r,z(S(e),this,i,s);case"latin1":case"binary":return function(e,t,r,a){return z(S(t),e,r,a)}(this,e,t,r);case"base64":return l=t,u=r,z(A(e),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,d=r,z(function(e,t){for(var r,a,n=[],o=0;o<e.length&&!((t-=2)<0);++o)a=(r=e.charCodeAt(o))>>8,n.push(r%256),n.push(a);return n}(e,this.length-c),this,c,d);default:if(f)throw TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),f=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var a=this.subarray(e,t);return Object.setPrototypeOf(a,s.prototype),a},s.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var a=this[e],n=1,o=0;++o<t&&(n*=256);)a+=this[e+o]*n;return a},s.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var a=this[e+--t],n=1;t>0&&(n*=256);)a+=this[e+--t]*n;return a},s.prototype.readUInt8=function(e,t){return e>>>=0,t||b(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var a=this[e],n=1,o=0;++o<t&&(n*=256);)a+=this[e+o]*n;return a>=(n*=128)&&(a-=Math.pow(2,8*t)),a},s.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var a=t,n=1,o=this[e+--a];a>0&&(n*=256);)o+=this[e+--a]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*t)),o},s.prototype.readInt8=function(e,t){return(e>>>=0,t||b(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||b(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt16BE=function(e,t){e>>>=0,t||b(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||b(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||b(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||b(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||b(e,8,this.length),n.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,r,a){if(e*=1,t>>>=0,r>>>=0,!a){var n=Math.pow(2,8*r)-1;w(this,e,t,r,n,0)}var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},s.prototype.writeUIntBE=function(e,t,r,a){if(e*=1,t>>>=0,r>>>=0,!a){var n=Math.pow(2,8*r)-1;w(this,e,t,r,n,0)}var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},s.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeIntLE=function(e,t,r,a){if(e*=1,t>>>=0,!a){var n=Math.pow(2,8*r-1);w(this,e,t,r,n-1,-n)}var o=0,i=1,s=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/i|0)-s&255;return t+r},s.prototype.writeIntBE=function(e,t,r,a){if(e*=1,t>>>=0,!a){var n=Math.pow(2,8*r-1);w(this,e,t,r,n-1,-n)}var o=r-1,i=1,s=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/i|0)-s&255;return t+r},s.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeFloatLE=function(e,t,r){return k(this,e,t,!0,r)},s.prototype.writeFloatBE=function(e,t,r){return k(this,e,t,!1,r)},s.prototype.writeDoubleLE=function(e,t,r){return E(this,e,t,!0,r)},s.prototype.writeDoubleBE=function(e,t,r){return E(this,e,t,!1,r)},s.prototype.copy=function(e,t,r,a){if(!s.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),a||0===a||(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a<r&&(a=r),a===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(a<0)throw RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t<a-r&&(a=e.length-t+r);var n=a-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,a);else if(this===e&&r<t&&t<a)for(var o=n-1;o>=0;--o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,a),t);return n},s.prototype.fill=function(e,t,r,a){if("string"==typeof e){if("string"==typeof t?(a=t,t=0,r=this.length):"string"==typeof r&&(a=r,r=this.length),void 0!==a&&"string"!=typeof a)throw TypeError("encoding must be a string");if("string"==typeof a&&!s.isEncoding(a))throw TypeError("Unknown encoding: "+a);if(1===e.length){var n,o=e.charCodeAt(0);("utf8"===a&&o<128||"latin1"===a)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n<r;++n)this[n]=e;else{var i=s.isBuffer(e)?e:s.from(e,a),l=i.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<r-t;++n)this[n+t]=i[n%l]}return this};var x=/[^+/0-9A-Za-z-_]/g;function I(e,t){t=t||1/0;for(var r,a=e.length,n=null,o=[],i=0;i<a;++i){if((r=e.charCodeAt(i))>55295&&r<57344){if(!n){if(r>56319||i+1===a){(t-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(t-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function S(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function A(e){return a.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(x,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,r,a){for(var n=0;n<a&&!(n+r>=t.length)&&!(n>=e.length);++n)t[n+r]=e[n];return n}function T(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var M=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var a=16*r,n=0;n<16;++n)t[a+n]=e[r]+e[n];return t}()},321:function(e,t){t.read=function(e,t,r,a,n){var o,i,s=8*n-a-1,l=(1<<s)-1,u=l>>1,c=-7,d=r?n-1:0,p=r?-1:1,f=e[t+d];for(d+=p,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+e[t+d],d+=p,c-=8);for(i=o&(1<<-c)-1,o>>=-c,c+=a;c>0;i=256*i+e[t+d],d+=p,c-=8);if(0===o)o=1-u;else{if(o===l)return i?NaN:1/0*(f?-1:1);i+=Math.pow(2,a),o-=u}return(f?-1:1)*i*Math.pow(2,o-a)},t.write=function(e,t,r,a,n,o){var i,s,l,u=8*o-n-1,c=(1<<u)-1,d=c>>1,p=5960464477539062e-23*(23===n),f=a?0:o-1,h=a?1:-1,m=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(s=+!!isNaN(t),i=c):(i=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-i))<1&&(i--,l*=2),i+d>=1?t+=p/l:t+=p*Math.pow(2,1-d),t*l>=2&&(i++,l/=2),i+d>=c?(s=0,i=c):i+d>=1?(s=(t*l-1)*Math.pow(2,n),i+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,n),i=0));n>=8;e[r+f]=255&s,f+=h,s/=256,n-=8);for(i=i<<n|s,u+=n;u>0;e[r+f]=255&i,f+=h,i/=256,u-=8);e[r+f-h]|=128*m}}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}},i=!0;try{a[e](r,r.exports,o),i=!1}finally{i&&delete n[e]}return r.exports}o.ab="/ROOT/node_modules/next/dist/compiled/buffer/",t.exports=o(230)},16518,(e,t,r)=>{"use strict";var a=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,s={},l={SYMBOL_FOR_REQ_CONTEXT:()=>c,getContext:()=>d};for(var u in l)a(s,u,{get:l[u],enumerable:!0});t.exports=((e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of o(t))i.call(e,s)||void 0===s||a(e,s,{get:()=>t[s],enumerable:!(r=n(t,s))||r.enumerable});return e})(a({},"__esModule",{value:!0}),s);let c=Symbol.for("@vercel/request-context");function d(){let e=globalThis;return e[c]?.get?.()??{}}},2985,(e,t,r)=>{"use strict";var a=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,s={},l={AccessTokenMissingError:()=>c,RefreshAccessTokenFailedError:()=>d};for(var u in l)a(s,u,{get:l[u],enumerable:!0});t.exports=((e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of o(t))i.call(e,s)||void 0===s||a(e,s,{get:()=>t[s],enumerable:!(r=n(t,s))||r.enumerable});return e})(a({},"__esModule",{value:!0}),s);class c extends Error{constructor(){super("No authentication found. Please log in with the Vercel CLI (vercel login)."),this.name="AccessTokenMissingError"}}class d extends Error{constructor(e){super("Failed to refresh authentication token.",{cause:e}),this.name="RefreshAccessTokenFailedError"}}},52897,(e,t,r)=>{"use strict";var a=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,s={},l={AccessTokenMissingError:()=>d.AccessTokenMissingError,RefreshAccessTokenFailedError:()=>d.RefreshAccessTokenFailedError,getContext:()=>c.getContext,getVercelOidcToken:()=>p,getVercelOidcTokenSync:()=>f,getVercelToken:()=>h};for(var u in l)a(s,u,{get:l[u],enumerable:!0});t.exports=((e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of o(t))i.call(e,s)||void 0===s||a(e,s,{get:()=>t[s],enumerable:!(r=n(t,s))||r.enumerable});return e})(a({},"__esModule",{value:!0}),s);var c=e.r(16518),d=e.r(2985);async function p(){return""}function f(){return""}async function h(){throw Error("getVercelToken is not supported in browser environments")}},26167,(e,t,r)=>{t.exports=function(e,t){let r;if("function"!=typeof e)throw TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let a=0;return function(...n){clearTimeout(r);let o=Date.now(),i=t-(o-a);i<=0?(a=o,e.apply(this,n)):r=setTimeout(()=>{a=Date.now(),e.apply(this,n)},i)}}}]);
|