@tapflowio/relay 0.27.1 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/dist/RelayServer.d.ts +54 -0
  2. package/dist/RelayServer.d.ts.map +1 -1
  3. package/dist/RelayServer.js +384 -37
  4. package/dist/RelayServer.js.map +1 -1
  5. package/dist/SessionManager.d.ts +63 -2
  6. package/dist/SessionManager.d.ts.map +1 -1
  7. package/dist/SessionManager.js +123 -1
  8. package/dist/SessionManager.js.map +1 -1
  9. package/dist/api/apps.d.ts +2 -1
  10. package/dist/api/apps.d.ts.map +1 -1
  11. package/dist/api/apps.js +20 -7
  12. package/dist/api/apps.js.map +1 -1
  13. package/dist/api/builds.d.ts +2 -1
  14. package/dist/api/builds.d.ts.map +1 -1
  15. package/dist/api/builds.js +10 -37
  16. package/dist/api/builds.js.map +1 -1
  17. package/dist/api/runVideos.d.ts +85 -0
  18. package/dist/api/runVideos.d.ts.map +1 -0
  19. package/dist/api/runVideos.js +494 -0
  20. package/dist/api/runVideos.js.map +1 -0
  21. package/dist/api/runs.d.ts +77 -0
  22. package/dist/api/runs.d.ts.map +1 -0
  23. package/dist/api/runs.js +579 -0
  24. package/dist/api/runs.js.map +1 -0
  25. package/dist/api/settings.d.ts +1 -1
  26. package/dist/api/settings.d.ts.map +1 -1
  27. package/dist/api/settings.js +39 -1
  28. package/dist/api/settings.js.map +1 -1
  29. package/dist/db.d.ts +2 -0
  30. package/dist/db.d.ts.map +1 -1
  31. package/dist/db.js +4 -0
  32. package/dist/db.js.map +1 -1
  33. package/dist/lib/buildDeletion.d.ts +21 -0
  34. package/dist/lib/buildDeletion.d.ts.map +1 -0
  35. package/dist/lib/buildDeletion.js +58 -0
  36. package/dist/lib/buildDeletion.js.map +1 -0
  37. package/dist/lib/watchActions.d.ts +10 -0
  38. package/dist/lib/watchActions.d.ts.map +1 -0
  39. package/dist/lib/watchActions.js +27 -0
  40. package/dist/lib/watchActions.js.map +1 -0
  41. package/dist/middleware/auth.d.ts +1 -0
  42. package/dist/middleware/auth.d.ts.map +1 -1
  43. package/dist/middleware/auth.js +1 -1
  44. package/dist/middleware/auth.js.map +1 -1
  45. package/dist/migrations/015_flow_runs.sql +59 -0
  46. package/dist/migrations/016_flow_run_videos.sql +51 -0
  47. package/dist/router.d.ts +5 -0
  48. package/dist/router.d.ts.map +1 -1
  49. package/dist/router.js +24 -0
  50. package/dist/router.js.map +1 -1
  51. package/package.json +9 -9
  52. package/public/assets/AISessionWatch-Bxew762e.js +36 -0
  53. package/public/assets/AISessionWatch-Bxew762e.js.br +0 -0
  54. package/public/assets/AISessionWatch-Bxew762e.js.gz +0 -0
  55. package/public/assets/AndroidDeviceScreen-C55msKfh.js +35 -0
  56. package/public/assets/AndroidDeviceScreen-C55msKfh.js.br +0 -0
  57. package/public/assets/AndroidDeviceScreen-C55msKfh.js.gz +0 -0
  58. package/public/assets/AppCenter-93hnrrdy.js +26 -0
  59. package/public/assets/AppCenter-93hnrrdy.js.br +0 -0
  60. package/public/assets/AppCenter-93hnrrdy.js.gz +0 -0
  61. package/public/assets/Default-BhgcUKBm.js +6 -0
  62. package/public/assets/Default-BhgcUKBm.js.br +0 -0
  63. package/public/assets/Default-BhgcUKBm.js.gz +0 -0
  64. package/public/assets/Invite-DQBwLaOl.js +1 -0
  65. package/public/assets/Invite-DQBwLaOl.js.br +0 -0
  66. package/public/assets/Invite-DQBwLaOl.js.gz +0 -0
  67. package/public/assets/MacResources-D4LMGxgV.js +1 -0
  68. package/public/assets/MacResources-D4LMGxgV.js.br +0 -0
  69. package/public/assets/MacResources-D4LMGxgV.js.gz +0 -0
  70. package/public/assets/{NotFound-wHOnT2Fl.js → NotFound-DVq_rCKc.js} +1 -1
  71. package/public/assets/NotFound-DVq_rCKc.js.br +0 -0
  72. package/public/assets/NotFound-DVq_rCKc.js.gz +0 -0
  73. package/public/assets/QASession-Dnuq0yrN.js +81 -0
  74. package/public/assets/QASession-Dnuq0yrN.js.br +0 -0
  75. package/public/assets/QASession-Dnuq0yrN.js.gz +0 -0
  76. package/public/assets/ResetPassword-inTbbral.js +1 -0
  77. package/public/assets/ResetPassword-inTbbral.js.br +0 -0
  78. package/public/assets/ResetPassword-inTbbral.js.gz +0 -0
  79. package/public/assets/RunDetail-B3dw8_U0.js +16 -0
  80. package/public/assets/RunDetail-B3dw8_U0.js.br +0 -0
  81. package/public/assets/RunDetail-B3dw8_U0.js.gz +0 -0
  82. package/public/assets/Runs-DqZl9Y6M.js +6 -0
  83. package/public/assets/Runs-DqZl9Y6M.js.br +0 -0
  84. package/public/assets/Runs-DqZl9Y6M.js.gz +0 -0
  85. package/public/assets/Setup-CPa_UWpa.js +1 -0
  86. package/public/assets/Setup-CPa_UWpa.js.br +0 -0
  87. package/public/assets/Setup-CPa_UWpa.js.gz +0 -0
  88. package/public/assets/Team-DZie8W7R.js +6 -0
  89. package/public/assets/Team-DZie8W7R.js.br +0 -0
  90. package/public/assets/Team-DZie8W7R.js.gz +0 -0
  91. package/public/assets/Tokens-u3-uRAwd.js +1 -0
  92. package/public/assets/Tokens-u3-uRAwd.js.br +0 -0
  93. package/public/assets/Tokens-u3-uRAwd.js.gz +0 -0
  94. package/public/assets/WatchedDevice-CpaKHa1x.js +1 -0
  95. package/public/assets/WatchedDevice-CpaKHa1x.js.br +0 -0
  96. package/public/assets/WatchedDevice-CpaKHa1x.js.gz +0 -0
  97. package/public/assets/aiSession-BsmDnyV1.js +31 -0
  98. package/public/assets/aiSession-BsmDnyV1.js.br +0 -0
  99. package/public/assets/aiSession-BsmDnyV1.js.gz +0 -0
  100. package/public/assets/alert-dialog-Bq_Ln5bp.js +1 -0
  101. package/public/assets/alert-dialog-Bq_Ln5bp.js.br +0 -0
  102. package/public/assets/alert-dialog-Bq_Ln5bp.js.gz +0 -0
  103. package/public/assets/{badge-DNaS0Mu3.js → badge-D-bt97WR.js} +1 -1
  104. package/public/assets/badge-D-bt97WR.js.br +0 -0
  105. package/public/assets/badge-D-bt97WR.js.gz +0 -0
  106. package/public/assets/build-format-ofd2iIzf.js +1 -0
  107. package/public/assets/build-format-ofd2iIzf.js.br +0 -0
  108. package/public/assets/build-format-ofd2iIzf.js.gz +0 -0
  109. package/public/assets/dialog-CtzPkg0O.js +1 -0
  110. package/public/assets/dialog-CtzPkg0O.js.br +0 -0
  111. package/public/assets/dialog-CtzPkg0O.js.gz +0 -0
  112. package/public/assets/field-hint-B774BIWK.js +1 -0
  113. package/public/assets/field-hint-B774BIWK.js.br +1 -0
  114. package/public/assets/field-hint-B774BIWK.js.gz +0 -0
  115. package/public/assets/index-D17hSi50.js +1 -0
  116. package/public/assets/index-D17hSi50.js.br +0 -0
  117. package/public/assets/index-D17hSi50.js.gz +0 -0
  118. package/public/assets/index-EPyP3g9A.css +1 -0
  119. package/public/assets/index-EPyP3g9A.css.br +0 -0
  120. package/public/assets/index-EPyP3g9A.css.gz +0 -0
  121. package/public/assets/index-cgl1yEKu.js +223 -0
  122. package/public/assets/index-cgl1yEKu.js.br +0 -0
  123. package/public/assets/index-cgl1yEKu.js.gz +0 -0
  124. package/public/assets/list-view-BcjDCJy5.js +1 -0
  125. package/public/assets/list-view-BcjDCJy5.js.br +0 -0
  126. package/public/assets/list-view-BcjDCJy5.js.gz +0 -0
  127. package/public/assets/{pencil-BN18R4oa.js → pencil-1XSs32nb.js} +2 -2
  128. package/public/assets/pencil-1XSs32nb.js.br +0 -0
  129. package/public/assets/pencil-1XSs32nb.js.gz +0 -0
  130. package/public/assets/play-DCvrorIC.js +6 -0
  131. package/public/assets/play-DCvrorIC.js.br +0 -0
  132. package/public/assets/play-DCvrorIC.js.gz +0 -0
  133. package/public/assets/resource-health-oWJ8hy9X.js +1 -0
  134. package/public/assets/resource-health-oWJ8hy9X.js.br +0 -0
  135. package/public/assets/resource-health-oWJ8hy9X.js.gz +0 -0
  136. package/public/assets/runs-CInQb6v1.js +1 -0
  137. package/public/assets/runs-CInQb6v1.js.br +0 -0
  138. package/public/assets/runs-CInQb6v1.js.gz +0 -0
  139. package/public/assets/search-input-CFWgLcKA.js +6 -0
  140. package/public/assets/search-input-CFWgLcKA.js.br +0 -0
  141. package/public/assets/search-input-CFWgLcKA.js.gz +0 -0
  142. package/public/assets/select-5ZtzWRYG.js +11 -0
  143. package/public/assets/select-5ZtzWRYG.js.br +0 -0
  144. package/public/assets/select-5ZtzWRYG.js.gz +0 -0
  145. package/public/assets/slider-DHuMDXcP.js +1 -0
  146. package/public/assets/slider-DHuMDXcP.js.br +0 -0
  147. package/public/assets/slider-DHuMDXcP.js.gz +0 -0
  148. package/public/assets/tabs-CmgV_sSI.js +1 -0
  149. package/public/assets/tabs-CmgV_sSI.js.br +0 -0
  150. package/public/assets/tabs-CmgV_sSI.js.gz +0 -0
  151. package/public/assets/tech-label-qLodPeUI.js +1 -0
  152. package/public/assets/tech-label-qLodPeUI.js.br +0 -0
  153. package/public/assets/tech-label-qLodPeUI.js.gz +0 -0
  154. package/public/assets/{trash-D1l1Fm-Z.js → trash-CXjB9oU1.js} +3 -3
  155. package/public/assets/trash-CXjB9oU1.js.br +0 -0
  156. package/public/assets/trash-CXjB9oU1.js.gz +0 -0
  157. package/public/assets/{useFocusAfterSwap-BY3N9f9v.js → useFocusAfterSwap-BdItkQCu.js} +1 -1
  158. package/public/assets/useFocusAfterSwap-BdItkQCu.js.br +0 -0
  159. package/public/assets/useFocusAfterSwap-BdItkQCu.js.gz +0 -0
  160. package/public/assets/useRelay-CES3I1Mt.js +1 -0
  161. package/public/assets/useRelay-CES3I1Mt.js.br +0 -0
  162. package/public/assets/useRelay-CES3I1Mt.js.gz +0 -0
  163. package/public/assets/useShownAfter-By1Yxysz.js +1 -0
  164. package/public/assets/useShownAfter-By1Yxysz.js.br +0 -0
  165. package/public/assets/useShownAfter-By1Yxysz.js.gz +0 -0
  166. package/public/assets/{vendor-charts-BykzUV2D.js → vendor-charts-BE7R_8yA.js} +2 -2
  167. package/public/assets/vendor-charts-BE7R_8yA.js.br +0 -0
  168. package/public/assets/vendor-charts-BE7R_8yA.js.gz +0 -0
  169. package/public/assets/{vendor-react-BlPSzrEe.js → vendor-react-DTSdA8m-.js} +4 -4
  170. package/public/assets/vendor-react-DTSdA8m-.js.br +0 -0
  171. package/public/assets/{vendor-react-BlPSzrEe.js.gz → vendor-react-DTSdA8m-.js.gz} +0 -0
  172. package/public/assets/{vendor-router-B_lVHrKl.js → vendor-router-B1pQim9Z.js} +3 -3
  173. package/public/assets/vendor-router-B1pQim9Z.js.br +0 -0
  174. package/public/assets/vendor-router-B1pQim9Z.js.gz +0 -0
  175. package/public/assets/video-CK2q3-0B.js +6 -0
  176. package/public/assets/video-CK2q3-0B.js.br +0 -0
  177. package/public/assets/video-CK2q3-0B.js.gz +0 -0
  178. package/public/index.html +18 -4
  179. package/public/index.html.br +0 -0
  180. package/public/index.html.gz +0 -0
  181. package/public/assets/AppCenter-CeLjUbnR.js +0 -26
  182. package/public/assets/AppCenter-CeLjUbnR.js.br +0 -0
  183. package/public/assets/AppCenter-CeLjUbnR.js.gz +0 -0
  184. package/public/assets/Default-UB0Pa3lN.js +0 -1
  185. package/public/assets/Default-UB0Pa3lN.js.br +0 -0
  186. package/public/assets/Default-UB0Pa3lN.js.gz +0 -0
  187. package/public/assets/Invite-Dv3omu3x.js +0 -1
  188. package/public/assets/Invite-Dv3omu3x.js.br +0 -0
  189. package/public/assets/Invite-Dv3omu3x.js.gz +0 -0
  190. package/public/assets/MacResources-CY4-OdGt.js +0 -1
  191. package/public/assets/MacResources-CY4-OdGt.js.br +0 -0
  192. package/public/assets/MacResources-CY4-OdGt.js.gz +0 -0
  193. package/public/assets/NotFound-wHOnT2Fl.js.br +0 -0
  194. package/public/assets/NotFound-wHOnT2Fl.js.gz +0 -0
  195. package/public/assets/QASession-H5eRSwZv.js +0 -150
  196. package/public/assets/QASession-H5eRSwZv.js.br +0 -0
  197. package/public/assets/QASession-H5eRSwZv.js.gz +0 -0
  198. package/public/assets/ResetPassword-nFTigYt2.js +0 -1
  199. package/public/assets/ResetPassword-nFTigYt2.js.br +0 -0
  200. package/public/assets/ResetPassword-nFTigYt2.js.gz +0 -0
  201. package/public/assets/Setup-UmLtF2PF.js +0 -1
  202. package/public/assets/Setup-UmLtF2PF.js.br +0 -0
  203. package/public/assets/Setup-UmLtF2PF.js.gz +0 -0
  204. package/public/assets/Team-DW40kt3H.js +0 -6
  205. package/public/assets/Team-DW40kt3H.js.br +0 -0
  206. package/public/assets/Team-DW40kt3H.js.gz +0 -0
  207. package/public/assets/Tokens-B1a4ChJK.js +0 -1
  208. package/public/assets/Tokens-B1a4ChJK.js.br +0 -0
  209. package/public/assets/Tokens-B1a4ChJK.js.gz +0 -0
  210. package/public/assets/alert-dialog-aoqYdAwx.js +0 -1
  211. package/public/assets/alert-dialog-aoqYdAwx.js.br +0 -0
  212. package/public/assets/alert-dialog-aoqYdAwx.js.gz +0 -0
  213. package/public/assets/badge-DNaS0Mu3.js.br +0 -0
  214. package/public/assets/badge-DNaS0Mu3.js.gz +0 -0
  215. package/public/assets/build-format-DF5aFcag.js +0 -11
  216. package/public/assets/build-format-DF5aFcag.js.br +0 -0
  217. package/public/assets/build-format-DF5aFcag.js.gz +0 -0
  218. package/public/assets/dialog-DE2WUMuX.js +0 -11
  219. package/public/assets/dialog-DE2WUMuX.js.br +0 -0
  220. package/public/assets/dialog-DE2WUMuX.js.gz +0 -0
  221. package/public/assets/field-hint-Csb40Gzp.js +0 -1
  222. package/public/assets/field-hint-Csb40Gzp.js.br +0 -2
  223. package/public/assets/field-hint-Csb40Gzp.js.gz +0 -0
  224. package/public/assets/index-BbCkTtjO.css +0 -1
  225. package/public/assets/index-BbCkTtjO.css.br +0 -0
  226. package/public/assets/index-BbCkTtjO.css.gz +0 -0
  227. package/public/assets/index-DSW9h8XX.js +0 -218
  228. package/public/assets/index-DSW9h8XX.js.br +0 -0
  229. package/public/assets/index-DSW9h8XX.js.gz +0 -0
  230. package/public/assets/list-view-C0w97ltJ.js +0 -1
  231. package/public/assets/list-view-C0w97ltJ.js.br +0 -0
  232. package/public/assets/list-view-C0w97ltJ.js.gz +0 -0
  233. package/public/assets/pencil-BN18R4oa.js.br +0 -0
  234. package/public/assets/pencil-BN18R4oa.js.gz +0 -0
  235. package/public/assets/resource-health-Bi20EUDs.js +0 -1
  236. package/public/assets/resource-health-Bi20EUDs.js.br +0 -0
  237. package/public/assets/resource-health-Bi20EUDs.js.gz +0 -0
  238. package/public/assets/trash-D1l1Fm-Z.js.br +0 -0
  239. package/public/assets/trash-D1l1Fm-Z.js.gz +0 -0
  240. package/public/assets/useFocusAfterSwap-BY3N9f9v.js.br +0 -0
  241. package/public/assets/useFocusAfterSwap-BY3N9f9v.js.gz +0 -0
  242. package/public/assets/vendor-charts-BykzUV2D.js.br +0 -0
  243. package/public/assets/vendor-charts-BykzUV2D.js.gz +0 -0
  244. package/public/assets/vendor-react-BlPSzrEe.js.br +0 -0
  245. package/public/assets/vendor-router-B_lVHrKl.js.br +0 -0
  246. package/public/assets/vendor-router-B_lVHrKl.js.gz +0 -0
@@ -0,0 +1,223 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Setup-CPa_UWpa.js","assets/vendor-react-DTSdA8m-.js","assets/field-hint-B774BIWK.js","assets/vendor-router-B1pQim9Z.js","assets/Invite-DQBwLaOl.js","assets/pencil-1XSs32nb.js","assets/ResetPassword-inTbbral.js","assets/AppCenter-93hnrrdy.js","assets/search-input-CFWgLcKA.js","assets/select-5ZtzWRYG.js","assets/index-D17hSi50.js","assets/dialog-CtzPkg0O.js","assets/tech-label-qLodPeUI.js","assets/trash-CXjB9oU1.js","assets/badge-D-bt97WR.js","assets/alert-dialog-Bq_Ln5bp.js","assets/build-format-ofd2iIzf.js","assets/play-DCvrorIC.js","assets/useFocusAfterSwap-BdItkQCu.js","assets/useShownAfter-By1Yxysz.js","assets/QASession-Dnuq0yrN.js","assets/useRelay-CES3I1Mt.js","assets/AndroidDeviceScreen-C55msKfh.js","assets/aiSession-BsmDnyV1.js","assets/video-CK2q3-0B.js","assets/tabs-CmgV_sSI.js","assets/publicLink-D6zKS_wu.js","assets/resource-health-oWJ8hy9X.js","assets/Runs-DqZl9Y6M.js","assets/list-view-BcjDCJy5.js","assets/runs-CInQb6v1.js","assets/RunDetail-B3dw8_U0.js","assets/slider-DHuMDXcP.js","assets/WatchedDevice-CpaKHa1x.js","assets/AISessionWatch-Bxew762e.js","assets/MacResources-D4LMGxgV.js","assets/vendor-charts-BE7R_8yA.js","assets/Default-BhgcUKBm.js","assets/Team-DZie8W7R.js","assets/Tokens-u3-uRAwd.js","assets/NotFound-DVq_rCKc.js"])))=>i.map(i=>d[i]);
2
+ var nc=e=>{throw TypeError(e)};var ks=(e,t,n)=>t.has(e)||nc("Cannot "+n);var S=(e,t,n)=>(ks(e,t,"read from private field"),n?n.call(e):t.get(e)),se=(e,t,n)=>t.has(e)?nc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),q=(e,t,n,r)=>(ks(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),pe=(e,t,n)=>(ks(e,t,"access private method"),n);var ho=(e,t,n,r)=>({set _(o){q(e,t,o,n)},get _(){return S(e,t,r)}});import{r as h,j as m,R as I,a as Cp,b as Bn,c as te,d as ru,u as kp,o as Op,s as Pp,f as Rp,e as Tp,h as Ip,i as Ap,l as Np,k as Dp,m as Mp}from"./vendor-react-DTSdA8m-.js";import{u as ou,a as su,L as po,N as Gi,O as jp,R as ot,b as $p,B as zp}from"./vendor-router-B1pQim9Z.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();var Fp=(e,t,n,r,o,s,i,a)=>{let c=document.documentElement,u=["light","dark"];function d(p){(Array.isArray(e)?e:[e]).forEach(v=>{let g=v==="class",_=g&&s?o.map(b=>s[b]||b):o;g?(c.classList.remove(..._),c.classList.add(s&&s[p]?s[p]:p)):c.setAttribute(v,p)}),l(p)}function l(p){a&&u.includes(p)&&(c.style.colorScheme=p)}function f(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)d(r);else try{let p=localStorage.getItem(t)||n,v=i&&p==="system"?f():p;d(v)}catch{}},rc=["light","dark"],iu="(prefers-color-scheme: dark)",Lp=typeof window>"u",qi=h.createContext(void 0),Vp={setTheme:e=>{},themes:[]},os=()=>{var e;return(e=h.useContext(qi))!=null?e:Vp},Up=e=>h.useContext(qi)?h.createElement(h.Fragment,null,e.children):h.createElement(Bp,{...e}),Zp=["light","dark"],Bp=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:o="theme",themes:s=Zp,defaultTheme:i=n?"system":"light",attribute:a="data-theme",value:c,children:u,nonce:d,scriptProps:l})=>{let[f,p]=h.useState(()=>Hp(o,i)),[v,g]=h.useState(()=>f==="system"?Os():f),_=c?Object.values(c):s,b=h.useCallback(E=>{let P=E;if(!P)return;E==="system"&&n&&(P=Os());let R=c?c[P]:P,T=t?Kp(d):null,A=document.documentElement,j=L=>{L==="class"?(A.classList.remove(..._),R&&A.classList.add(R)):L.startsWith("data-")&&(R?A.setAttribute(L,R):A.removeAttribute(L))};if(Array.isArray(a)?a.forEach(j):j(a),r){let L=rc.includes(i)?i:null,z=rc.includes(P)?P:L;A.style.colorScheme=z}T==null||T()},[d]),x=h.useCallback(E=>{let P=typeof E=="function"?E(f):E;p(P);try{localStorage.setItem(o,P)}catch{}},[f]),w=h.useCallback(E=>{let P=Os(E);g(P),f==="system"&&n&&!e&&b("system")},[f,e]);h.useEffect(()=>{let E=window.matchMedia(iu);return E.addListener(w),w(E),()=>E.removeListener(w)},[w]),h.useEffect(()=>{let E=P=>{P.key===o&&(P.newValue?p(P.newValue):x(i))};return window.addEventListener("storage",E),()=>window.removeEventListener("storage",E)},[x]),h.useEffect(()=>{b(e??f)},[e,f]);let C=h.useMemo(()=>({theme:f,setTheme:x,forcedTheme:e,resolvedTheme:f==="system"?v:f,themes:n?[...s,"system"]:s,systemTheme:n?v:void 0}),[f,x,e,v,n,s]);return h.createElement(qi.Provider,{value:C},h.createElement(Wp,{forcedTheme:e,storageKey:o,attribute:a,enableSystem:n,enableColorScheme:r,defaultTheme:i,value:c,themes:s,nonce:d,scriptProps:l}),u)},Wp=h.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:s,value:i,themes:a,nonce:c,scriptProps:u})=>{if(typeof window<"u")return null;let d=JSON.stringify([n,t,s,e,a,i,r,o]).slice(1,-1);return h.createElement("script",{...u,suppressHydrationWarning:!0,nonce:typeof window>"u"?c:"",dangerouslySetInnerHTML:{__html:`(${Fp.toString()})(${d})`}})}),Hp=(e,t)=>{if(Lp)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},Kp=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},Os=e=>(e||(e=window.matchMedia(iu)),e.matches?"dark":"light");const Gp="modulepreload",qp=function(e){return"/"+e},oc={},Et=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let i=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(l=>({status:"fulfilled",value:l}),l=>({status:"rejected",reason:l}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));o=i(n.map(u=>{if(u=qp(u),u in oc)return;oc[u]=!0;const d=u.endsWith(".css"),l=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${l}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":Gp,d||(f.as="script"),f.crossOrigin="",f.href=u,c&&f.setAttribute("nonce",c),document.head.appendChild(f),d)return new Promise((p,v)=>{f.addEventListener("load",p),f.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return o.then(i=>{for(const a of i||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})},au=h.createContext(void 0),Qi=e=>{const t=h.useContext(au);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Qp=({client:e,children:t})=>(h.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),m.jsx(au.Provider,{value:e,children:t})),Yp={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var gn,Ki,Kl,Jp=(Kl=class{constructor(){se(this,gn,Yp);se(this,Ki,!1)}setTimeoutProvider(e){q(this,gn,e)}setTimeout(e,t){return S(this,gn).setTimeout(e,t)}clearTimeout(e){S(this,gn).clearTimeout(e)}setInterval(e,t){return S(this,gn).setInterval(e,t)}clearInterval(e){S(this,gn).clearInterval(e)}},gn=new WeakMap,Ki=new WeakMap,Kl);const In=new Jp;function Xp(e){setTimeout(e,0)}const em=typeof window>"u"||"Deno"in globalThis;function vt(){}function tm(e,t){return typeof e=="function"?e(t):e}function cu(e){return typeof e=="number"&&e>=0&&e!==1/0}function lu(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Re(e,t){return typeof e=="function"?e(t):e}function sc(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Yi(i,t.options))return!1}else if(!vr(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function ic(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Hr(t.options.mutationKey)!==Hr(s))return!1}else if(!vr(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Yi(e,t){return((t==null?void 0:t.queryKeyHashFn)||Hr)(e)}function Hr(e){return JSON.stringify(e,(t,n)=>Qs(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function vr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let r=0;r<t.length;r++)if(!vr(e[r],t[r]))return!1;return!0}const n=Object.keys(t);for(const r of n)if(!vr(e[r],t[r]))return!1;return!0}return!1}const nm=Object.prototype.hasOwnProperty;function uu(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=ac(e)&&ac(t);if(!r&&!(Qs(e)&&Qs(t)))return t;const o=(r?e:Object.keys(e)).length,s=r?t:Object.keys(t),i=s.length,a=r?new Array(i):{};let c=0;for(let u=0;u<i;u++){const d=r?u:s[u],l=e[d],f=t[d];if(l===f){a[d]=l,(r?u<o:nm.call(e,d))&&c++;continue}if(l===null||f===null||typeof l!="object"||typeof f!="object"){a[d]=f;continue}const p=uu(l,f,n+1);a[d]=p,p===l&&c++}return o===i&&c===o?e:a}function Ps(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function ac(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Qs(e){if(!cc(e))return!1;const t=Object.getPrototypeOf(e),n=t==null?void 0:t.constructor;if(n===void 0)return!0;if(typeof n!="function")return!1;const r=n.prototype;return!(!cc(r)||!r.hasOwnProperty("isPrototypeOf")||t!==Object.prototype)}function cc(e){return Object.prototype.toString.call(e)==="[object Object]"}function rm(e){return new Promise(t=>{In.setTimeout(t,e)})}function Ys(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?uu(e,t):t}function hk(e){return e}function om(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function sm(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}const Ji=Symbol();function du(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ji?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function fu(e,t){return typeof e=="function"?e(...t):!!e}function im(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}let am=()=>em;const Xi=()=>am();var oo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},An,vn,or,Gl,cm=(Gl=class extends oo{constructor(){super();se(this,An);se(this,vn);se(this,or);q(this,or,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){S(this,vn)||this.setEventListener(S(this,or))}onUnsubscribe(){var t;this.hasListeners()||((t=S(this,vn))==null||t.call(this),q(this,vn,void 0))}setEventListener(t){var n;q(this,or,t),(n=S(this,vn))==null||n.call(this),q(this,vn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){S(this,An)!==t&&(q(this,An,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof S(this,An)=="boolean"?S(this,An):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},An=new WeakMap,vn=new WeakMap,or=new WeakMap,Gl);const ea=new cm,lm=Xp;function um(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=lm;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}const et=um();var sr,yn,ir,ql,dm=(ql=class extends oo{constructor(){super();se(this,sr,!0);se(this,yn);se(this,ir);q(this,ir,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){S(this,yn)||this.setEventListener(S(this,ir))}onUnsubscribe(){var t;this.hasListeners()||((t=S(this,yn))==null||t.call(this),q(this,yn,void 0))}setEventListener(t){var n;q(this,ir,t),(n=S(this,yn))==null||n.call(this),q(this,yn,t(this.setOnline.bind(this)))}setOnline(t){S(this,sr)!==t&&(q(this,sr,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return S(this,sr)}},sr=new WeakMap,yn=new WeakMap,ir=new WeakMap,ql);const Uo=new dm;function fm(e){return Math.min(1e3*2**e,3e4)}function hu(e){return(e??"online")==="online"?Uo.isOnline():!0}var Js=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function pu(e){let t=!1,n=0,r,o="pending",s,i;const a=new Promise((x,w)=>{s=x,i=w});a.catch(vt);const c=()=>o!=="pending",u=x=>{var w;if(!c()){const C=new Js(x);g(C),(w=e.onCancel)==null||w.call(e,C)}},d=()=>{t=!0},l=()=>{t=!1},f=()=>ea.isFocused()&&(e.networkMode==="always"||Uo.isOnline())&&e.canRun(),p=()=>hu(e.networkMode)&&e.canRun(),v=x=>{c()||(r==null||r(),o="resolved",s(x))},g=x=>{c()||(r==null||r(),o="rejected",i(x))},_=x=>new Promise(w=>{var C;r=E=>{(c()||x())&&w(E)},(C=e.onPause)==null||C.call(e)}).then(()=>{var w;r=void 0,c()||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(c())return;let x;const w=n===0?e.initialPromise:void 0;try{x=w??e.fn()}catch(C){x=Promise.reject(C)}Promise.resolve(x).then(v).catch(C=>{var A;if(c())return;const E=e.retry??(Xi()?0:3),P=e.retryDelay??fm,R=typeof P=="function"?P(n,C):P,T=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,C);if(t||!T){g(C);return}n++,(A=e.onFail)==null||A.call(e,n,C),rm(R).then(()=>f()?void 0:_(f)).then(()=>{t?g(C):b()})})};return{promise:a,status:()=>o,cancel:u,continue:()=>(r==null||r(),a),cancelRetry:d,continueRetry:l,canStart:p,start:()=>(p()?b():_(p).then(b),a)}}var Nn,Ql,mu=(Ql=class{constructor(){se(this,Nn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),cu(this.gcTime)&&q(this,Nn,In.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Xi()?1/0:3e5))}clearGcTimeout(){S(this,Nn)!==void 0&&(In.clearTimeout(S(this,Nn)),q(this,Nn,void 0))}},Nn=new WeakMap,Ql);function hm(e){return{onFetch:(t,n)=>{var d,l,f,p,v;const r=t.options,o=(f=(l=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:l.fetchMore)==null?void 0:f.direction,s=((p=t.state.data)==null?void 0:p.pages)||[],i=((v=t.state.data)==null?void 0:v.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let g=!1;const _=w=>{im(w,()=>t.signal,()=>g=!0)},b=du(t.options,t.fetchOptions),x=async(w,C,E)=>{if(g)return Promise.reject(t.signal.reason);if(C==null&&w.pages.length)return Promise.resolve(w);const R=(()=>{const L={client:t.client,queryKey:t.queryKey,pageParam:C,direction:E?"backward":"forward",meta:t.options.meta};return _(L),L})(),T=await b(R),{maxPages:A}=t.options,j=E?sm:om;return{pages:j(w.pages,T,A),pageParams:j(w.pageParams,C,A)}};if(o&&s.length){const w=o==="backward",C=w?pm:lc,E={pages:s,pageParams:i};a=await x(E,C(r,E),w)}else{const w=e??s.length;do{const C=c===0?i[0]??r.initialPageParam:lc(r,a);if(c>0&&C==null)break;a=await x(a,C),c++}while(c<w)}return a};t.options.persister?t.fetchFn=()=>{var g,_;return(_=(g=t.options).persister)==null?void 0:_.call(g,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function lc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function pm(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var ar,Dn,cr,Ot,Mn,He,Xr,jn,Nt,Kt,Yl,mm=(Yl=class extends mu{constructor(t){super();se(this,Nt);se(this,ar);se(this,Dn);se(this,cr);se(this,Ot);se(this,Mn);se(this,He);se(this,Xr);se(this,jn);q(this,jn,!1),q(this,Xr,t.defaultOptions),this.setOptions(t.options),this.observers=[],q(this,Mn,t.client),q(this,Ot,S(this,Mn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,q(this,Dn,dc(this.options)),this.state=t.state??S(this,Dn),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return S(this,ar)}get promise(){var t;return(t=S(this,He))==null?void 0:t.promise}setOptions(t){if(this.options={...S(this,Xr),...t},t!=null&&t._type&&q(this,ar,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=dc(this.options);n.data!==void 0&&(this.setState(uc(n.data,n.dataUpdatedAt)),q(this,Dn,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&S(this,Ot).remove(this)}setData(t,n){const r=Ys(this.state.data,t,this.options);return pe(this,Nt,Kt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){pe(this,Nt,Kt).call(this,{type:"setState",state:t})}cancel(t){var r,o;const n=(r=S(this,He))==null?void 0:r.promise;return(o=S(this,He))==null||o.cancel(t),n?n.then(vt).catch(vt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return S(this,Dn)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Re(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ji||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Re(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!lu(this.state.dataUpdatedAt,t)}onFocus(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||t.refetch({cancelRefetch:!1}),(n=S(this,He))==null||n.continue()}onOnline(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||t.refetch({cancelRefetch:!1}),(n=S(this,He))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),S(this,Ot).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){const n=this.observers.indexOf(t);n!==-1&&(this.observers.splice(n,1),this.observers.length||(S(this,He)&&(S(this,jn)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?S(this,He).cancel({revert:!0}):S(this,He).cancelRetry()),this.scheduleGc()),S(this,Ot).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||pe(this,Nt,Kt).call(this,{type:"invalidate"})}async fetch(t,n){var u,d,l,f,p,v,g,_,b,x,w,C;if(this.state.fetchStatus!=="idle"&&((u=S(this,He))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(S(this,He))return S(this,He).continueRetry(),S(this,He).promise}if(t&&this.setOptions(t),!this.options.queryFn){const E=this.observers.find(P=>P.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,o=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(q(this,jn,!0),r.signal)})},s=()=>{const E=du(this.options,n),R=(()=>{const T={client:S(this,Mn),queryKey:this.queryKey,meta:this.meta};return o(T),T})();return q(this,jn,!1),this.options.persister?this.options.persister(E,R,this):E(R)},a=(()=>{const E={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:S(this,Mn),state:this.state,fetchFn:s};return o(E),E})();(d=S(this,ar)==="infinite"?hm(this.options.pages):this.options.behavior)==null||d.onFetch(a,this),q(this,cr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((l=a.fetchOptions)==null?void 0:l.meta))&&pe(this,Nt,Kt).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta});const c=q(this,He,pu({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:E=>{E instanceof Js&&E.revert&&this.setState({...S(this,cr),fetchStatus:"idle"}),r.abort()},onFail:(E,P)=>{pe(this,Nt,Kt).call(this,{type:"failed",failureCount:E,error:P})},onPause:()=>{pe(this,Nt,Kt).call(this,{type:"pause"})},onContinue:()=>{pe(this,Nt,Kt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const E=await c.start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(v=(p=S(this,Ot).config).onSuccess)==null||v.call(p,E,this),(_=(g=S(this,Ot).config).onSettled)==null||_.call(g,E,this.state.error,this),E}catch(E){if(E instanceof Js){if(E.silent)return S(this,He).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw pe(this,Nt,Kt).call(this,{type:"error",error:E}),(x=(b=S(this,Ot).config).onError)==null||x.call(b,E,this),(C=(w=S(this,Ot).config).onSettled)==null||C.call(w,this.state.data,E,this),E}finally{S(this,He)===c&&q(this,He,void 0),this.scheduleGc()}}},ar=new WeakMap,Dn=new WeakMap,cr=new WeakMap,Ot=new WeakMap,Mn=new WeakMap,He=new WeakMap,Xr=new WeakMap,jn=new WeakMap,Nt=new WeakSet,Kt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...gu(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...uc(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return q(this,cr,t.manual?o:void 0),o;case"error":const s=t.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),et.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),S(this,Ot).notify({query:this,type:"updated",action:t})})},Yl);function gu(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hu(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function uc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function dc(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ut,me,eo,dt,$n,lr,Qt,to,ur,dr,zn,Fn,bn,fr,xe,Fr,Xs,ei,ti,ni,ri,oi,si,ii,Jl,gm=(Jl=class extends oo{constructor(t,n){super();se(this,xe);se(this,ut);se(this,me);se(this,eo);se(this,dt);se(this,$n);se(this,lr);se(this,Qt);se(this,to);se(this,ur);se(this,dr);se(this,zn);se(this,Fn);se(this,bn);se(this,fr,new Set);this.options=n,q(this,ut,t),q(this,Qt,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(S(this,me).addObserver(this),fc(S(this,me),this.options)?pe(this,xe,Fr).call(this):this.updateResult(),pe(this,xe,ri).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ai(S(this,me),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ai(S(this,me),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,pe(this,xe,oi).call(this),pe(this,xe,si).call(this),S(this,me).removeObserver(this)}setOptions(t){const n=this.options,r=S(this,me);if(this.options=S(this,ut).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Re(this.options.enabled,S(this,me))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");pe(this,xe,ii).call(this),S(this,me).setOptions(this.options),n._defaulted&&!Ps(this.options,n)&&S(this,ut).getQueryCache().notify({type:"observerOptionsUpdated",query:S(this,me),observer:this});const o=this.hasListeners();o&&hc(S(this,me),r,this.options,n)&&pe(this,xe,Fr).call(this),this.updateResult(),o&&(S(this,me)!==r||Re(this.options.enabled,S(this,me))!==Re(n.enabled,S(this,me))||Re(this.options.staleTime,S(this,me))!==Re(n.staleTime,S(this,me)))&&pe(this,xe,ei).call(this);const s=pe(this,xe,ti).call(this);o&&(S(this,me)!==r||Re(this.options.enabled,S(this,me))!==Re(n.enabled,S(this,me))||s!==S(this,bn))&&pe(this,xe,ni).call(this,s)}getOptimisticResult(t){const n=S(this,ut).getQueryCache().build(S(this,ut),t),r=this.createResult(n,t);return Ps(this.getCurrentResult(),r)||(q(this,dt,r),q(this,lr,this.options),q(this,$n,S(this,me).state)),r}getCurrentResult(){return S(this,dt)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),Reflect.get(r,o))})}trackProp(t){S(this,fr).add(t)}getCurrentQuery(){return S(this,me)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=S(this,ut).defaultQueryOptions(t),r=S(this,ut).getQueryCache().build(S(this,ut),n);let o=()=>{},s;const i=new Promise(a=>{s=a,o=S(this,ut).getQueryCache().subscribe(c=>{c.type==="updated"&&c.query.queryHash===r.queryHash&&r.state.data!==void 0&&(o(),a(this.createResult(r,n)))})});return Promise.race([r.fetch().then(()=>{const a=this.createResult(r,n);return s==null||s(a),a}).finally(()=>{o()}),i])}fetch(t){return pe(this,xe,Fr).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),S(this,dt)))}createResult(t,n){var P;const r=S(this,me),o=this.options,s=S(this,dt),i=S(this,$n),a=S(this,lr),c=t!==r?t.state:S(this,eo),{state:u}=t;let d={...u},l=!1,f;if(n._optimisticResults){const R=this.hasListeners(),T=!R&&fc(t,n),A=R&&hc(t,r,n,o);(T||A)&&(d={...d,...gu(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:v,status:g}=d;f=d.data;let _=!1;if(n.placeholderData!==void 0&&f===void 0&&g==="pending"){let R;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(R=s.data,_=!0):R=typeof n.placeholderData=="function"?n.placeholderData((P=S(this,dr))==null?void 0:P.state.data,S(this,dr)):n.placeholderData,R!==void 0&&(g="success",f=Ys(s==null?void 0:s.data,R,n),l=!0)}if(n.select&&f!==void 0&&!_)if(s&&f===(i==null?void 0:i.data)&&n.select===S(this,to))f=S(this,ur);else try{q(this,to,n.select),f=n.select(f),f=Ys(s==null?void 0:s.data,f,n),q(this,ur,f),q(this,Qt,null)}catch(R){q(this,Qt,R)}else f===void 0&&q(this,Qt,null);S(this,Qt)&&(p=S(this,Qt),f=S(this,ur),v=Date.now(),g="error",l=!1);const b=d.fetchStatus==="fetching",x=g==="pending",w=g==="error",C=x&&b,E=f!==void 0;return{status:g,fetchStatus:d.fetchStatus,isPending:x,isSuccess:g==="success",isError:w,isInitialLoading:C,isLoading:C,data:f,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:w&&!E,isPaused:d.fetchStatus==="paused",isPlaceholderData:l,isRefetchError:w&&E,isStale:ta(t,n),refetch:this.refetch,isEnabled:Re(n.enabled,t)!==!1}}updateResult(){const t=S(this,dt),n=this.createResult(S(this,me),this.options);if(q(this,$n,S(this,me).state),q(this,lr,this.options),S(this,$n).data!==void 0&&q(this,dr,S(this,me)),Ps(n,t))return;q(this,dt,n);const o=(()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!S(this,fr).size)return!0;const a=new Set(i??S(this,fr));return this.options.throwOnError&&a.add("error"),Object.keys(S(this,dt)).some(c=>{const u=c;return S(this,dt)[u]!==t[u]&&a.has(u)})})();et.batch(()=>{o&&this.listeners.forEach(s=>{s(S(this,dt))}),S(this,ut).getQueryCache().notify({query:S(this,me),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&pe(this,xe,ri).call(this)}},ut=new WeakMap,me=new WeakMap,eo=new WeakMap,dt=new WeakMap,$n=new WeakMap,lr=new WeakMap,Qt=new WeakMap,to=new WeakMap,ur=new WeakMap,dr=new WeakMap,zn=new WeakMap,Fn=new WeakMap,bn=new WeakMap,fr=new WeakMap,xe=new WeakSet,Fr=function(t){pe(this,xe,ii).call(this);let n=S(this,me).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(vt)),n},Xs=function(t){return!Xi()&&Re(this.options.enabled,S(this,me))!==!1&&cu(t)},ei=function(){pe(this,xe,oi).call(this);const t=Re(this.options.staleTime,S(this,me));if(S(this,dt).isStale||!pe(this,xe,Xs).call(this,t))return;const n=lu(S(this,dt).dataUpdatedAt,t)+1;q(this,zn,In.setTimeout(()=>{S(this,dt).isStale||this.updateResult()},n))},ti=function(){return Re(this.options.refetchInterval,S(this,me))??!1},ni=function(t){pe(this,xe,si).call(this),q(this,bn,t),!(S(this,bn)===0||!pe(this,xe,Xs).call(this,S(this,bn)))&&q(this,Fn,In.setInterval(()=>{(this.options.refetchIntervalInBackground||ea.isFocused())&&pe(this,xe,Fr).call(this)},S(this,bn)))},ri=function(){pe(this,xe,ei).call(this),pe(this,xe,ni).call(this,pe(this,xe,ti).call(this))},oi=function(){S(this,zn)!==void 0&&(In.clearTimeout(S(this,zn)),q(this,zn,void 0))},si=function(){S(this,Fn)!==void 0&&(In.clearInterval(S(this,Fn)),q(this,Fn,void 0))},ii=function(){const t=S(this,ut).getQueryCache().build(S(this,ut),this.options);if(t===S(this,me))return;const n=S(this,me);q(this,me,t),q(this,eo,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Jl);function vm(e,t){return Re(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Re(t.retryOnMount,e)===!1)}function fc(e,t){return vm(e,t)||e.state.data!==void 0&&ai(e,t,t.refetchOnMount)}function ai(e,t,n){if(Re(t.enabled,e)!==!1&&Re(t.staleTime,e)!=="static"){const r=Re(n,e);return r==="always"||r!==!1&&ta(e,t)}return!1}function hc(e,t,n,r){return(e!==t||Re(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ta(e,n)}function ta(e,t){return Re(t.enabled,e)!==!1&&e.isStaleByTime(Re(t.staleTime,e))}var no,Ft,st,Ln,Lt,hn,Xl,ym=(Xl=class extends mu{constructor(t){super();se(this,Lt);se(this,no);se(this,Ft);se(this,st);se(this,Ln);q(this,no,t.client),this.mutationId=t.mutationId,q(this,st,t.mutationCache),q(this,Ft,[]),this.state=t.state||bm(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){S(this,Ft).includes(t)||(S(this,Ft).push(t),this.clearGcTimeout(),S(this,st).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){q(this,Ft,S(this,Ft).filter(n=>n!==t)),this.scheduleGc(),S(this,st).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){S(this,Ft).length||(this.state.status==="pending"?this.scheduleGc():S(this,st).remove(this))}continue(){var t;return((t=S(this,Ln))==null?void 0:t.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(t){var a,c,u,d,l,f,p,v,g,_,b,x,w,C,E,P,R,T;const n=()=>{pe(this,Lt,hn).call(this,{type:"continue"})},r={client:S(this,no),meta:this.options.meta,mutationKey:this.options.mutationKey},o=q(this,Ln,pu({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(A,j)=>{pe(this,Lt,hn).call(this,{type:"failed",failureCount:A,error:j})},onPause:()=>{pe(this,Lt,hn).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>S(this,st).canRun(this)})),s=this.state.status==="pending",i=!o.canStart();try{if(s)n();else{pe(this,Lt,hn).call(this,{type:"pending",variables:t,isPaused:i}),S(this,st).config.onMutate&&await S(this,st).config.onMutate(t,this,r);const j=await((c=(a=this.options).onMutate)==null?void 0:c.call(a,t,r));j!==this.state.context&&pe(this,Lt,hn).call(this,{type:"pending",context:j,variables:t,isPaused:i})}const A=await o.start();return await((d=(u=S(this,st).config).onSuccess)==null?void 0:d.call(u,A,t,this.state.context,this,r)),await((f=(l=this.options).onSuccess)==null?void 0:f.call(l,A,t,this.state.context,r)),await((v=(p=S(this,st).config).onSettled)==null?void 0:v.call(p,A,null,this.state.variables,this.state.context,this,r)),await((_=(g=this.options).onSettled)==null?void 0:_.call(g,A,null,t,this.state.context,r)),pe(this,Lt,hn).call(this,{type:"success",data:A}),A}catch(A){try{await((x=(b=S(this,st).config).onError)==null?void 0:x.call(b,A,t,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((C=(w=this.options).onError)==null?void 0:C.call(w,A,t,this.state.context,r))}catch(j){Promise.reject(j)}try{await((P=(E=S(this,st).config).onSettled)==null?void 0:P.call(E,void 0,A,this.state.variables,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((T=(R=this.options).onSettled)==null?void 0:T.call(R,void 0,A,t,this.state.context,r))}catch(j){Promise.reject(j)}throw pe(this,Lt,hn).call(this,{type:"error",error:A}),A}finally{S(this,Ln)===o&&q(this,Ln,void 0),S(this,st).runNext(this)}}},no=new WeakMap,Ft=new WeakMap,st=new WeakMap,Ln=new WeakMap,Lt=new WeakSet,hn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),et.batch(()=>{S(this,Ft).forEach(r=>{r.onMutationUpdate(t)}),S(this,st).notify({mutation:this,type:"updated",action:t})})},Xl);function bm(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Yt,Dt,ro,eu,wm=(eu=class extends oo{constructor(t={}){super();se(this,Yt);se(this,Dt);se(this,ro);this.config=t,q(this,Yt,new Set),q(this,Dt,new Map),q(this,ro,0)}build(t,n,r){const o=new ym({client:t,mutationCache:this,mutationId:++ho(this,ro)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){S(this,Yt).add(t);const n=mo(t);if(typeof n=="string"){const r=S(this,Dt).get(n);r?r.push(t):S(this,Dt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(S(this,Yt).delete(t)){const n=mo(t);if(typeof n=="string"){const r=S(this,Dt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&S(this,Dt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=mo(t);if(typeof n=="string"){const o=(r=S(this,Dt).get(n))==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r,o;const n=mo(t);return typeof n=="string"?((o=(r=S(this,Dt).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused))==null?void 0:o.continue())??Promise.resolve():Promise.resolve()}clear(){et.batch(()=>{S(this,Yt).forEach(t=>{this.notify({type:"removed",mutation:t})}),S(this,Yt).clear(),S(this,Dt).clear()})}getAll(){return Array.from(S(this,Yt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ic(n,r))}findAll(t={}){return this.getAll().filter(n=>ic(t,n))}notify(t){et.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return et.batch(()=>Promise.all(t.map(n=>n.continue().catch(vt))))}},Yt=new WeakMap,Dt=new WeakMap,ro=new WeakMap,eu);function mo(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Vt,tu,_m=(tu=class extends oo{constructor(t={}){super();se(this,Vt);this.config=t,q(this,Vt,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??Yi(o,n);let i=this.get(s);return i||(i=new mm({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){S(this,Vt).has(t.queryHash)||(S(this,Vt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){S(this,Vt).get(t.queryHash)===t&&(t.destroy(),S(this,Vt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){et.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return S(this,Vt).get(t)}getAll(){return[...S(this,Vt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>sc(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>sc(t,r)):n}notify(t){et.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){et.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){et.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Vt=new WeakMap,tu),Ae,wn,_n,hr,pr,xn,mr,gr,nu,xm=(nu=class{constructor(e={}){se(this,Ae);se(this,wn);se(this,_n);se(this,hr);se(this,pr);se(this,xn);se(this,mr);se(this,gr);q(this,Ae,e.queryCache||new _m),q(this,wn,e.mutationCache||new wm),q(this,_n,e.defaultOptions||{}),q(this,hr,new Map),q(this,pr,new Map),q(this,xn,0)}mount(){ho(this,xn)._++,S(this,xn)===1&&(q(this,mr,ea.subscribe(async e=>{e&&(await this.resumePausedMutations(),S(this,Ae).onFocus())})),q(this,gr,Uo.subscribe(async e=>{e&&(await this.resumePausedMutations(),S(this,Ae).onOnline())})))}unmount(){var e,t;ho(this,xn)._--,S(this,xn)===0&&((e=S(this,mr))==null||e.call(this),q(this,mr,void 0),(t=S(this,gr))==null||t.call(this),q(this,gr,void 0))}isFetching(e){return S(this,Ae).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return S(this,wn).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=S(this,Ae).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=S(this,Ae).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Re(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return S(this,Ae).findAll(e).map(({queryKey:t,state:n})=>[t,n.data])}setQueryData(e,t,n){var i;const r=this.defaultQueryOptions({queryKey:e}),o=(i=S(this,Ae).get(r.queryHash))==null?void 0:i.state.data,s=tm(t,o);if(s!==void 0)return S(this,Ae).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return et.batch(()=>S(this,Ae).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=S(this,Ae).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=S(this,Ae);et.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=S(this,Ae);return et.batch(()=>{const r=n.findAll(e),o=new Set(r);return r.forEach(s=>{s.reset()}),this.refetchQueries({type:"active",predicate:s=>o.has(s)},t)})}cancelQueries(e,t={}){const n={revert:!0,...t},r=et.batch(()=>S(this,Ae).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(vt).catch(vt)}invalidateQueries(e,t={}){return et.batch(()=>(S(this,Ae).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=et.batch(()=>S(this,Ae).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(vt)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(vt)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=S(this,Ae).build(this,t),r=n.isStaleByTime(Re(t.staleTime,n))?await n.fetch(t):n.state.data,o=t.select;return o?o(r):r}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=S(this,Ae).build(this,t);return n.isStaleByTime(Re(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vt).catch(vt)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vt).catch(vt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Uo.isOnline()?S(this,wn).resumePausedMutations():Promise.resolve()}getQueryCache(){return S(this,Ae)}getMutationCache(){return S(this,wn)}getDefaultOptions(){return S(this,_n)}setDefaultOptions(e){q(this,_n,e)}setQueryDefaults(e,t){S(this,hr).set(Hr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...S(this,hr).values()],n={};return t.forEach(r=>{vr(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){S(this,pr).set(Hr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...S(this,pr).values()],n={};return t.forEach(r=>{vr(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...S(this,_n).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Yi(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ji&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...S(this,_n).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){S(this,Ae).clear(),S(this,wn).clear()}},Ae=new WeakMap,wn=new WeakMap,_n=new WeakMap,hr=new WeakMap,pr=new WeakMap,xn=new WeakMap,mr=new WeakMap,gr=new WeakMap,nu);const vu=h.createContext(!1),Sm=()=>h.useContext(vu);vu.Provider;function Em(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const Cm=h.createContext(Em()),km=()=>h.useContext(Cm),Om=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?fu(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Pm=e=>{h.useEffect(()=>{e.clearReset()},[e])},Rm=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||fu(n,[e.error,r])),Tm=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Im=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Am=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Nm(e,t,n){const r=Sm(),o=km(),s=Qi(),i=s.defaultQueryOptions(e),a=s.getQueryCache().get(i.queryHash),c=e.subscribed!==!1;i._optimisticResults=r?"isRestoring":c?"optimistic":void 0,Tm(i),Om(i,o,a),Pm(o);const[u]=h.useState(()=>new t(s,i)),d=u.getOptimisticResult(i),l=!r&&c;if(h.useSyncExternalStore(h.useCallback(f=>{const p=l?u.subscribe(et.batchCalls(f)):vt;return u.updateResult(),p},[u,l]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),h.useEffect(()=>{u.setOptions(i)},[i,u]),Im(i,d))throw Am(i,u,o);if(Rm({result:d,errorResetBoundary:o,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw d.error;return i.notifyOnChangeProps?d:u.trackResult(d)}function Zo(e,t){return Nm(e,gm)}function Dm(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Mm=e=>{switch(e){case"success":return zm;case"info":return Lm;case"warning":return Fm;case"error":return Vm;default:return null}},jm=Array(12).fill(0),$m=({visible:e,className:t})=>I.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},I.createElement("div",{className:"sonner-spinner"},jm.map((n,r)=>I.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),zm=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},I.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Fm=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},I.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Lm=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Vm=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Um=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},I.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),I.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Zm=()=>{const[e,t]=I.useState(document.hidden);return I.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),e};let Bm=1;const Wm=100,pc=e=>{var t;return typeof(e==null?void 0:e.id)=="number"||(e==null||(t=e.id)==null?void 0:t.length)>0?e.id:Bm++};class Hm{constructor(){this.subscribe=t=>(this.subscribers.push(t),this.getActiveToasts().forEach(n=>t(n)),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t],this.trimHistory()},this.trimHistory=()=>{let t=this.toasts.length-Wm;t<=0||(this.toasts=this.toasts.filter(n=>t>0&&this.dismissedToasts.has(n.id)?(this.dismissedToasts.delete(n.id),t--,!1):!0))},this.create=t=>{const{message:n,...r}=t,o=pc(t),s=this.pendingDismissals.get(o);s!==void 0&&(cancelAnimationFrame(s),this.pendingDismissals.delete(o),this.dismissedToasts.delete(o));const i=this.dismissedToasts.has(o),a=t.dismissible===void 0?!0:t.dismissible;return i&&(this.dismissedToasts.delete(o),this.toasts=this.toasts.filter(u=>u.id!==o)),(i?void 0:this.toasts.find(u=>u.id===o))?this.toasts=this.toasts.map(u=>u.id===o?(this.publish({...u,...t,id:o,title:n}),{...u,...t,id:o,dismissible:a,title:n}):u):this.addToast({title:n,...r,dismissible:a,id:o}),o},this.dismiss=t=>{if(t==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(o=>o({id:r.id,dismiss:!0}))}),t;this.dismissedToasts.add(t);const n=this.pendingDismissals.get(t);return n!==void 0&&cancelAnimationFrame(n),this.pendingDismissals.set(t,requestAnimationFrame(()=>{this.pendingDismissals.delete(t),this.subscribers.forEach(r=>r({id:t,dismiss:!0}))})),t},this.message=(t,n)=>this.create({...n,message:t,type:void 0}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,i;const a=o.then(async u=>{if(i=["resolve",u],I.isValidElement(u))s=!1,this.create({id:r,type:"default",message:u});else if(Gm(u)&&!u.ok){s=!1;const l=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description,v=typeof l=="object"&&!I.isValidElement(l)?l:{message:l};this.create({id:r,type:"error",description:f,...v})}else if(u instanceof Error){s=!1;const l=typeof n.error=="function"?await n.error(u):n.error,f=typeof n.description=="function"?await n.description(u):n.description,v=typeof l=="object"&&!I.isValidElement(l)?l:{message:l};this.create({id:r,type:"error",description:f,...v})}else if(n.success!==void 0){s=!1;const l=typeof n.success=="function"?await n.success(u):n.success,f=typeof n.description=="function"?await n.description(u):n.description,v=typeof l=="object"&&!I.isValidElement(l)?l:{message:l};this.create({id:r,type:"success",description:f,...v})}}).catch(async u=>{if(i=["reject",u],n.error!==void 0){s=!1;const d=typeof n.error=="function"?await n.error(u):n.error,l=typeof n.description=="function"?await n.description(u):n.description,p=typeof d=="object"&&!I.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:l,...p})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((u,d)=>a.then(()=>i[0]==="reject"?d(i[1]):u(i[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=pc(n);return this.create({...n,jsx:t(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const gt=new Hm,Km=(e,t)=>gt.message(e,t),Gm=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",qm=Km,Qm=()=>gt.toasts,Ym=()=>gt.getActiveToasts(),pk=Object.assign(qm,{success:gt.success,info:gt.info,warning:gt.warning,error:gt.error,custom:gt.custom,message:gt.message,promise:gt.promise,dismiss:gt.dismiss,loading:gt.loading},{getHistory:Qm,getToasts:Ym});Dm("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function go(e){return e.label!==void 0}const Jm=3,Xm="24px",eg="16px",mc=4e3,tg=356,ng=14,rg=45,og=200;function $t(...e){return e.filter(Boolean).join(" ")}function sg(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const ig=e=>{var t,n,r,o,s,i,a,c,u;const{invert:d,toast:l,unstyled:f,interacting:p,setHeights:v,visibleToasts:g,heights:_,index:b,toasts:x,expanded:w,removeToast:C,defaultRichColors:E,closeButton:P,style:R,cancelButtonStyle:T,actionButtonStyle:A,className:j="",descriptionClassName:L="",duration:z,position:J,gap:W,expandByDefault:K,classNames:Z,icons:X,closeButtonAriaLabel:re="Close toast"}=e,[Y,ee]=I.useState(null),[G,ve]=I.useState(null),[he,oe]=I.useState(!1),[le,U]=I.useState(!1),[fe,Ee]=I.useState(!1),[ue,qe]=I.useState(!1),[Xe,Ze]=I.useState(!1),[De,Be]=I.useState(0),[kt,ct]=I.useState(0),$e=I.useRef(l.duration||z||mc),qn=I.useRef(null),pt=I.useRef(null),Rn=b===0,sn=b+1<=g,Me=l.type,Tr=Me??"default",an=l.dismissible!==!1,Ir=l.className||"",uo=l.descriptionClassName||"",cn=I.useMemo(()=>_.findIndex(D=>D.toastId===l.id)||0,[_,l.id]),Ar=I.useMemo(()=>{var D;return(D=l.closeButton)!=null?D:P},[l.closeButton,P]),fo=I.useMemo(()=>l.duration||z||mc,[l.duration,z]),Qn=I.useRef(0),ln=I.useRef(0),Nr=I.useRef(0),Wt=I.useRef(null),[xs,Ss]=J.split("-"),Es=I.useMemo(()=>_.reduce((D,V,Q)=>Q>=cn?D:D+V.height,0),[_,cn]),Cs=Zm(),wt=I.useMemo(()=>{var D;return(D=e.swipeDirections)!=null?D:sg(J)},[e.swipeDirections,J]),y=l.invert||d,O=Me==="loading";ln.current=I.useMemo(()=>cn*W+Es,[cn,Es]),I.useEffect(()=>{$e.current=fo},[fo]),I.useEffect(()=>{oe(!0)},[]),I.useEffect(()=>{const D=pt.current;if(D){const V=D.getBoundingClientRect().height;return ct(V),v(Q=>[{toastId:l.id,height:V,position:l.position},...Q]),()=>v(Q=>Q.filter(ae=>ae.toastId!==l.id))}},[v,l.id]),I.useLayoutEffect(()=>{if(!he)return;const D=pt.current,V=D.style.height;D.style.height="auto";const Q=D.getBoundingClientRect().height;D.style.height=V,ct(Q),v(ae=>ae.find(be=>be.toastId===l.id)?ae.map(be=>be.toastId===l.id?{...be,height:Q}:be):[{toastId:l.id,height:Q,position:l.position},...ae])},[he,l.title,l.description,v,l.id,l.jsx,l.action,l.cancel]);const k=I.useCallback(()=>{U(!0),Be(ln.current),v(D=>D.filter(V=>V.toastId!==l.id)),setTimeout(()=>{C(l)},og)},[l,C,v,ln]);I.useEffect(()=>{if(l.promise&&Me==="loading"||l.duration===1/0||l.type==="loading")return;let D;return w||p||Cs?(()=>{if(Nr.current<Qn.current){const ae=new Date().getTime()-Qn.current;$e.current=$e.current-ae}Nr.current=new Date().getTime()})():(()=>{$e.current!==1/0&&(Qn.current=new Date().getTime(),D=setTimeout(()=>{l.onAutoClose==null||l.onAutoClose.call(l,l),k()},$e.current))})(),()=>clearTimeout(D)},[w,p,l,Me,Cs,k]),I.useEffect(()=>{l.delete&&(k(),l.onDismiss==null||l.onDismiss.call(l,l))},[k,l.delete]);function N(){var D;if(X!=null&&X.loading){var V;return I.createElement("div",{className:$t(Z==null?void 0:Z.loader,l==null||(V=l.classNames)==null?void 0:V.loader,"sonner-loader"),"data-visible":Me==="loading"},X.loading)}return I.createElement($m,{className:$t(Z==null?void 0:Z.loader,l==null||(D=l.classNames)==null?void 0:D.loader),visible:Me==="loading"})}const $=l.icon||(X==null?void 0:X[Me])||Mm(Me);var H,F;return I.createElement("li",{tabIndex:0,ref:pt,className:$t(j,Ir,Z==null?void 0:Z.toast,l==null||(t=l.classNames)==null?void 0:t.toast,Z==null?void 0:Z[Tr],l==null||(n=l.classNames)==null?void 0:n[Tr]),"data-sonner-toast":"","data-rich-colors":(H=l.richColors)!=null?H:E,"data-styled":!(l.jsx||l.unstyled||f),"data-mounted":he,"data-promise":!!l.promise,"data-swiped":Xe,"data-removed":le,"data-visible":sn,"data-y-position":xs,"data-x-position":Ss,"data-index":b,"data-front":Rn,"data-swiping":fe,"data-dismissible":an,"data-type":Me,"data-invert":y,"data-swipe-out":ue,"data-swipe-direction":G,"data-expanded":!!(w||K&&he),"data-testid":l.testId,style:{"--index":b,"--toasts-before":b,"--z-index":x.length-b,"--offset":`${le?De:ln.current}px`,"--initial-height":K?"auto":`${kt}px`,...R,...l.style},onDragEnd:()=>{Ee(!1),ee(null),Wt.current=null},onPointerDown:D=>{D.button!==2&&(O||!an||(qn.current=new Date,Be(ln.current),D.target.setPointerCapture(D.pointerId),D.target.tagName!=="BUTTON"&&(Ee(!0),Wt.current={x:D.clientX,y:D.clientY})))},onPointerUp:()=>{var D,V,Q;if(ue||!an)return;Wt.current=null;const ae=Number(((D=pt.current)==null?void 0:D.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ye=Number(((V=pt.current)==null?void 0:V.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),be=new Date().getTime()-((Q=qn.current)==null?void 0:Q.getTime()),Ce=Y==="x"?ae:ye,mt=Math.abs(Ce)/be;if((Y==="x"?wt.includes(ae>0?"right":"left"):wt.includes(ye>0?"bottom":"top"))&&(Math.abs(Ce)>=rg||mt>.11)){Be(ln.current),l.onDismiss==null||l.onDismiss.call(l,l),ve(Y==="x"?ae>0?"right":"left":ye>0?"down":"up"),k(),qe(!0);return}else{var _t,Dr;(_t=pt.current)==null||_t.style.setProperty("--swipe-amount-x","0px"),(Dr=pt.current)==null||Dr.style.setProperty("--swipe-amount-y","0px")}Ze(!1),Ee(!1),ee(null)},onPointerMove:D=>{var V,Q,ae;if(!Wt.current||!an||((V=window.getSelection())==null?void 0:V.toString().length)>0)return;const be=D.clientY-Wt.current.y,Ce=D.clientX-Wt.current.x;!Y&&(Math.abs(Ce)>1||Math.abs(be)>1)&&ee(Math.abs(Ce)>Math.abs(be)?"x":"y");let mt={x:0,y:0};const un=_t=>1/(1.5+Math.abs(_t)/20);if(Y==="y"){if(wt.includes("top")||wt.includes("bottom"))if(wt.includes("top")&&be<0||wt.includes("bottom")&&be>0)mt.y=be;else{const _t=be*un(be);mt.y=Math.abs(_t)<Math.abs(be)?_t:be}}else if(Y==="x"&&(wt.includes("left")||wt.includes("right")))if(wt.includes("left")&&Ce<0||wt.includes("right")&&Ce>0)mt.x=Ce;else{const _t=Ce*un(Ce);mt.x=Math.abs(_t)<Math.abs(Ce)?_t:Ce}(Math.abs(mt.x)>0||Math.abs(mt.y)>0)&&Ze(!0),(Q=pt.current)==null||Q.style.setProperty("--swipe-amount-x",`${mt.x}px`),(ae=pt.current)==null||ae.style.setProperty("--swipe-amount-y",`${mt.y}px`)}},Ar&&!l.jsx&&Me!=="loading"?I.createElement("button",{"aria-label":re,"data-disabled":O,"data-close-button":!0,onClick:O||!an?()=>{}:()=>{k(),l.onDismiss==null||l.onDismiss.call(l,l)},className:$t(Z==null?void 0:Z.closeButton,l==null||(r=l.classNames)==null?void 0:r.closeButton)},(F=X==null?void 0:X.close)!=null?F:Um):null,(Me||l.icon||l.promise)&&l.icon!==null&&((X==null?void 0:X[Me])!==null||l.icon)?I.createElement("div",{"data-icon":"",className:$t(Z==null?void 0:Z.icon,l==null||(o=l.classNames)==null?void 0:o.icon)},Me==="loading"?l.icon||N():l.promise?N():null,Me!=="loading"?$:null):null,I.createElement("div",{"data-content":"",className:$t(Z==null?void 0:Z.content,l==null||(s=l.classNames)==null?void 0:s.content)},I.createElement("div",{"data-title":"",className:$t(Z==null?void 0:Z.title,l==null||(i=l.classNames)==null?void 0:i.title)},l.jsx?l.jsx:typeof l.title=="function"?l.title():l.title),l.description?I.createElement("div",{"data-description":"",className:$t(L,uo,Z==null?void 0:Z.description,l==null||(a=l.classNames)==null?void 0:a.description)},typeof l.description=="function"?l.description():l.description):null),I.isValidElement(l.cancel)?l.cancel:l.cancel&&go(l.cancel)?I.createElement("button",{"data-button":!0,"data-cancel":!0,style:l.cancelButtonStyle||T,onClick:D=>{go(l.cancel)&&an&&(l.cancel.onClick==null||l.cancel.onClick.call(l.cancel,D),k())},className:$t(Z==null?void 0:Z.cancelButton,l==null||(c=l.classNames)==null?void 0:c.cancelButton)},l.cancel.label):null,I.isValidElement(l.action)?l.action:l.action&&go(l.action)?I.createElement("button",{"data-button":!0,"data-action":!0,style:l.actionButtonStyle||A,onClick:D=>{go(l.action)&&(l.action.onClick==null||l.action.onClick.call(l.action,D),!D.defaultPrevented&&k())},className:$t(Z==null?void 0:Z.actionButton,l==null||(u=l.classNames)==null?void 0:u.actionButton)},l.action.label):null)};function gc(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function ag(e,t){const n={};return[e,t].forEach((r,o)=>{const s=o===1,i=s?"--mobile-offset":"--offset",a=s?eg:Xm;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${i}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${i}-${u}`]=a:n[`${i}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(a)}),n}const cg=I.forwardRef(function(t,n){const{id:r,invert:o,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:c,className:u,offset:d,mobileOffset:l,theme:f="light",richColors:p,duration:v,style:g,visibleToasts:_=Jm,toastOptions:b,dir:x=gc(),gap:w=ng,icons:C,customAriaLabel:E,containerAriaLabel:P="Notifications"}=t,[R,T]=I.useState([]),A=I.useMemo(()=>r?R.filter(oe=>oe.toasterId===r):R.filter(oe=>!oe.toasterId),[R,r]),j=I.useMemo(()=>Array.from(new Set([s].concat(A.filter(oe=>oe.position).map(oe=>oe.position)))),[A,s]),[L,z]=I.useState([]),[J,W]=I.useState(!1),[K,Z]=I.useState(!1),[X,re]=I.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Y=I.useRef(null),ee=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),G=I.useRef(null),ve=I.useRef(!1),he=I.useCallback(oe=>{T(le=>{var U;return(U=le.find(fe=>fe.id===oe.id))!=null&&U.delete||gt.dismiss(oe.id),le.filter(({id:fe})=>fe!==oe.id)})},[]);return I.useEffect(()=>gt.subscribe(oe=>{if(oe.dismiss){requestAnimationFrame(()=>{T(le=>le.map(U=>U.id===oe.id?{...U,delete:!0}:U))});return}setTimeout(()=>{Cp.flushSync(()=>{T(le=>{const U=le.findIndex(fe=>fe.id===oe.id);return U!==-1?[...le.slice(0,U),{...le[U],...oe},...le.slice(U+1)]:[oe,...le]})})})}),[]),I.useEffect(()=>{if(f!=="system"){re(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?re("dark"):re("light")),typeof window>"u")return;const oe=window.matchMedia("(prefers-color-scheme: dark)");try{oe.addEventListener("change",({matches:le})=>{re(le?"dark":"light")})}catch{oe.addListener(({matches:U})=>{try{re(U?"dark":"light")}catch(fe){console.error(fe)}})}},[f]),I.useEffect(()=>{R.length<=1&&W(!1)},[R]),I.useEffect(()=>{const oe=le=>{var U;if(i.length>0&&i.every(ue=>le[ue]||le.code===ue)){var Ee;W(!0),(Ee=Y.current)==null||Ee.focus()}le.code==="Escape"&&(document.activeElement===Y.current||(U=Y.current)!=null&&U.contains(document.activeElement))&&W(!1)};return document.addEventListener("keydown",oe),()=>document.removeEventListener("keydown",oe)},[i]),I.useEffect(()=>{if(Y.current)return()=>{G.current&&(G.current.focus({preventScroll:!0}),G.current=null,ve.current=!1)}},[Y.current]),I.createElement("section",{ref:n,"aria-label":E??`${P} ${ee}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},j.map((oe,le)=>{var U;const[fe,Ee]=oe.split("-");return A.length?I.createElement("ol",{key:oe,dir:x==="auto"?gc():x,tabIndex:-1,ref:Y,className:u,"data-sonner-toaster":!0,"data-sonner-theme":X,"data-y-position":fe,"data-x-position":Ee,style:{"--front-toast-height":`${((U=L[0])==null?void 0:U.height)||0}px`,"--width":`${tg}px`,"--gap":`${w}px`,...g,...ag(d,l)},onBlur:ue=>{ve.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(ve.current=!1,G.current&&(G.current.focus({preventScroll:!0}),G.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||ve.current||(ve.current=!0,G.current=ue.relatedTarget)},onMouseEnter:()=>W(!0),onMouseMove:()=>W(!0),onMouseLeave:()=>{K||W(!1)},onDragEnd:()=>W(!1),onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||Z(!0)},onPointerUp:()=>Z(!1)},A.filter(ue=>!ue.position&&le===0||ue.position===oe).map((ue,qe)=>{var Xe,Ze;return I.createElement(ig,{key:ue.id,icons:C,index:qe,toast:ue,defaultRichColors:p,duration:(Xe=b==null?void 0:b.duration)!=null?Xe:v,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:o,visibleToasts:_,closeButton:(Ze=b==null?void 0:b.closeButton)!=null?Ze:c,interacting:K,position:oe,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:he,toasts:A.filter(De=>De.position==ue.position),heights:L.filter(De=>De.position==ue.position),setHeights:z,expandByDefault:a,gap:w,expanded:J,swipeDirections:t.swipeDirections})})):null}))});var lg=Object.defineProperty,na=(e,t)=>lg(e,"name",{value:t,configurable:!0});function ci(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}na(ci,"setRef");function yu(...e){return t=>{let n=!1;const r=e.map(o=>{const s=ci(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():ci(e[o],null)}}}}na(yu,"composeRefs");function Pe(...e){return h.useCallback(yu(...e),e)}na(Pe,"useComposedRefs");var ug=Object.defineProperty,Ct=(e,t)=>ug(e,"name",{value:t,configurable:!0});function Xt(e){const t=h.forwardRef((n,r)=>{let{children:o,...s}=n,i=null,a=!1;const c=[];o=Cu(o),h.Children.forEach(o,f=>{var p;if(Su(f)){a=!0;const v=f;let g="child"in v.props?v.props.child:v.props.children;for(;ra(g)&&typeof Bo=="function";)g=Bo(g._payload);i=dg(v,g),c.push((p=i==null?void 0:i.props)==null?void 0:p.children)}else c.push(f)}),i?i=h.cloneElement(i,void 0,c):!a&&h.Children.count(o)===1&&h.isValidElement(o)&&(i=o);const u=i?xu(i):void 0,d=Pe(r,u);if(!i){if(o||o===0)throw new Error(a?pg(e):hg(e));return o}const l=_u(s,i.props??{});return i.type!==h.Fragment&&(l.ref=r?d:u),h.cloneElement(i,l)});return t.displayName=`${e}.Slot`,t}Ct(Xt,"createSlot");var xr=Xt("Slot"),bu=Symbol.for("radix.slottable");function wu(e){const t=Ct(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=bu,t}Ct(wu,"createSlottable");var dg=Ct((e,t)=>"child"in e.props?h.isValidElement(t)?h.cloneElement(t,void 0,e.props.children(t.props.children)):null:h.isValidElement(t)?t:null,"getSlottableElementFromSlottable");function _u(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"?n[r]=[o,s].filter(Boolean).join(" "):r==="aria-describedby"&&(n[r]=ku(s,o))}return{...e,...n}}Ct(_u,"mergeProps");function xu(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Ct(xu,"getElementRef");function Su(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bu}Ct(Su,"isSlottable");var fg=Symbol.for("react.lazy");function ra(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===fg&&"_payload"in e&&Eu(e._payload)}Ct(ra,"isLazyComponent");function Eu(e){return typeof e=="object"&&e!==null&&"then"in e}Ct(Eu,"isPromiseLike");function Cu(e){let t=e;for(;ra(t)&&typeof Bo=="function";)t=Bo(t._payload);return t}Ct(Cu,"useUnwrappedLazy");function ku(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}Ct(ku,"concatAriaDescribedby");var hg=Ct(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),pg=Ct(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Bo=Bn[" use ".trim().toString()];function Ou(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Ou(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Pu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ou(e))&&(r&&(r+=" "),r+=t);return r}const vc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,yc=Pu,so=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return yc(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],l=s==null?void 0:s[u];if(d===null)return null;const f=vc(d)||vc(l);return o[u][f]}),a=n&&Object.entries(n).reduce((u,d)=>{let[l,f]=d;return f===void 0||(u[l]=f),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:l,className:f,...p}=d;return Object.entries(p).every(v=>{let[g,_]=v;return Array.isArray(_)?_.includes({...s,...a}[g]):{...s,...a}[g]===_})?[...u,l,f]:u},[]);return yc(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)};/**
3
+ * @license lucide-react v1.58.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */const mg=e=>e==null?void 0:e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
8
+ * @license lucide-react v1.58.0 - ISC
9
+ *
10
+ * This source code is licensed under the ISC license.
11
+ * See the LICENSE file in the root directory of this source tree.
12
+ */function gg(e,t,n=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:mg(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}/**
13
+ * @license lucide-react v1.58.0 - ISC
14
+ *
15
+ * This source code is licensed under the ISC license.
16
+ * See the LICENSE file in the root directory of this source tree.
17
+ */const vg=e=>{let t="",n=!1;for(const r of e){if(r==="-"||r==="_"||r<=" "){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t};/**
18
+ * @license lucide-react v1.58.0 - ISC
19
+ *
20
+ * This source code is licensed under the ISC license.
21
+ * See the LICENSE file in the root directory of this source tree.
22
+ */const yg=e=>{const t=vg(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
23
+ * @license lucide-react v1.58.0 - ISC
24
+ *
25
+ * This source code is licensed under the ISC license.
26
+ * See the LICENSE file in the root directory of this source tree.
27
+ */const li=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
28
+ * @license lucide-react v1.58.0 - ISC
29
+ *
30
+ * This source code is licensed under the ISC license.
31
+ * See the LICENSE file in the root directory of this source tree.
32
+ */const Tn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
33
+ * @license lucide-react v1.58.0 - ISC
34
+ *
35
+ * This source code is licensed under the ISC license.
36
+ * See the LICENSE file in the root directory of this source tree.
37
+ */function Rs(e){return e!=null}function bg(e,t={}){var f,p;const n=t.attributeNames??{},r=v=>n[v]??v,o=e.size??e.width??Tn.width,s=e.size??e.height??Tn.height,i=((f=e.aliases)==null?void 0:f.filter(v=>typeof v=="string"&&v.trim()!=="").map(v=>`lucide-${v}`))??[],a=[...e.name?[`lucide-${e.name}`]:[],...i],c=((p=t.className)==null?void 0:p.split(" ").filter(Boolean))??[],u=t.includeDefaultClasses===!1?li(...c):li("lucide",...a,...c),d=t.absoluteStrokeWidth?Number(t.strokeWidth??Tn["stroke-width"])*Number(e.size??e.width??Tn.width)/Number(t.size??t.width??Tn.width):t.strokeWidth??Tn["stroke-width"];return["svg",{...Object.entries(Tn).reduce((v,[g,_])=>(v[r(g)]=_,v),{}),..."color"in t&&t.color&&{[r("stroke")]:t.color},..."size"in t&&Rs(t.size)&&{[r("width")]:t.size,[r("height")]:t.size},..."width"in t&&Rs(t.width)&&{[r("width")]:t.width},..."height"in t&&Rs(t.height)&&{[r("height")]:t.height},[r("stroke-width")]:d,...u&&{[r("class")]:u},[r("viewBox")]:`0 0 ${o} ${s}`,...t.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(v=>{const[g,_,b]=v,x=t.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",..._}:_;return b?[g,x,b]:[g,x]})]}/**
38
+ * @license lucide-react v1.58.0 - ISC
39
+ *
40
+ * This source code is licensed under the ISC license.
41
+ * See the LICENSE file in the root directory of this source tree.
42
+ */function wg(e,t={}){return bg(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
43
+ * @license lucide-react v1.58.0 - ISC
44
+ *
45
+ * This source code is licensed under the ISC license.
46
+ * See the LICENSE file in the root directory of this source tree.
47
+ */const _g=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},xg=h.createContext({}),Sg=()=>h.useContext(xg),Eg=h.forwardRef(({color:e,size:t,width:n,height:r,strokeWidth:o,absoluteStrokeWidth:s,nonScalingStroke:i,className:a="",children:c,iconNode:u=[],icon:d={node:u,aliases:[],size:24},...l},f)=>{const{size:p=24,strokeWidth:v=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:b="currentColor",className:x=""}=Sg()??{},w=!!c||_g(l),[C,E,P=[]]=wg(d,{color:e??b,width:n??t??p,height:r??t??p,strokeWidth:o??v,absoluteStrokeWidth:s??g,nonScalingStroke:i??_,className:li(x,a),hasA11yProp:w,attributes:l});return h.createElement(C,{ref:f,...E},[...P.map(([R,T])=>h.createElement(R,T)),...Array.isArray(c)?c:[c]])});/**
48
+ * @license lucide-react v1.58.0 - ISC
49
+ *
50
+ * This source code is licensed under the ISC license.
51
+ * See the LICENSE file in the root directory of this source tree.
52
+ */function ft(e,t=[],n=[]){const r=typeof e=="string"?gg(e,t,n):e,o=h.forwardRef(({className:s,...i},a)=>h.createElement(Eg,{ref:a,icon:r,className:s,...i}));return r.name&&(o.displayName=yg(r.name)),o}/**
53
+ * @license lucide-react v1.58.0 - ISC
54
+ *
55
+ * This source code is licensed under the ISC license.
56
+ * See the LICENSE file in the root directory of this source tree.
57
+ */const Ru={name:"book-open",size:24,node:[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]]};Ru.node;const Cg=ft(Ru);/**
58
+ * @license lucide-react v1.58.0 - ISC
59
+ *
60
+ * This source code is licensed under the ISC license.
61
+ * See the LICENSE file in the root directory of this source tree.
62
+ */const Tu={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};Tu.node;const kg=ft(Tu);/**
63
+ * @license lucide-react v1.58.0 - ISC
64
+ *
65
+ * This source code is licensed under the ISC license.
66
+ * See the LICENSE file in the root directory of this source tree.
67
+ */const Iu={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};Iu.node;const Og=ft(Iu);/**
68
+ * @license lucide-react v1.58.0 - ISC
69
+ *
70
+ * This source code is licensed under the ISC license.
71
+ * See the LICENSE file in the root directory of this source tree.
72
+ */const Au={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};Au.node;const Pg=ft(Au);/**
73
+ * @license lucide-react v1.58.0 - ISC
74
+ *
75
+ * This source code is licensed under the ISC license.
76
+ * See the LICENSE file in the root directory of this source tree.
77
+ */const Nu={name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]};Nu.node;const Rg=ft(Nu);/**
78
+ * @license lucide-react v1.58.0 - ISC
79
+ *
80
+ * This source code is licensed under the ISC license.
81
+ * See the LICENSE file in the root directory of this source tree.
82
+ */const Du={name:"layout-grid",size:24,node:[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]};Du.node;const Tg=ft(Du);/**
83
+ * @license lucide-react v1.58.0 - ISC
84
+ *
85
+ * This source code is licensed under the ISC license.
86
+ * See the LICENSE file in the root directory of this source tree.
87
+ */const Mu={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};Mu.node;const Ig=ft(Mu);/**
88
+ * @license lucide-react v1.58.0 - ISC
89
+ *
90
+ * This source code is licensed under the ISC license.
91
+ * See the LICENSE file in the root directory of this source tree.
92
+ */const ju={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};ju.node;const Ag=ft(ju);/**
93
+ * @license lucide-react v1.58.0 - ISC
94
+ *
95
+ * This source code is licensed under the ISC license.
96
+ * See the LICENSE file in the root directory of this source tree.
97
+ */const $u={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};$u.node;const Ng=ft($u);/**
98
+ * @license lucide-react v1.58.0 - ISC
99
+ *
100
+ * This source code is licensed under the ISC license.
101
+ * See the LICENSE file in the root directory of this source tree.
102
+ */const zu={name:"panel-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],aliases:["sidebar"]};zu.node;const Dg=ft(zu);/**
103
+ * @license lucide-react v1.58.0 - ISC
104
+ *
105
+ * This source code is licensed under the ISC license.
106
+ * See the LICENSE file in the root directory of this source tree.
107
+ */const Fu={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};Fu.node;const Lu=ft(Fu);/**
108
+ * @license lucide-react v1.58.0 - ISC
109
+ *
110
+ * This source code is licensed under the ISC license.
111
+ * See the LICENSE file in the root directory of this source tree.
112
+ */const Vu={name:"square-play",size:24,node:[["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}]],aliases:["play-square"]};Vu.node;const Mg=ft(Vu);/**
113
+ * @license lucide-react v1.58.0 - ISC
114
+ *
115
+ * This source code is licensed under the ISC license.
116
+ * See the LICENSE file in the root directory of this source tree.
117
+ */const Uu={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};Uu.node;const jg=ft(Uu);/**
118
+ * @license lucide-react v1.58.0 - ISC
119
+ *
120
+ * This source code is licensed under the ISC license.
121
+ * See the LICENSE file in the root directory of this source tree.
122
+ */const Zu={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};Zu.node;const $g=ft(Zu);/**
123
+ * @license lucide-react v1.58.0 - ISC
124
+ *
125
+ * This source code is licensed under the ISC license.
126
+ * See the LICENSE file in the root directory of this source tree.
127
+ */const Bu={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};Bu.node;const zg=ft(Bu),Fg=768,Wu=`(max-width: ${Fg-1}px)`;function Lg(e){const t=window.matchMedia(Wu);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function Vg(){return h.useSyncExternalStore(Lg,Zg,Ug)}function Ug(){return!1}function Zg(){return window.matchMedia(Wu).matches}const oa="-",Bg=e=>{const t=Hg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(oa);return a[0]===""&&a.length!==1&&a.shift(),Hu(a,t)||Wg(i)},getConflictingClassGroupIds:(i,a)=>{const c=n[i]||[];return a&&r[i]?[...c,...r[i]]:c}}},Hu=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Hu(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(oa);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},bc=/^\[(.+)\]$/,Wg=e=>{if(bc.test(e)){const t=bc.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Hg=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Gg(Object.entries(e.classGroups),n).forEach(([s,i])=>{ui(i,r,s,t)}),r},ui=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:wc(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(Kg(o)){ui(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{ui(i,wc(t,s),n,r)})})},wc=(e,t)=>{let n=e;return t.split(oa).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Kg=e=>e.isThemeGetter,Gg=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,qg=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},Ku="!",Qg=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const c=[];let u=0,d=0,l;for(let _=0;_<a.length;_++){let b=a[_];if(u===0){if(b===o&&(r||a.slice(_,_+s)===t)){c.push(a.slice(d,_)),d=_+s;continue}if(b==="/"){l=_;continue}}b==="["?u++:b==="]"&&u--}const f=c.length===0?a:a.substring(d),p=f.startsWith(Ku),v=p?f.substring(1):f,g=l&&l>d?l-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:i}):i},Yg=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Jg=e=>({cache:qg(e.cacheSize),parseClassName:Qg(e),...Bg(e)}),Xg=/\s+/,ev=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(Xg);let a="";for(let c=i.length-1;c>=0;c-=1){const u=i[c],{modifiers:d,hasImportantModifier:l,baseClassName:f,maybePostfixModifierPosition:p}=n(u);let v=!!p,g=r(v?f.substring(0,p):f);if(!g){if(!v){a=u+(a.length>0?" "+a:a);continue}if(g=r(f),!g){a=u+(a.length>0?" "+a:a);continue}v=!1}const _=Yg(d).join(":"),b=l?_+Ku:_,x=b+g;if(s.includes(x))continue;s.push(x);const w=o(g,v);for(let C=0;C<w.length;++C){const E=w[C];s.push(b+E)}a=u+(a.length>0?" "+a:a)}return a};function tv(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Gu(t))&&(r&&(r+=" "),r+=n);return r}const Gu=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Gu(e[r]))&&(n&&(n+=" "),n+=t);return n};function nv(e,...t){let n,r,o,s=i;function i(c){const u=t.reduce((d,l)=>l(d),e());return n=Jg(u),r=n.cache.get,o=n.cache.set,s=a,a(c)}function a(c){const u=r(c);if(u)return u;const d=ev(c,n);return o(c,d),d}return function(){return s(tv.apply(null,arguments))}}const Oe=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},qu=/^\[(?:([a-z-]+):)?(.+)\]$/i,rv=/^\d+\/\d+$/,ov=new Set(["px","full","screen"]),sv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,av=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,cv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ht=e=>nr(e)||ov.has(e)||rv.test(e),dn=e=>Sr(e,"length",vv),nr=e=>!!e&&!Number.isNaN(Number(e)),Ts=e=>Sr(e,"number",nr),Mr=e=>!!e&&Number.isInteger(Number(e)),uv=e=>e.endsWith("%")&&nr(e.slice(0,-1)),de=e=>qu.test(e),fn=e=>sv.test(e),dv=new Set(["length","size","percentage"]),fv=e=>Sr(e,dv,Qu),hv=e=>Sr(e,"position",Qu),pv=new Set(["image","url"]),mv=e=>Sr(e,pv,bv),gv=e=>Sr(e,"",yv),jr=()=>!0,Sr=(e,t,n)=>{const r=qu.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},vv=e=>iv.test(e)&&!av.test(e),Qu=()=>!1,yv=e=>cv.test(e),bv=e=>lv.test(e),wv=()=>{const e=Oe("colors"),t=Oe("spacing"),n=Oe("blur"),r=Oe("brightness"),o=Oe("borderColor"),s=Oe("borderRadius"),i=Oe("borderSpacing"),a=Oe("borderWidth"),c=Oe("contrast"),u=Oe("grayscale"),d=Oe("hueRotate"),l=Oe("invert"),f=Oe("gap"),p=Oe("gradientColorStops"),v=Oe("gradientColorStopPositions"),g=Oe("inset"),_=Oe("margin"),b=Oe("opacity"),x=Oe("padding"),w=Oe("saturate"),C=Oe("scale"),E=Oe("sepia"),P=Oe("skew"),R=Oe("space"),T=Oe("translate"),A=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",de,t],z=()=>[de,t],J=()=>["",Ht,dn],W=()=>["auto",nr,de],K=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Z=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>["start","end","center","between","around","evenly","stretch"],Y=()=>["","0",de],ee=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>[nr,de];return{cacheSize:500,separator:":",theme:{colors:[jr],spacing:[Ht,dn],blur:["none","",fn,de],brightness:G(),borderColor:[e],borderRadius:["none","","full",fn,de],borderSpacing:z(),borderWidth:J(),contrast:G(),grayscale:Y(),hueRotate:G(),invert:Y(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[uv,dn],inset:L(),margin:L(),opacity:G(),padding:z(),saturate:G(),scale:G(),sepia:Y(),skew:G(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",de]}],container:["container"],columns:[{columns:[fn]}],"break-after":[{"break-after":ee()}],"break-before":[{"break-before":ee()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...K(),de]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Mr,de]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",de]}],grow:[{grow:Y()}],shrink:[{shrink:Y()}],order:[{order:["first","last","none",Mr,de]}],"grid-cols":[{"grid-cols":[jr]}],"col-start-end":[{col:["auto",{span:["full",Mr,de]},de]}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":[jr]}],"row-start-end":[{row:["auto",{span:[Mr,de]},de]}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",de]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",de]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...re()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...re(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...re(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[_]}],mx:[{mx:[_]}],my:[{my:[_]}],ms:[{ms:[_]}],me:[{me:[_]}],mt:[{mt:[_]}],mr:[{mr:[_]}],mb:[{mb:[_]}],ml:[{ml:[_]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",de,t]}],"min-w":[{"min-w":[de,t,"min","max","fit"]}],"max-w":[{"max-w":[de,t,"none","full","min","max","fit","prose",{screen:[fn]},fn]}],h:[{h:[de,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[de,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[de,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[de,t,"auto","min","max","fit"]}],"font-size":[{text:["base",fn,dn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ts]}],"font-family":[{font:[jr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",de]}],"line-clamp":[{"line-clamp":["none",nr,Ts]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ht,de]}],"list-image":[{"list-image":["none",de]}],"list-style-type":[{list:["none","disc","decimal",de]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ht,dn]}],"underline-offset":[{"underline-offset":["auto",Ht,de]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",de]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...K(),hv]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",fv]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},mv]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...Z(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:Z()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...Z()]}],"outline-offset":[{"outline-offset":[Ht,de]}],"outline-w":[{outline:[Ht,dn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Ht,dn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",fn,gv]}],"shadow-color":[{shadow:[jr]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...X(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",fn,de]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[l]}],saturate:[{saturate:[w]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[l]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",de]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",de]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",de]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Mr,de]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",de]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",de]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",de]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ht,dn,Ts]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},_v=nv(wv);function ie(...e){return _v(Pu(e))}const xv=so("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8","icon-sm":"h-9 w-9",icon:"h-10 w-10",pill:"h-12 px-6 rounded-pill",nav:"h-7 px-3 text-xs"}},defaultVariants:{variant:"default",size:"default"}}),ss=h.forwardRef((e,t)=>{const n=te.c(15);let r,o,s,i,a;n[0]!==e?({className:r,variant:a,size:s,asChild:i,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5]);const u=(i===void 0?!1:i)?xr:"button";let d;n[6]!==r||n[7]!==s||n[8]!==a?(d=ie(xv({variant:a,size:s,className:r})),n[6]=r,n[7]=s,n[8]=a,n[9]=d):d=n[9];let l;return n[10]!==u||n[11]!==o||n[12]!==t||n[13]!==d?(l=m.jsx(u,{className:d,ref:t,...o}),n[10]=u,n[11]=o,n[12]=t,n[13]=d,n[14]=l):l=n[14],l});ss.displayName="Button";const Wo=h.forwardRef((e,t)=>{const n=te.c(11);let r,o,s;n[0]!==e?({className:r,type:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);let i;n[4]!==r?(i=ie("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),n[4]=r,n[5]=i):i=n[5];let a;return n[6]!==o||n[7]!==t||n[8]!==i||n[9]!==s?(a=m.jsx("input",{type:s,className:i,ref:t,...o}),n[6]=o,n[7]=t,n[8]=i,n[9]=s,n[10]=a):a=n[10],a});Wo.displayName="Input";var Sv=Object.defineProperty,Ev=(e,t)=>Sv(e,"name",{value:t,configurable:!0}),Cv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Le=Cv.reduce((e,t)=>{const n=Xt(`Primitive.${t}`),r=h.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function sa(e,t){e&&ru.flushSync(()=>e.dispatchEvent(t))}Ev(sa,"dispatchDiscreteCustomEvent");var kv=Object.defineProperty,Yu=(e,t)=>kv(e,"name",{value:t,configurable:!0}),ia={Horizontal:"horizontal",Vertical:"vertical"},_c=ia.Horizontal,Ov=Object.values(ia),Ju=h.forwardRef(Yu(function(t,n){const{decorative:r,orientation:o=_c,...s}=t,i=Xu(o)?o:_c,a=i===ia.Vertical?i:void 0,c=r?{role:"none"}:{"aria-orientation":a,role:"separator"};return m.jsx(Le.div,{"data-orientation":i,...c,...s,ref:n})},"Separator"));function Xu(e){return Ov.includes(e)}Yu(Xu,"isValidOrientation");const Ho=h.forwardRef((e,t)=>{const n=te.c(14);let r,o,s,i;n[0]!==e?({className:r,orientation:s,decorative:i,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);const a=s===void 0?"horizontal":s,c=i===void 0?!0:i,u=a==="horizontal"?"h-[1px] w-full":"h-full w-[1px]";let d;n[5]!==r||n[6]!==u?(d=ie("shrink-0 bg-border",u,r),n[5]=r,n[6]=u,n[7]=d):d=n[7];let l;return n[8]!==c||n[9]!==a||n[10]!==o||n[11]!==t||n[12]!==d?(l=m.jsx(Ju,{ref:t,decorative:c,orientation:a,className:d,...o}),n[8]=c,n[9]=a,n[10]=o,n[11]=t,n[12]=d,n[13]=l):l=n[13],l});Ho.displayName=Ju.displayName;var Pv=Object.defineProperty,Er=(e,t)=>Pv(e,"name",{value:t,configurable:!0}),ed=!!(typeof window<"u"&&window.document&&window.document.createElement);function ce(e,t,{checkForDefaultPrevented:n=!0}={}){return Er(function(o){if(e==null||e(o),n===!1||!o||!o.defaultPrevented)return t==null?void 0:t(o)},"handleEvent")}Er(ce,"composeEventHandlers");function Rv(e){var t;if(!ed)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}Er(Rv,"getOwnerWindow");function di(e){if(!ed)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Er(di,"getOwnerDocument");function td(e,t=!1){const{activeElement:n}=di(e);if(!(n!=null&&n.nodeName))return null;if(nd(n)&&n.contentDocument)return td(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=di(n).getElementById(r);if(o)return o}}return n}Er(td,"getActiveElement");function nd(e){return e.tagName==="IFRAME"}Er(nd,"isFrame");var Tv=Object.defineProperty,Pt=(e,t)=>Tv(e,"name",{value:t,configurable:!0});function Iv(e,t){const n=h.createContext(t);n.displayName=e+"Context";const r=Pt(s=>{const{children:i,...a}=s,c=h.useMemo(()=>a,Object.values(a));return m.jsx(n.Provider,{value:c,children:i})},"Provider");r.displayName=e+"Provider";function o(s,i={}){const{optional:a=!1}=i,c=h.useContext(n);if(c)return c;if(t!==void 0)return t;if(!a)throw new Error(`\`${s}\` must be used within \`${e}\``)}return Pt(o,"useContext"),[r,o]}Pt(Iv,"createContext");function rn(e,t=[]){let n=[];function r(s,i){const a=h.createContext(i);a.displayName=s+"Context";const c=n.length;n=[...n,i];const u=Pt(l=>{var b;const{scope:f,children:p,...v}=l,g=((b=f==null?void 0:f[e])==null?void 0:b[c])||a,_=h.useMemo(()=>v,Object.values(v));return m.jsx(g.Provider,{value:_,children:p})},"Provider");u.displayName=s+"Provider";function d(l,f,p={}){var b;const{optional:v=!1}=p,g=((b=f==null?void 0:f[e])==null?void 0:b[c])||a,_=h.useContext(g);if(_)return _;if(i!==void 0)return i;if(!v)throw new Error(`\`${l}\` must be used within \`${s}\``)}return Pt(d,"useContext"),[u,d]}Pt(r,"createContext");const o=Pt(()=>{const s=n.map(i=>h.createContext(i));return Pt(function(a){const c=(a==null?void 0:a[e])||s;return h.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])},"useScope")},"createScope");return o.scopeName=e,[r,rd(o,...t)]}Pt(rn,"createContextScope");function rd(...e){const t=e[0];if(e.length===1)return t;const n=Pt(()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return Pt(function(s){const i=r.reduce((a,{useScope:c,scopeName:u})=>{const l=c(s)[`__scope${u}`];return{...a,...l}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}Pt(rd,"composeContextScopes");var at=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},Av=Object.defineProperty,Nv=(e,t)=>Av(e,"name",{value:t,configurable:!0}),Dv=Bn[" useId ".trim().toString()]||(()=>{}),Mv=0;function En(e){const[t,n]=h.useState(Dv());return at(()=>{e||n(r=>r??String(Mv++))},[e]),e||(t?`radix-${t}`:"")}Nv(En,"useId");var jv=Object.defineProperty,$v=(e,t)=>jv(e,"name",{value:t,configurable:!0}),xc=Bn[" useEffectEvent ".trim().toString()],Sc=Bn[" useInsertionEffect ".trim().toString()];function od(e){if(typeof xc=="function")return xc(e);const t=h.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Sc=="function"?Sc(()=>{t.current=e}):at(()=>{t.current=e}),h.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}$v(od,"useEffectEvent");var zv=Object.defineProperty,io=(e,t)=>zv(e,"name",{value:t,configurable:!0}),Fv=Bn[" useInsertionEffect ".trim().toString()]||at;function ao({prop:e,defaultProp:t,onChange:n=io(()=>{},"onChange"),caller:r}){const[o,s,i]=sd({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o,u=h.useCallback(d=>{var l;if(a){const f=id(d)?d(e):d;f!==e&&((l=i.current)==null||l.call(i,f))}else s(d)},[a,e,s,i]);return[c,u]}io(ao,"useControllableState");function sd({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),o=h.useRef(n),s=h.useRef(t);return Fv(()=>{s.current=t},[t]),h.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}io(sd,"useUncontrolledState");function id(e){return typeof e=="function"}io(id,"isFunction");var Ec=Symbol("RADIX:SYNC_STATE");function Lv(e,t,n,r){const{prop:o,defaultProp:s,onChange:i,caller:a}=t,c=o!==void 0,u=od(i),d=[{...n,state:s}];r&&d.push(r);const[l,f]=h.useReducer((_,b)=>{if(b.type===Ec)return{..._,state:b.state};const x=e(_,b);return c&&!Object.is(x.state,_.state)&&u(x.state),x},...d),p=l.state,v=h.useRef(p);h.useEffect(()=>{v.current!==p&&(v.current=p,c||u(p))},[p,v,c]);const g=h.useMemo(()=>o!==void 0?{...l,state:o}:l,[l,o]);return h.useEffect(()=>{c&&!Object.is(o,l.state)&&f({type:Ec,state:o})},[o,l.state,c]),[g,f]}io(Lv,"useControllableStateReducer");var Vv=Object.defineProperty,Uv=(e,t)=>Vv(e,"name",{value:t,configurable:!0}),Cc=Bn[" useInsertionEffect ".trim().toString()];function en(e){const t=h.useRef(e);return typeof Cc=="function"?Cc(()=>{t.current=e}):at(()=>{t.current=e}),h.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}Uv(en,"useCallbackRef");var Zv=Object.defineProperty,Je=(e,t)=>Zv(e,"name",{value:t,configurable:!0}),fi="dismissableLayer.update",Bv="dismissableLayer.pointerDownOutside",Wv="dismissableLayer.focusOutside",kc,ad=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),aa=h.forwardRef(Je(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:c,onDismiss:u,...d}=t,l=h.useContext(ad),[f,p]=h.useState(null),v=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=h.useState({}),_=Pe(n,p),b=Array.from(l.layers),[x]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),w=x?b.indexOf(x):-1,C=f?b.indexOf(f):-1,E=l.layersWithOutsidePointerEventsDisabled.size>0,P=C>=w,R=h.useRef(!1),T=ld(z=>{i==null||i(z),c==null||c(z),z.defaultPrevented||u==null||u()},{ownerDocument:v,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:R,dismissableSurfaces:l.dismissableSurfaces,shouldHandlePointerDownOutside:h.useCallback(z=>{if(!(z instanceof Node))return!1;const J=[...l.branches].some(W=>W.contains(z));return P&&!J},[l.branches,P])}),A=ud(z=>{if(o&&R.current)return;const J=z.target;[...l.branches].some(K=>K.contains(J))||(a==null||a(z),c==null||c(z),z.defaultPrevented||u==null||u())},v),j=f?C===b.length-1:!1,L=en(z=>{z.key==="Escape"&&(s==null||s(z),!z.defaultPrevented&&u&&(z.preventDefault(),u()))});return h.useEffect(()=>{if(j)return v.addEventListener("keydown",L,{capture:!0}),()=>v.removeEventListener("keydown",L,{capture:!0})},[v,j,L]),h.useEffect(()=>{if(f)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(kc=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),hi(),()=>{r&&(l.layersWithOutsidePointerEventsDisabled.delete(f),l.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=kc))}},[f,v,r,l]),h.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),hi())},[f,l]),h.useEffect(()=>{const z=Je(()=>g({}),"handleUpdate");return document.addEventListener(fi,z),()=>document.removeEventListener(fi,z)},[]),m.jsx(Le.div,{...d,ref:_,style:{pointerEvents:E?P?"auto":"none":void 0,...t.style},onFocusCapture:ce(t.onFocusCapture,A.onFocusCapture),onBlurCapture:ce(t.onBlurCapture,A.onBlurCapture),onPointerDownCapture:ce(t.onPointerDownCapture,T.onPointerDownCapture)})},"DismissableLayer"));function cd(){const e=h.useContext(ad),[t,n]=h.useState(null);return h.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Je(cd,"useDismissableLayerSurface");var Hv=Je(()=>!0,"IS_TRUE");function ld(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:i=Hv}=t,a=en(e),c=h.useRef(!1),u=h.useRef(!1),d=h.useRef(new Map),l=h.useRef(()=>{});return h.useEffect(()=>{function f(){u.current=!1,o.current=!1,d.current.clear()}Je(f,"resetOutsideInteraction");function p(){return Array.from(d.current.values()).some(Boolean)}Je(p,"isOutsideInteractionIntercepted");function v(w){if(!u.current)return;const C=w.target;C instanceof Node&&[...s].some(P=>P.contains(C))||d.current.set(w.type,!0),w.type==="click"&&window.setTimeout(()=>{u.current&&l.current()},0)}Je(v,"handleInteractionCapture");function g(w){u.current&&d.current.set(w.type,!1)}Je(g,"handleInteractionBubble");const _=Je(w=>{if(w.target&&!c.current){let C=function(){n.removeEventListener("click",l.current);const P=p();f(),P||ca(Bv,a,E,{discrete:!0})};if(Je(C,"handleAndDispatchPointerDownOutsideEvent"),!i(w.target)){n.removeEventListener("click",l.current),f(),c.current=!1;return}const E={originalEvent:w};u.current=!0,o.current=r&&w.button===0,d.current.clear(),!r||w.button!==0?C():(n.removeEventListener("click",l.current),l.current=C,n.addEventListener("click",l.current,{once:!0}))}else n.removeEventListener("click",l.current),f();c.current=!1},"handlePointerDown"),b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const w of b)n.addEventListener(w,v,!0),n.addEventListener(w,g);const x=window.setTimeout(()=>{n.addEventListener("pointerdown",_)},0);return()=>{window.clearTimeout(x),n.removeEventListener("pointerdown",_),n.removeEventListener("click",l.current);for(const w of b)n.removeEventListener(w,v,!0),n.removeEventListener(w,g)}},[n,a,r,o,s,i]),{onPointerDownCapture:Je(()=>c.current=!0,"onPointerDownCapture")}}Je(ld,"usePointerDownOutside");function ud(e,t=globalThis==null?void 0:globalThis.document){const n=en(e),r=h.useRef(!1);return h.useEffect(()=>{const o=Je(s=>{s.target&&!r.current&&ca(Wv,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:Je(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Je(()=>r.current=!1,"onBlurCapture")}}Je(ud,"useFocusOutside");function hi(){const e=new CustomEvent(fi);document.dispatchEvent(e)}Je(hi,"dispatchUpdate");function ca(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?sa(o,s):o.dispatchEvent(s)}Je(ca,"handleAndDispatchCustomEvent");var Kv=Object.defineProperty,We=(e,t)=>Kv(e,"name",{value:t,configurable:!0}),Is="focusScope.autoFocusOnMount",As="focusScope.autoFocusOnUnmount",Oc={bubbles:!1,cancelable:!0},dd=h.forwardRef(We(function(t,n){const{loop:r=!1,trapped:o=!1,branches:s,onMountAutoFocus:i,onUnmountAutoFocus:a,...c}=t,[u,d]=h.useState(null),l=en(i),f=en(a),p=h.useRef(null),v=Pe(n,d),g=h.useRef(s);h.useEffect(()=>{g.current=s});const _=h.useCallback(w=>{var C;return w?u!=null&&u.contains(w)?!0:!!((C=g.current)!=null&&C.some(E=>E.contains(w))):!1},[u]),b=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(o){let w=function(R){if(b.paused||!u)return;const T=R.target;_(T)?p.current=T:qt(p.current,{select:!0})},C=function(R){if(b.paused||!u)return;const T=R.relatedTarget;T!==null&&(_(T)||qt(p.current,{select:!0}))},E=function(R){if(document.activeElement===document.body)for(const A of R)A.removedNodes.length>0&&qt(u)};We(w,"handleFocusIn"),We(C,"handleFocusOut"),We(E,"handleMutations"),document.addEventListener("focusin",w),document.addEventListener("focusout",C);const P=new MutationObserver(E);return u&&P.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),P.disconnect()}}},[o,u,b.paused,_]),h.useEffect(()=>{if(u){Pc.add(b);const w=document.activeElement;if(!u.contains(w)){const E=new CustomEvent(Is,Oc);u.addEventListener(Is,l),u.dispatchEvent(E),E.defaultPrevented||(hd(yd(fa(u)),{select:!0}),document.activeElement===w&&qt(u))}return()=>{u.removeEventListener(Is,l);const E=u.ownerDocument,P=CustomEvent;setTimeout(()=>{const R=new P(As,Oc);u.addEventListener(As,f),u.dispatchEvent(R),R.defaultPrevented||qt(w??E.body,{select:!0}),u.removeEventListener(As,f),Pc.remove(b)},0)}}},[u,l,f,b]);const x=h.useCallback(w=>{if(!r&&!o||b.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,E=document.activeElement;if(C&&E){const P=w.currentTarget,[R,T]=pd(P);R&&T?!w.shiftKey&&E===T?(w.preventDefault(),r&&qt(R,{select:!0})):w.shiftKey&&E===R&&(w.preventDefault(),r&&qt(T,{select:!0})):E===P&&w.preventDefault()}},[r,o,b.paused]);return m.jsx(Le.div,{tabIndex:-1,...c,ref:v,onKeyDown:x})},"FocusScope")),fd=h.createContext(null);function la({registry:e,children:t}){return e?m.jsx(fd.Provider,{value:e,children:t}):t}We(la,"FocusScopeBranchProvider");function ua(){const[e,t]=h.useState([]),n=h.useMemo(()=>({add:We(r=>t(o=>o.includes(r)?o:[...o,r]),"add"),remove:We(r=>t(o=>o.filter(s=>s!==r)),"remove")}),[]);return{nodes:e,registry:n}}We(ua,"useFocusScopeBranchRegistry");function da(e){const t=h.useContext(fd);h.useEffect(()=>{if(!(!e||!t))return t.add(e),()=>t.remove(e)},[e,t])}We(da,"useFocusScopeBranch");function hd(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(qt(r,{select:t}),document.activeElement!==n)return}We(hd,"focusFirst");function pd(e){const t=fa(e),n=pi(t,e),r=pi(t.reverse(),e);return[n,r]}We(pd,"getTabbableEdges");function fa(e){const t=[],r=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:We(o=>{const s=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||s?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)t.push(r.currentNode);return t}We(fa,"getTabbableCandidates");function pi(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):md(r,{upTo:t})))return r}We(pi,"findVisible");function md(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}We(md,"isHidden");function gd(e){return e.tagName==="INPUT"&&typeof e.select=="function"}We(gd,"isSelectableInput");function qt(e,{select:t=!1}={}){if(e&&e.focus){const r=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==r&&gd(e)&&t&&e.select()}}We(qt,"focus");var Pc=vd();function vd(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=mi(e,t),e.unshift(t)},remove(t){var n;e=mi(e,t),(n=e[0])==null||n.resume()}}}We(vd,"createFocusScopesStack");function mi(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}We(mi,"arrayRemove");function yd(e){return e.filter(t=>t.tagName!=="A")}We(yd,"removeLinks");var Gv=Object.defineProperty,qv=(e,t)=>Gv(e,"name",{value:t,configurable:!0}),ha=h.forwardRef(qv(function(t,n){var c;const{container:r,...o}=t,[s,i]=h.useState(!1);at(()=>i(!0),[]);const a=r||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?ru.createPortal(m.jsx(Le.div,{...o,ref:n}),a):null},"Portal")),Qv=Object.defineProperty,tn=(e,t)=>Qv(e,"name",{value:t,configurable:!0});function bd(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}tn(bd,"useStateMachine");var on=tn(e=>{const{present:t,children:n}=e,r=wd(t),o=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),s=_d(r.ref,xd(o));return typeof n=="function"||r.isPresent?h.cloneElement(o,{ref:s}):null},"Presence");function wd(e){const[t,n]=h.useState(),r=h.useRef(null),o=h.useRef(e),s=h.useRef("none"),i=h.useRef(void 0),a=e?"mounted":"unmounted",[c,u]=bd(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{c==="mounted"?(s.current=i.current??tr(r.current),i.current=void 0):s.current="none"},[c]),at(()=>{const d=r.current,l=o.current;if(l!==e){const p=s.current,v=tr(d);e?(i.current=v,u("MOUNT")):v==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(l&&p!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),at(()=>{if(t){let d;const l=t.ownerDocument.defaultView??window,f=tn(v=>{const _=tr(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&_&&(u("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",d=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},"handleAnimationEnd"),p=tn(v=>{v.target===t&&(s.current=tr(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{l.clearTimeout(d),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:h.useCallback(d=>{if(d){const l=getComputedStyle(d);r.current=l,i.current=tr(l)}else r.current=null;n(d)},[])}}tn(wd,"usePresence");function gi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}tn(gi,"setRef");function _d(...e){const t=h.useRef(e);return t.current=e,h.useCallback(n=>{const r=t.current;let o=!1;const s=r.map(i=>{const a=gi(i,n);return!o&&typeof a=="function"&&(o=!0),a});if(o)return()=>{for(let i=0;i<s.length;i++){const a=s[i];typeof a=="function"?a():gi(r[i],null)}}},[])}tn(_d,"useStableComposedRefs");function tr(e){return(e==null?void 0:e.animationName)||"none"}tn(tr,"getAnimationName");function xd(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}tn(xd,"getElementRef");var Yv=Object.defineProperty,pa=(e,t)=>Yv(e,"name",{value:t,configurable:!0}),vo=0,zt=null;function Jv(e){return is(),e.children}pa(Jv,"FocusGuards");function is(){h.useEffect(()=>{zt||(zt={start:vi(),end:vi()});const{start:e,end:t}=zt;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),vo++,()=>{vo===1&&(zt==null||zt.start.remove(),zt==null||zt.end.remove(),zt=null),vo=Math.max(0,vo-1)}},[])}pa(is,"useFocusGuards");function vi(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}pa(vi,"createFocusGuard");var Ut=function(){return Ut=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Ut.apply(this,arguments)};function Sd(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Xv(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Ao="right-scroll-bar-position",No="width-before-scroll-bar",ey="with-scroll-bars-hidden",ty="--removed-body-scroll-bar-size";function Ns(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ny(e,t){var n=h.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var ry=typeof window<"u"?h.useLayoutEffect:h.useEffect,Rc=new WeakMap;function oy(e,t){var n=ny(null,function(r){return e.forEach(function(o){return Ns(o,r)})});return ry(function(){var r=Rc.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Ns(a,null)}),s.forEach(function(a){o.has(a)||Ns(a,i)})}Rc.set(n,e)},[e]),n}function sy(e){return e}function iy(e,t){t===void 0&&(t=sy);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var d=i;i=[],d.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),n}}}};return o}function ay(e){e===void 0&&(e={});var t=iy(null);return t.options=Ut({async:!0,ssr:!1},e),t}var Ed=function(e){var t=e.sideCar,n=Sd(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return h.createElement(r,Ut({},n))};Ed.isSideCarExport=!0;function cy(e,t){return e.useMedium(t),Ed}var Cd=ay(),Ds=function(){},as=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:Ds,onWheelCapture:Ds,onTouchMoveCapture:Ds}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,l=e.shards,f=e.sideCar,p=e.noRelative,v=e.noIsolation,g=e.inert,_=e.allowPinchZoom,b=e.as,x=b===void 0?"div":b,w=e.gapMode,C=Sd(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,P=oy([n,t]),R=Ut(Ut({},C),o);return h.createElement(h.Fragment,null,d&&h.createElement(E,{sideCar:Cd,removeScrollBar:u,shards:l,noRelative:p,noIsolation:v,inert:g,setCallbacks:s,allowPinchZoom:!!_,lockRef:n,gapMode:w}),i?h.cloneElement(h.Children.only(a),Ut(Ut({},R),{ref:P})):h.createElement(x,Ut({},R,{className:c,ref:P}),a))});as.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};as.classNames={fullWidth:No,zeroRight:Ao};var ly=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function uy(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ly();return t&&e.setAttribute("nonce",t),e}function dy(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function fy(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var hy=function(){var e=0,t=null;return{add:function(n){e==0&&(t=uy())&&(dy(t,n),fy(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},py=function(){var e=hy();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},kd=function(){var e=py(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},my={left:0,top:0,right:0,gap:0},Ms=function(e){return parseInt(e||"",10)||0},gy=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ms(n),Ms(r),Ms(o)]},vy=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return my;var t=gy(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},yy=kd(),rr="data-scroll-locked",by=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
128
+ .`.concat(ey,` {
129
+ overflow: hidden `).concat(r,`;
130
+ padding-right: `).concat(a,"px ").concat(r,`;
131
+ }
132
+ body[`).concat(rr,`] {
133
+ overflow: hidden `).concat(r,`;
134
+ overscroll-behavior: contain;
135
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
136
+ padding-left: `.concat(o,`px;
137
+ padding-top: `).concat(s,`px;
138
+ padding-right: `).concat(i,`px;
139
+ margin-left:0;
140
+ margin-top:0;
141
+ margin-right: `).concat(a,"px ").concat(r,`;
142
+ `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
143
+ }
144
+
145
+ .`).concat(Ao,` {
146
+ right: `).concat(a,"px ").concat(r,`;
147
+ }
148
+
149
+ .`).concat(No,` {
150
+ margin-right: `).concat(a,"px ").concat(r,`;
151
+ }
152
+
153
+ .`).concat(Ao," .").concat(Ao,` {
154
+ right: 0 `).concat(r,`;
155
+ }
156
+
157
+ .`).concat(No," .").concat(No,` {
158
+ margin-right: 0 `).concat(r,`;
159
+ }
160
+
161
+ body[`).concat(rr,`] {
162
+ `).concat(ty,": ").concat(a,`px;
163
+ }
164
+ `)},Tc=function(){var e=parseInt(document.body.getAttribute(rr)||"0",10);return isFinite(e)?e:0},wy=function(){h.useEffect(function(){return document.body.setAttribute(rr,(Tc()+1).toString()),function(){var e=Tc()-1;e<=0?document.body.removeAttribute(rr):document.body.setAttribute(rr,e.toString())}},[])},_y=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;wy();var s=h.useMemo(function(){return vy(o)},[o]);return h.createElement(yy,{styles:by(s,!t,o,n?"":"!important")})},yi=!1;if(typeof window<"u")try{var yo=Object.defineProperty({},"passive",{get:function(){return yi=!0,!0}});window.addEventListener("test",yo,yo),window.removeEventListener("test",yo,yo)}catch{yi=!1}var Yn=yi?{passive:!1}:!1,xy=function(e){return e.tagName==="TEXTAREA"},Od=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!xy(e)&&n[t]==="visible")},Sy=function(e){return Od(e,"overflowY")},Ey=function(e){return Od(e,"overflowX")},Ic=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Pd(e,r);if(o){var s=Rd(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Cy=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ky=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Pd=function(e,t){return e==="v"?Sy(t):Ey(t)},Rd=function(e,t){return e==="v"?Cy(t):ky(t)},Oy=function(e,t){return e==="h"&&t==="rtl"?-1:1},Py=function(e,t,n,r,o){var s=Oy(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,c=t.contains(a),u=!1,d=i>0,l=0,f=0;do{if(!a)break;var p=Rd(e,a),v=p[0],g=p[1],_=p[2],b=g-_-s*v;(v||b)&&Pd(e,a)&&(l+=b,f+=v);var x=a.parentNode;a=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(d&&Math.abs(l)<1||!d&&Math.abs(f)<1)&&(u=!0),u},bo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ac=function(e){return[e.deltaX,e.deltaY]},Nc=function(e){return e&&"current"in e?e.current:e},Ry=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ty=function(e){return`
165
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
166
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
167
+ `)},Iy=0,Jn=[];function Ay(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(Iy++)[0],s=h.useState(kd)[0],i=h.useRef(e);h.useEffect(function(){i.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=Xv([e.lockRef.current],(e.shards||[]).map(Nc),!0).filter(Boolean);return g.forEach(function(_){return _.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(g,_){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var b=bo(g),x=n.current,w="deltaX"in g?g.deltaX:x[0]-b[0],C="deltaY"in g?g.deltaY:x[1]-b[1],E,P=g.target,R=Math.abs(w)>Math.abs(C)?"h":"v";if("touches"in g&&R==="h"&&P.type==="range")return!1;var T=window.getSelection(),A=T&&T.anchorNode,j=A?A===P||A.contains(P):!1;if(j)return!1;var L=Ic(R,P);if(!L)return!0;if(L?E=R:(E=R==="v"?"h":"v",L=Ic(R,P)),!L)return!1;if(!r.current&&"changedTouches"in g&&(w||C)&&(r.current=E),!E)return!0;var z=r.current||E;return Py(z,_,g,z==="h"?w:C)},[]),c=h.useCallback(function(g){var _=g;if(!(!Jn.length||Jn[Jn.length-1]!==s)){var b="deltaY"in _?Ac(_):bo(_),x=t.current.filter(function(E){return E.name===_.type&&(E.target===_.target||_.target===E.shadowParent)&&Ry(E.delta,b)})[0];if(x&&x.should){_.cancelable&&_.preventDefault();return}if(!x){var w=(i.current.shards||[]).map(Nc).filter(Boolean).filter(function(E){return E.contains(_.target)}),C=w.length>0?a(_,w[0]):!i.current.noIsolation;C&&_.cancelable&&_.preventDefault()}}},[]),u=h.useCallback(function(g,_,b,x){var w={name:g,delta:_,target:b,should:x,shadowParent:Ny(b)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(C){return C!==w})},1)},[]),d=h.useCallback(function(g){n.current=bo(g),r.current=void 0},[]),l=h.useCallback(function(g){u(g.type,Ac(g),g.target,a(g,e.lockRef.current))},[]),f=h.useCallback(function(g){u(g.type,bo(g),g.target,a(g,e.lockRef.current))},[]);h.useEffect(function(){return Jn.push(s),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Yn),document.addEventListener("touchmove",c,Yn),document.addEventListener("touchstart",d,Yn),function(){Jn=Jn.filter(function(g){return g!==s}),document.removeEventListener("wheel",c,Yn),document.removeEventListener("touchmove",c,Yn),document.removeEventListener("touchstart",d,Yn)}},[]);var p=e.removeScrollBar,v=e.inert;return h.createElement(h.Fragment,null,v?h.createElement(s,{styles:Ty(o)}):null,p?h.createElement(_y,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ny(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Dy=cy(Cd,Ay);var ma=h.forwardRef(function(e,t){return h.createElement(as,Ut({},e,{ref:t,sideCar:Dy}))});ma.classNames=as.classNames;var My=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Xn=new WeakMap,wo=new WeakMap,_o={},js=0,Td=function(e){return e&&(e.host||Td(e.parentNode))},jy=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Td(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},$y=function(e,t,n,r){var o=jy(t,Array.isArray(e)?e:[e]);_o[n]||(_o[n]=new WeakMap);var s=_o[n],i=[],a=new Set,c=new Set(o),u=function(l){!l||a.has(l)||(a.add(l),u(l.parentNode))};o.forEach(u);var d=function(l){!l||c.has(l)||Array.prototype.forEach.call(l.children,function(f){if(a.has(f))d(f);else try{var p=f.getAttribute(r),v=p!==null&&p!=="false",g=(Xn.get(f)||0)+1,_=(s.get(f)||0)+1;Xn.set(f,g),s.set(f,_),i.push(f),g===1&&v&&wo.set(f,!0),_===1&&f.setAttribute(n,"true"),v||f.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return d(t),a.clear(),js++,function(){i.forEach(function(l){var f=Xn.get(l)-1,p=s.get(l)-1;Xn.set(l,f),s.set(l,p),f||(wo.has(l)||l.removeAttribute(r),wo.delete(l)),p||l.removeAttribute(n)}),js--,js||(Xn=new WeakMap,Xn=new WeakMap,wo=new WeakMap,_o={})}},Id=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=My(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),$y(r,o,n,"aria-hidden")):function(){return null}},zy=Object.defineProperty,bt=(e,t)=>zy(e,"name",{value:t,configurable:!0}),ga="Dialog",[Ad,mk]=rn(ga),[Fy,jt]=Ad(ga),Ly=bt(e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=h.useRef(null),c=h.useRef(null),{nodes:u,registry:d}=ua(),[l,f]=ao({prop:r,defaultProp:o??!1,onChange:s,caller:ga}),[p,v]=h.useState(0),[g,_]=h.useState(0);return m.jsx(Fy,{scope:t,triggerRef:a,contentRef:c,contentId:En(),titleId:En(),descriptionId:En(),titlePresent:p>0,descriptionPresent:g>0,setTitleCount:v,setDescriptionCount:_,open:l,onOpenChange:f,onOpenToggle:h.useCallback(()=>f(b=>!b),[f]),modal:i,branchNodes:u,branchRegistry:d,children:n})},"Dialog"),Vy="DialogTrigger",gk=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt(Vy,r),i=Pe(n,s.triggerRef);return m.jsx(Le.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":cs(s.open),...o,ref:i,onClick:ce(t.onClick,s.onOpenToggle)})},"DialogTrigger")),Nd="DialogPortal",[Uy,Dd]=Ad(Nd,{forceMount:void 0}),Zy=bt(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=jt(Nd,t);return m.jsx(Uy,{scope:t,forceMount:n,children:h.Children.map(r,i=>m.jsx(on,{present:n||s.open,children:m.jsx(ha,{asChild:!0,container:o,children:i})}))})},"DialogPortal"),bi="DialogOverlay",Md=h.forwardRef(bt(function(t,n){const r=Dd(bi,t.__scopeDialog),{forceMount:o=r.forceMount,...s}=t,i=jt(bi,t.__scopeDialog);return i.modal?m.jsx(on,{present:o||i.open,children:m.jsx(Wy,{...s,ref:n})}):null},"DialogOverlay")),By=Xt("DialogOverlay.RemoveScroll"),Wy=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt(bi,r),i=cd(),a=Pe(n,i);return m.jsx(ma,{as:By,allowPinchZoom:!0,shards:h.useMemo(()=>[s.contentRef,...s.branchNodes.map(c=>({current:c}))],[s.contentRef,s.branchNodes]),children:m.jsx(Le.div,{"data-state":cs(s.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),Kr="DialogContent",jd=h.forwardRef(bt(function(t,n){const r=Dd(Kr,t.__scopeDialog),{forceMount:o=r.forceMount,...s}=t,i=jt(Kr,t.__scopeDialog);return m.jsx(on,{present:o||i.open,children:i.modal?m.jsx(Hy,{...s,ref:n}):m.jsx(Ky,{...s,ref:n})})},"DialogContent")),Hy=h.forwardRef(bt(function(t,n){const r=jt(Kr,t.__scopeDialog),o=h.useRef(null),s=Pe(n,r.contentRef,o);return h.useEffect(()=>{const i=o.current;if(i)return Id(i)},[]),m.jsx($d,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:ce(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:ce(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&i.preventDefault()}),onFocusOutside:ce(t.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),Ky=h.forwardRef(bt(function(t,n){const r=jt(Kr,t.__scopeDialog),o=h.useRef(!1),s=h.useRef(!1);return m.jsx($d,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(o.current||(c=r.triggerRef.current)==null||c.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),$d=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,"aria-describedby":a,children:c,...u}=t,d=jt(Kr,r);return is(),m.jsx(la,{registry:d.branchRegistry,children:m.jsx(dd,{asChild:!0,loop:!0,trapped:o,branches:d.branchNodes,onMountAutoFocus:s,onUnmountAutoFocus:i,children:m.jsx(aa,{role:"dialog",id:d.contentId,"aria-labelledby":d.titlePresent?d.titleId:void 0,"aria-describedby":d.descriptionPresent?Ld(a,d.descriptionId):a,"data-state":cs(d.open),...u,ref:n,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1),children:c})})})},"DialogContentImpl")),zd=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt("DialogTitle",r),{setTitleCount:i}=s;return at(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),m.jsx(Le.h2,{id:s.titleId,...o,ref:n})},"DialogTitle")),Fd=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt("DialogDescription",r),{setDescriptionCount:i}=s;return at(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),m.jsx(Le.p,{id:s.descriptionId,...o,ref:n})},"DialogDescription")),Gy="DialogClose",qy=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt(Gy,r);return m.jsx(Le.button,{type:"button",...o,ref:n,onClick:ce(t.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function Ld(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}bt(Ld,"concatAriaDescribedby");function cs(e){return e?"open":"closed"}bt(cs,"getState");const Qy=Ly,Yy=Zy,Vd=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Md,{className:s,...o,ref:t}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Vd.displayName=Md.displayName;const Jy=so("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Ud=h.forwardRef((e,t)=>{const n=te.c(15);let r,o,s,i;n[0]!==e?({side:i,className:o,children:r,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);const a=i===void 0?"right":i;let c;n[5]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx(Vd,{}),n[5]=c):c=n[5];let u;n[6]!==o||n[7]!==a?(u=ie(Jy({side:a}),o),n[6]=o,n[7]=a,n[8]=u):u=n[8];let d;n[9]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsxs(qy,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[m.jsx(zg,{className:"h-4 w-4"}),m.jsx("span",{className:"sr-only",children:"Close"})]}),n[9]=d):d=n[9];let l;return n[10]!==r||n[11]!==s||n[12]!==t||n[13]!==u?(l=m.jsxs(Yy,{children:[c,m.jsxs(jd,{ref:t,className:u,...s,children:[r,d]})]}),n[10]=r,n[11]=s,n[12]=t,n[13]=u,n[14]=l):l=n[14],l});Ud.displayName=jd.displayName;const Zd=e=>{const t=te.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let o;t[3]!==n?(o=ie("flex flex-col space-y-2 text-center sm:text-left",n),t[3]=n,t[4]=o):o=t[4];let s;return t[5]!==r||t[6]!==o?(s=m.jsx("div",{className:o,...r}),t[5]=r,t[6]=o,t[7]=s):s=t[7],s};Zd.displayName="SheetHeader";const Bd=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("text-lg font-semibold text-foreground",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(zd,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Bd.displayName=zd.displayName;const Wd=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("text-sm text-muted-foreground",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Fd,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Wd.displayName=Fd.displayName;function Dc(e){const t=te.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let o;t[3]!==n?(o=ie("animate-pulse rounded-md bg-muted",n),t[3]=n,t[4]=o):o=t[4];let s;return t[5]!==r||t[6]!==o?(s=m.jsx("div",{className:o,...r}),t[5]=r,t[6]=o,t[7]=s):s=t[7],s}var Xy=Object.defineProperty,eb=(e,t)=>Xy(e,"name",{value:t,configurable:!0});function Hd(e){const[t,n]=h.useState(void 0);return at(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let r=0;const o=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];window.cancelAnimationFrame(r),r=window.requestAnimationFrame(()=>{let a,c;if("borderBoxSize"in i){const u=i.borderBoxSize,d=Array.isArray(u)?u[0]:u;a=d.inlineSize,c=d.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})})});return o.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}else n(void 0)},[e]),t}eb(Hd,"useSize");var tb=Object.defineProperty,Cn=(e,t)=>tb(e,"name",{value:t,configurable:!0}),Mc={Partial:"partial"},jc={Optimized:"optimized",Always:"always"},Kd="Popper",[Gd,ls]=rn(Kd),[nb,qd]=Gd(Kd),Qd=Cn(e=>{const{__scopePopper:t,children:n}=e,[r,o]=h.useState(null),[s,i]=h.useState(void 0);return m.jsx(nb,{scope:t,anchor:r,onAnchorChange:o,placementState:s,setPlacementState:i,children:n})},"Popper"),rb="PopperAnchor",Yd=h.forwardRef(Cn(function(t,n){const{__scopePopper:r,virtualRef:o,...s}=t,i=qd(rb,r),a=h.useRef(null),c=i.onAnchorChange,u=h.useCallback(g=>{a.current=g,g&&c(g)},[c]),d=Pe(n,u),l=h.useRef(null);h.useEffect(()=>{if(!o)return;const g=l.current;l.current=o.current,g!==l.current&&c(l.current)});const f=i.placementState&&us(i.placementState),p=f==null?void 0:f[0],v=f==null?void 0:f[1];return o?null:m.jsx(Le.div,{"data-radix-popper-side":p,"data-radix-popper-align":v,...s,ref:d})},"PopperAnchor")),Jd="PopperContent",[ob,vk]=Gd(Jd),Xd=h.forwardRef(Cn(function(t,n){var ue,qe,Xe,Ze,De,Be,kt;const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:l=0,sticky:f=Mc.Partial,hideWhenDetached:p=!1,updatePositionStrategy:v=jc.Optimized,onPlaced:g,..._}=t,b=qd(Jd,r),[x,w]=h.useState(null),C=Pe(n,w),[E,P]=h.useState(null),R=Hd(E),T=(R==null?void 0:R.width)??0,A=(R==null?void 0:R.height)??0,j=o+(i!=="center"?"-"+i:""),L=typeof l=="number"?l:{top:0,right:0,bottom:0,left:0,...l},z=Array.isArray(d)?d:[d],J=z.length>0,W={padding:L,boundary:z.filter(ef),altBoundary:J},{refs:K,floatingStyles:Z,placement:X,isPositioned:re,middlewareData:Y}=kp({strategy:"fixed",placement:j,whileElementsMounted:Cn((...ct)=>Dp(...ct,{animationFrame:v===jc.Always}),"whileElementsMounted"),elements:{reference:b.anchor},middleware:[Op({mainAxis:s+A,alignmentAxis:a}),u&&Pp({mainAxis:!0,crossAxis:!1,...f===Mc.Partial?{limiter:Np()}:{},...W}),u&&Rp({...W}),Tp({...W,apply:Cn(({elements:ct,rects:$e,availableWidth:qn,availableHeight:pt})=>{const{width:Rn,height:sn}=$e.reference,Me=ct.floating.style;Me.setProperty("--radix-popper-available-width",`${qn}px`),Me.setProperty("--radix-popper-available-height",`${pt}px`),Me.setProperty("--radix-popper-anchor-width",`${Rn}px`),Me.setProperty("--radix-popper-anchor-height",`${sn}px`)},"apply")}),E&&Ip({element:E,padding:c}),sb({arrowWidth:T,arrowHeight:A}),p&&Ap(J?{strategy:"referenceHidden",...W}:{strategy:"referenceHidden",padding:W.padding,altBoundary:W.altBoundary})]}),ee=b.setPlacementState;at(()=>(ee(X),()=>{ee(void 0)}),[X,ee]);const[G,ve]=us(X),he=en(g);at(()=>{re&&(he==null||he())},[re,he]);const oe=(ue=Y.arrow)==null?void 0:ue.x,le=(qe=Y.arrow)==null?void 0:qe.y,U=((Xe=Y.arrow)==null?void 0:Xe.centerOffset)!==0,[fe,Ee]=h.useState();return at(()=>{x&&Ee(window.getComputedStyle(x).zIndex)},[x]),m.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:re?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(Ze=Y.transformOrigin)==null?void 0:Ze.x,(De=Y.transformOrigin)==null?void 0:De.y].join(" "),...((Be=Y.hide)==null?void 0:Be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:m.jsx(ob,{scope:r,placedSide:G,placedAlign:ve,onArrowChange:P,arrowX:oe,arrowY:le,shouldHideArrow:U,children:m.jsx(Le.div,{"data-side":G,"data-align":ve,..._,ref:C,style:{..._.style,animation:re?(kt=_.style)==null?void 0:kt.animation:"none"}})})})},"PopperContent"));function ef(e){return e!==null}Cn(ef,"isNotNull");var sb=Cn(e=>({name:"transformOrigin",options:e,fn(t){var _,b,x;const{placement:n,rects:r,middlewareData:o}=t,i=((_=o.arrow)==null?void 0:_.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,d]=us(n),l={start:"0%",center:"50%",end:"100%"}[d],f=(((b=o.arrow)==null?void 0:b.x)??0)+a/2,p=(((x=o.arrow)==null?void 0:x.y)??0)+c/2;let v="",g="";return u==="bottom"?(v=i?l:`${f}px`,g=`${-c}px`):u==="top"?(v=i?l:`${f}px`,g=`${r.floating.height+c}px`):u==="right"?(v=`${-c}px`,g=i?l:`${p}px`):u==="left"&&(v=`${r.floating.width+c}px`,g=i?l:`${p}px`),{data:{x:v,y:g}}}}),"transformOrigin");function us(e){const[t,n="center"]=e.split("-");return[t,n]}Cn(us,"getSideAndAlignFromPlacement");var ib=Object.defineProperty,ab=(e,t)=>ib(e,"name",{value:t,configurable:!0}),cb=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),lb=h.forwardRef(ab(function(t,n){return m.jsx(Le.span,{...t,ref:n,style:{...cb,...t.style}})},"VisuallyHidden")),ub=Object.defineProperty,Ge=(e,t)=>ub(e,"name",{value:t,configurable:!0}),[va,yk]=rn("Tooltip",[ls]),ya=ls(),db="TooltipProvider",fb=700,wi="tooltip.open",[hb,ba]=va(db),pb=Ge(e=>{const{__scopeTooltip:t,delayDuration:n=fb,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=h.useRef(!0),a=h.useRef(!1),c=h.useRef(0);return h.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),m.jsx(hb,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:h.useCallback(()=>{r<=0||(window.clearTimeout(c.current),i.current=!1)},[r]),onClose:h.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r))},[r]),isPointerInTransitRef:a,onPointerInTransitChange:h.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})},"TooltipProvider"),_i="Tooltip",[mb,co]=va(_i),gb=Ge(e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,c=ba(_i,e.__scopeTooltip),u=ya(t),[d,l]=h.useState(null),[f,p]=h.useState(void 0),v=En(),g=h.useRef(0),_=i??c.disableHoverableContent,b=a??c.delayDuration,x=h.useRef(!1),[w,C]=ao({prop:r,defaultProp:o??!1,onChange:Ge(j=>{j?(c.onOpen(),document.dispatchEvent(new CustomEvent(wi))):c.onClose(),s==null||s(j)},"onChange"),caller:_i}),E=h.useMemo(()=>w?x.current?"delayed-open":"instant-open":"closed",[w]),P=h.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x.current=!1,C(!0)},[C]),R=h.useCallback(()=>{window.clearTimeout(g.current),g.current=0,C(!1)},[C]),T=h.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,C(!0),g.current=0},b)},[b,C]);h.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]);const A=f??v;return m.jsx(Qd,{...u,children:m.jsx(mb,{scope:t,contentId:A,setContentId:p,open:w,stateAttribute:E,trigger:d,onTriggerChange:l,onTriggerEnter:h.useCallback(()=>{c.isOpenDelayedRef.current?T():P()},[c.isOpenDelayedRef,T,P]),onTriggerLeave:h.useCallback(()=>{_?R():(window.clearTimeout(g.current),g.current=0)},[R,_]),onOpen:P,onClose:R,disableHoverableContent:_,children:n})})},"Tooltip"),$c="TooltipTrigger",vb=h.forwardRef(Ge(function(t,n){const{__scopeTooltip:r,"aria-describedby":o,...s}=t,i=co($c,r),a=ba($c,r),c=ya(r),u=h.useRef(null),d=Pe(n,u,i.onTriggerChange),l=h.useRef(!1),f=h.useRef(!1),p=h.useCallback(()=>l.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),m.jsx(Yd,{asChild:!0,...c,children:m.jsx(Le.button,{"aria-describedby":i.open?df(o,i.contentId):o,"data-state":i.stateAttribute,...s,ref:d,onPointerMove:ce(t.onPointerMove,v=>{v.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),f.current=!0)}),onPointerLeave:ce(t.onPointerLeave,()=>{i.onTriggerLeave(),f.current=!1}),onPointerDown:ce(t.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:ce(t.onFocus,()=>{l.current||i.onOpen()}),onBlur:ce(t.onBlur,i.onClose),onClick:ce(t.onClick,i.onClose)})})},"TooltipTrigger")),tf="TooltipPortal",[yb,bb]=va(tf,{forceMount:void 0}),wb=Ge(e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=co(tf,t);return m.jsx(yb,{scope:t,forceMount:n,children:m.jsx(on,{present:n||s.open,children:m.jsx(ha,{asChild:!0,container:o,children:r})})})},"TooltipPortal"),Gr="TooltipContent",nf=h.forwardRef(Ge(function(t,n){const r=bb(Gr,t.__scopeTooltip),{forceMount:o=r.forceMount,side:s="top",...i}=t,a=co(Gr,t.__scopeTooltip);return m.jsx(on,{present:o||a.open,children:a.disableHoverableContent?m.jsx(rf,{side:s,...i,ref:n}):m.jsx(_b,{side:s,...i,ref:n})})},"TooltipContent")),_b=h.forwardRef(Ge(function(t,n){const r=co(Gr,t.__scopeTooltip),o=ba(Gr,t.__scopeTooltip),s=h.useRef(null),i=Pe(n,s),[a,c]=h.useState(null),{trigger:u,onClose:d}=r,l=s.current,{onPointerInTransitChange:f}=o,p=h.useCallback(()=>{c(null),f(!1)},[f]),v=h.useCallback((g,_)=>{const b=g.currentTarget,x={x:g.clientX,y:g.clientY},w=of(x,b.getBoundingClientRect()),C=sf(x,w),E=af(_.getBoundingClientRect()),P=lf([...C,...E]);c(P),f(!0)},[f]);return h.useEffect(()=>()=>p(),[p]),h.useEffect(()=>{if(u&&l){const g=Ge(b=>v(b,l),"handleTriggerLeave"),_=Ge(b=>v(b,u),"handleContentLeave");return u.addEventListener("pointerleave",g),l.addEventListener("pointerleave",_),()=>{u.removeEventListener("pointerleave",g),l.removeEventListener("pointerleave",_)}}},[u,l,v,p]),h.useEffect(()=>{if(a){const g=Ge(_=>{const b=_.target,x={x:_.clientX,y:_.clientY},w=(u==null?void 0:u.contains(b))||(l==null?void 0:l.contains(b)),C=!cf(x,a);w?p():C&&(p(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[u,l,a,d,p]),m.jsx(rf,{...t,ref:i})},"TooltipContentHoverable")),xb=wu("TooltipContent"),rf=h.forwardRef(Ge(function(t,n){const{__scopeTooltip:r,children:o,"aria-label":s,id:i,onEscapeKeyDown:a,onPointerDownOutside:c,...u}=t,d=co(Gr,r),l=ya(r),{onClose:f}=d,[p,v]=h.useState(null),g=Pe(n,v);da(p),h.useEffect(()=>(document.addEventListener(wi,f),()=>document.removeEventListener(wi,f)),[f]),h.useEffect(()=>{if(d.trigger){const b=Ge(x=>{x.target instanceof Node&&x.target.contains(d.trigger)&&f()},"handleScroll");return window.addEventListener("scroll",b,{capture:!0}),()=>window.removeEventListener("scroll",b,{capture:!0})}},[d.trigger,f]);const{setContentId:_}=d;return at(()=>(_(i),()=>{_(void 0)}),[i,_]),m.jsx(aa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:b=>b.preventDefault(),onDismiss:f,children:m.jsxs(Xd,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...l,...u,ref:g,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[m.jsx(xb,{children:o}),s?m.jsx(lb,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function of(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}Ge(of,"getExitSideFromRect");function sf(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}Ge(sf,"getPaddedExitPoints");function af(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}Ge(af,"getPointsFromRect");function cf(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],u=a.x,d=a.y,l=c.x,f=c.y;d>r!=f>r&&n<(l-u)*(r-d)/(f-d)+u&&(o=!o)}return o}Ge(cf,"isPointInPolygon");function lf(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),uf(t)}Ge(lf,"getHull");function uf(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Ge(uf,"getHullPresorted");function df(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}Ge(df,"concatAriaDescribedby");const Sb=pb,Eb=gb,Cb=vb,ff=h.forwardRef((e,t)=>{const n=te.c(11);let r,o,s;n[0]!==e?({className:r,sideOffset:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=s===void 0?4:s;let a;n[4]!==r?(a=ie("z-[50] overflow-hidden rounded-lg bg-foreground/85 px-[7px] py-1.5 text-[11px] text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",r),n[4]=r,n[5]=a):a=n[5];let c;return n[6]!==o||n[7]!==t||n[8]!==i||n[9]!==a?(c=m.jsx(wb,{children:m.jsx(nf,{ref:t,sideOffset:i,"data-slot":"tooltip-content",className:a,...o})}),n[6]=o,n[7]=t,n[8]=i,n[9]=a,n[10]=c):c=n[10],c});ff.displayName=nf.displayName;const kb="sidebar_state",Ob=3600*24*7,Pb="16rem",Rb="18rem",Tb="3rem",Ib="b",hf=h.createContext(null);function ds(){const e=h.useContext(hf);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const pf=h.forwardRef((e,t)=>{const n=te.c(37);let r,o,s,i,a,c,u;n[0]!==e?({defaultOpen:u,open:s,onOpenChange:a,className:o,style:c,children:r,...i}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a,n[6]=c,n[7]=u):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5],c=n[6],u=n[7]);const d=u===void 0?!0:u,l=Vg(),[f,p]=h.useState(!1),[v,g]=h.useState(d),_=s??v;let b;n[8]!==_||n[9]!==a?(b=K=>{const Z=typeof K=="function"?K(_):K;a?a(Z):g(Z),document.cookie=`${kb}=${Z}; path=/; max-age=${Ob}`},n[8]=_,n[9]=a,n[10]=b):b=n[10];const x=b;let w;n[11]!==l||n[12]!==x?(w=()=>l?p(Zb):x(Bb),n[11]=l,n[12]=x,n[13]=w):w=n[13];const C=w;let E,P;n[14]!==C?(E=()=>{const K=Z=>{Z.key===Ib&&(Z.metaKey||Z.ctrlKey)&&(Z.preventDefault(),C())};return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},P=[C],n[14]=C,n[15]=E,n[16]=P):(E=n[15],P=n[16]),h.useEffect(E,P);const R=_?"expanded":"collapsed";let T;n[17]!==l||n[18]!==_||n[19]!==f||n[20]!==x||n[21]!==R||n[22]!==C?(T={state:R,open:_,setOpen:x,isMobile:l,openMobile:f,setOpenMobile:p,toggleSidebar:C},n[17]=l,n[18]=_,n[19]=f,n[20]=x,n[21]=R,n[22]=C,n[23]=T):T=n[23];const A=T;let j;n[24]!==c?(j={"--sidebar-width":Pb,"--sidebar-width-icon":Tb,...c},n[24]=c,n[25]=j):j=n[25];const L=j;let z;n[26]!==o?(z=ie("group/sidebar-wrapper flex h-svh w-full has-[[data-variant=inset]]:bg-sidebar",o),n[26]=o,n[27]=z):z=n[27];let J;n[28]!==r||n[29]!==i||n[30]!==t||n[31]!==L||n[32]!==z?(J=m.jsx(Sb,{delayDuration:0,children:m.jsx("div",{style:L,className:z,ref:t,...i,children:r})}),n[28]=r,n[29]=i,n[30]=t,n[31]=L,n[32]=z,n[33]=J):J=n[33];let W;return n[34]!==A||n[35]!==J?(W=m.jsx(hf.Provider,{value:A,children:J}),n[34]=A,n[35]=J,n[36]=W):W=n[36],W});pf.displayName="SidebarProvider";const mf=h.forwardRef((e,t)=>{const n=te.c(48);let r,o,s,i,a,c;n[0]!==e?({side:i,variant:a,collapsible:c,className:o,children:r,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a,n[6]=c):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5],c=n[6]);const u=i===void 0?"left":i,d=a===void 0?"sidebar":a,l=c===void 0?"offcanvas":c,{isMobile:f,state:p,openMobile:v,setOpenMobile:g}=ds();if(l==="none"){let j;n[7]!==o?(j=ie("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),n[7]=o,n[8]=j):j=n[8];let L;return n[9]!==r||n[10]!==s||n[11]!==t||n[12]!==j?(L=m.jsx("div",{className:j,ref:t,...s,children:r}),n[9]=r,n[10]=s,n[11]=t,n[12]=j,n[13]=L):L=n[13],L}if(f){let j;n[14]===Symbol.for("react.memo_cache_sentinel")?(j={"--sidebar-width":Rb},n[14]=j):j=n[14];let L;n[15]===Symbol.for("react.memo_cache_sentinel")?(L=m.jsxs(Zd,{className:"sr-only",children:[m.jsx(Bd,{children:"Sidebar"}),m.jsx(Wd,{children:"Displays the mobile sidebar."})]}),n[15]=L):L=n[15];let z;n[16]!==r?(z=m.jsx("div",{className:"flex h-full w-full flex-col",children:r}),n[16]=r,n[17]=z):z=n[17];let J;n[18]!==u||n[19]!==z?(J=m.jsxs(Ud,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:j,side:u,children:[L,z]}),n[18]=u,n[19]=z,n[20]=J):J=n[20];let W;return n[21]!==v||n[22]!==s||n[23]!==g||n[24]!==J?(W=m.jsx(Qy,{open:v,onOpenChange:g,...s,children:J}),n[21]=v,n[22]=s,n[23]=g,n[24]=J,n[25]=W):W=n[25],W}const _=p==="collapsed"?l:"",b=d==="floating"||d==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]";let x;n[26]!==b?(x=ie("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",b),n[26]=b,n[27]=x):x=n[27];let w;n[28]!==x?(w=m.jsx("div",{className:x}),n[28]=x,n[29]=w):w=n[29];const C=u==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",E=d==="floating"||d==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l";let P;n[30]!==o||n[31]!==C||n[32]!==E?(P=ie("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",C,E,o),n[30]=o,n[31]=C,n[32]=E,n[33]=P):P=n[33];let R;n[34]!==r?(R=m.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:r}),n[34]=r,n[35]=R):R=n[35];let T;n[36]!==s||n[37]!==P||n[38]!==R?(T=m.jsx("div",{className:P,...s,children:R}),n[36]=s,n[37]=P,n[38]=R,n[39]=T):T=n[39];let A;return n[40]!==t||n[41]!==u||n[42]!==p||n[43]!==T||n[44]!==_||n[45]!==w||n[46]!==d?(A=m.jsxs("div",{ref:t,className:"group peer hidden text-sidebar-foreground md:block","data-state":p,"data-collapsible":_,"data-variant":d,"data-side":u,children:[w,T]}),n[40]=t,n[41]=u,n[42]=p,n[43]=T,n[44]=_,n[45]=w,n[46]=d,n[47]=A):A=n[47],A});mf.displayName="Sidebar";const gf=h.forwardRef((e,t)=>{const n=te.c(16);let r,o,s;n[0]!==e?({className:r,onClick:o,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const{toggleSidebar:i}=ds();let a;n[4]!==r?(a=ie("h-7 w-7",r),n[4]=r,n[5]=a):a=n[5];let c;n[6]!==o||n[7]!==i?(c=f=>{o==null||o(f),i()},n[6]=o,n[7]=i,n[8]=c):c=n[8];let u,d;n[9]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(Dg,{}),d=m.jsx("span",{className:"sr-only",children:"Toggle Sidebar"}),n[9]=u,n[10]=d):(u=n[9],d=n[10]);let l;return n[11]!==s||n[12]!==t||n[13]!==a||n[14]!==c?(l=m.jsxs(ss,{ref:t,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:a,onClick:c,...s,children:[u,d]}),n[11]=s,n[12]=t,n[13]=a,n[14]=c,n[15]=l):l=n[15],l});gf.displayName="SidebarTrigger";const Ab=h.forwardRef((e,t)=>{const n=te.c(10);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);const{toggleSidebar:s}=ds();let i;n[3]!==r?(i=ie("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",r),n[3]=r,n[4]=i):i=n[4];let a;return n[5]!==o||n[6]!==t||n[7]!==i||n[8]!==s?(a=m.jsx("button",{ref:t,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:s,title:"Toggle Sidebar",className:i,...o}),n[5]=o,n[6]=t,n[7]=i,n[8]=s,n[9]=a):a=n[9],a});Ab.displayName="SidebarRail";const vf=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("main",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});vf.displayName="SidebarInset";const Nb=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Wo,{ref:t,"data-sidebar":"input",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Nb.displayName="SidebarInput";const yf=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("flex flex-col gap-2 p-2",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"header",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});yf.displayName="SidebarHeader";const bf=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("flex flex-col gap-2 p-2",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"footer",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});bf.displayName="SidebarFooter";const Db=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("mx-2 w-auto bg-sidebar-border",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Ho,{ref:t,"data-sidebar":"separator",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Db.displayName="SidebarSeparator";const wf=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"content",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});wf.displayName="SidebarContent";const Do=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("relative flex w-full min-w-0 flex-col p-2",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"group",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Do.displayName="SidebarGroup";const xi=h.forwardRef((e,t)=>{const n=te.c(11);let r,o,s;n[0]!==e?({className:r,asChild:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const a=(s===void 0?!1:s)?xr:"div";let c;n[4]!==r?(c=ie("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",r),n[4]=r,n[5]=c):c=n[5];let u;return n[6]!==a||n[7]!==o||n[8]!==t||n[9]!==c?(u=m.jsx(a,{ref:t,"data-sidebar":"group-label",className:c,...o}),n[6]=a,n[7]=o,n[8]=t,n[9]=c,n[10]=u):u=n[10],u});xi.displayName="SidebarGroupLabel";const Mb=h.forwardRef((e,t)=>{const n=te.c(11);let r,o,s;n[0]!==e?({className:r,asChild:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const a=(s===void 0?!1:s)?xr:"button";let c;n[4]!==r?(c=ie("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",r),n[4]=r,n[5]=c):c=n[5];let u;return n[6]!==a||n[7]!==o||n[8]!==t||n[9]!==c?(u=m.jsx(a,{ref:t,"data-sidebar":"group-action",className:c,...o}),n[6]=a,n[7]=o,n[8]=t,n[9]=c,n[10]=u):u=n[10],u});Mb.displayName="SidebarGroupAction";const Mo=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("w-full text-sm",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"group-content",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Mo.displayName="SidebarGroupContent";const jo=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("flex w-full min-w-0 flex-col gap-1",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("ul",{ref:t,"data-sidebar":"menu",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});jo.displayName="SidebarMenu";const Ko=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("group/menu-item relative",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("li",{ref:t,"data-sidebar":"menu-item",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Ko.displayName="SidebarMenuItem";const jb=so("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),Go=h.forwardRef((e,t)=>{const n=te.c(29);let r,o,s,i,a,c,u;n[0]!==e?({asChild:s,isActive:i,variant:a,size:c,tooltip:u,className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a,n[6]=c,n[7]=u):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5],c=n[6],u=n[7]);const d=s===void 0?!1:s,l=i===void 0?!1:i,f=a===void 0?"default":a,p=c===void 0?"default":c,v=d?xr:"button",{isMobile:g,state:_}=ds();let b;n[8]!==r||n[9]!==p||n[10]!==f?(b=ie(jb({variant:f,size:p}),r),n[8]=r,n[9]=p,n[10]=f,n[11]=b):b=n[11];let x;n[12]!==v||n[13]!==l||n[14]!==o||n[15]!==t||n[16]!==p||n[17]!==b?(x=m.jsx(v,{ref:t,"data-sidebar":"menu-button","data-size":p,"data-active":l,className:b,...o}),n[12]=v,n[13]=l,n[14]=o,n[15]=t,n[16]=p,n[17]=b,n[18]=x):x=n[18];const w=x;if(!u)return w;if(typeof u=="string"){let T;n[19]!==u?(T={children:u},n[19]=u,n[20]=T):T=n[20],u=T}let C;n[21]!==w?(C=m.jsx(Cb,{asChild:!0,children:w}),n[21]=w,n[22]=C):C=n[22];const E=_!=="collapsed"||g;let P;n[23]!==E||n[24]!==u?(P=m.jsx(ff,{side:"right",align:"center",hidden:E,...u}),n[23]=E,n[24]=u,n[25]=P):P=n[25];let R;return n[26]!==C||n[27]!==P?(R=m.jsxs(Eb,{children:[C,P]}),n[26]=C,n[27]=P,n[28]=R):R=n[28],R});Go.displayName="SidebarMenuButton";const $b=h.forwardRef((e,t)=>{const n=te.c(13);let r,o,s,i;n[0]!==e?({className:r,asChild:s,showOnHover:i,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);const a=s===void 0?!1:s,c=i===void 0?!1:i,u=a?xr:"button",d=c&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0";let l;n[5]!==r||n[6]!==d?(l=ie("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",d,r),n[5]=r,n[6]=d,n[7]=l):l=n[7];let f;return n[8]!==u||n[9]!==o||n[10]!==t||n[11]!==l?(f=m.jsx(u,{ref:t,"data-sidebar":"menu-action",className:l,...o}),n[8]=u,n[9]=o,n[10]=t,n[11]=l,n[12]=f):f=n[12],f});$b.displayName="SidebarMenuAction";const zb=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"menu-badge",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});zb.displayName="SidebarMenuBadge";const Fb=h.forwardRef((e,t)=>{const n=te.c(15);let r,o,s;n[0]!==e?({className:r,showIcon:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=s===void 0?!1:s,a=`${Math.floor(Math.random()*40)+50}%`;let c;n[4]!==r?(c=ie("flex h-8 items-center gap-2 rounded-md px-2",r),n[4]=r,n[5]=c):c=n[5];let u;n[6]!==i?(u=i&&m.jsx(Dc,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),n[6]=i,n[7]=u):u=n[7];let d;n[8]===Symbol.for("react.memo_cache_sentinel")?(d={"--skeleton-width":a},n[8]=d):d=n[8];let l;n[9]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(Dc,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:d}),n[9]=l):l=n[9];let f;return n[10]!==o||n[11]!==t||n[12]!==c||n[13]!==u?(f=m.jsxs("div",{ref:t,"data-sidebar":"menu-skeleton",className:c,...o,children:[u,l]}),n[10]=o,n[11]=t,n[12]=c,n[13]=u,n[14]=f):f=n[14],f});Fb.displayName="SidebarMenuSkeleton";const Lb=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("ul",{ref:t,"data-sidebar":"menu-sub",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Lb.displayName="SidebarMenuSub";const Vb=h.forwardRef((e,t)=>{const n=te.c(5);let r;n[0]!==e?({...r}=e,n[0]=e,n[1]=r):r=n[1];let o;return n[2]!==r||n[3]!==t?(o=m.jsx("li",{ref:t,...r}),n[2]=r,n[3]=t,n[4]=o):o=n[4],o});Vb.displayName="SidebarMenuSubItem";const Ub=h.forwardRef((e,t)=>{const n=te.c(17);let r,o,s,i,a;n[0]!==e?({asChild:i,size:a,isActive:o,className:r,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5]);const c=i===void 0?!1:i,u=a===void 0?"md":a,d=c?xr:"a",l=u==="sm"&&"text-xs",f=u==="md"&&"text-sm";let p;n[6]!==r||n[7]!==l||n[8]!==f?(p=ie("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",l,f,"group-data-[collapsible=icon]:hidden",r),n[6]=r,n[7]=l,n[8]=f,n[9]=p):p=n[9];let v;return n[10]!==d||n[11]!==o||n[12]!==s||n[13]!==t||n[14]!==u||n[15]!==p?(v=m.jsx(d,{ref:t,"data-sidebar":"menu-sub-button","data-size":u,"data-active":o,className:p,...s}),n[10]=d,n[11]=o,n[12]=s,n[13]=t,n[14]=u,n[15]=p,n[16]=v):v=n[16],v});Ub.displayName="SidebarMenuSubButton";function Zb(e){return!e}function Bb(e){return!e}var Wb=Object.defineProperty,Ke=(e,t)=>Wb(e,"name",{value:t,configurable:!0});function wa(e){const t=e+"CollectionProvider",[n,r]=rn(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=Ke(g=>{const{scope:_,children:b}=g,x=h.useRef(null),w=h.useRef(new Map).current;return m.jsx(o,{scope:_,itemMap:w,collectionRef:x,children:b})},"CollectionProvider");i.displayName=t;const a=e+"CollectionSlot",c=Xt(a),u=h.forwardRef((g,_)=>{const{scope:b,children:x}=g,w=s(a,b),C=Pe(_,w.collectionRef);return m.jsx(c,{ref:C,children:x})});u.displayName=a;const d=e+"CollectionItemSlot",l="data-radix-collection-item",f=Xt(d),p=h.forwardRef((g,_)=>{const{scope:b,children:x,...w}=g,C=h.useRef(null),E=Pe(_,C),P=s(d,b);return h.useEffect(()=>(P.itemMap.set(C,{ref:C,...w}),()=>void P.itemMap.delete(C))),m.jsx(f,{[l]:"",ref:E,children:x})});p.displayName=d;function v(g){const _=s(e+"CollectionConsumer",g);return h.useCallback(()=>{const x=_.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${l}]`));return Array.from(_.itemMap.values()).sort((P,R)=>w.indexOf(P.ref.current)-w.indexOf(R.ref.current))},[_.collectionRef,_.itemMap])}return Ke(v,"useCollection"),[{Provider:i,Slot:u,ItemSlot:p},v,r]}Ke(wa,"createCollection");var zc=new WeakMap,Fe,xt,xo=(xt=class extends Map{constructor(n){super(n);se(this,Fe);q(this,Fe,[...super.keys()]),zc.set(this,!0)}set(n,r){return zc.get(this)&&!this.has(n)&&S(this,Fe).push(n),super.set(n,r),this}insert(n,r,o){const s=this.has(r),i=s?this.size:this.size+1,a=_a(n),c=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(s?S(this,Fe).indexOf(r)===c:c===this.size)return this.set(r,o),this;const u=S(this,Fe).filter(l=>l!==r);u.splice(c,0,r);const d=u.map(l=>[l,l===r?o:this.get(l)]);this.clear();for(const[l,f]of d)this.set(l,f);return this}with(n,r,o){const s=new xt(this);return s.insert(n,r,o),s}before(n){const r=S(this,Fe).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,o){const s=S(this,Fe).indexOf(n);if(s===-1)return this;const i=S(this,Fe).indexOf(r),a=i!==-1&&i<s?s-1:s;return this.insert(a,r,o)}after(n){let r=S(this,Fe).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,o){const s=S(this,Fe).indexOf(n);if(s===-1)return this;const i=S(this,Fe).indexOf(r),a=i!==-1&&i<=s?s:s+1;return this.insert(a,r,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return q(this,Fe,[]),super.clear()}delete(n){const r=super.delete(n);return r&&S(this,Fe).splice(S(this,Fe).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=$o(S(this,Fe),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=$o(S(this,Fe),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return S(this,Fe).indexOf(n)}keyAt(n){return $o(S(this,Fe),n)}from(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return s;o++}}findIndex(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return o;o++}return-1}filter(n,r){const o=[];let s=0;for(const i of this)Reflect.apply(n,r,[i,s,this])&&o.push(i),s++;return new xt(o)}map(n,r){const o=[];let s=0;for(const i of this)o.push([i[0],Reflect.apply(n,r,[i,s,this])]),s++;return new xt(o)}reduce(...n){const[r,o]=n,s=n.length>1;if(!s&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let i=0,a=o;for(const c of this)i===0&&!s?a=c:a=Reflect.apply(r,this,[a,c,i,this]),i++;return a}reduceRight(...n){const[r,o]=n,s=n.length>1;if(!s&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let i=o;for(let a=this.size-1;a>=0;a--){const c=this.entryAt(a);a===this.size-1&&!s?i=c:i=Reflect.apply(r,this,[i,c,a,this])}return i}sort(n){if(typeof n!="function")throw new TypeError("OrderedDict.sort requires a compare function");const r=[...this.entries()].sort(n);this.clear();for(const[o,s]of r)this.set(o,s);return this}toSorted(n){if(typeof n!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const r=[...this.entries()].sort(n);return new xt(r)}toReversed(){const n=new xt;for(let r=this.size-1;r>=0;r--){const o=this.keyAt(r),s=this.get(o);n.set(o,s)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new xt(r)}slice(n,r){const o=new xt;for(const s of S(this,Fe).slice(n,r))o.set(s,this.get(s));return o}every(n,r){let o=0;for(const s of this){if(!Reflect.apply(n,r,[s,o,this]))return!1;o++}return!0}some(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return!0;o++}return!1}},Fe=new WeakMap,Ke(xt,"OrderedDict"),xt);function $o(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=_f(e,t);return n===-1?void 0:e[n]}Ke($o,"at");function _f(e,t){const n=e.length,r=_a(t),o=r>=0?r:n+r;return o<0||o>=n?-1:o}Ke(_f,"toSafeIndex");function _a(e){return e!==e||e===0?0:Math.trunc(e)}Ke(_a,"toSafeInteger");function Hb(e){const t=e+"CollectionProvider",[n,r]=rn(t),[o,s]=n(t);o.displayName=e+"CollectionStableContextProvider";const[i,a]=n(t);i.displayName=e+"CollectionStatefulContextProvider";const c=Ke(({state:P,...R})=>P?m.jsx(d,{...R,state:P}):m.jsx(u,{...R}),"CollectionProvider");c.displayName=t;const u=Ke(P=>{const R=x();return m.jsx(d,{...P,state:R})},"CollectionInit");u.displayName=e+"CollectionInit";const d=Ke(P=>{const{scope:R,children:T,state:A}=P,j=h.useRef(null),[L,z]=h.useState(null),J=Pe(j,z),[W,K]=A,Z=h.useRef(new xo),X=h.useCallback(()=>{const re=Z.current;return Ef(re)||re.sort(zo),re},[]);return h.useEffect(()=>{if(!L)return;const re=Cf(()=>{K(Y=>{const ee=Y.toSorted(zo);return ee.some(([ve],he)=>Y.keyAt(he)!==ve)?ee:Y})});return re.observe(L,{childList:!0,subtree:!0}),()=>{re.disconnect()}},[L,K]),m.jsx(o,{scope:R,collectionElementRef:J,collectionElementRefObject:j,getCollection:X,setCollection:K,registryRef:Z,children:m.jsx(i,{scope:R,collectionElement:L,collection:W,children:T})})},"CollectionProviderImpl");d.displayName=e+"CollectionProviderImpl";const l=e+"CollectionSlot",f=Xt(l),p=h.forwardRef((P,R)=>{const{scope:T,children:A}=P,j=s(l,T),L=Pe(R,j.collectionElementRef);return m.jsx(f,{ref:L,children:A})});p.displayName=l;const v=e+"CollectionItemSlot",g="data-radix-collection-item",_=Xt(v),b=h.forwardRef((P,R)=>{const{scope:T,children:A,...j}=P,L=h.useRef(null),z=s(v,T),{setCollection:J,registryRef:W}=z,K=h.useRef(j);xf(K.current,j)||(K.current=j);const Z=K.current,X=h.useCallback(ee=>{const G=W.current;ee?G.set(ee,{...K.current,element:ee}):L.current&&G.delete(L.current)},[W]),re=Pe(R,X,L);at(()=>{const ee=L.current,G=W.current;ee&&G.has(ee)&&G.set(ee,{...Z,element:ee})},[Z,W]);const Y=h.useRef(null);return h.useEffect(()=>{const ee=L.current,G=Y.current;((G==null?void 0:G.element)??null)===ee&&(!ee||(G==null?void 0:G.itemData)===Z)||(Y.current=ee?{element:ee,itemData:Z}:null,J(ve=>{const he=new xo(ve);return G&&G.element!==ee&&he.delete(G.element),ee&&he.set(ee,{...Z,element:ee}),he.sort(zo)}))}),h.useEffect(()=>()=>{const ee=Y.current;Y.current=null,ee&&J(G=>{if(!G.has(ee.element))return G;const ve=new xo(G);return ve.delete(ee.element),ve})},[J]),m.jsx(_,{[g]:"",ref:re,children:A})});b.displayName=v;function x(){return h.useState(new xo)}Ke(x,"useInitCollection");function w(P){const{collection:R}=a(e+"CollectionConsumer",P);return R}Ke(w,"useCollection");function C(P){const{getCollection:R}=s(e+"CollectionConsumer",P);return R}return Ke(C,"useGetCollection"),[{Provider:c,Slot:p,ItemSlot:b},{createCollectionScope:r,useCollection:w,useGetCollection:C,useInitCollection:x}]}Ke(Hb,"createCollection");function xf(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||e[o]!==t[o])return!1;return!0}Ke(xf,"shallowEqual");function Sf(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Ke(Sf,"isElementPreceding");function Ef(e){let t;for(const n of e.keys()){if(t){const r=t.compareDocumentPosition(n);if(!(r&Node.DOCUMENT_POSITION_DISCONNECTED)&&r&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}Ke(Ef,"isInDocumentOrder");function zo(e,t){return!e[1].element||!t[1].element?0:Sf(e[1].element,t[1].element)?-1:1}Ke(zo,"sortByDocumentPosition");function Cf(e){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){e();return}})}Ke(Cf,"getChildListObserver");var Kb=Object.defineProperty,Gb=(e,t)=>Kb(e,"name",{value:t,configurable:!0}),qb={LTR:"ltr"},Qb=h.createContext(void 0);function xa(e){const t=h.useContext(Qb);return e||t||qb.LTR}Gb(xa,"useDirection");var Yb=Object.defineProperty,Sa=(e,t)=>Yb(e,"name",{value:t,configurable:!0}),$s=!1;function kf(){const[e,t]=h.useState($s);return h.useEffect(()=>{$s||($s=!0,t(!0))},[]),e}Sa(kf,"useIsHydrated");var Of=Bn[" useSyncExternalStore ".trim().toString()];function Pf(){return()=>{}}Sa(Pf,"subscribe");function Rf(){return Of(Pf,()=>!0,()=>!1)}Sa(Rf,"useIsHydratedModern");var Jb=typeof Of=="function"?Rf:kf,Xb=Object.defineProperty,Wn=(e,t)=>Xb(e,"name",{value:t,configurable:!0}),zs="rovingFocusGroup.onEntryFocus",ew={bubbles:!1,cancelable:!0},fs="RovingFocusGroup",[Si,Tf,tw]=wa(fs),[nw,If]=rn(fs,[tw]),Fc={Vertical:"vertical",Horizontal:"horizontal"},rw={RTL:"rtl"},[ow,sw]=nw(fs),iw=h.forwardRef(Wn(function(t,n){return m.jsx(Si.Provider,{scope:t.__scopeRovingFocusGroup,children:m.jsx(Si.Slot,{scope:t.__scopeRovingFocusGroup,children:m.jsx(aw,{...t,ref:n})})})},"RovingFocusGroup")),aw=h.forwardRef(Wn(function(t,n){const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:l=!1,...f}=t,p=h.useRef(null),v=Pe(n,p),g=xa(i),[_,b]=ao({prop:a,defaultProp:c??null,onChange:u,caller:fs}),[x,w]=h.useState(!1),C=en(d),E=Tf(r),P=h.useRef(!1),[R,T]=h.useState(0);return h.useEffect(()=>{const A=p.current;if(A)return A.addEventListener(zs,C),()=>A.removeEventListener(zs,C)},[C]),m.jsx(ow,{scope:r,orientation:o,dir:g,loop:s,currentTabStopId:_,onItemFocus:h.useCallback(A=>b(A),[b]),onItemShiftTab:h.useCallback(()=>w(!0),[]),onFocusableItemAdd:h.useCallback(()=>T(A=>A+1),[]),onFocusableItemRemove:h.useCallback(()=>T(A=>A-1),[]),children:m.jsx(Le.div,{tabIndex:x||R===0?-1:0,"data-orientation":o,...f,ref:v,style:{outline:"none",...t.style},onMouseDown:ce(t.onMouseDown,()=>{P.current=!0}),onFocus:ce(t.onFocus,A=>{const j=!P.current;if(A.target===A.currentTarget&&j&&!x){const L=new CustomEvent(zs,ew);if(A.currentTarget.dispatchEvent(L),!L.defaultPrevented){const z=E().filter(X=>X.focusable),J=z.find(X=>X.active),W=z.find(X=>X.id===_),Z=[J,W,...z].filter(Boolean).map(X=>X.ref.current);Ea(Z,l)}}P.current=!1}),onBlur:ce(t.onBlur,()=>w(!1))})})},"RovingFocusGroupImpl")),cw="RovingFocusGroupItem",lw=h.forwardRef(Wn(function(t,n){const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:i,children:a,...c}=t,u=En(),d=i||u,l=sw(cw,r),f=l.currentTabStopId===d,p=Tf(r),{onFocusableItemAdd:v,onFocusableItemRemove:g,currentTabStopId:_}=l,b=Jb();return at(()=>{if(!(!b||!o))return v(),()=>g()},[b,o,v,g]),h.useEffect(()=>{if(!(b||!o))return v(),()=>g()},[b,o,v,g]),m.jsx(Si.ItemSlot,{scope:r,id:d,focusable:o,active:s,children:m.jsx(Le.span,{tabIndex:f?0:-1,"data-orientation":l.orientation,...c,ref:n,onMouseDown:ce(t.onMouseDown,x=>{o?l.onItemFocus(d):x.preventDefault()}),onFocus:ce(t.onFocus,()=>l.onItemFocus(d)),onKeyDown:ce(t.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){l.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const w=Nf(x,l.orientation,l.dir);if(w!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let E=p().filter(P=>P.focusable).map(P=>P.ref.current);if(w==="last")E.reverse();else if(w==="prev"||w==="next"){w==="prev"&&E.reverse();const P=E.indexOf(x.currentTarget);E=l.loop?Df(E,P+1):E.slice(P+1)}setTimeout(()=>Ea(E))}}),children:typeof a=="function"?a({isCurrentTabStop:f,hasTabStop:_!=null}):a})})},"RovingFocusGroupItem")),uw={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Af(e,t){return t!==rw.RTL?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Wn(Af,"getDirectionAwareKey");function Nf(e,t,n){const r=Af(e.key,n);if(!(t===Fc.Vertical&&["ArrowLeft","ArrowRight"].includes(r))&&!(t===Fc.Horizontal&&["ArrowUp","ArrowDown"].includes(r)))return uw[r]}Wn(Nf,"getFocusIntent");function Ea(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Wn(Ea,"focusFirst");function Df(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Wn(Df,"wrapArray");var dw=Object.defineProperty,_e=(e,t)=>dw(e,"name",{value:t,configurable:!0}),fw={RTL:"rtl"},Ei=["Enter"," "],hw=["ArrowDown","PageUp","Home"],Mf=["ArrowUp","PageDown","End"],pw=[...hw,...Mf],mw={ltr:[...Ei,"ArrowRight"],rtl:[...Ei,"ArrowLeft"]},gw={ltr:["ArrowLeft"],rtl:["ArrowRight"]},hs="Menu",[qr,vw,yw]=wa(hs),[Hn,jf]=rn(hs,[yw,ls,If]),Ca=ls(),$f=If(),[bw,Kn]=Hn(hs),[ww,lo]=Hn(hs),_w=_e(e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=Ca(t),[c,u]=h.useState(null),d=h.useRef(!1),l=en(s),f=xa(o);return h.useEffect(()=>{const p=_e(()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},"handleKeyDown"),v=_e(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),h.useEffect(()=>{if(!n)return;const p=_e(()=>l(!1),"handleBlur");return window.addEventListener("blur",p),()=>window.removeEventListener("blur",p)},[n,l]),m.jsx(Qd,{...a,children:m.jsx(bw,{scope:t,open:n,onOpenChange:l,content:c,onContentChange:u,children:m.jsx(ww,{scope:t,onClose:h.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:d,dir:f,modal:i,children:r})})})},"Menu"),zf=h.forwardRef(_e(function(t,n){const{__scopeMenu:r,...o}=t,s=Ca(r);return m.jsx(Yd,{...s,...o,ref:n})},"MenuAnchor")),Ff="MenuPortal",[xw,Lf]=Hn(Ff,{forceMount:void 0}),Sw=_e(e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Kn(Ff,t);return m.jsx(xw,{scope:t,forceMount:n,children:m.jsx(on,{present:n||s.open,children:m.jsx(ha,{asChild:!0,container:o,children:r})})})},"MenuPortal"),Mt="MenuContent",[Ew,ka]=Hn(Mt),Cw=h.forwardRef(_e(function(t,n){const r=Lf(Mt,t.__scopeMenu),{forceMount:o=r.forceMount,...s}=t,i=Kn(Mt,t.__scopeMenu),a=lo(Mt,t.__scopeMenu);return m.jsx(qr.Provider,{scope:t.__scopeMenu,children:m.jsx(on,{present:o||i.open,children:m.jsx(qr.Slot,{scope:t.__scopeMenu,children:a.modal?m.jsx(kw,{...s,ref:n}):m.jsx(Ow,{...s,ref:n})})})})},"MenuContent")),kw=h.forwardRef(_e(function(t,n){const r=Kn(Mt,t.__scopeMenu),o=h.useRef(null),s=Pe(n,o);return h.useEffect(()=>{const i=o.current;if(i)return Id(i)},[]),m.jsx(Oa,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ce(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),Ow=h.forwardRef(_e(function(t,n){const r=Kn(Mt,t.__scopeMenu);return m.jsx(Oa,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),Pw=Xt("MenuContent.ScrollLock"),Oa=h.forwardRef(_e(function(t,n){const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:l,onFocusOutside:f,onInteractOutside:p,onDismiss:v,disableOutsideScroll:g,..._}=t,b=Kn(Mt,r),x=lo(Mt,r),w=Ca(r),C=$f(r),E=vw(r),[P,R]=h.useState(null),T=h.useRef(null),[A,j]=h.useState(null);da(A);const{nodes:L,registry:z}=ua(),J=!!(s||g),W=Pe(n,T,b.onContentChange,j),K=h.useRef(0),Z=h.useRef(""),X=h.useRef(0),re=h.useRef(null),Y=h.useRef("right"),ee=h.useRef(0),G=h.useMemo(()=>g?[T,...L.map(U=>({current:U}))]:[],[T,L,g]),ve=g?ma:h.Fragment,he=g?{as:Pw,allowPinchZoom:!0,shards:G}:void 0,oe=_e(U=>{var kt,ct;const fe=Z.current+U,Ee=E().filter($e=>!$e.disabled),ue=document.activeElement,qe=(kt=Ee.find($e=>$e.ref.current===ue))==null?void 0:kt.textValue,Xe=Ee.map($e=>$e.textValue),Ze=Kf(Xe,fe,qe),De=(ct=Ee.find($e=>$e.textValue===Ze))==null?void 0:ct.ref.current;function Be($e){Z.current=$e,window.clearTimeout(K.current),$e!==""&&(K.current=window.setTimeout(()=>Be(""),1e3))}_e(Be,"updateSearch"),Be(fe),De&&setTimeout(()=>De.focus())},"handleTypeaheadSearch");h.useEffect(()=>()=>window.clearTimeout(K.current),[]),is();const le=h.useCallback(U=>{var Ee,ue;return Y.current===((Ee=re.current)==null?void 0:Ee.side)&&qf(U,(ue=re.current)==null?void 0:ue.area)},[]);return m.jsx(Ew,{scope:r,searchRef:Z,onItemEnter:h.useCallback(U=>{le(U)&&U.preventDefault()},[le]),onItemLeave:h.useCallback(U=>{var fe;le(U)||((fe=T.current)==null||fe.focus(),R(null))},[le]),onTriggerLeave:h.useCallback(U=>{le(U)&&U.preventDefault()},[le]),pointerGraceTimerRef:X,onPointerGraceIntentChange:h.useCallback(U=>{re.current=U},[]),children:m.jsx(la,{registry:J?z:null,children:m.jsx(ve,{...he,children:m.jsx(dd,{asChild:!0,trapped:s,branches:L,onMountAutoFocus:ce(i,U=>{var fe;U.preventDefault(),(fe=T.current)==null||fe.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:m.jsx(aa,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:l,onFocusOutside:f,onInteractOutside:p,onDismiss:v,children:m.jsx(iw,{asChild:!0,...C,dir:x.dir,orientation:"vertical",loop:o,currentTabStopId:P,onCurrentTabStopIdChange:R,onEntryFocus:ce(u,U=>{x.isUsingKeyboardRef.current||U.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(Xd,{role:"menu","aria-orientation":"vertical","data-state":Ra(b.open),"data-radix-menu-content":"",dir:x.dir,...w,..._,ref:W,style:{outline:"none",..._.style},onKeyDown:ce(_.onKeyDown,U=>{const Ee=U.target.closest("[data-radix-menu-content]")===U.currentTarget,ue=U.ctrlKey||U.altKey||U.metaKey,qe=U.key.length===1;Ee&&(U.key==="Tab"&&U.preventDefault(),!ue&&qe&&oe(U.key));const Xe=T.current;if(U.target!==Xe||!pw.includes(U.key))return;U.preventDefault();const De=E().filter(Be=>!Be.disabled).map(Be=>Be.ref.current);Mf.includes(U.key)&&De.reverse(),Wf(De)}),onBlur:ce(t.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(K.current),Z.current="")}),onPointerMove:ce(t.onPointerMove,yr(U=>{const fe=U.target,Ee=ee.current!==U.clientX;if(U.currentTarget.contains(fe)&&Ee){const ue=U.clientX>ee.current?"right":"left";Y.current=ue,ee.current=U.clientX}}))})})})})})})})},"MenuContentImpl")),Rw=h.forwardRef(_e(function(t,n){const{__scopeMenu:r,...o}=t;return m.jsx(Le.div,{...o,ref:n})},"MenuLabel")),Ci="MenuItem",Lc="menu.itemSelect",Pa=h.forwardRef(_e(function(t,n){const{disabled:r=!1,onSelect:o,...s}=t,i=h.useRef(null),a=lo(Ci,t.__scopeMenu),c=ka(Ci,t.__scopeMenu),u=Pe(n,i),d=h.useRef(!1),l=_e(()=>{const f=i.current;if(!r&&f){const p=new CustomEvent(Lc,{bubbles:!0,cancelable:!0});f.addEventListener(Lc,v=>o==null?void 0:o(v),{once:!0}),sa(f,p),p.defaultPrevented?d.current=!1:a.onClose()}},"handleSelect");return m.jsx(Vf,{...s,ref:u,disabled:r,onClick:ce(t.onClick,l),onPointerDown:f=>{var p;(p=t.onPointerDown)==null||p.call(t,f),d.current=!0},onPointerUp:ce(t.onPointerUp,f=>{var p;d.current||(p=f.currentTarget)==null||p.click()}),onKeyDown:ce(t.onKeyDown,f=>{r||f.target!==f.currentTarget||c.searchRef.current!==""&&f.key===" "||Ei.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})},"MenuItem")),Vf=h.forwardRef(_e(function(t,n){const{__scopeMenu:r,disabled:o=!1,textValue:s,...i}=t,a=ka(Ci,r),c=$f(r),u=h.useRef(null),d=Pe(n,u),[l,f]=h.useState(!1),[p,v]=h.useState("");return h.useEffect(()=>{const g=u.current;g&&v((g.textContent??"").trim())},[i.children]),m.jsx(qr.ItemSlot,{scope:r,disabled:o,textValue:s??p,children:m.jsx(lw,{asChild:!0,...c,focusable:!o,children:m.jsx(Le.div,{role:"menuitem","data-highlighted":l?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:d,onPointerMove:ce(t.onPointerMove,yr(g=>{o?a.onItemLeave(g):(a.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ce(t.onPointerLeave,yr(g=>a.onItemLeave(g))),onFocus:ce(t.onFocus,()=>f(!0)),onBlur:ce(t.onBlur,()=>f(!1))})})})},"MenuItemImpl")),Tw=h.forwardRef(_e(function(t,n){const{checked:r=!1,onCheckedChange:o,...s}=t;return m.jsx(Zf,{scope:t.__scopeMenu,checked:r,children:m.jsx(Pa,{role:"menuitemcheckbox","aria-checked":Qr(r)?"mixed":r,...s,ref:n,"data-state":ps(r),onSelect:ce(s.onSelect,()=>o==null?void 0:o(Qr(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),Iw="MenuRadioGroup",[bk,Aw]=Hn(Iw,{value:void 0,onValueChange:_e(()=>{},"onValueChange")}),Nw="MenuRadioItem",Dw=h.forwardRef(_e(function(t,n){const{value:r,...o}=t,s=Aw(Nw,t.__scopeMenu),i=r===s.value;return m.jsx(Zf,{scope:t.__scopeMenu,checked:i,children:m.jsx(Pa,{role:"menuitemradio","aria-checked":i,...o,ref:n,"data-state":ps(i),onSelect:ce(o.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,r)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),Uf="MenuItemIndicator",[Zf,Mw]=Hn(Uf,{checked:!1}),jw=h.forwardRef(_e(function(t,n){const{__scopeMenu:r,forceMount:o,...s}=t,i=Mw(Uf,r);return m.jsx(on,{present:o||Qr(i.checked)||i.checked===!0,children:m.jsx(Le.span,{...s,ref:n,"data-state":ps(i.checked)})})},"MenuItemIndicator")),$w=h.forwardRef(_e(function(t,n){const{__scopeMenu:r,...o}=t;return m.jsx(Le.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})},"MenuSeparator")),zw="MenuSub",[wk,Bf]=Hn(zw),So="MenuSubTrigger",Fw=h.forwardRef(_e(function(t,n){const r=Kn(So,t.__scopeMenu),o=lo(So,t.__scopeMenu),s=Bf(So,t.__scopeMenu),i=ka(So,t.__scopeMenu),a=h.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,d={__scopeMenu:t.__scopeMenu},l=h.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);h.useEffect(()=>l,[l]),h.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),u(null)}},[c,u]);const f=Pe(n,s.onTriggerChange);return m.jsx(zf,{asChild:!0,...d,children:m.jsx(Vf,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?s.contentId:void 0,"data-state":Ra(r.open),...t,ref:f,onClick:p=>{var v;(v=t.onClick)==null||v.call(t,p),!(t.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ce(t.onPointerMove,yr(p=>{i.onItemEnter(p),!p.defaultPrevented&&!t.disabled&&!r.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),l()},100))})),onPointerLeave:ce(t.onPointerLeave,yr(p=>{var g,_;l();const v=(g=r.content)==null?void 0:g.getBoundingClientRect();if(v){const b=(_=r.content)==null?void 0:_.dataset.side,x=b==="right",w=x?-5:5,C=v[x?"left":"right"],E=v[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+w,y:p.clientY},{x:C,y:v.top},{x:E,y:v.top},{x:E,y:v.bottom},{x:C,y:v.bottom}],side:b}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ce(t.onKeyDown,p=>{var g;t.disabled||p.target!==p.currentTarget||i.searchRef.current!==""&&p.key===" "||mw[o.dir].includes(p.key)&&(r.onOpenChange(!0),(g=r.content)==null||g.focus(),p.preventDefault())})})})},"MenuSubTrigger")),Lw="MenuSubContent",Vw=h.forwardRef(_e(function(t,n){const r=Lf(Mt,t.__scopeMenu),{forceMount:o=r.forceMount,align:s="start",...i}=t,a=Kn(Mt,t.__scopeMenu),c=lo(Mt,t.__scopeMenu),u=Bf(Lw,t.__scopeMenu),d=h.useRef(null),l=Pe(n,d);return m.jsx(qr.Provider,{scope:t.__scopeMenu,children:m.jsx(on,{present:o||a.open,children:m.jsx(qr.Slot,{scope:t.__scopeMenu,children:m.jsx(Oa,{id:u.contentId,"aria-labelledby":u.triggerId,...i,ref:l,align:s,side:c.dir===fw.RTL?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var p;c.isUsingKeyboardRef.current&&((p=d.current)==null||p.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:ce(t.onFocusOutside,f=>{f.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:ce(t.onEscapeKeyDown,f=>{c.onClose(),f.preventDefault()}),onKeyDown:ce(t.onKeyDown,f=>{var g;const p=f.currentTarget.contains(f.target),v=gw[c.dir].includes(f.key);p&&v&&(a.onOpenChange(!1),(g=u.trigger)==null||g.focus(),f.preventDefault())})})})})})},"MenuSubContent"));function Ra(e){return e?"open":"closed"}_e(Ra,"getOpenState");function Qr(e){return e==="indeterminate"}_e(Qr,"isIndeterminate");function ps(e){return Qr(e)?"indeterminate":e?"checked":"unchecked"}_e(ps,"getCheckedState");function Wf(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}_e(Wf,"focusFirst");function Hf(e,t){return e.map((n,r)=>e[(t+r)%e.length])}_e(Hf,"wrapArray");function Kf(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Hf(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}_e(Kf,"getNextMatch");function Gf(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],u=a.x,d=a.y,l=c.x,f=c.y;d>r!=f>r&&n<(l-u)*(r-d)/(f-d)+u&&(o=!o)}return o}_e(Gf,"isPointInPolygon");function qf(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Gf(n,t)}_e(qf,"isPointerInGraceArea");function yr(e){return t=>t.pointerType==="mouse"?e(t):void 0}_e(yr,"whenMouse");var Uw=Object.defineProperty,Tt=(e,t)=>Uw(e,"name",{value:t,configurable:!0}),Ta="DropdownMenu",[Zw,_k]=rn(Ta,[jf]),It=jf(),[Bw,Qf]=Zw(Ta),Ww=Tt(e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=It(t),u=h.useRef(null),[d,l]=ao({prop:o,defaultProp:s??!1,onChange:i,caller:Ta});return m.jsx(Bw,{scope:t,triggerId:En(),triggerRef:u,contentId:En(),open:d,onOpenChange:l,onOpenToggle:h.useCallback(()=>l(f=>!f),[l]),modal:a,children:m.jsx(_w,{...c,open:d,onOpenChange:l,dir:r,modal:a,children:n})})},"DropdownMenu"),Hw="DropdownMenuTrigger",Kw=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,disabled:o=!1,...s}=t,i=Qf(Hw,r),a=It(r),c=Pe(n,i.triggerRef);return m.jsx(zf,{asChild:!0,...a,children:m.jsx(Le.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...s,ref:c,onPointerDown:ce(t.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:ce(t.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),Gw=Tt(e=>{const{__scopeDropdownMenu:t,...n}=e,r=It(t);return m.jsx(Sw,{...r,...n})},"DropdownMenuPortal"),qw="DropdownMenuContent",Yf=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=Qf(qw,r),i=It(r),a=h.useRef(!1);return m.jsx(Cw,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...o,ref:n,onCloseAutoFocus:ce(t.onCloseAutoFocus,c=>{var u;a.current||(u=s.triggerRef.current)==null||u.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:ce(t.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,l=u.button===2||d;(!s.modal||l)&&(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),Jf=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Rw,{...s,...o,ref:n})},"DropdownMenuLabel")),Xf=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Pa,{...s,...o,ref:n})},"DropdownMenuItem")),eh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Tw,{...s,...o,ref:n})},"DropdownMenuCheckboxItem")),th=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Dw,{...s,...o,ref:n})},"DropdownMenuRadioItem")),nh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(jw,{...s,...o,ref:n})},"DropdownMenuItemIndicator")),rh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx($w,{...s,...o,ref:n})},"DropdownMenuSeparator")),oh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Fw,{...s,...o,ref:n})},"DropdownMenuSubTrigger")),sh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Vw,{...s,...o,ref:n,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent"));const Qw=Ww,Yw=Kw,Jw=h.forwardRef((e,t)=>{const n=te.c(14);let r,o,s,i;n[0]!==e?({className:o,inset:s,children:r,...i}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);const a=s&&"pl-8";let c;n[5]!==o||n[6]!==a?(c=ie("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a,o),n[5]=o,n[6]=a,n[7]=c):c=n[7];let u;n[8]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(Og,{className:"ml-auto"}),n[8]=u):u=n[8];let d;return n[9]!==r||n[10]!==i||n[11]!==t||n[12]!==c?(d=m.jsxs(oh,{ref:t,className:c,...i,children:[r,u]}),n[9]=r,n[10]=i,n[11]=t,n[12]=c,n[13]=d):d=n[13],d});Jw.displayName=oh.displayName;const Xw=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(sh,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Xw.displayName=sh.displayName;const ih=h.forwardRef((e,t)=>{const n=te.c(11);let r,o,s;n[0]!==e?({className:r,sideOffset:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=s===void 0?4:s;let a;n[4]!==r?(a=ie("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",r),n[4]=r,n[5]=a):a=n[5];let c;return n[6]!==o||n[7]!==t||n[8]!==i||n[9]!==a?(c=m.jsx(Gw,{children:m.jsx(Yf,{ref:t,sideOffset:i,className:a,...o})}),n[6]=o,n[7]=t,n[8]=i,n[9]=a,n[10]=c):c=n[10],c});ih.displayName=Yf.displayName;const ki=h.forwardRef((e,t)=>{const n=te.c(11);let r,o,s;n[0]!==e?({className:r,inset:o,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=o&&"pl-8";let a;n[4]!==r||n[5]!==i?(a=ie("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",i,r),n[4]=r,n[5]=i,n[6]=a):a=n[6];let c;return n[7]!==s||n[8]!==t||n[9]!==a?(c=m.jsx(Xf,{ref:t,className:a,...s}),n[7]=s,n[8]=t,n[9]=a,n[10]=c):c=n[10],c});ki.displayName=Xf.displayName;const e0=h.forwardRef((e,t)=>{const n=te.c(14);let r,o,s,i;n[0]!==e?({className:s,children:o,checked:r,...i}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);let a;n[5]!==s?(a=ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),n[5]=s,n[6]=a):a=n[6];let c;n[7]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(nh,{children:m.jsx(kg,{className:"h-4 w-4"})})}),n[7]=c):c=n[7];let u;return n[8]!==r||n[9]!==o||n[10]!==i||n[11]!==t||n[12]!==a?(u=m.jsxs(eh,{ref:t,className:a,checked:r,...i,children:[c,o]}),n[8]=r,n[9]=o,n[10]=i,n[11]=t,n[12]=a,n[13]=u):u=n[13],u});e0.displayName=eh.displayName;const t0=h.forwardRef((e,t)=>{const n=te.c(12);let r,o,s;n[0]!==e?({className:o,children:r,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);let i;n[4]!==o?(i=ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",o),n[4]=o,n[5]=i):i=n[5];let a;n[6]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(nh,{children:m.jsx(Pg,{className:"h-2 w-2 fill-current"})})}),n[6]=a):a=n[6];let c;return n[7]!==r||n[8]!==s||n[9]!==t||n[10]!==i?(c=m.jsxs(th,{ref:t,className:i,...s,children:[a,r]}),n[7]=r,n[8]=s,n[9]=t,n[10]=i,n[11]=c):c=n[11],c});t0.displayName=th.displayName;const n0=h.forwardRef((e,t)=>{const n=te.c(11);let r,o,s;n[0]!==e?({className:r,inset:o,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=o&&"pl-8";let a;n[4]!==r||n[5]!==i?(a=ie("px-2 py-1.5 text-sm font-semibold",i,r),n[4]=r,n[5]=i,n[6]=a):a=n[6];let c;return n[7]!==s||n[8]!==t||n[9]!==a?(c=m.jsx(Jf,{ref:t,className:a,...s}),n[7]=s,n[8]=t,n[9]=a,n[10]=c):c=n[10],c});n0.displayName=Jf.displayName;const ah=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("-mx-1 my-1 h-px bg-muted",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(rh,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});ah.displayName=rh.displayName;const r0=1,o0=1,s0=2,Vc=9;function i0(e,t){const n=new DataView(e),r=[];let o=0;for(;o+Vc<=e.byteLength;){const s=n.getUint8(o),i=n.getUint32(o+1),a=n.getUint32(o+5),c=o+Vc;if(c+a>e.byteLength)break;if(s===o0)r.push({kind:"frame",ms:i,chunk:t,data:e.slice(c,c+a)});else if(s===s0)try{r.push({kind:"event",ms:i,chunk:t,event:JSON.parse(new TextDecoder().decode(new Uint8Array(e,c,a)))})}catch{}o=c+a}return r}function xk(e,t){const n=[...e.chunks].sort((f,p)=>f.seq-p.seq),r=[],o=[];n.forEach((f,p)=>{o.push(r.length),f.offset+f.length<=t.byteLength&&r.push(...i0(t.slice(f.offset,f.offset+f.length),p))});const s=r.length>0?r[r.length-1].ms:0,i=[],a=new Set(e.gaps);n.forEach((f,p)=>{const v=n[p+1];if(v&&v.seq!==f.seq+1){const g=r[(o[p+1]??r.length)-1];i.push({fromMs:(g==null?void 0:g.ms)??f.startMs,toMs:v.startMs})}}),n.length>0&&[...a].some(f=>f<n[0].seq)&&i.unshift({fromMs:0,toMs:n[0].startMs});const c=n.length>0?n[n.length-1].seq:-1;[...a].some(f=>f>c)&&i.push({fromMs:s,toMs:s});const d=r.flatMap(f=>f.kind==="event"&&f.event.type==="step"&&f.event.phase==="start"?[{index:f.event.index,name:f.event.name,ms:f.ms}]:[]),l=new Map(r.flatMap(f=>f.kind==="event"&&f.event.type==="step"&&f.event.phase==="end"?[[f.event.index,f.event.status]]:[]));return{meta:e.meta,records:r,chunkStarts:o,chunks:n,durationMs:s,gaps:i,steps:d.map(f=>{const p=l.get(f.index);return p?{...f,status:p}:f})}}function Sk(e,t){const n=e.chunks;let r=-1;n.forEach((o,s)=>{o.startMs<=t&&(r=s)});for(let o=r;o>=0;o--){if(n[o].keyframe)return o;if(o>0&&n[o].seq!==n[o-1].seq+1)break}return n.findIndex((o,s)=>s>r&&o.keyframe)}function Ek(e,t){let n;for(const r of e.records)if(!(r.kind!=="event"||r.event.type!=="chrome")){if(r.ms>t&&n!==void 0)break;n=r.event.payload}return n??null}function Ck(e,t){const n=Math.max(150,e.durationMs*.02);let r=null;for(const o of e.steps){const s=Math.abs(o.ms-t);s<=n&&(!r||s<r.d)&&(r={ms:o.ms,d:s})}return r?r.ms:t}function kk(e){const t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function Ok(e){return e.notRecorded==="jpeg"?"No video: this device streamed JPEG, which is not kept. The agent sends H.264 unless TAPFLOW_IOS_CODEC=jpeg is set.":e.notRecorded==="no-keyframe"?"No video: the device's stream gave no frame a video could start from.":e.notRecorded?"No video for this flow.":e.evicted?"Video no longer kept: removed by the retention policy, or to make room when video storage was full.":null}function Pk(e){switch(e){case"size-limit":return"The video stops early: it reached the 100 MB limit for one flow.";case"storage-full":return"The video stops early: the relay's storage for videos was full.";case"cancelled":return"The run was cancelled here.";case"runner-lost":return"The video stops where the runner disconnected.";case"truncated":return"The end of this video did not reach the relay.";default:return null}}const Oi="";async function Eo(e,t,n,r){const o=await fetch(`${Oi}${t}`,{method:e,credentials:"include",headers:{"Content-Type":"application/json",...r},body:n!=null?JSON.stringify(n):void 0});if(o.status===204)return{data:null,status:204};const s=await o.json().catch(()=>null);return o.ok?{data:s,status:o.status}:{data:null,status:o.status,error:(s==null?void 0:s.error)??"Request failed"}}const ch={get:e=>Eo("GET",e),post:(e,t)=>Eo("POST",e,t),patch:(e,t)=>Eo("PATCH",e,t),delete:e=>Eo("DELETE",e),upload:async(e,t)=>{const n=await fetch(`${Oi}${e}`,{method:"POST",credentials:"include",body:t});if(n.status===204)return{data:null,status:204};const r=await n.json().catch(()=>null);return n.ok?{data:r,status:n.status}:{data:null,status:n.status,error:(r==null?void 0:r.error)??"Upload failed"}},uploadPatch:async(e,t)=>{const n=await fetch(`${Oi}${e}`,{method:"PATCH",credentials:"include",body:t});if(n.status===204)return{data:null,status:204};const r=await n.json().catch(()=>null);return n.ok?{data:r,status:n.status}:{data:null,status:n.status,error:(r==null?void 0:r.error)??"Upload failed"}}},qo={authStatus:["auth","status"],me:["auth","me"],inviteToken:e=>["invitations","verify",e],resetToken:e=>["auth","reset-password",e],apps:["apps"],settings:["settings"],tokens:["tokens"],teamMembers:["team","members"],comments:e=>["comments",e],allRecordings:["recordings"],recordings:e=>["recordings",e],agents:["agents"],resourceHistory:(e,t)=>["agents",e,"resources",t],runs:e=>["runs","list",e],run:e=>["runs","detail",e],runVideo:(e,t)=>["runs","video",e,t],anyRun:["runs","any"]};async function a0(){const e=await fetch("/api/v1/auth/status");if(!e.ok)throw new Error(`GET /api/v1/auth/status failed with ${e.status}`);return e.json()}async function c0(){const{data:e,status:t}=await ch.get("/api/v1/auth/me");if(t===401)return null;if(!e)throw new Error(`GET /api/v1/auth/me failed with ${t}`);return e}async function Rk(e){const t=await fetch(`/api/v1/invitations/verify?token=${e}`);if(!t.ok)throw new Error(`invitation refused with ${t.status}`);return t.json()}async function Cr(e){const t=await fetch(e,{credentials:"include"});if(!t.ok)throw new Error(`GET ${e} failed with ${t.status}`);return t.json()}const l0=()=>Cr("/api/v1/settings"),Tk=()=>Cr("/api/v1/tokens"),Ik=()=>Cr("/api/v1/team/members"),Ak=e=>Cr(`/api/v1/comments?build_id=${e}`),Nk=e=>Cr(`/api/v1/recordings?buildId=${e}`),Dk=()=>Cr("/api/v1/agents");async function Mk(e,t,n){const r=await fetch(`/api/v1/agents/${encodeURIComponent(e)}/resources?range=${t}`,{credentials:"include",signal:n});if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.json()}async function jk(e){const t=await fetch(`/api/v1/auth/reset-password/verify?token=${e}`);if(!t.ok)throw new Error(`reset token refused with ${t.status}`);return!0}async function $k(){const e=await fetch("/api/v1/apps",{credentials:"include"});if(!e.ok)throw new Error(`GET /api/v1/apps failed with ${e.status}`);return(await e.json()).items}async function zk({appId:e,search:t,statusFilter:n}){const r=new URLSearchParams({app_id:String(e),limit:"100",sort:"uploaded_at",dir:"desc"});t&&r.set("q",t),n&&n!=="all"&&r.set("status",n);const o=await fetch(`/api/v1/builds?${r}`,{credentials:"include"});if(!o.ok)throw new Error(`GET /api/v1/builds failed with ${o.status}`);return(await o.json()).items}async function Fk(e){const t=await fetch("/api/v1/apps",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return t.status===409?{error:"App with this bundle ID already exists"}:t.ok?t.json():null}class u0 extends Error{}async function Ia(e){if(e.status!==403)return;const t=await e.json().catch(()=>null);throw new u0((t==null?void 0:t.error)??"You do not have permission to do this")}async function Lk(e,t){const n=await fetch(`/api/v1/builds/${e}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({status_label:t})});if(await Ia(n),!n.ok)throw new Error(`PATCH /api/v1/builds/${e} failed with ${n.status}`)}async function Vk(e){const t=await fetch(`/api/v1/builds/${e}/schedule-deletion`,{method:"POST",credentials:"include"});if(await Ia(t),!t.ok)throw new Error(`Failed to schedule deletion (${t.status})`);return(await t.json()).delete_after}async function Uk(e){const t=await fetch(`/api/v1/builds/${e}/schedule-deletion`,{method:"DELETE",credentials:"include"});if(await Ia(t),!t.ok)throw new Error(`Failed to cancel scheduled deletion (${t.status})`)}async function Zk(e){const t=await fetch(`/api/v1/builds/${e}`,{credentials:"include"});return t.ok?t.json():null}function Bk(e){const t=new Map;for(const n of e){const r=n.version_name??"Unversioned";t.has(r)||t.set(r,[]),t.get(r).push(n)}return Array.from(t.entries()).map(([n,r])=>({versionName:n,builds:r}))}const d0=1e4;function Aa(e){const t=new AbortController,n=setTimeout(()=>t.abort(new DOMException("timed out","TimeoutError")),d0);return t.signal.addEventListener("abort",()=>clearTimeout(n),{once:!0}),e&&(e.aborted?t.abort(e.reason):e.addEventListener("abort",()=>t.abort(e.reason),{once:!0})),t.signal}const f0=25;async function h0(e){const t=await fetch("/api/v1/runs?limit=1",{credentials:"include",signal:Aa(e)});if(!t.ok)throw new Error(`GET /api/v1/runs failed with ${t.status}`);return(await t.json()).items.length>0}async function Wk(e,t,n){const r=new URLSearchParams;e.ci!==void 0&&r.set("ci",e.ci?"1":"0"),e.status&&r.set("status",e.status),e.flow&&r.set("flow",e.flow),e.build!==void 0&&r.set("build",String(e.build)),t.before&&r.set("before",t.before),t.after&&r.set("after",t.after),r.set("limit",String(f0));const o=`/api/v1/runs${r.size?`?${r}`:""}`,s=await fetch(o,{credentials:"include",signal:Aa(n)});if(!s.ok)throw new Error(`GET /api/v1/runs failed with ${s.status}`);return s.json()}async function Hk(e,t){const n=await fetch(`/api/v1/runs/${encodeURIComponent(e)}`,{credentials:"include",signal:Aa(t)});if(n.status===404)return null;if(!n.ok)throw new Error(`GET /api/v1/runs/${e} failed with ${n.status}`);return n.json()}async function Kk(e,t,n){const r=await fetch(p0(e,t),{credentials:"include",signal:n});if(r.status===404||r.status===410)return{kind:"gone"};if(!r.ok)throw new Error(`video index ${r.status}`);const o=await r.json();if(o.evicted)return{kind:"gone"};if(o.meta.formatVersion!==r0)return{kind:"unsupported"};const s=await fetch(m0(e,t),{credentials:"include",signal:n});if(s.status===404||s.status===410)return{kind:"gone"};if(!s.ok)throw new Error(`video ${s.status}`);return{kind:"ready",index:o,file:await s.arrayBuffer()}}function p0(e,t){return`/api/v1/runs/${encodeURIComponent(e)}/flows/${t}/video/index`}function m0(e,t){return`/api/v1/runs/${encodeURIComponent(e)}/flows/${t}/video`}function Gk(e,t){return`/api/v1/runs/${encodeURIComponent(e)}/flows/${t}/screenshot`}function lh(){const e=te.c(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:qo.me,queryFn:c0},e[0]=t):t=e[0];const n=Zo(t),r=n.data??null,o=n.data===void 0;let s;return e[1]!==r||e[2]!==o?(s={user:r,loading:o},e[1]=r,e[2]=o,e[3]=s):s=e[3],s}const g0={"/settings/team":["Admin"],"/settings/tokens":["Admin","Developer","QA"]};function uh(e,t){const n=Object.entries(g0).find(([r])=>e.startsWith(r));return!n||t!==void 0&&n[1].includes(t)}const v0=6;function y0(e){let t=0;for(const n of e)t=t*31+n.charCodeAt(0)&4294967295;return Math.abs(t)}function b0(e){const t=y0(e)%v0+1;return{bg:`hsl(var(--avatar-${t}-bg))`,fg:`hsl(var(--avatar-${t}-fg))`}}function w0(e){const t=te.c(20),{name:n,avatarUrl:r,size:o}=e,s=o===void 0?28:o,i=(n==null?void 0:n[0])??"?";let a;t[0]!==i?(a=i.toUpperCase(),t[0]=i,t[1]=a):a=t[1];const c=a;let u;t[2]!==s?(u={width:s,height:s,borderRadius:"50%",flexShrink:0},t[2]=s,t[3]=u):u=t[3];const d=u;if(r){let b;t[4]!==d?(b={...d,objectFit:"cover"},t[4]=d,t[5]=b):b=t[5];let x;return t[6]!==r||t[7]!==n||t[8]!==b?(x=m.jsx("img",{src:r,alt:n,style:b}),t[6]=r,t[7]=n,t[8]=b,t[9]=x):x=t[9],x}let l;t[10]!==n?(l=b0(n),t[10]=n,t[11]=l):l=t[11];const{bg:f,fg:p}=l,v=s*.42;let g;t[12]!==f||t[13]!==p||t[14]!==d||t[15]!==v?(g={...d,background:f,display:"inline-flex",alignItems:"center",justifyContent:"center",color:p,fontSize:v,fontWeight:600,userSelect:"none"},t[12]=f,t[13]=p,t[14]=d,t[15]=v,t[16]=g):g=t[16];let _;return t[17]!==c||t[18]!==g?(_=m.jsx("span",{style:g,children:c}),t[17]=c,t[18]=g,t[19]=_):_=t[19],_}const Pi="/automation/runs",_0=[{label:"App Center",href:"/app-center",icon:Tg},{label:"Flow Runs",href:Pi,icon:Mg},{label:"Mac Resources",href:"/mac-resources",icon:Ag}],x0=[{label:"Default",href:"/settings/default",icon:Lu},{label:"Team",href:"/settings/team",icon:$g},{label:"Tokens",href:"/settings/tokens",icon:Rg}],S0=[{label:"Docs",href:"https://www.tapflow.dev/get-started/teammates",icon:Cg}];function E0(){const e=te.c(70),{pathname:t}=ou(),n=su(),{user:r}=lh(),{resolvedTheme:o}=os(),s=o==="dark"?"/logo-dark.svg":"/logo.svg";let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={queryKey:qo.settings,queryFn:l0},e[0]=i):i=e[0];const a=Zo(i).data,c=(a==null?void 0:a.logo_url)??null,u=(a==null?void 0:a.team_name)||"tapflow",d=Qi();let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={queryKey:qo.anyRun,queryFn:k0},e[1]=l):l=e[1];const f=Zo(l);let p;e[2]!==f.data||e[3]!==f.isError||e[4]!==t?(p=f.data===!0||f.isError||t.startsWith(Pi),e[2]=f.data,e[3]=f.isError,e[4]=t,e[5]=p):p=e[5];const v=p;let g,_,b,x,w,C,E,P,R;if(e[6]!==s||e[7]!==c||e[8]!==n||e[9]!==t||e[10]!==d||e[11]!==v||e[12]!==u){let Y;e[22]!==v?(Y=U=>U.href!==Pi||v,e[22]=v,e[23]=Y):Y=e[23];const ee=_0.filter(Y);let G;e[24]!==n||e[25]!==d?(G=async function(){await fetch("/api/v1/auth/logout",{method:"POST",credentials:"include"}),d.clear(),n("/login",{replace:!0})},e[24]=n,e[25]=d,e[26]=G):G=e[26],C=G,w=mf,P="icon";const ve=c??s;let he;e[27]!==ve?(he=m.jsx("img",{src:ve,alt:"tapflow",className:"w-6 h-6 min-w-6 shrink-0"}),e[27]=ve,e[28]=he):he=e[28];let oe;e[29]!==u?(oe=m.jsx("span",{className:"text-base font-semibold tracking-tight truncate text-sidebar-accent-foreground group-data-[collapsible=icon]:hidden",children:u}),e[29]=u,e[30]=oe):oe=e[30],e[31]!==oe||e[32]!==he?(R=m.jsx(yf,{className:"p-2",children:m.jsxs(po,{to:"/app-center",className:"flex items-center gap-2 p-1",children:[he,oe]})}),e[31]=oe,e[32]=he,e[33]=R):R=e[33],x=wf,b=Do,_=Mo,g=jo;let le;e[34]!==t?(le=U=>m.jsx(Ko,{children:m.jsx(Go,{asChild:!0,isActive:t.startsWith(U.href),tooltip:U.label,children:m.jsxs(po,{to:U.href,children:[m.jsx(U.icon,{}),m.jsx("span",{children:U.label})]})})},U.href),e[34]=t,e[35]=le):le=e[35],E=ee.map(le),e[6]=s,e[7]=c,e[8]=n,e[9]=t,e[10]=d,e[11]=v,e[12]=u,e[13]=g,e[14]=_,e[15]=b,e[16]=x,e[17]=w,e[18]=C,e[19]=E,e[20]=P,e[21]=R}else g=e[13],_=e[14],b=e[15],x=e[16],w=e[17],C=e[18],E=e[19],P=e[20],R=e[21];let T;e[36]!==g||e[37]!==E?(T=m.jsx(g,{children:E}),e[36]=g,e[37]=E,e[38]=T):T=e[38];let A;e[39]!==_||e[40]!==T?(A=m.jsx(_,{children:T}),e[39]=_,e[40]=T,e[41]=A):A=e[41];let j;e[42]!==b||e[43]!==A?(j=m.jsx(b,{children:A}),e[42]=b,e[43]=A,e[44]=j):j=e[44];let L;e[45]===Symbol.for("react.memo_cache_sentinel")?(L=m.jsx(xi,{children:"Settings"}),e[45]=L):L=e[45];let z;if(e[46]!==t||e[47]!==(r==null?void 0:r.role)){let Y;e[49]!==(r==null?void 0:r.role)?(Y=G=>uh(G.href,r==null?void 0:r.role),e[49]=r==null?void 0:r.role,e[50]=Y):Y=e[50];let ee;e[51]!==t?(ee=G=>m.jsx(Ko,{children:m.jsx(Go,{asChild:!0,isActive:t===G.href,tooltip:G.label,children:m.jsxs(po,{to:G.href,children:[m.jsx(G.icon,{}),m.jsx("span",{children:G.label})]})})},G.href),e[51]=t,e[52]=ee):ee=e[52],z=x0.filter(Y).map(ee),e[46]=t,e[47]=r==null?void 0:r.role,e[48]=z}else z=e[48];let J;e[53]!==z?(J=m.jsxs(Do,{children:[L,m.jsx(Mo,{children:m.jsx(jo,{children:z})})]}),e[53]=z,e[54]=J):J=e[54];let W;e[55]===Symbol.for("react.memo_cache_sentinel")?(W=m.jsx(xi,{children:"Reference"}),e[55]=W):W=e[55];let K;e[56]===Symbol.for("react.memo_cache_sentinel")?(K=m.jsxs(Do,{children:[W,m.jsx(Mo,{children:m.jsx(jo,{children:S0.map(C0)})})]}),e[56]=K):K=e[56];let Z;e[57]!==x||e[58]!==J||e[59]!==j?(Z=m.jsxs(x,{children:[j,J,K]}),e[57]=x,e[58]=J,e[59]=j,e[60]=Z):Z=e[60];let X;e[61]!==C||e[62]!==r?(X=r&&m.jsx(bf,{className:"px-3 py-3",children:m.jsxs(Qw,{children:[m.jsx(Yw,{asChild:!0,children:m.jsxs("button",{className:"flex w-full items-center gap-2.5 rounded-md px-1 py-1 text-left hover:bg-sidebar-accent transition-colors group-data-[collapsible=icon]:justify-center",children:[m.jsx(w0,{name:r.displayName??"",avatarUrl:r.avatarUrl,size:28}),m.jsxs("div",{className:"flex flex-col min-w-0 flex-1 group-data-[collapsible=icon]:hidden",children:[m.jsx("span",{className:"text-sm font-medium truncate",children:r.displayName}),m.jsx("span",{className:"text-xs text-muted-foreground truncate",children:r.email})]})]})}),m.jsxs(ih,{side:"top",align:"start",className:"w-56",children:[m.jsx(ki,{asChild:!0,children:m.jsxs(po,{to:"/settings/default",children:[m.jsx(Lu,{className:"mr-2 h-4 w-4"}),"Settings"]})}),m.jsx(ah,{}),m.jsxs(ki,{onClick:C,className:"text-destructive focus:text-destructive",children:[m.jsx(Ig,{className:"mr-2 h-4 w-4"}),"Log out"]})]})]})}),e[61]=C,e[62]=r,e[63]=X):X=e[63];let re;return e[64]!==w||e[65]!==Z||e[66]!==X||e[67]!==P||e[68]!==R?(re=m.jsxs(w,{collapsible:P,children:[R,Z,X]}),e[64]=w,e[65]=Z,e[66]=X,e[67]=P,e[68]=R,e[69]=re):re=e[69],re}function C0(e){return m.jsx(Ko,{children:m.jsx(Go,{asChild:!0,tooltip:e.label,children:m.jsxs("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",children:[m.jsx(e.icon,{}),m.jsx("span",{children:e.label})]})})},e.href)}function k0(e){const{signal:t}=e;return h0(t)}function O0(){const e=te.c(7),{theme:t,setTheme:n}=os();let r;e[0]!==n||e[1]!==t?(r=()=>n(t==="dark"?"light":"dark"),e[0]=n,e[1]=t,e[2]=r):r=e[2];let o,s;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(jg,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),s=m.jsx(Ng,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),e[3]=o,e[4]=s):(o=e[3],s=e[4]);let i;return e[5]!==r?(i=m.jsxs(ss,{variant:"ghost",size:"icon",onClick:r,"aria-label":"Toggle theme",children:[o,s]}),e[5]=r,e[6]=i):i=e[6],i}const dh=h.createContext({node:null,setNode:()=>{}});function P0(e){const t=te.c(5),{children:n}=e,[r,o]=h.useState(null);let s;t[0]!==r?(s={node:r,setNode:o},t[0]=r,t[1]=s):s=t[1];const i=s;let a;return t[2]!==n||t[3]!==i?(a=m.jsx(dh.Provider,{value:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function R0(){return h.useContext(dh)}function T0(){const e=te.c(8),{node:t}=R0();let n,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx(gf,{className:"-ml-1"}),r=m.jsx(Ho,{orientation:"vertical",className:"h-4"}),e[0]=n,e[1]=r):(n=e[0],r=e[1]);let o,s,i;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("div",{className:"flex-1"}),s=m.jsx(O0,{}),i=m.jsx(Ho,{orientation:"vertical",className:"h-4"}),e[2]=o,e[3]=s,e[4]=i):(o=e[2],s=e[3],i=e[4]);let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("a",{href:"https://github.com/jo-duchan/tapflow",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center w-8 h-8 rounded-md hover:bg-accent transition-colors","aria-label":"GitHub",children:m.jsx("svg",{viewBox:"0 0 24 24",className:"w-4 h-4 fill-current","aria-hidden":"true",children:m.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})})}),e[5]=a):a=e[5];let c;return e[6]!==t?(c=m.jsxs("header",{className:"flex h-16 items-center gap-2 border-b px-4",children:[n,r,t,o,s,i,a]}),e[6]=t,e[7]=c):c=e[7],c}function I0(){const e=te.c(5),{user:t,loading:n}=lh(),r=ou();if(n)return null;if(!t){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(Gi,{to:"/login",replace:!0}),e[0]=a):a=e[0],a}if(!uh(r.pathname,t.role)){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("div",{className:"flex h-screen items-center justify-center",children:m.jsxs("div",{className:"text-center space-y-2",children:[m.jsx("p",{className:"text-lg font-semibold",children:"Access Denied"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:"Your role does not have access to this page."})]})}),e[1]=a):a=e[1],a}let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(E0,{}),e[2]=o):o=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(T0,{}),e[3]=s):s=e[3];let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx(P0,{children:m.jsxs(pf,{children:[o,m.jsxs(vf,{children:[s,m.jsx("main",{className:"relative flex-1 min-h-0 overflow-auto",children:m.jsx(h.Suspense,{fallback:m.jsx("div",{className:"flex h-full w-full items-center justify-center text-sm text-muted-foreground",children:"Loading…"}),children:m.jsx(jp,{})})})]})]})}),e[4]=i):i=e[4],i}var kr=e=>e.type==="checkbox",ms=e=>e.type==="file",Sn=e=>e instanceof Date,Ye=e=>e==null;const Na=e=>typeof e=="object";var Te=e=>!Ye(e)&&!Array.isArray(e)&&Na(e)&&!Sn(e),Ri=e=>Te(e)&&e.target?kr(e.target)?e.target.checked:ms(e.target)?e.target.files:e.target.value:e;const A0=/[.[\]'"]/;var Un=e=>e.split(A0).filter(Boolean);function N0(e,t){const n=Un(t);let r=e._formValues,o=e._defaultValues;for(let s=0;s<n.length-1;s++){const i=n[s];if(r=r==null?r:r[i],o=o==null?o:o[i],r===null||o===null)return null}}var fh=(e,t)=>t.split(".").some((n,r,o)=>!isNaN(Number(n))&&e.has(o.slice(0,r).join("."))),gs=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ke(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e);const t=typeof Blob<"u"&&e instanceof Blob,n=typeof FileList<"u"&&e instanceof FileList;if(gs&&(t||n))return e;const r=Array.isArray(e),o=Object.getPrototypeOf(e);if(!r&&o&&e.constructor!==Object)return e;const s=r?new Array(e.length):Object.create(o);for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(s[i]=ke(e[i]));return s}const mn={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},Rt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Qe={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},D0=[Qe.required,Qe.min,Qe.max,Qe.minLength,Qe.maxLength,Qe.pattern,Qe.validate],Lr="form",hh="root",Da=["__proto__","constructor","prototype"],M0=/^\w*$/;var br=e=>M0.test(e),ge=e=>e===void 0,B=(e,t,n)=>{if(!t||!Te(e))return n;const r=br(t)?[t]:Un(t);if(r.some(s=>Da.includes(s)))return n;const o=r.reduce((s,i)=>Ye(s)?void 0:s[i],e);return ge(o)||o===e?ge(e[t])?n:e[t]:o},yt=e=>typeof e=="boolean",tt=e=>typeof e=="function",we=(e,t,n)=>{let r=-1;const o=br(t)?[t]:Un(t),s=o.length,i=s-1;for(;++r<s;){const a=o[r];let c=n;if(r!==i){const u=e[a];c=Te(u)||Array.isArray(u)?u:isNaN(+o[r+1])?{}:[]}if(Da.includes(a))return;e[a]=c,e=e[a]}};const ph=I.createContext(null);ph.displayName="HookFormControlContext";const Ma=()=>I.useContext(ph);var mh=(e,t,n,r=!0)=>{const o={};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==Rt.all&&(t._proxyFormState[i]=!r||Rt.all),n&&(n[i]=!0),e[i]}});return o};const ja=gs?I.useLayoutEffect:I.useEffect;var j0=e=>{const t=e.constructor&&e.constructor.prototype;return Te(t)&&t.hasOwnProperty("isPrototypeOf")},Ti=e=>Ye(e)||!Na(e);const Uc=(e,t)=>t.length===0&&!Array.isArray(e)&&!j0(e);function it(e,t,n=!1,r=new WeakMap){if(e===t)return!0;if(Ti(e)||Ti(t))return Object.is(e,t);if(Sn(e)&&Sn(t))return Object.is(e.getTime(),t.getTime());const o=Object.keys(e),s=Object.keys(t);if(o.length!==s.length)return!1;if(Uc(e,o)||Uc(t,s))return Object.is(e,t);if(!o.length&&Array.isArray(e)!==Array.isArray(t))return!1;const i=r.get(e);if(i&&i.has(t))return!0;if(i)i.add(t);else{const a=new WeakSet;a.add(t),r.set(e,a)}for(const a of o){const c=e[a];if(!(a in t))return!1;if(!n||a!=="ref"){const u=t[a];if(Sn(c)&&Sn(u)||(Te(c)||Array.isArray(c))&&(Te(u)||Array.isArray(u))?!it(c,u,n,r):!Object.is(c,u))return!1}}return!0}function $a(e){const t=I.useRef(!1),n=I.useRef(!1),r=I.useRef(void 0),o=I.useRef(0);o.current++,!n.current&&e&&(n.current=!0,r.current=ke(e()));const s=I.useCallback((a,c,u)=>{if(a&&(t.current||n.current&&o.current>1)){const d=c();it(r.current,d)||u(d)}t.current=!0},[]),i=I.useCallback((a,c)=>{a&&(r.current=ke(c()))},[]);return{resyncIfNeeded:s,snapshot:i}}function $0(e){const t=Ma(),{control:n=t,disabled:r,name:o,exact:s}=e||{},i=()=>({...n._formState,defaultValues:n._defaultValues}),[a,c]=I.useState(i),u=I.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),{resyncIfNeeded:d,snapshot:l}=$a(i);return ja(()=>{d(!r,i,c);const f=n._subscribe({name:o,formState:u.current,exact:s,callback:p=>{!r&&c({...n._formState,...p,defaultValues:n._defaultValues})}});return()=>{f(),l(!r,i)}},[n,o,r,s,d,l]),I.useEffect(()=>{u.current.isValid&&n._setValid(!0)},[n]),I.useMemo(()=>mh(a,n,u.current,!1),[a,n])}var nt=e=>typeof e=="string",Ii=(e,t,n,r,o)=>nt(e)?(r&&t.watch.add(e),B(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),B(n,s,B(o,s)))):(r&&(t.watchAll=!0),n);function z0(e){const t=Ma(),{control:n=t,name:r,defaultValue:o,disabled:s,exact:i,compute:a}=e||{},c=I.useRef(o),u=I.useRef(a),d=I.useRef(n),l=I.useRef(r);u.current=a;const f=()=>{const A=n._getWatch(r,c.current);return u.current?u.current(A):A},[p,v]=I.useState(f),g=I.useRef(p),_=I.useCallback(A=>{const j=Ii(r,n._names,A||n._formValues,!1,c.current);return u.current?u.current(j):j},[n._formValues,n._names,r]),b=I.useCallback(A=>{if(!s){const j=Ii(r,n._names,A||n._formValues,!1,c.current);if(u.current){const L=u.current(j);it(L,g.current)||(v(L),g.current=L)}else v(j)}},[n._formValues,n._names,s,r]),{resyncIfNeeded:x,snapshot:w}=$a(f),C=I.useRef(b);C.current=b;const E=I.useRef(_);E.current=_,ja(()=>{d.current!==n||!it(l.current,r)?(d.current=n,l.current=r,C.current()):x(!s,()=>E.current(),j=>{const L=ke(j);v(L),g.current=L});const A=n._subscribe({name:r,formState:{values:!0},exact:i,callback:j=>{C.current(j.values)}});return()=>{A(),w(!s,()=>E.current())}},[n,i,r,s,x,w]),I.useEffect(()=>n._removeUnmounted());const P=d.current!==n,R=l.current;return I.useMemo(()=>{if(s)return!1;const A=!P&&!it(R,r);return P||A},[s,P,r,R])?_():p}function F0(e){const t=Ma(),{name:n,disabled:r,control:o=t,shouldUnregister:s,defaultValue:i,exact:a=!0}=e,c=fh(o._names.array,n),u=I.useMemo(()=>{const C=B(o._formValues,n,B(o._defaultValues,n,i));return ge(C)?N0(o,n):C},[o,n,i]),d=z0({control:o,name:n,defaultValue:u,exact:a}),l=$0({control:o,name:n,exact:a}),f=I.useRef(e),p=I.useRef(null),v=I.useRef(o.register(n,{...e.rules,value:d,...yt(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const g=I.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!B(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!B(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!B(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!B(l.validatingFields,n)},error:{enumerable:!0,get:()=>B(l.errors,n)}}),[l,n]),_=I.useCallback(C=>{const E=Ri(C);return B(o._fields,n)||(v.current=o.register(n,{...f.current.rules,value:E})),v.current.onChange({target:{value:Ri(C),name:n},type:mn.CHANGE})},[n,o]),b=I.useCallback(()=>{const C=B(o._formValues,n);return B(o._fields,n)||(v.current=o.register(n,{...f.current.rules,value:C})),v.current.onBlur({target:{value:C,name:n},type:mn.BLUR})},[n,o]),x=I.useCallback(C=>{C&&(p.current={focus:()=>tt(C.focus)&&C.focus(),select:()=>tt(C.select)&&C.select(),setCustomValidity:P=>tt(C.setCustomValidity)&&C.setCustomValidity(P),reportValidity:()=>tt(C.reportValidity)&&C.reportValidity()});const E=B(o._fields,n);E&&E._f&&C&&(E._f.ref=p.current,E._f._c=!0)},[o._fields,n]),w=I.useMemo(()=>({name:n,value:d,...yt(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:_,onBlur:b,ref:x}),[n,r,l.disabled,_,b,x,d]);return I.useEffect(()=>{const C=o._options.shouldUnregister||s;v.current=o.register(n,{...f.current.rules,...yt(f.current.disabled)?{disabled:f.current.disabled}:{}});const E=(P,R)=>{const T=B(o._fields,P);T&&T._f&&(T._f.mount=R,T._f._c=R)};if(E(n,!0),C){const P=ke(B(s?o._defaultValues:o._options.values||o._defaultValues,n,B(o._options.defaultValues,n,f.current.defaultValue)));we(o._defaultValues,n,P),ge(B(o._formValues,n))&&we(o._formValues,n,P)}if(!c&&o.register(n,{...f.current.rules,...yt(f.current.disabled)?{disabled:f.current.disabled}:{}}),p.current){const P=B(o._fields,n);P&&P._f&&(P._f.ref=p.current)}return()=>{(c?C&&!o._state.action:C)?o.unregister(n):E(n,!1)}},[n,o,c,s]),I.useEffect(()=>{o._setDisabledField({disabled:r,name:n})},[r,n,o]),I.useMemo(()=>({field:w,formState:l,fieldState:g}),[w,l,g])}const qk=e=>e.render(F0(e));var Co=e=>({isOnSubmit:!e||e===Rt.onSubmit,isOnBlur:e===Rt.onBlur,isOnChange:e===Rt.onChange,isOnAll:e===Rt.all,isOnTouch:e===Rt.onTouched}),Fs=(e,t,n)=>{if(n)return!1;if(t.watchAll||t.watch.has(e))return!0;for(const r of t.watch)if(e.startsWith(r)&&e.charAt(r.length)===".")return!0;return!1};const Zr=(e,t,n)=>{for(const r of n||Object.keys(e)){if(r==="_f")continue;const o=n?B(e,r):e[r];if(o){const{_f:s}=o;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],s.name))return!0;if(s.ref&&t(s.ref,s.name))return!0;if(Zr(o,t))return!0}else if((Te(o)||Array.isArray(o))&&Zr(o,t))return!0}}};var Zc=(e,t,n)=>{const r=B(e,n),o=Array.isArray(r)?r:[];return we(o,hh,t[n]),we(e,n,o),e},ze=e=>Te(e)&&!Object.keys(e).length,Qo=e=>{if(!gs)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},vs=e=>e.type==="radio",Yo=e=>e instanceof RegExp,za=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{};const Bc={value:!1,isValid:!1},Wc={value:!0,isValid:!0};var gh=e=>{if(!Array.isArray(e))return Bc;if(e.length>1){const n=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:n,isValid:!!n.length}}const t=e[0];return!t||!t.checked||t.disabled?Bc:!t.attributes||!("value"in t.attributes)||ge(t.value)||t.value===""?Wc:{value:t.value,isValid:!0}};const Hc={isValid:!1,value:null};var vh=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Hc):Hc;function Kc(e,t,n="validate"){if(nt(e)||Array.isArray(e)&&e.every(nt)||yt(e)&&!e)return{type:n,message:nt(e)?e:"",ref:t}}var er=e=>Te(e)&&!Yo(e)?e:{value:e,message:""},Gc=async(e,t,n,r,o,s)=>{const{ref:i,refs:a,required:c,maxLength:u,minLength:d,min:l,max:f,pattern:p,validate:v,name:g,valueAsNumber:_,mount:b,_c:x}=e._f,w=B(n,g);if(!b||t.has(g))return{};const C=a?a[0]:i,E=W=>{if(o&&C.reportValidity){const K=yt(W)?"":W||"";a?a.forEach(Z=>tt(Z.setCustomValidity)&&Z.setCustomValidity(K)):C.setCustomValidity(K),C.reportValidity()}},P={},R=vs(i),T=kr(i),A=R||T,j=(_||ms(i))&&ge(i.value)&&ge(w)||Qo(i)&&i.value===""&&!x||w===""||Array.isArray(w)&&!w.length,L=za.bind(null,g,r,P),z=(W,K,Z,X=Qe.maxLength,re=Qe.minLength)=>{const Y=W?K:Z;P[g]={type:W?X:re,message:Y,ref:i,...L(W?X:re,Y)}};if(s?!Array.isArray(w)||!w.length:c&&(!A&&(j||Ye(w))||yt(w)&&!w||T&&!gh(a).isValid||R&&!vh(a).isValid)){const{value:W,message:K}=nt(c)?{value:!!c,message:c}:er(c);if(W&&(P[g]={type:Qe.required,message:K,ref:C,...L(Qe.required,K)},!r))return E(K),P}if(!j&&(!Ye(l)||!Ye(f))){let W,K;const Z=er(f),X=er(l);if(!Ye(w)&&!Sn(w)&&!isNaN(w)){const re=i.valueAsNumber||w&&+w;Ye(Z.value)||(W=re>Z.value),Ye(X.value)||(K=re<X.value)}else{const re=i.valueAsDate||new Date(w),Y=ve=>new Date(new Date().toDateString()+" "+ve),ee=i.type=="time",G=i.type=="week";nt(Z.value)&&w&&(W=ee?Y(w)>Y(Z.value):G?w>Z.value:re>new Date(Z.value)),nt(X.value)&&w&&(K=ee?Y(w)<Y(X.value):G?w<X.value:re<new Date(X.value))}if((W||K)&&(z(!!W,Z.message,X.message,Qe.max,Qe.min),!r))return E(P[g].message),P}if((u||d)&&!j&&(nt(w)||s&&Array.isArray(w))){const W=er(u),K=er(d),Z=!Ye(W.value)&&w.length>+W.value,X=!Ye(K.value)&&w.length<+K.value;if((Z||X)&&(z(Z,W.message,K.message),!r))return E(P[g].message),P}if(p&&!j&&nt(w)){const{value:W,message:K}=er(p);if(Yo(W)&&!w.match(W)&&(P[g]={type:Qe.pattern,message:K,ref:i,...L(Qe.pattern,K)},!r))return E(K),P}if(v){if(tt(v)){const W=await v(w,n),K=Kc(W,C);if(K&&(P[g]={...K,...L(Qe.validate,K.message)},!r))return E(K.message),P}else if(Te(v)){let W={};for(const K in v){if(!ze(W)&&!r)break;const Z=Kc(await v[K](w,n),C,K);Z&&(W={...Z,...L(K,Z.message)},r||E(Z.message),r&&(P[g]=W))}if(!ze(W)&&(P[g]={ref:C,...W},!r))return P}}const J=P[g];return E(J?J.message:!0),P},Ls=e=>Array.isArray(e)?e:[e],yh=e=>Array.isArray(e)?e.filter(Boolean):[];function L0(e,t){const n=t.length-1;let r=0;for(;r<n;){if(Ye(e)){e=void 0;break}e=e[t[r]],r++}return e}function V0(e){for(const t in e)if(e.hasOwnProperty(t)&&!ge(e[t]))return!1;return!0}function je(e,t){if(nt(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const n=Array.isArray(t)?t:br(t)?[t]:Un(t);if(n.some(i=>Da.includes(String(i))))return e;const r=n.length===1?e:L0(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(Te(r)&&ze(r)||Array.isArray(r)&&V0(r))&&je(e,n.slice(0,-1)),e}const U0=I.createContext(null);U0.displayName="HookFormContext";var qc=()=>{let e=new Set,t=0;return{get observers(){return Array.from(e)},next:s=>{const i=e;t++;for(const a of i)a.next&&a.next(s);i===e&&t--},subscribe:s=>(e.add(s),{unsubscribe:()=>{t&&(e=new Set(e),t=0),e.delete(s)}}),unsubscribe:()=>{e=new Set,t=0}}};function bh(e,t){const n=Array.isArray(e)?[]:{};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const o=e[r],s=t[r];o&&(Te(o)||Array.isArray(o))&&s?n[r]=bh(o,s):e[r]&&(n[r]=s)}return n}const Qc=(e,t)=>e!==null&&Na(e)&&Object.prototype.hasOwnProperty.call(e,t);var Yc=(e,t)=>{if(!t)return!1;let n=e;for(const r of br(t)?[t]:Un(t)){if(!Qc(n,r))return Qc(e,t);n=n[r]}return!0},Z0=e=>kr(e)?e.checked!==e.defaultChecked:!vs(e)&&"defaultValue"in e&&e.value!==e.defaultValue,wh=e=>e.type==="select-multiple",B0=e=>vs(e)||kr(e),Vs=e=>Qo(e)&&e.isConnected;function Jc(e){return Array.isArray(e)||Te(e)}function _h(e,t,n="",r=[]){for(const o in e){const s=n?`${n}.${o}`:o,i=e[o];Jc(i)&&Jc(B(t,s))?_h(i,t,s,r):r.push(s)}return r}var W0=e=>{for(const t in e)if(tt(e[t]))return!0;return!1};function xh(e){return Array.isArray(e)||Te(e)&&!W0(e)}function Sh(e){return!!(e&&"_f"in e)}function Eh(e){return Array.isArray(e)?!e.some(t=>!ge(t)):!Object.keys(e).length}function Ai(e,t){Array.isArray(e)?e[t]=void 0:delete e[t]}function Ni(e,t={},n){for(const r in e){const o=e[r],s=n&&n[r];xh(o)&&(!Array.isArray(o)||!Sh(s))?(t[r]=Array.isArray(o)?[]:{},Ni(o,t[r],s),Eh(t[r])&&Ai(t,r)):ge(o)||(t[r]=!0)}return t}function Gt(e,t,n,r){n||(n=Ni(t,Array.isArray(t)?[]:{},r));for(const o in e){const s=e[o],i=r&&r[o];xh(s)&&(!Array.isArray(s)||!Sh(i))?(ge(t)||Ti(n[o])?n[o]=Ni(s,Array.isArray(s)?[]:{},i):Gt(s,Ye(t)?{}:t[o],n[o],i),Eh(n[o])&&Ai(n,o)):it(s,t[o])?Ai(n,o):n[o]=!0}return n}var H0=(e,t)=>{const n=t.split("."),r=[];let o=n[0];for(let s=1;s<n.length;o+="."+n[s++])!isNaN(+n[s])&&e.has(o)&&r.push(`${o}.${n[s]}`);return r},Di=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>ge(e)?e:t?e===""?NaN:e&&+e:n&&nt(e)?new Date(e):r?r(e):e;function Xc(e){const t=e.ref;return ms(t)?t.files:vs(t)?vh(e.refs).value:wh(t)?[...t.selectedOptions].map(({value:n})=>n):kr(t)?gh(e.refs).value:Di(t.value,e)}var K0=(e,t,n,r)=>{const o={};for(const s of e){const i=B(t,s);i&&we(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},$r=e=>ge(e)?e:Yo(e)?e.source:Te(e)?Yo(e.value)?e.value.source:e.value:e;const el="AsyncFunction";var G0=e=>{if(!e||!e.validate)return!1;if(tt(e.validate))return e.validate.constructor.name===el;if(Te(e.validate)){for(const t in e.validate)if(e.validate[t].constructor.name===el)return!0}return!1},q0=e=>e.mount&&(e.required||!ge(e.required)&&e.required!==!1||!ge(e.min)||!ge(e.max)||!ge(e.maxLength)||!ge(e.minLength)||e.pattern||e.validate);function tl(e,t,n){const r=B(e,n);if(r&&(r.type||r.message)||Array.isArray(r))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=B(t,s),a=B(e,s);if(i&&!Array.isArray(i)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};if(a&&a.root&&a.root.type)return{name:`${s}.root`,error:a.root};o.pop()}return{name:n}}var Q0=(e,t,n)=>{const r=Object.keys(e).filter(o=>o!=="name");return!r.length||n&&r.length>=Object.keys(t).length||r.find(o=>t[o]===(!n||Rt.all))};const nl=(e,t,n)=>n?e===t||e.startsWith(t+"."):e.startsWith(t)||t.startsWith(e);var rl=(e,t,n)=>{if(!e||!t||e===t)return!0;if(!Array.isArray(e))return nl(e,t,n);for(const r of e)if(r&&nl(r,t,n))return!0;return!1},Y0=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,J0=(e,t)=>{const n=B(e,t);!yh(n).length&&!(n&&n.root)&&je(e,t)};const Fo={mode:Rt.onSubmit,reValidateMode:Rt.onChange,shouldFocusError:!0},X0=(e,t)=>{for(const n in e)delete e[n];Object.assign(e,t)},Ch={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function e_(e={}){let t={...Fo,...e},n={...ke(Ch),isLoading:tt(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},r={},o=Te(t.defaultValues)||Te(t.values)?ke(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:ke(o),i={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},a=!1,c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const u={},d={},l=new Set;let f=Co(t.mode),p=Co(t.reValidateMode);const v={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},g={...v},_={},b=(...y)=>y.some(O=>g[O]||_[O]),x=y=>{for(const O of l)if(rl(O.name,y,O.exact))return!0;return!1},w={array:qc(),state:qc()};let C=0,E=0,P=t.criteriaMode===Rt.all;const R=(y,O)=>k=>{clearTimeout(d[y]),d[y]=setTimeout(O,k)},T=y=>{clearTimeout(d[y]),delete d[y],delete u[y]},A=y=>{T(y);const O=`${y}.`;for(const k of Object.keys(u))k.startsWith(O)&&T(k)},j=async y=>{if(!i.keepIsValid&&!t.disabled&&(b("isValid")||y)){const O=++C;let k;t.resolver?(k=ze((await G()).errors),O===C&&L()):k=await oe({fields:r,onlyCheckValid:!0,eventType:mn.VALID}),O===C&&k!==n.isValid&&w.state.next({isValid:k})}},L=(y,O)=>{!t.disabled&&b("isValidating","validatingFields")&&((y||c.mount).forEach(k=>{k&&(O?we(n.validatingFields,k,O):je(n.validatingFields,k))}),w.state.next({validatingFields:n.validatingFields,isValidating:!ze(n.validatingFields)}))},z=()=>{n.dirtyFields=Gt(o,s,void 0,r)},J=(y,O=[],k,N,$=!0,H=!0)=>{if(N&&k&&!t.disabled){i.action=!0;const F=B(r,y);if(i.actionArrayLengths.has(y)||i.actionArrayLengths.set(y,Array.isArray(F)?F.length:0),H&&Array.isArray(F)){const ye=k(F,N.argA,N.argB);$&&we(r,y,ye)}const D=B(n.errors,y);if(H&&Array.isArray(D)){const ye=D.root,be=k(D,N.argA,N.argB)||D;ye&&(be.root=ye),$&&we(n.errors,y,be),J0(n.errors,y),n.errors={...n.errors}}const V=B(n.touchedFields,y),Q=H&&Array.isArray(V);if(Q){const ye=k(V,N.argA,N.argB);$&&we(n.touchedFields,y,ye)}const ae=B(n.dirtyFields,y);if(H&&Array.isArray(ae)){const ye=k(ae,N.argA,N.argB)||ae;$&&we(n.dirtyFields,y,ye)}b("dirtyFields")?z():a=!0,w.state.next({name:y,isDirty:U(y,O),dirtyFields:n.dirtyFields,...Q&&{touchedFields:n.touchedFields},errors:n.errors,isValid:n.isValid})}else we(s,y,O)},W=(y,O)=>{we(n.errors,y,O),n.errors={...n.errors},w.state.next({errors:n.errors})},K=y=>{Object.keys(u).forEach(T);const O=!ze(y);n.errors=y,w.state.next({errors:n.errors,...O?{isValid:!1}:{}}),!O&&i.mount&&j()},Z=y=>{const O=br(y)?[y]:Un(y);let k=s,N=o;for(let $=0;$<O.length-1;$++){const H=O[$];if(k=Ye(k)?k:k[H],N=Ye(N)?N:N[H],k===null&&N!==null)return!0}return!1},X=y=>{if(!i.actionArrayLengths.size)return!1;const O=br(y)?[y]:Un(y);let k=s,N="",$=-1,H=0;for(let F=0;F<O.length;F++){if(Ye(k))return!1;const D=O[F];if(N=N?`${N}.${D}`:D,Array.isArray(k)&&+D>=k.length)return $===-1?!1:F===$?+D<H:!0;if(i.actionArrayLengths.has(N)&&($=F+1,H=i.actionArrayLengths.get(N)),k=k[D],ge(k)&&$!==-1&&F>$&&+O[$]<H)return!0}return!1},re=(y,O,k,N)=>{const $=B(r,y);if($){if(Z(y)||X(y))return;const H=ge(B(s,y)),F=B(s,y,ge(k)?B(o,y):k),D=!!N&&!n.isReady&&Z0(N);if(ge(F)||N&&N.defaultChecked||D||O){const V=O?F:Xc($._f);b("dirtyFields")&&!it(B(s,y),V)&&(a=!0),we(s,y,V),D&&Y(y,V)}else ue(y,F);i.mount&&!i.action&&(t.resolver&&b("isValidating","validatingFields")?Promise.resolve().then(()=>j()):j(),H&&n.isDirty&&b("isDirty")&&(U()||(n.isDirty=!1,w.state.next({...n}))),t.shouldUnregister&&H&&!ge(B(s,y))&&Fs(y,c)&&(i.watch=!0))}},Y=(y,O,k,N,$)=>{let H=!1,F=!1;const D={name:y};if(!t.disabled||N===!0){if(!k||N){const V=it(B(o,y),O);if(b("isDirty")&&(F=n.isDirty,n.isDirty=D.isDirty=!V||U(),H=F!==D.isDirty),F=!!B(n.dirtyFields,y),V)je(n.dirtyFields,y);else{const ae=B(o,y),ye=B(r,y),be=!(ye&&ye._f)&&(Te(ae)||Array.isArray(ae))?Gt(ae,O,void 0,ye):!0;we(n.dirtyFields,y,be)}let Q=!1;if(a||V&&(b("isDirty")?n.isDirty:U())){a=!1;const ae=Gt(o,s,void 0,r);it(n.dirtyFields,ae)||(Q=!0,X0(n.dirtyFields,ae))}D.dirtyFields=n.dirtyFields,H=H||b("dirtyFields")&&(Q||F!==!V)}if(k){const V=Yc(n.touchedFields,y)?B(n.touchedFields,y):void 0;V||(we(n.touchedFields,y,k),D.touchedFields=n.touchedFields,H=H||b("touchedFields")&&V!==k)}H&&$&&w.state.next(D)}return H?D:{}},ee=(y,O,k,N)=>{const $=B(n.errors,y),H=b("isValid")&&yt(O)&&n.isValid!==O;if(t.delayError&&k?(u[y]=R(y,()=>W(y,k)),u[y](t.delayError)):(T(y),k?we(n.errors,y,k):je(n.errors,y),n.errors={...n.errors}),(k?!it($,k,!0):$)||!ze(N)||H){const F={...N,...H&&yt(O)?{isValid:O}:{},errors:n.errors,name:y};w.state.next(F)}},G=async y=>(L(y,!0),await t.resolver(s,t.context,K0(y||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),ve=async y=>{const O=E,{errors:k}=await G(y);if(O!==E)return k;if(L(y),y){for(const N of y){const $=B(k,N);A(N);const H=c.array.has(N)&&Te($)&&!Object.keys($).some(V=>!Number.isNaN(Number(V))),F=B(r,N),D=Te(F)&&Object.keys(F).some(V=>V!=="_f");H?Zc(n.errors,{[N]:$},N):$&&($.type||$.message)||Array.isArray($)||Te($)&&D?we(n.errors,N,$):je(n.errors,N)}n.errors={...n.errors}}else Object.keys(u).forEach(T),n.errors=k;return k},he=async({name:y,eventType:O})=>{if(t.validate){const k=E,N=await t.validate({formValues:s,formState:n,name:y,eventType:O});if(k!==E)return!0;if(Te(N)){let $=!0;Rn(Lr);for(const H in N){const F=N[H];F&&($=!1,sn(`${Lr}.${H}`,{message:nt(F.message)?F.message:"",type:F.type||Qe.validate}))}return $}else return nt(N)||!N?(sn(Lr,{message:N||"",type:Qe.validate}),!1):(Rn(Lr),!0)}return!0},oe=async({fields:y,onlyCheckValid:O,name:k,eventType:N,context:$={valid:!0,runRootValidation:!1}})=>{const H=E;if(t.validate&&!$.runRootValidation&&($.runRootValidation=!0,!await he({name:k,eventType:N})&&($.valid=!1,O)))return $.valid;for(const F in y){const D=y[F];if(D){const{_f:V,...Q}=D;if(V){const ae=c.array.has(V.name),ye=D._f&&G0(D._f),be=b("isValidating","validatingFields");ye&&be&&L([V.name],!0);const Ce=await Gc(D,c.disabled,s,P,t.shouldUseNativeValidation&&!O,ae);if(H!==E)return $.valid;if(ye&&be&&L([V.name]),Ce[V.name]&&($.valid=!1,O)||(O||(T(V.name),B(Ce,V.name)?ae?Zc(n.errors,Ce,V.name):we(n.errors,V.name,Ce[V.name]):je(n.errors,V.name)),t.shouldUseNativeValidation&&Ce[V.name]))break}!ze(Q)&&await oe({context:$,onlyCheckValid:O,fields:Q,name:F,eventType:N})}}return $.valid},le=()=>{for(const y of c.unMount){const O=B(r,y);O&&(O._f.refs?O._f.refs.every(k=>!Vs(k)):!Vs(O._f.ref))&&Ir(y)}c.unMount=new Set},U=(y,O)=>(y&&O&&we(s,y,O),!it(i.mount?s:o,o)),fe=(y,O,k)=>{const N=i.mount?s:ge(O)||!ge(y)?o:O;return Ii(y,c,ge(y)?{...N}:N,k,O)},Ee=y=>yh(B(i.mount?s:o,y,t.shouldUnregister?B(o,y,[]):[])),ue=(y,O,k={},N=!1,$=!1,H=!1)=>{const F=B(r,y);let D=O;if(F){const V=F._f;V&&(!V.disabled&&we(s,y,Di(O,V)),D=Qo(V.ref)&&Ye(O)?"":O,wh(V.ref)?[...V.ref.options].forEach(Q=>Q.selected=D.includes(Q.value)):V.refs?kr(V.ref)?V.refs.forEach(Q=>{(!Q.defaultChecked||!Q.disabled)&&(Array.isArray(D)?Q.checked=!!D.find(ae=>ae===Q.value):Q.checked=D===Q.value||!!D)}):V.refs.forEach(Q=>Q.checked=Q.value===D):ms(V.ref)?V.ref.value="":(V.ref.value=D,!V.ref.type&&!$&&!H&&w.state.next({name:y,values:N?s:x(y)?ke(s):void 0})))}(k.shouldDirty||k.shouldTouch)&&Y(y,F&&F._f&&!F._f.disabled&&(F._f.valueAsNumber||F._f.valueAsDate||F._f.setValueAs)?Di(O,F._f):D,k.shouldTouch,k.shouldDirty,!$),k.shouldValidate&&ct(y,{delayError:k.delayError}),k.shouldValidate&&F&&F._f&&F._f.deps&&(!Array.isArray(F._f.deps)||F._f.deps.length>0)&&ct(F._f.deps)},qe=(y,O,k,N=!1,$=!1,H=!1)=>{c.array.has(y)&&w.array.next({name:y,values:N?s:ke(s)});for(const F in O){if(!O.hasOwnProperty(F))continue;const D=O[F],V=y+"."+F,Q=B(r,V);(c.array.has(y)||Te(D)||Q&&!Q._f)&&!Sn(D)?qe(V,D,k,N,$,H):ue(V,D,k,N,$,H)}},Xe=(y,O,k,N,$=!1)=>{const H=B(r,y),F=c.array.has(y),D=N?O:ke(O),V=B(s,y),Q=it(V,D);if(Q||we(s,y,D),F)w.array.next({name:y,values:N?s:ke(s)}),b("isDirty","dirtyFields")&&k.shouldDirty&&(z(),$||w.state.next({name:y,dirtyFields:n.dirtyFields,isDirty:U(y,D)})),k.shouldValidate&&ct(y,{delayError:k.delayError});else{const ae=Array.isArray(D)&&!D.length||ze(D),ye=!Q&&!$;!H||H._f||Ye(D)||ae?ue(y,D,k,N,$,ye):qe(y,D,k,N,$,ye)}if(!Q&&!$){const ae=Fs(y,c),ye=i.mount||ae?y:void 0,be=F?[]:H0(c.array,y),Ce=N?s:x(ye)||be.some(x)?ke(s):void 0;w.state.next({...ae&&n,name:ye,values:Ce});for(const mt of be)w.state.next({name:mt,values:Ce})}},Ze=(y,O,k={})=>Xe(y,O,k,!1),De=(y,O={})=>{const k=tt(y)?y(s):y;if(!it(s,k)){s={...s,...k};for(const N of c.mount)Yc(k,N)&&Xe(N,B(k,N),O,!0,!0);w.state.next({...n,name:void 0,type:void 0,...l.size?{values:s}:{}}),O.shouldValidate&&j()}},Be=async y=>{i.mount=!0;const O=y.target;let k=O.name,N=!0;const $=B(r,k),H=F=>{N=Number.isNaN(F)||Sn(F)&&isNaN(F.getTime())||it(F,B(s,k,F))};if($){let F,D;const V=O.type?Xc($._f):Ri(y),Q=y.type===mn.BLUR||y.type===mn.FOCUS_OUT,ae=!q0($._f)&&!t.validate&&!t.resolver&&!B(n.errors,k)&&!$._f.deps,ye=ae||Y0(Q,B(n.touchedFields,k),n.isSubmitted,p,f),be=Fs(k,c,Q);we(s,k,ke(V)),Q?(!O||!O.readOnly)&&($._f.onBlur&&$._f.onBlur(y),Object.prototype.hasOwnProperty.call(u,k)&&u[k](0)):$._f.onChange&&$._f.onChange(y);const Ce=Y(k,V,Q),mt=!ze(Ce)||be;if(!Q&&w.state.next({name:k,type:y.type,...x(k)?{values:ke(s)}:{}}),ye)return(!ae||!n.isValid)&&b("isValid")&&(t.mode==="onBlur"?Q&&j():Q||j()),mt&&w.state.next({name:k,...be?{}:Ce});if(!t.resolver&&t.validate&&await he({name:k,eventType:y.type}),!Q&&be&&w.state.next({...n}),t.resolver){const un=E,{errors:_t}=await G([k]);if(un!==E)return;if(L([k]),H(V),!N){!ze(Ce)&&w.state.next(Ce);return}const Dr=tl(n.errors,r,k),tc=tl(_t,r,Dr.name||k);F=tc.error,k=tc.name,D=ze(_t)}else{const un=E;if(L([k],!0),F=(await Gc($,c.disabled,s,P,t.shouldUseNativeValidation))[k],un!==E)return;if(L([k]),H(V),N){if(F)D=!1;else if(b("isValid")&&(D=await oe({fields:r,onlyCheckValid:!0,name:k,eventType:y.type}),un!==E))return}}N&&($._f.deps&&(!Array.isArray($._f.deps)||$._f.deps.length>0)&&ct($._f.deps),ee(k,D,F,Ce))}},kt=(y,O)=>{if(B(n.errors,O)&&y.focus)return y.focus(),1},ct=async(y,O={})=>{let k,N;const $=Ls(y);if(t.resolver){const H=E,F=await ve(ge(y)?y:$);if(k=ze(F),N=y?!$.some(D=>B(F,D)):k,H!==E)return N}else y?(N=(await Promise.all($.map(async H=>{const F=B(r,H);return await oe({fields:F&&F._f?{[H]:F}:F,eventType:mn.TRIGGER})}))).every(Boolean),!(!N&&!n.isValid)&&j()):N=k=await oe({fields:r,name:y,eventType:mn.TRIGGER});if(O.delayError&&t.delayError&&nt(y)){const H=B(n.errors,y);H?(je(n.errors,y),u[y]=R(y,()=>W(y,H)),u[y](t.delayError)):T(y)}if(O.shouldTouch)for(const H of y?$:c.mount)!c.array.has(H)&&we(n.touchedFields,H,!0);return n.errors={...n.errors},w.state.next({...!nt(y)||b("isValid")&&k!==n.isValid?{}:{name:y},...t.resolver||!y?{isValid:k}:{},...O.shouldTouch&&b("touchedFields")?{touchedFields:n.touchedFields}:{},errors:n.errors}),O.shouldFocus&&!N&&Zr(r,kt,y?$:c.mount),N},$e=(y,O)=>{let k={...i.mount?s:o};return O&&(k=bh(O.dirtyFields?n.dirtyFields:n.touchedFields,k)),ge(y)?k:nt(y)?B(k,y):y.map(N=>B(k,N))},qn=y=>ge(y)?{...n.errors}:nt(y)?B(n.errors,y):y.map(O=>B(n.errors,O)),pt=(y,O)=>{const k=O||n,N=B(k.errors,y);return{invalid:!!N,isDirty:!!B(k.dirtyFields,y),error:N,isValidating:!!B(k.validatingFields,y),isTouched:!!B(k.touchedFields,y)}},Rn=y=>{const O=y?Ls(y):void 0;O?O.forEach(k=>{A(k),je(n.errors,k),n.errors={...n.errors},w.state.next({name:k,errors:n.errors})}):(Object.keys(u).forEach(T),n.errors={},w.state.next({errors:n.errors}))},sn=(y,O,k)=>{A(y);const N=(B(r,y,{_f:{}})._f||{}).ref,$=B(n.errors,y)||{},{ref:H,message:F,type:D,types:V,...Q}=$;we(n.errors,y,{...Q,...O,ref:N}),n.errors={...n.errors},w.state.next({name:y,errors:n.errors,isValid:!1}),k&&k.shouldFocus&&N&&N.focus&&N.focus()},Me=(y,O)=>{if(tt(y)){const k={};l.add(k);const{unsubscribe:N}=w.state.subscribe({next:$=>"values"in $&&y($.values||fe(void 0,O),$)});return{unsubscribe:()=>{l.delete(k),N()}}}return fe(y,O,!0)},Tr=y=>{const O={name:y.name,exact:y.exact};y.formState&&y.formState.values&&l.add(O);const{unsubscribe:k}=w.state.subscribe({next:N=>{if(rl(y.name,N.name,y.exact)&&Q0(N,y.formState||g,y.reRenderRoot)){const $=N.values||{...s};y.callback({...n,...N,values:$,defaultValues:o})}}});return()=>{l.delete(O),k()}},an=y=>{i.mount=!0;const O=Object.keys(y.formState||{}).filter(N=>y.formState&&y.formState[N]);for(const N of O)_[N]=(_[N]||0)+1;const k=Tr({...y,formState:{...v,...y.formState}});return()=>{for(const N of O.splice(0))_[N]--;k()}},Ir=(y,O={})=>{for(const k of y?Ls(y):c.mount)c.mount.delete(k),c.array.delete(k),c.disabled.delete(k),O.keepValue||(je(r,k),je(s,k)),O.keepError||(A(k),je(n.errors,k)),!O.keepDirty&&je(n.dirtyFields,k),!O.keepTouched&&je(n.touchedFields,k),!O.keepIsValidating&&je(n.validatingFields,k),!t.shouldUnregister&&!O.keepDefaultValue&&je(o,k);O.keepError||(n.errors={...n.errors}),l.size&&w.state.next({values:ke(s)}),w.state.next({...n,...O.keepDirty?{}:{isDirty:U()},...O.keepIsValidating?{}:{isValidating:!ze(n.validatingFields)}}),!O.keepIsValid&&j()},uo=({disabled:y,name:O})=>{if(yt(y)&&i.mount||y||c.disabled.has(O)){const $=c.disabled.has(O)!==!!y;y?c.disabled.add(O):c.disabled.delete(O),$&&i.mount&&!i.action&&j()}},cn=(y,O={})=>{let k=B(r,y);const N=yt(O.disabled)||yt(t.disabled),$=!c.registerName.has(y)&&k&&k._f&&!k._f.mount;if(we(r,y,{...k||{},_f:{...k&&k._f?k._f:{ref:{name:y}},name:y,mount:!0,...O}}),c.mount.add(y),k&&k._f){const H=B(r,y);for(const F of D0)F in O||delete H._f[F]}return k&&!$?uo({disabled:yt(O.disabled)?O.disabled:t.disabled,name:y}):re(y,!0,O.value),{...N?{disabled:O.disabled||t.disabled}:{},...t.progressive?{required:!!O.required,min:$r(O.min),max:$r(O.max),minLength:$r(O.minLength),maxLength:$r(O.maxLength),pattern:$r(O.pattern)}:{},name:y,onChange:Be,onBlur:Be,ref:H=>{if(H){c.registerName.add(y),cn(y,O),c.registerName.delete(y),k=B(r,y);const F=ge(H.value)&&H.querySelectorAll&&H.querySelectorAll("input,select,textarea")[0]||H,D=B0(F),V=k._f.refs||[];if(D?V.find(ae=>ae===F):F===k._f.ref)return;const Q={...k._f};D?(Q.refs=[...V.filter(Vs),F,...Array.isArray(B(o,y))?[{}]:[]],Q.ref={type:F.type,name:y}):(Q.ref=F,delete Q.refs),we(r,y,{_f:Q}),re(y,!1,void 0,F)}else k=B(r,y,{}),k._f&&(k._f.mount=!1),(t.shouldUnregister||O.shouldUnregister)&&!(fh(c.array,y)&&i.action)&&c.unMount.add(y)}}},Ar=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Zr(r,kt,c.mount),fo=y=>{yt(y)&&(w.state.next({disabled:y}),Zr(r,(O,k)=>{const N=B(r,k);N&&(O.disabled=N._f.disabled||y,Array.isArray(N._f.refs)&&N._f.refs.forEach($=>{$.disabled=N._f.disabled||y}))},0))},Qn=(y,O)=>async k=>{let N,$;k&&(k.preventDefault&&k.preventDefault(),k.persist&&k.persist());let H=ke(s);if(w.state.next({isSubmitting:!0}),t.resolver){const F=E,{errors:D,values:V}=await G();if(F!==E)return;L(),Object.keys(u).forEach(T),n.errors=D,H=ke(V)}else{const F=E;if(await oe({fields:r,eventType:mn.SUBMIT}),F!==E)return;je(n.errors,hh),n.errors={...n.errors}}if(c.disabled.size)for(const F of c.disabled)je(H,F);if(ze(n.errors)){w.state.next({errors:{}});try{N=await y(H,k)}catch(F){$=F}}else O&&await O({...n.errors},k),Ar(),setTimeout(Ar);if(w.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ze(n.errors)&&!$,submitCount:n.submitCount+1,errors:n.errors}),$)throw $;return N},ln=(y,O={})=>{B(r,y)&&(je(n.validatingFields,y),ge(O.defaultValue)?Ze(y,ke(B(o,y))):(Ze(y,O.defaultValue),we(o,y,ke(O.defaultValue))),O.keepTouched||je(n.touchedFields,y),O.keepDirty||(je(n.dirtyFields,y),n.isDirty=O.defaultValue?U(y,ke(B(o,y))):U()),O.keepError||(A(y),je(n.errors,y),n.errors={...n.errors},j()),w.state.next({...n,isValidating:!ze(n.validatingFields)}))},Nr=(y,O={})=>{E++;const k=y?ke(y):o,N=ke(k),$=ze(y),H=N,F=r;if(Object.keys(u).forEach(T),O.keepDefaultValues||(o=k),!O.keepValues){if(O.keepDirtyValues){const D=new Set([...c.mount,..._h(Gt(o,s,void 0,F),n.dirtyFields)]);for(const V of D){const Q=B(n.dirtyFields,V),ae=B(s,V),ye=B(H,V);Q&&!ge(ae)?we(H,V,ae):!Q&&!ge(ye)&&Ze(V,ye)}}else{if(gs&&ge(y))for(const D of c.mount){const V=B(r,D);if(V&&V._f){const Q=Array.isArray(V._f.refs)?V._f.refs[0]:V._f.ref;if(Qo(Q)){const ae=Q.closest("form");if(ae){ae.reset();break}}}}if(O.keepFieldsRef)for(const D of c.mount)Ze(D,B(H,D));else r={}}if(t.shouldUnregister){if(s=O.keepDefaultValues?ke(o):{},O.keepFieldsRef)for(const D of c.mount)we(s,D,B(H,D))}else s=ke(H);w.array.next({values:{...H}}),w.state.next({name:void 0,type:void 0,values:{...H}})}c={mount:O.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!g.isValid||!!O.keepIsValid||!!O.keepDirtyValues||!t.shouldUnregister&&!ze(H),i.watch=!!t.shouldUnregister,i.keepIsValid=!!O.keepIsValid,i.action=!1,i.actionArrayLengths.clear(),a=!1,O.keepErrors||(n.errors={}),w.state.next({submitCount:O.keepSubmitCount?n.submitCount:0,isDirty:$?!1:O.keepDirty?n.isDirty:O.keepValues?U():!!(O.keepDefaultValues&&y&&!it(y,o)),isSubmitted:O.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:$?{}:O.keepDirtyValues?O.keepDefaultValues&&s?Gt(o,s,void 0,F):n.dirtyFields:O.keepDefaultValues&&y?Gt(o,y,void 0,F):O.keepDirty?n.dirtyFields:O.keepValues?Gt(o,s,void 0,F):{},touchedFields:O.keepTouched?n.touchedFields:{},...!O.keepIsValidating&&(n.isValidating||!ze(n.validatingFields))?{validatingFields:{},isValidating:!1}:null,errors:O.keepErrors?n.errors:{},isSubmitSuccessful:O.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Wt=(y,O)=>Nr(tt(y)?y(s):y,{...t.resetOptions,...O}),xs=(y,O={})=>{const k=B(r,y),N=k&&k._f;if(N){const $=N.refs?N.refs[0]:N.ref;$.focus&&setTimeout(()=>{$.focus(),O.shouldSelect&&tt($.select)&&$.select()})}},Ss=y=>{const{name:O,type:k,values:N,...$}=y;Object.keys($).length&&(n={...n,...$})};w.state.subscribe({next:Ss});const wt={control:{register:cn,unregister:Ir,getFieldState:pt,handleSubmit:Qn,setError:sn,_subscribe:Tr,_runSchema:G,_updateIsValidating:L,_focusError:Ar,_getWatch:fe,_getDirty:U,_setValid:j,_setFieldArray:J,_setDisabledField:uo,_setErrors:K,_getFieldArray:Ee,_reset:Nr,_resetDefaultValues:()=>tt(t.defaultValues)&&t.defaultValues().then(y=>{Wt(y,t.resetOptions),w.state.next({isLoading:!1})}),_removeUnmounted:le,_disableForm:fo,_subjects:w,_proxyFormState:g,get _fields(){return r},get _formValues(){return s},get _state(){return i},set _state(y){i=y},get _defaultValues(){return o},get _names(){return c},set _names(y){c=y},get _formState(){return n},get _options(){return t},set _options(y){t={...t,...y},f=Co(t.mode),p=Co(t.reValidateMode),P=t.criteriaMode===Rt.all}},subscribe:an,trigger:ct,register:cn,handleSubmit:Qn,watch:Me,setValue:Ze,setValues:De,getValues:$e,getErrors:qn,reset:Wt,resetField:ln,resetDefaultValues:(y,O={})=>{if(o=ke(y),!O.keepDirty){const k=Gt(o,s,void 0,r);n.dirtyFields=k,n.isDirty=!ze(k)}O.keepIsValid||j(),w.state.next({...n,defaultValues:o})},clearErrors:Rn,unregister:Ir,setError:sn,setFocus:xs,getFieldState:pt};return{...wt,formControl:wt}}const ol={mode:Fo.mode,reValidateMode:Fo.reValidateMode,shouldFocusError:Fo.shouldFocusError,resolver:void 0,criteriaMode:void 0,delayError:void 0,shouldUnregister:void 0,shouldUseNativeValidation:void 0,context:void 0};function t_(e={}){const t=I.useRef(void 0),n=I.useRef(void 0),r=I.useRef(e.formControl),o=I.useRef(!!e.validate),[s,i]=I.useState(()=>({...ke(Ch),isLoading:tt(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:tt(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&r.current!==e.formControl)if(r.current=e.formControl,e.formControl)t.current={...e.formControl,formState:s},e.defaultValues&&!tt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:p,...v}=e_(e);t.current={...v,formState:s}}const a=t.current.control,c=a._options,u={};for(const p in ol)p in c&&!(p in e)&&(u[p]=ol[p]);a._options={...u,...e,validate:e.validate};const d=()=>({...a._formState,defaultValues:a._defaultValues}),{resyncIfNeeded:l,snapshot:f}=$a(d);return ja(()=>{l(!0,d,i);const p=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState,defaultValues:a._defaultValues}),reRenderRoot:!0});return i(v=>({...v,isReady:!0})),a._formState.isReady=!0,()=>{p(),f(!0,d)}},[a,l,f]),I.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),I.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),I.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),I.useEffect(()=>{o.current&&!e.validate&&t.current&&t.current.clearErrors(Lr),o.current=!!e.validate},[e.validate]),I.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),I.useEffect(()=>{if(a._proxyFormState.isDirty){const p=a._getDirty();p!==s.isDirty&&a._subjects.state.next({isDirty:p})}},[a,s.isDirty]),I.useEffect(()=>{e.values&&!it(e.values,n.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),a._options.resetOptions&&a._options.resetOptions.keepIsValid||a._setValid(),n.current=e.values,i(p=>({...p}))):a._resetDefaultValues()},[a,e.values]),I.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=I.useMemo(()=>mh(s,a),[a,s]),t.current}const sl=(e,t,n)=>{if(e&&"reportValidity"in e){const r=B(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Mi=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?sl(r.ref,n,e):r&&r.refs&&r.refs.forEach(o=>sl(o,n,e))}},il=(e,t)=>{t.shouldUseNativeValidation&&Mi(e,t);const n={};for(const r in e){const o=B(t.fields,r),s=Object.assign(e[r]||{},{ref:o&&o.refs?o.refs[0]:o&&o.ref});if(n_(t.names||Object.keys(e),r)){const i=Object.assign({},B(n,r));we(i,"root",s),we(n,r,i)}else we(n,r,s)}return n},n_=(e,t)=>{const n=al(t).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(r=>al(r).match(`^${n}\\.\\d+`))};function al(e){return e.replace(/\[(\d+)]/g,".$1").replace(/[[\]]/g,"")}function ji(){return ji=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ji.apply(null,arguments)}function cl(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function r_(e,t){for(var n=Object.create(null);e.length;){var r=e[0],o=r.code,s=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var a,c,u=r.unionErrors.reduce(function(f,p){return p.errors.length<f.errors.length?p:f}).errors[0];n[i]={message:(a=u==null?void 0:u.message)!=null?a:s,type:(c=u==null?void 0:u.code)!=null?c:o}}else n[i]={message:s,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(f){return f.errors.forEach(function(p){return e.push(p)})}),t){var d=n[i].types,l=d&&d[r.code];n[i]=za(i,t,n,o,l?[].concat(l,r.message):r.message)}e.shift()}return n}function o_(e,t){for(var n=Object.create(null),r=function(){var o=e[0],s=o.code,i=o.message,a=o.path.join(".");if(!n[a])if(o.code==="invalid_union"&&o.errors.length>0){var c,u,d=o.errors.reduce(function(p,v){return v.length<p.length?v:p})[0];n[a]={message:(c=d==null?void 0:d.message)!=null?c:i,type:(u=d==null?void 0:d.code)!=null?u:s}}else n[a]={message:i,type:s};if(o.code==="invalid_union"&&o.errors.forEach(function(p){return p.forEach(function(v){return e.push(ji({},v,{path:[].concat(o.path,v.path)}))})}),t){var l=n[a].types,f=l&&l[o.code];n[a]=za(a,t,n,s,f?[].concat(f,o.message):o.message)}e.shift()};e.length;)r();return n}function s_(e,t,n){if(n===void 0&&(n={}),(function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,o,s){try{return Promise.resolve(cl(function(){function i(c){return s.shouldUseNativeValidation&&Mi({},s),{errors:{},values:n.raw?Object.assign({},r):c}}var a=e;return n.mode==="sync"?i(a.parse(r,t)):Promise.resolve(a.parseAsync(r,t)).then(i)},function(i){if((function(a){var c;return!(a==null||(c=a._zod)==null||(c=c.traits)==null||!c.has("$ZodError"))})(i))return{values:{},errors:il(o_(i.issues,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};if((function(r){return"_def"in r&&typeof r._def=="object"})(e))return function(r,o,s){try{return Promise.resolve(cl(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(i){return s.shouldUseNativeValidation&&Mi({},s),{errors:{},values:n.raw?Object.assign({},r):i}})},function(i){if((function(a){return Array.isArray(a==null?void 0:a.issues)})(i))return{values:{},errors:il(r_(i.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};throw new Error("Invalid input: not a Zod schema")}function $i(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function ll(e,t="|"){return e.map(n=>Ih(n)).join(t)}function zi(e,t){return typeof t=="bigint"?t.toString():t}class i_{constructor(t){this._getter=t,this._value=void 0}get value(){const t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}}function Fa(e){return new i_(e)}function a_(e){return e==null}function La(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function c_(e,t){const n=e/t,r=Math.round(n),o=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}function Gn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function kh(e){const t=Object.getOwnPropertyDescriptor(e,"shape");return t!=null&&t.get?t.get.raw:t==null?void 0:t.value}function nn(e){return kh(e._zod.def)??e._zod.def.shape}function Oh(e,t,n){Object.defineProperty(e,t,{get(){const r=n();return Gn(this,t,r),r},enumerable:!0,configurable:!0})}function Ph(e,t,n){t in e?Gn(e,t,n):e[t]=n}function Zn(e,t,n,r){const o=nn(t);for(const s of n){const i=Object.getOwnPropertyDescriptor(o,s);i.enumerable&&(i.get?Oh(e,s,()=>{const a=t._zod.def.shape[s];return r?r(a,s):a}):Ph(e,s,r?r(i.value,s):i.value))}}function l_(e,t){for(const n of Reflect.ownKeys(t)){const r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Oh(e,n,()=>t[n]):Ph(e,n,r.value))}}function St(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function u_(e){return JSON.stringify(e)}function d_(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Rh="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Jo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const f_=Fa(()=>{var e;if(Bt.jitless||typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Yr(e){if(Jo(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Jo(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Th(e){return Yr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const h_=new Set(["string","number","symbol"]);function ys(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function On(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function ne(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Ih(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function p_(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}const Ah={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},m_={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function g_(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s={};return Zn(s,e,bs(e,t)),On(e,St(n,{shape:s,checks:[]}))}function bs(e,t){var o;const n=nn(e),r=[];for(const s of Reflect.ownKeys(t)){if(!((o=Object.getOwnPropertyDescriptor(n,s))!=null&&o.enumerable))throw new Error(`Unrecognized key: "${String(s)}"`);t[s]&&r.push(s)}return r}function v_(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=new Set(bs(e,t)),i={};return Zn(i,e,Reflect.ownKeys(nn(e)).filter(a=>!s.has(a))),On(e,St(n,{shape:i,checks:[]}))}function y_(e,t){if(!Yr(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=nn(e);for(const s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return On(e,St(e._zod.def,{shape:Nh(e,t)}))}function Nh(e,t){const n={};return Zn(n,e,Reflect.ownKeys(nn(e))),l_(n,t),n}function b_(e,t){if(!Yr(t))throw new Error("Invalid input to safeExtend: expected a plain object");return On(e,St(e._zod.def,{shape:Nh(e,t)}))}function w_(e,t){var o,s;if(!((o=t==null?void 0:t._zod)!=null&&o.def))throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if((s=e._zod.def.checks)!=null&&s.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n={};Zn(n,e,Reflect.ownKeys(nn(e))),Zn(n,t,Reflect.ownKeys(nn(t)));const r=St(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return On(e,r)}function ul(e,t,n,r="partial"){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);const a=n?new Set(bs(t,n)):void 0,c={};return Zn(c,t,Reflect.ownKeys(nn(t)),e&&((u,d)=>a&&!a.has(d)?u:new e({type:"optional",innerType:u}))),On(t,St(t._zod.def,{shape:c,checks:[]}))}function __(e,t,n){const r=n?new Set(bs(t,n)):void 0,o={};return Zn(o,t,Reflect.ownKeys(nn(t)),(s,i)=>r&&!r.has(i)?s:new e({type:"nonoptional",innerType:s})),On(t,St(t._zod.def,{shape:o}))}function Jt(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function x_(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)===!1)return!0;return!1}function Va(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function zr(e){return typeof e=="string"?e:e==null?void 0:e.message}function dl(e){const t=[];for(const n of e??[]){const r=n._zod.def;if(!/_(length|size)$|_equals$/.test(r.check))break;const o=r.maximum??r.length??r.size;o>=0&&t.push([o,n])}return t}function Fi(e,t,n){var r;for(let o=t;o<e.length;o++)(r=e[o]).schema??(r.schema=n)}function Or(e,t,n){var c,u,d,l,f,p,v,g,_,b;var r;const o=(u=(c=e.inst)==null?void 0:c._zod)==null?void 0:u.traits;o!=null&&o.has("$ZodType")&&(o.has("$ZodCheck")?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);const s=e.schema!==e.inst?(l=(d=e.schema)==null?void 0:d._zod.def)==null?void 0:l.error:void 0,i=e.message?e.message:zr((v=(p=(f=e.inst)==null?void 0:f._zod.def)==null?void 0:p.error)==null?void 0:v.call(p,e))??zr(s==null?void 0:s(e))??zr((g=t==null?void 0:t.error)==null?void 0:g.call(t,e))??zr((_=n.customError)==null?void 0:_.call(n,e))??zr((b=n.localeError)==null?void 0:b.call(n,e))??"Invalid input",a={};for(const x of Object.keys(e))x==="inst"||x==="schema"||x==="continue"||x==="input"||x==="__proto__"||(a[x]=e[x]);return a.path??(a.path=[]),a.message=i,t!=null&&t.reportInput&&(a.input=e.input),a}const S_=/[\uD800-\uDBFF]/;function Ua(e){const t=e.length;if(!S_.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)===55296&&(e.charCodeAt(r+1)&64512)===56320&&(n--,r++);return n}function Za(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function E_(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";const n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function Jr(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function C_(e,t){for(const n in t){const r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):k_(e,n,r.value)}}function kn(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Ba(e,t,n){return kn(e,t,n,!1)}function Dh(e,t){for(const n in e){const r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return kn(this,n,r(this))},set(o){kn(this,n,o)}})}return t}function k_(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:kn(this,t,n.bind(this))},set(r){kn(this,t,r)}})}function O_(e,t){const n=Object.getPrototypeOf(e);return t in n?void 0:n}let Us,pn=!1;const P_={configurable:!0,get(){pn=!0}};function Se(e,t,n){const r=Object.getPrototypeOf(e._zod);if(t in r&&Us!==e._zod){Us=void 0;return}Us=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,P_);const o=pn;pn=!1;try{const s=n(this);return pn?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),pn=pn||o,s}catch(s){throw delete this[t],pn=pn||o,s}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function R_(e,t,n,r){const o=O_(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){const s={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,s),s.value=n(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:s})}})}const T_="~constantCatch";function I_(e){const t=()=>e;return t[T_]=!0,t}var fl;const Zs={value:void 0,enumerable:!1};let hl="captureStackTrace"in Error?Error:null;function A_(e){const t=hl;if(t){const n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return hl=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function M(e,t,n,r){const o={};function s(f){this.def=f,this.constr=l,this.traits=new Set}s.prototype=o;const i=n,a=i&&new WeakSet;function c(f,p){if(f._zod){if(f._zod.traits.has(e))return}else{Zs.value=new s(p);try{Object.defineProperty(f,"_zod",Zs)}finally{Zs.value=void 0}}if(f._zod.traits.add(e),t(f,p),a){const g=Object.getPrototypeOf(f),_=f._zod.constr.prototype;let b=g;for(;b&&b!==_;)b=Object.getPrototypeOf(b);const x=b??g;a.has(x)||(a.add(x),C_(x,i))}const v=l.prototype;for(const g in v)Object.prototype.hasOwnProperty.call(v,g)&&(g in f||(f[g]=v[g].bind(f)))}const u=(r==null?void 0:r.Parent)??Object;class d extends u{}Object.defineProperty(d,"name",{value:e});function l(f){var _;const p=r!=null&&r.Parent?A_(d):this;c(p,f);const v=p._zod.deferred;if(v){for(const b of v)b();p._zod.deferred=void 0}const g=(_=globalThis.__zod_globalConfig)==null?void 0:_.postProcessor;return g&&g(p),p}return Object.defineProperty(l,"init",{value:c}),Object.defineProperty(l,Symbol.hasInstance,{value:f=>{var p,v;return r!=null&&r.Parent&&f instanceof r.Parent?!0:(v=(p=f==null?void 0:f._zod)==null?void 0:p.traits)==null?void 0:v.has(e)}}),Object.defineProperty(l,"name",{value:e}),l}class Vn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Mh extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(fl=globalThis).__zod_globalConfig??(fl.__zod_globalConfig={});const Bt=globalThis.__zod_globalConfig;function Pn(e){return e&&Object.assign(Bt,e),Bt}function N_(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,zi,2)),e.message}function D_(e){this._zod.message=e}const M_={get:N_,set:D_,enumerable:!0,configurable:!0},Bs={value:void 0,enumerable:!1},pl=new WeakSet([Object.prototype,Error.prototype]),j_=(e,t)=>{e.name="$ZodError",Bs.value=t,Object.defineProperty(e,"issues",Bs),Bs.value=void 0,Object.defineProperty(e,"message",M_);const n=Object.getPrototypeOf(e);pl.has(n)||(pl.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){const r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))},$_=M("$ZodError",j_);function z_(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function F_(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?z_(n,o.path[0],()=>[]).push(t(o)):r.push(t(o));return{formErrors:r,fieldErrors:n}}function L_(e,t=n=>n.message){const n={_errors:[]},r=(o,s=[])=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>r({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")r({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")r({issues:i.issues},[...s,...i.path]);else{const a=[...s,...i.path];if(a.length===0)n._errors.push(t(i));else{let c=n,u=0;for(;u<a.length;){const d=a[u],l=u===a.length-1;if(d==="_errors"){l&&c._errors.push(t(i)),u++;continue}Object.prototype.hasOwnProperty.call(c,d)||Object.defineProperty(c,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const f=c[d];l&&f._errors.push(t(i)),c=f,u++}}}};return r(e),n}function ws(e,t){return{callee:(t==null?void 0:t.callee)??e,Err:t==null?void 0:t.Err}}const Wa=e=>{const t=(n,r,o,s)=>{const i=o?{...o,async:!1}:{async:!1},a=n._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Vn;if(a.issues.length){const c=new((s==null?void 0:s.Err)??e)(a.issues.map(u=>Or(u,i,Pn())));throw Rh(c,(s==null?void 0:s.callee)??t),c}return a.value};return t},Ha=e=>{const t=async(n,r,o,s)=>{const i=o?{...o,async:!0}:{async:!0};let a=n._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){const c=new((s==null?void 0:s.Err)??e)(a.issues.map(u=>Or(u,i,Pn())));throw Rh(c,(s==null?void 0:s.callee)??t),c}return a.value};return t},Ka=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new Vn;return s.issues.length?jh(e,s.issues,o):{success:!0,data:s.value}};function jh(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(o=>Or(o,n,Pn()))),t=void 0,n=void 0),r},set error(o){r=o,t=void 0,n=void 0}}}const Ga=e=>async(t,n,r)=>{const o=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?jh(e,s.issues,o):{success:!0,data:s.value}},V_=Symbol.for("zod.compile.invalid"),U_=Symbol.for("zod.compile.fallback"),Z_=((e,t,n)=>{const r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==V_)return!0;if(r.definite===!0&&n===void 0)return!1}return B_(e,t,n)});function B_(e,t,n){const r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun;let s;if(o?(r[U_]=!0,s=o({value:t,issues:[]},r)):s=e._zod.run({value:t,issues:[]},r),s instanceof Promise)throw new Vn;return s.issues.length===0}const W_=async(e,t,n)=>{const r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let o=e._zod.run({value:t,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length===0},H_=e=>{const t=Wa(e),n=(r,o,s,i)=>{const a=s?{...s,direction:"backward"}:{direction:"backward"};return t(r,o,a,ws(n,i))};return n},K_=e=>{const t=Wa(e),n=(r,o,s,i)=>t(r,o,s,ws(n,i));return n},G_=e=>{const t=Ha(e),n=async(r,o,s,i)=>{const a=s?{...s,direction:"backward"}:{direction:"backward"};return await t(r,o,a,ws(n,i))};return n},q_=e=>{const t=Ha(e),n=async(r,o,s,i)=>await t(r,o,s,ws(n,i));return n},Q_=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Ka(e)(t,n,o)},Y_=e=>(t,n,r)=>Ka(e)(t,n,r),J_=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Ga(e)(t,n,o)},X_=e=>async(t,n,r)=>Ga(e)(t,n,r),ex=/^[cC][0-9a-z]{6,}$/,tx=/^[0-9a-z]+$/,nx=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,rx=/^[0-9a-vA-V]{20}$/,ox=/^[A-Za-z0-9]{27}$/,sx=/^[a-zA-Z0-9_-]{21}$/;function ix(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const ax=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,cx=/^([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})$/,ml=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([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)$/,lx=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ux="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function dx(){return new RegExp(ux,"u")}const fx=/^(?:(?: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])$/,hx=/^(([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}|:))$/,px=/^((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])$/,mx=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gx=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,vx=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,yx=/^https?$/,bx=/^\+[1-9]\d{6,14}$/,$h="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function wx(e){return new RegExp(`^${e}$`)}const _x=wx($h);function Li(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function xx(e){return new RegExp(`^${Li(e)}$`)}function Sx(e){const t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${Li({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${Li({precision:e.precision})}`:n;return new RegExp(`^${$h}T(?:${r})$`)}const Ex=/^[\s\S]{0,}$/,Cx=/^-?\d+(?:\.\d+)?$/,kx=/^(?:true|false)$/i,Ox=/^[^A-Z]*$/,Px=/^[^a-z]*$/,ht=M("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),qa=e=>{const t=e.value;return!a_(t)&&t.length!==void 0},Xo={number:"number",bigint:"bigint",object:"date"},zh=M("$ZodCheckLessThan",(e,t)=>{ht.init(e,t);const n=Xo[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Xo[typeof r.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fh=M("$ZodCheckGreaterThan",(e,t)=>{ht.init(e,t);const n=Xo[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Xo[typeof r.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Rx=M("$ZodCheckMultipleOf",(e,t)=>{ht.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):c_(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Tx=M("$ZodCheckNumberFormat",(e,t)=>{var i;ht.init(e,t),t.format=t.format||"float64";const n=(i=t.format)==null?void 0:i.includes("int"),r=n?"int":"number",[o,s]=Ah[t.format];e._zod.check=a=>{const c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<o&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>s&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),Ix=M("$ZodCheckMaxLength",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=qa),e._zod.check=r=>{const o=r.value,s=o.length;if((typeof o=="string"&&s>t.maximum?Ua(o):s)<=t.maximum)return;const a=Za(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Ax=M("$ZodCheckMinLength",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=qa),e._zod.check=r=>{const o=r.value,s=o.length;if((typeof o=="string"&&s>=t.minimum&&s<t.minimum*2?Ua(o):s)>=t.minimum)return;const a=Za(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Nx=M("$ZodCheckLengthEquals",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=qa),e._zod.check=r=>{const o=r.value,s=o.length,i=typeof o=="string"&&s>=t.length&&s<=t.length*2?Ua(o):s;if(i===t.length)return;const a=Za(o),c=i>t.length;r.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),_s=M("$ZodCheckStringFormat",(e,t)=>{var n,r;ht.init(e,t),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Dx=M("$ZodCheckRegex",(e,t)=>{_s.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Mx=M("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ox),_s.init(e,t)}),jx=M("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Px),_s.init(e,t)}),$x=M("$ZodCheckIncludes",(e,t)=>{ht.init(e,t);const n=ys(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),zx=M("$ZodCheckStartsWith",(e,t)=>{ht.init(e,t);const n=new RegExp(`^${ys(t.prefix)}.*`);t.pattern??(t.pattern=n),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})}}),Fx=M("$ZodCheckEndsWith",(e,t)=>{ht.init(e,t);const n=new RegExp(`.*${ys(t.suffix)}$`);t.pattern??(t.pattern=n),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})}});function gl(e,t,n){e.issues.length&&t.issues.push(...Va(n,e.issues))}const Lx=M("$ZodCheckProperties",(e,t)=>{ht.init(e,t),Ba(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:"object",code:"invalid_type",input:r.value,inst:e});return}n??(n=Reflect.ownKeys(t.shape).map(i=>[i,t.shape[i]]));const o=r.value;let s;for(const[i,a]of n){const c=a._zod.run({value:o[i],issues:[]},{});c instanceof Promise?(s??(s=[]),s.push(c.then(u=>gl(u,r,i)))):gl(c,r,i)}if(s)return Promise.all(s).then(()=>{})}}),Vx=M("$ZodCheckOverwrite",(e,t)=>{ht.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Ux{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
168
+ `).filter(i=>i),o=Math.min(...r.map(i=>i.length-i.trimStart().length)),s=r.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(const i of s)this.content.push(i)}compile(){const t=Function,n=(this==null?void 0:this.content)??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
169
+ ${n.join(`
170
+ `)}
171
+ };`)(...Object.values(this.closed))}}const Zx={major:4,minor:6,patch:7},Ve=M("$ZodType",(e,t)=>{var s;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Zx;const r=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r!=null&&r.length?[...r]:[];for(const i of o)for(const a of i._zod.onattach)a(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),(s=e._zod.deferred)==null||s.push(()=>{e._zod.run=e._zod.parse});else{const i=(c,u,d)=>{if(c.memo)return c;let l=Jt(c),f;for(const p of u){if(p._zod.def.when){if(x_(c)||!p._zod.def.when(c))continue}else if(l)continue;const v=c.issues.length,g=p._zod.check(c);if(g instanceof Promise&&(d==null?void 0:d.async)===!1)throw new Vn;if(f||g instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await g,c.issues.length!==v&&(Fi(c.issues,v,e),l||(l=Jt(c,v)))});else{if(c.issues.length===v)continue;Fi(c.issues,v,e),l||(l=Jt(c,v))}}return f?f.then(()=>c):c},a=(c,u,d)=>{if(Jt(c))return c.aborted=!0,c;const l=i(u,o,d);if(l instanceof Promise){if(d.async===!1)throw new Vn;return l.then(f=>e._zod.parse(f,d))}return e._zod.parse(l,d)};e._zod.run=(c,u)=>{if(u.skipChecks)return e._zod.parse(c,u);if(u.direction==="backward"){const l=e._zod.parse({value:c.value,issues:[]},{...u,skipChecks:!0});return l instanceof Promise?l.then(f=>a(f,c,u)):a(l,c,u)}const d=e._zod.parse(c,u);if(d instanceof Promise){if(u.async===!1)throw new Vn;return d.then(l=>i(l,o,u))}return i(d,o,u)}}},{get"~standard"(){return Ba(this,"~standard",Vh(this))},set"~standard"(e){kn(this,"~standard",e)}}),Lh=(e,t)=>e.issues.length?{issues:e.issues.map(n=>Or(n,t,Pn()))}:{value:e.value};async function Bx(e,t){const n={async:!0};return Lh(await e._zod.run({value:t,issues:[]},n),n)}function Vh(e){return{validate:t=>{const n={async:!1};try{const r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Lh(r,n)}catch{}return Bx(e,t)},vendor:"zod",version:1}}const Qa=M("$ZodString",(e,t)=>{Ve.init(e,t),e._zod.pattern=t.pattern??Ex,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ie=M("$ZodStringFormat",(e,t)=>{_s.init(e,t),Qa.init(e,t)}),Wx=M("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=cx),Ie.init(e,t)}),Hx=M("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ml(r))}else t.pattern??(t.pattern=ml());Ie.init(e,t)}),Kx=M("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=lx),Ie.init(e,t)}),Uh=1,es=2;function Zh(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Gx(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?Zh(e)||es:qx(e,t)}function qx(e,t){var n;if(!t.normalize&&((n=t.protocol)==null?void 0:n.source)===yx.source&&!/^https?:\/\//i.test(e))return Uh;try{if(typeof URL<"u"){const r=URL;if(typeof r.parse=="function")return r.parse(e)??es}return new URL(e)}catch{return es}}const Qx=/[\t\n\r]/g;function vl(e){return e.replace(Qx,"")}function Yx(e,t){return t.lastIndex=0,t.test(e.hostname)}function Jx(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}const Xx=M("$ZodURL",(e,t)=>{Ie.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=Gx(r,t);if(o===Uh){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(o===es){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}if(o===!0){n.value=vl(r);return}t.hostname&&!Yx(o,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Jx(o,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?o.href:vl(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),e1=M("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=dx()),Ie.init(e,t)}),t1=M("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?sx:ix(t.length)),Ie.init(e,t)}),n1=M("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ex),Ie.init(e,t)}),r1=M("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=tx),Ie.init(e,t)}),o1=M("$ZodULID",(e,t)=>{t.pattern??(t.pattern=nx),Ie.init(e,t)}),s1=M("$ZodXID",(e,t)=>{t.pattern??(t.pattern=rx),Ie.init(e,t)}),i1=M("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ox),Ie.init(e,t)}),a1=M("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Sx(t)),Ie.init(e,t)}),c1=M("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=_x),Ie.init(e,t)}),l1=M("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=xx(t)),Ie.init(e,t)}),u1=M("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ax),Ie.init(e,t)}),d1=M("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=fx),Ie.init(e,t)}),f1=/^[0-9a-fA-F:.]+$/;function Bh(e){return f1.test(e)?Zh(`http://[${e}]`):!1}const h1=M("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=hx),Ie.init(e,t),e._zod.check=n=>{Bh(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),p1=M("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=px),Ie.init(e,t)});function m1(e){const t=e.split("/");if(t.length!==2)return!1;const[n,r]=t;if(!r)return!1;const o=Number(r);return`${o}`!==r||o<0||o>128?!1:Bh(n)}const g1=M("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=mx),Ie.init(e,t),e._zod.check=n=>{m1(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function Wh(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Hh=/^[0-9a-zA-Z+/]*={0,2}$/,v1=M("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Hh),Ie.init(e,t),e._zod.check=n=>{Wh(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),Ya=/^[A-Za-z0-9_-]*$/;function y1(e){if(!Ya.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Wh(n)}const b1=M("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ya),Ie.init(e,t),e._zod.check=n=>{y1(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),w1=M("$ZodE164",(e,t)=>{t.pattern??(t.pattern=bx),Ie.init(e,t)});function _1(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const x1=M("$ZodJWT",(e,t)=>{Ie.init(e,t),e._zod.check=n=>{_1(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Kh=M("$ZodNumber",(e,t)=>{Ve.init(e,t),e._zod.pattern=Cx,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),S1=M("$ZodNumberFormat",(e,t)=>{Tx.init(e,t),Kh.init(e,t)}),E1=M("$ZodBoolean",(e,t)=>{Ve.init(e,t),e._zod.pattern=kx,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),C1=M("$ZodUnknown",(e,t)=>{Ve.init(e,t),e._zod.parse=n=>n}),k1=M("$ZodNever",(e,t)=>{Ve.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function O1(e,t){const n=dl(e._zod.def.checks);if(!n.length)return;const r=Math.min(...n.map(s=>s[0])),o=e._zod.parse;e._zod.parse=(s,i)=>{const a=t(s.value);if(a>r&&!(i!=null&&i.skipChecks)&&(i==null?void 0:i.direction)!=="backward"){for(const[c,u]of dl(e._zod.def.checks))if(a>c&&u._zod.def.when(s)){const d=s.issues.length;return u._zod.check(s),s.issues[d].continue=!1,Fi(s.issues,d,e),s}}return o(s,i)}}const P1=e=>Array.isArray(e)?e.length:-1;function yl(e,t,n){e.issues.length&&t.issues.push(...Va(n,e.issues)),t.value[n]=e.value}const R1=M("$ZodArray",(e,t)=>{Ve.init(e,t);const n=Bt.memoizer;n==null||n.attach(e),e._zod.parse=(r,o)=>{const s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=n?n.alloc(e,r,Array(s.length),o):Array(s.length);const i=[],a=o==null?void 0:o.abortEarly;for(let c=0;c<s.length;c++){const u=s[c],d=t.element._zod.run({value:u,issues:[]},o);if(d instanceof Promise)i.push(d.then(l=>yl(l,r,c)));else if(yl(d,r,c),a&&d.issues.length!==0&&Jt(d))break}return i.length?Promise.all(i).then(()=>r):r},O1(e,P1)});function ts(e,t,n,r,o,s){const i=n in r,a=s==="optional";if(!(!i&&a&&o==="optional")){if(e.issues.length){if(o!==void 0&&a&&!i)return;t.issues.push(...Va(n,e.issues))}if(!i&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(i||o==="defaulted"&&!a)&&(t.value[n]=void 0):t.value[n]=e.value}}const T1=[];function Gh(e){var i,a,c,u;const t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:T1,o=r.length?[...t,...r]:t;for(const d of o)if(!((u=(c=(a=(i=e.shape)==null?void 0:i[d])==null?void 0:a._zod)==null?void 0:c.traits)!=null&&u.has("$ZodType")))throw new Error(`Invalid element at key "${String(d)}": expected a Zod schema`);const s=p_(e.shape);return{...e,allKeys:o,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function qh(e,t,n,r,o,s,i){const a=[],c=o.keySet,u=o.catchall._zod,d=u.def.type,l=u.optin,f=u.optout;let p=0;for(const v in t){if(i&&n.issues.length!==p){if(Jt(n,p))break;p=n.issues.length}if(c.has(v))continue;if(v==="__proto__"){d==="never"&&a.push(v);continue}if(d==="never"){a.push(v);continue}const g=u.run({value:t[v],issues:[]},r);g instanceof Promise?e.push(g.then(_=>ts(_,n,v,t,l,f))):ts(g,n,v,t,l,f)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const I1=M("$ZodObject",(e,t)=>{Ve.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape"),r=n!=null&&n.get?n.get.raw:t.shape??{};if(r){const u=()=>{const d={...r};return Object.defineProperty(t,"shape",{value:d}),u.raw=d,d};u.raw=r,Object.defineProperty(t,"shape",{get:u})}const o=Fa(()=>Gh(t));Se(e,"propValues",u=>{const d=u.def.shape,l={};for(const f in d){const p=d[f]._zod;if(p.values){Object.prototype.hasOwnProperty.call(l,f)||Gn(l,f,new Set);for(const v of p.values)l[f].add(v);p.optin!==void 0&&l[f].add(void 0)}}return l});const s=Jo,i=t.catchall;let a;const c=Bt.memoizer;c==null||c.attach(e),e._zod.parse=(u,d)=>{a??(a=o.value);const l=u.value;if(!s(l))return u.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),u;u.value=c?c.alloc(e,u,{},d):{};const f=[],p=a.shape,v=d==null?void 0:d.abortEarly;let g=u.issues.length;for(const _ of a.allKeys){if(v&&u.issues.length!==g){if(Jt(u,g))break;g=u.issues.length}if(_==="__proto__")continue;const b=p[_],x=b._zod.optin,w=b._zod.optout,C=b._zod.run({value:l[_],issues:[]},d);C instanceof Promise?f.push(C.then(E=>ts(E,u,_,l,x,w))):ts(C,u,_,l,x,w)}return i?qh(f,l,u,d,o.value,e,v===!0):f.length?Promise.all(f).then(()=>u):u}}),A1=M("$ZodObjectJIT",(e,t)=>{I1.init(e,t);const n=e._zod.parse,r=Fa(()=>Gh(t)),o=Bt.memoizer,s=p=>{var E,P;const v=r.value,g=v.symbolKeys,_=new Ux(["payload","ctx"],{shape:p,inst:e,memo:o,syms:g}),b=R=>`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`,x=(R,T)=>`
172
+ let ${R}_ab = false;
173
+ for (let i = 0; i < ${R}.issues.length; i++) {
174
+ const iss = ${R}.issues[i];
175
+ iss.path = iss.path ? [${T}, ...iss.path] : [${T}];
176
+ payload.issues.push(iss);
177
+ if (iss.continue !== true) ${R}_ab = true;
178
+ }
179
+ if (${R}_ab && ctx && ctx.abortEarly) {
180
+ payload.value = newResult;
181
+ return payload;
182
+ }`;_.write("const input = payload.value;");const w=Object.create(null);let C=0;for(const R of v.allKeys)w[R]=`key_${C++}`;_.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const R of v.allKeys){if(R==="__proto__")continue;const T=w[R],A=typeof R=="symbol"?`syms[${g.indexOf(R)}]`:u_(R),j=`${A} in input`,L=p[R],z=(E=L==null?void 0:L._zod)==null?void 0:E.optin,J=z!==void 0,W=((P=L==null?void 0:L._zod)==null?void 0:P.optout)==="optional";if(_.write(`const ${T} = ${b(A)};`),J&&W){const K=z==="optional"?`${T}_present`:`${T}.value !== undefined || ${T}_present`;_.write(`
183
+ const ${T}_present = ${j};
184
+ if (!${T}.issues.length || ${T}_present) {
185
+ if (${T}.issues.length) {${x(T,A)}
186
+ }
187
+
188
+ if (${K}) {
189
+ newResult[${A}] = ${T}.value;
190
+ }
191
+ }
192
+
193
+ `)}else J?(_.write(`
194
+ if (${T}.issues.length) {${x(T,A)}
195
+ }
196
+ `),z==="defaulted"?_.write(`newResult[${A}] = ${T}.value;`):_.write(`
197
+ if (${T}.value !== undefined || ${j}) {
198
+ newResult[${A}] = ${T}.value;
199
+ }
200
+ `)):_.write(`
201
+ const ${T}_present = ${j};
202
+ if (${T}.issues.length) {${x(T,A)}
203
+ }
204
+ if (!${T}_present && !${T}.issues.length) {
205
+ payload.issues.push({
206
+ code: "invalid_type",
207
+ expected: "nonoptional",
208
+ input: undefined,
209
+ path: [${A}]
210
+ });
211
+ if (ctx && ctx.abortEarly) {
212
+ payload.value = newResult;
213
+ return payload;
214
+ }
215
+ }
216
+
217
+ if (${T}_present) {
218
+ newResult[${A}] = ${T}.value;
219
+ }
220
+
221
+ `)}return _.write("payload.value = newResult;"),_.write("return payload;"),_.compile()};let i;const a=Jo,c=!Bt.jitless,d=c&&f_.value,l=t.catchall;let f;e._zod.parse=(p,v)=>{f??(f=r.value);const g=p.value;return a(g)?c&&d&&(v==null?void 0:v.async)===!1&&v.jitless!==!0?(i||(i=s(t.shape)),p=i(p,v),l?qh([],g,p,v,f,e,(v==null?void 0:v.abortEarly)===!0):p):n(p,v):(p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p)}});function bl(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Jt(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(i=>Or(i,r,Pn())))}),t)}const N1=M("$ZodUnion",(e,t)=>{Ve.init(e,t),Se(e,"optin",r=>r.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":r.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),Se(e,"optout",r=>r.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Se(e,"values",r=>{if(r.def.options.every(o=>o._zod.values))return new Set(r.def.options.flatMap(o=>Array.from(o._zod.values)))}),Se(e,"pattern",r=>{if(r.def.options.every(o=>o._zod.pattern)){const o=r.def.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>La(s.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let s=!1;const i=[];for(const a of t.options){const c=a._zod.run({value:r.value,issues:[]},o);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}return s?Promise.all(i).then(a=>bl(a,r,e,o)):bl(i,r,e,o)}}),D1=M("$ZodIntersection",(e,t)=>{Ve.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>wl(n,c,u)):wl(n,s,i)}});function Vi(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Yr(e)&&Yr(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(const s of r){if(s==="__proto__")continue;const i=Vi(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r],i=Vi(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function wl(e,t,n){const r=new Map;let o;const s=new Map,i=(u,d)=>{var f,p;let l;if(u.code==="unrecognized_keys"&&!((f=u.path)!=null&&f.length))o??(o=u),l=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&((p=u.path)==null?void 0:p.length)===1){const v=String(u.path[0]);s.has(v)||s.set(v,u),l=[v]}else return!1;for(const v of l)r.has(v)||r.set(v,{}),r.get(v)[d]=!0;return!0};for(const u of t.issues)i(u,"l")||e.issues.push(u);for(const u of n.issues)i(u,"r")||e.issues.push(u);const a=[...r].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){const u=o?a.filter(d=>o.keys.includes(d)):[];u.length&&e.issues.push({...o,keys:u});for(const d of a)!u.includes(d)&&s.has(d)&&e.issues.push(s.get(d))}const c=Vi(t.value,n.value);if(!c.valid){if(Jt(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const M1=M("$ZodEnum",(e,t)=>{Ve.init(e,t);const n=$i(t.entries),r=new Set(n);e._zod.values=r,Se(e,"pattern",o=>{const s=$i(o.def.entries).filter(i=>h_.has(typeof i));return new RegExp(s.length?`^(${s.map(i=>ys(i.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,s)=>{const i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:n,input:i,inst:e}),o}}),j1=M("$ZodTransform",(e,t)=>{var n;Ve.init(e,t),e._zod.optin="optional",(n=Bt.memoizer)==null||n.guard(e),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Mh(e.constructor.name);const s=t.transform(r.value,r);if(o.async)return(s instanceof Promise?s:Promise.resolve(s)).then(a=>(r.value=a,r));if(s instanceof Promise)throw new Vn;return r.value=s,r}});function _l(e,t){return e.value=t.issues.length?void 0:t.value,e}const Qh=M("$ZodOptional",(e,t)=>{Ve.init(e,t),Se(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Se(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),Se(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${La(r.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;const o=t.innerType._zod.run({value:n.value,issues:[]},r);return o instanceof Promise?o.then(s=>_l(n,s)):_l(n,o)}return t.innerType._zod.run(n,r)}}),$1=M("$ZodExactOptional",(e,t)=>{Qh.init(e,t),Se(e,"values",n=>n.def.innerType._zod.values),Se(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),z1=M("$ZodNullable",(e,t)=>{Ve.init(e,t),Se(e,"optin",n=>n.def.innerType._zod.optin),Se(e,"optout",n=>n.def.innerType._zod.optout),Se(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${La(r.source)}|null)$`):void 0}),Se(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),F1=M("$ZodDefault",(e,t)=>{Ve.init(e,t),e._zod.optin="defaulted",Se(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>xl(s,t)):xl(o,t)}});function xl(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const L1=M("$ZodPrefault",(e,t)=>{Ve.init(e,t),e._zod.optin="defaulted",Se(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),V1=M("$ZodNonOptional",(e,t)=>{Ve.init(e,t),Se(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>Sl(s,e)):Sl(o,e)}});function Sl(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function El(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>Or(o,r,Pn()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const U1=M("$ZodCatch",(e,t)=>{Ve.init(e,t),Se(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Se(e,"optout",n=>n.def.innerType._zod.optout),Se(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run({value:n.value,issues:[]},r);return o instanceof Promise?o.then(s=>El(n,s,t,r)):El(n,o,t,r)}}),Z1=M("$ZodPipe",(e,t)=>{Ve.init(e,t),Se(e,"values",n=>n.def.in._zod.values),Se(e,"optin",n=>n.def.in._zod.optin),Se(e,"optout",n=>n.def.out._zod.optout),Se(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(i=>ko(i,t.in,r)):ko(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>ko(s,t.out,r)):ko(o,t.out,r)}});function ko(e,t,n){return e.issues.some(r=>r.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const B1=M("$ZodReadonly",(e,t)=>{Ve.init(e,t),Se(e,"propValues",n=>n.def.innerType._zod.propValues),Se(e,"values",n=>n.def.innerType._zod.values),Se(e,"optin",n=>{var r,o;return(o=(r=n.def.innerType)==null?void 0:r._zod)==null?void 0:o.optin}),Se(e,"optout",n=>{var r,o;return(o=(r=n.def.innerType)==null?void 0:r._zod)==null?void 0:o.optout}),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(Cl):Cl(o)}});function Cl(e){return e.memo||(e.value=Object.freeze(e.value)),e}const W1=M("$ZodCustom",(e,t)=>{ht.init(e,t),Ve.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>kl(s,n,r,e));kl(o,n,r,e)}});function kl(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Jr(o))}}class H1 extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const Ui="~memo",Ol=[];function Yh(e){return e!==null&&typeof e=="object"}function Ws(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}const Jh=new WeakMap,Vr=0,Lo=1,Br=2;function Vo(e,t,n){const r=Jh.get(e);if(r!==void 0)return r?Br:Vr;if(t.has(e))return Br;t.add(e);let o=Vr;const s=d=>{if(o!==Br&&(d!=null&&d._zod)){const l=Vo(d,t);l>o&&(o=l)}},i=(d,l)=>{var p;let f=Vr;for(const v of Reflect.ownKeys(d)){const g=Object.getOwnPropertyDescriptor(d,v);if(!g.enumerable)continue;const _=g.get?Lo:(p=g.value)!=null&&p._zod?Vo(g.value,t):Vr;_>f&&(f=_)}return f},a=d=>{d>o&&(o=d)},c=e._zod.def;switch(c.type){case"object":{const d=kh(c);a(d?i(d):Lo),s(c.catchall);break}case"array":s(c.element);break;case"tuple":for(const d of c.items)s(d);s(c.rest);break;case"record":case"map":s(c.keyType),s(c.valueType);break;case"set":s(c.valueType);break;case"union":for(const d of c.options)s(d);break;case"intersection":s(c.left),s(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(c.innerType);break;case"pipe":s(c.in),s(c.out);break;case"function":s(c.input),s(c.output);break;case"lazy":{const d=c._cachedInner??void 0;a(d?Vo(d,t):Lo);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const d in c){const l=Object.getOwnPropertyDescriptor(c,d);if(!l||l.get)continue;const f=l.value;if(!(!f||typeof f!="object")){if(f._zod)s(f);else if(Array.isArray(f))for(const p of f)s(p)}}}return t.delete(e),K1(e,o)}function K1(e,t){return t!==Lo&&Jh.set(e,t===Br),t}function G1(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}let Oo;const Po=[],q1={alloc(e,t,n){const r=Oo;if(!r)return n;Oo=void 0;const o={value:n,issues:null};return r.set(t.value,o),Po.push(o),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const n=e._zod.parse,r=(o,s)=>{if(s.direction!=="backward"&&Y1(s,o.value))throw new H1;return n(o,s)};e._zod.parse=r,e._zod.run===n&&(e._zod.run=r)})},attach(e){var t;let n,r=!1,o,s;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const i=e._zod.parse,a=(c,u)=>{if(n===void 0){const b=Vo(e,new Set);if(b===Vr)return e._zod.parse=i,e._zod.run===a&&(e._zod.run=i),i(c,u);b===Br||r?n=!0:r=!0}const d=c.value;if(!Yh(d))return i(c,u);let l=u[Ui];l||(l={buckets:new WeakMap,backEdges:void 0},u[Ui]=l);let f;o===u?f=s:(f=G1(l,e),o=u,s=f);const p=f.get(d);if(p)return c.value=p.value,p.issues?p.issues.length&&c.issues.push(...Ws(p.issues)):(c.memo=!0,l.backEdges??(l.backEdges=new WeakSet),l.backEdges.add(p.value)),c;Oo=f;const v=Po.length,g=i(c,u);Oo=void 0;const _=Po.length>v?Po.pop():void 0;return g instanceof Promise?g.then(b=>(_&&(_.issues=b.issues.length?Ws(b.issues):Ol),b)):(_&&(_.issues=g.issues.length?Ws(g.issues):Ol),g)};e._zod.parse=a,e._zod.run===i&&(e._zod.run=a)})}};function Q1(){return q1}function Y1(e,t){var r;const n=(r=e[Ui])==null?void 0:r.backEdges;return n!==void 0&&Yh(t)&&n.has(t)}const J1=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(s){return e[s]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function o(s,i){return s==="number"&&typeof i=="number"&&!Number.isFinite(i)?String(i):r[s]??s}return s=>{switch(s.code){case"invalid_type":{const i=o(s.expected),a=E_(s.input),c=o(a,s.input);return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":return s.values.length===1?`Invalid input: expected ${Ih(s.values[0])}`:`Invalid option: expected one of ${ll(s.values,"|")}`;case"too_big":{const i=s.exact?"exactly ":s.inclusive?"<=":"<",a=t(s.origin);return a?`Too big: expected ${s.origin??"value"} to have ${i}${s.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${s.origin??"value"} to be ${i}${s.maximum.toString()}`}case"too_small":{const i=s.exact?"exactly ":s.inclusive?">=":">",a=t(s.origin);return a?`Too small: expected ${s.origin} to have ${i}${s.minimum.toString()} ${a.unit}`:`Too small: expected ${s.origin} to be ${i}${s.minimum.toString()}`}case"invalid_format":{const i=s;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${n[i.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${ll(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Invalid discriminator value. Expected ${s.options.map(a=>`'${a}'`).join(" | ")}`:s.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function X1(){return{localeError:J1()}}var Pl;class eS{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function tS(){return new eS}(Pl=globalThis).__zod_globalRegistry??(Pl.__zod_globalRegistry=tS());const Ur=globalThis.__zod_globalRegistry;function Xh(e){return e.checks&&(e.checks=[...e.checks]),e}function nS(e,t){return new e(Xh({type:"string",...ne(t)}))}function rS(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ne(t)})}function oS(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ne(t)})}function sS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ne(t)})}function iS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ne(t)})}function aS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ne(t)})}function cS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ne(t)})}function lS(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ne(t)})}function uS(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ne(t)})}function dS(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ne(t)})}function fS(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ne(t)})}function hS(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ne(t)})}function pS(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ne(t)})}function mS(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ne(t)})}function gS(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ne(t)})}function vS(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ne(t)})}function yS(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ne(t)})}function bS(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ne(t)})}function wS(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ne(t)})}function _S(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ne(t)})}function xS(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ne(t)})}function SS(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ne(t)})}function ES(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ne(t)})}function CS(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ne(t)})}function kS(e,t){return new e({type:"string",format:"date",check:"string_format",...ne(t)})}function OS(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ne(t)})}function PS(e,t){return new e({type:"string",format:"duration",check:"string_format",...ne(t)})}function RS(e,t){return new e(Xh({type:"number",checks:[],...ne(t)}))}function TS(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ne(t)})}function IS(e,t){return new e({type:"boolean",...ne(t)})}function AS(e){return new e({type:"unknown"})}function NS(e,t){return new e({type:"never",...ne(t)})}function Rl(e,t){return new zh({check:"less_than",...ne(t),value:e,inclusive:!1})}function Hs(e,t){return new zh({check:"less_than",...ne(t),value:e,inclusive:!0})}function Tl(e,t){return new Fh({check:"greater_than",...ne(t),value:e,inclusive:!1})}function Ks(e,t){return new Fh({check:"greater_than",...ne(t),value:e,inclusive:!0})}function Il(e,t){return new Rx({check:"multiple_of",...ne(t),value:e})}function ep(e,t){return new Ix({check:"max_length",...ne(t),maximum:e})}function ns(e,t){return new Ax({check:"min_length",...ne(t),minimum:e})}function tp(e,t){return new Nx({check:"length_equals",...ne(t),length:e})}function DS(e,t){return new Dx({check:"string_format",format:"regex",...ne(t),pattern:e})}function MS(e){return new Mx({check:"string_format",format:"lowercase",...ne(e)})}function jS(e){return new jx({check:"string_format",format:"uppercase",...ne(e)})}function $S(e,t){return new $x({check:"string_format",format:"includes",...ne(t),includes:e})}function zS(e,t){return new zx({check:"string_format",format:"starts_with",...ne(t),prefix:e})}function FS(e,t){return new Fx({check:"string_format",format:"ends_with",...ne(t),suffix:e})}function LS(e,t){return new Lx({check:"properties",shape:e,...ne(t)})}function Pr(e){return new Vx({check:"overwrite",tx:e})}function VS(e){return Pr(t=>t.normalize(e))}function US(){return Pr(e=>e.trim())}function ZS(){return Pr(e=>e.toLowerCase())}function BS(){return Pr(e=>e.toUpperCase())}function WS(){return Pr(e=>d_(e))}function HS(e,t,n){return new e({type:"array",element:t,...ne(n)})}function KS(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ne(n)})}function GS(e,t){const n=qS(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(Jr(o,r.value,n._zod.def));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=n),s.continue??(s.continue=!n._zod.def.abort),r.issues.push(Jr(s))}},e(r.value,r)),t);return n}function qS(e,t){const n=new ht({check:"custom",...ne(t)});return n._zod.check=e,n}function Wr(e,...t){for(const n of t)for(const r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&Gn(e,r,n[r]);return e}function np(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??Ur,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",intersections:[],deferred:[],external:(e==null?void 0:e.external)??void 0}}function Rr(e,t,n,r,o){const s=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:o}):t.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw new Error(o);return Object.assign(n,s),!0}function rt(e,t,n={path:[],schemaPath:[]}){var d,l;var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;const a=(l=(d=e._zod).toJSONSchema)==null?void 0:l.call(d);if(a)i.schema=a;else{const f={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,f);else{const v=i.schema,g=t.processors[o.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);g(e,t,v,f)}const p=e._zod.parent;p&&(i.ref||(i.ref=p),rt(p,t,f),t.seen.get(p).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Wr(i.schema,c),t.io==="input"&&lt(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function Al(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function rp(e,t){var i,a,c,u;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;const r=new Map;for(const d of e.seen.entries()){const l=(i=e.metadataRegistry.get(d[0]))==null?void 0:i.id;if(l){const f=r.get(l);if(f&&f!==d[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(l,d[0])}}const o=d=>{var g;const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const _=(g=e.external.registry.get(d[0]))==null?void 0:g.id,b=e.external.uri??(w=>w);if(_)return{ref:b(_)};const x=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=x,{defId:x,ref:`${b("__shared")}#/${l}/${Al(x)}`}}const f="#",p=`${f}/${l}/`;if(d[1]===n&&!d[1].schema.id)return{ref:f};const v=d[1].schema.id??`__schema${e.counter++}`;return{defId:v,ref:p+Al(v)}},s=d=>{if(d[1].schema.$ref)return;const l=d[1],{ref:f,defId:p}=o(d);l.def={...l.schema},p&&(l.defId=p);const v=l.schema;for(const g in v)delete v[g];v.$ref=f};if(e.cycles==="throw")for(const d of e.seen.entries()){const l=d[1];if(l.cycle)throw new Error(`Cycle detected: #/${(a=l.cycle)==null?void 0:a.join("/")}/<root>
222
+
223
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const l=d[1];if(t===d[0]){s(d);continue}if(e.external){const p=(c=e.external.registry.get(d[0]))==null?void 0:c.id;if(t!==d[0]&&p){s(d);continue}}if((u=e.metadataRegistry.get(d[0]))==null?void 0:u.id){s(d);continue}if(l.cycle){s(d);continue}l.count>1&&e.reused==="ref"&&s(d)}e.external&&(e.sharedDefsExtractedFor=e.external)}function op(e){const t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;const n=[];for(const r of t){if(!r||typeof r!="object")return;op(r);const o=Object.keys(r);if(o.length!==1||o[0]!=="type")return;const s=r.type;for(const i of Array.isArray(s)?s:[s]){if(typeof i!="string")return;n.includes(i)||n.push(i)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const sp=new Set(["type","properties","required","additionalProperties"]),Nl=["oneOf","anyOf"];function Dl(e){const t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function Zi(e){var s;const t=[];for(const i of e){if(typeof i!="object"||i.type!=="object")return null;for(const a in i)if(!sp.has(a))return null;t.push(i)}const n={},r=new Set;for(const i of t){for(const a in i.properties){if(Object.prototype.hasOwnProperty.call(n,a))continue;const c=[];for(const d of t){const l=((s=d.properties)==null?void 0:s[a])??Dl(d);l!=null&&(c.some(f=>JSON.stringify(f)===JSON.stringify(l))||c.push(l))}const u=c.length===1?c[0]:Zi(c)??{allOf:c};Gn(n,a,u)}for(const a of i.required??[])r.add(a)}const o={type:"object",properties:n};if(r.size&&(o.required=[...r]),t.every(i=>i.additionalProperties===!1))o.additionalProperties=!1;else{const i=[];for(const a of t){const c=Dl(a);c&&!i.some(u=>JSON.stringify(u)===JSON.stringify(c))&&i.push(c)}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i})}return o}function QS(e){const t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(const o of sp)if(o in e)return;const n=t.filter(o=>Nl.some(s=>Array.isArray(o[s])));let r=null;if(!n.length)r=Zi(t);else{const o=n[0],s=Nl.find(c=>Array.isArray(o[c]));if(Object.keys(o).length!==1)return;const i=t.filter(c=>c!==o),a=o[s].map(c=>Zi([...i,c]));if(a.some(c=>!c))return;r={[s]:a}}r&&(delete e.allOf,Wr(e,r))}function ip(e,t){var a,c,u,d;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const f=e.seen.get(l);if(f.ref===null)return;const p=f.def??f.schema,v={...p},g=f.ref;if(f.ref=null,g){r(g);const b=e.seen.get(g),x=b.schema;if(x.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(x)):Wr(p,x),Wr(p,v),l._zod.parent===g)for(const C in p)C==="$ref"||C==="allOf"||C in v||delete p[C];if(x.$ref&&b.def)for(const C in p)C==="$ref"||C==="allOf"||C in b.def&&JSON.stringify(p[C])===JSON.stringify(b.def[C])&&delete p[C]}const _=l._zod.parent;if(_&&_!==g){r(_);const b=e.seen.get(_);if(b!=null&&b.schema.$ref&&(p.$ref=b.schema.$ref,b.def))for(const x in p)x==="$ref"||x==="allOf"||x in b.def&&JSON.stringify(p[x])===JSON.stringify(b.def[x])&&delete p[x]}e.override({zodSchema:l,jsonSchema:p,path:f.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const l of[...e.seen.entries()].reverse())r(l[0]);if(e.target!=="openapi-3.0")for(const l of e.seen.entries())op(l[1].def??l[1].schema);for(const l of e.deferred)l();if(e.intersections.length){const l=new Map;for(const f of e.seen.values())for(const p of[f.schema,f.def]){const v=p==null?void 0:p.allOf;if(!Array.isArray(v))continue;const g=l.get(v);g?g.push(p):l.set(v,[p])}for(const f of e.intersections)for(const p of l.get(f)??[])QS(p)}}const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,(a=e.external)!=null&&a.uri){const l=(c=e.external.registry.get(t))==null?void 0:c.id;if(!l)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(l)}Wr(o,n.defId?n.schema:n.def??n.schema);const s=(u=e.metadataRegistry.get(t))==null?void 0:u.id;s!==void 0&&o.id===s&&delete o.id;const i=((d=e.external)==null?void 0:d.defs)??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const l of e.seen.entries()){const f=l[1];f.def&&f.defId&&(f.def.id===f.defId&&delete f.def.id,Gn(i,f.defId,f.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const l=JSON.parse(JSON.stringify(o));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:rs(t,"input",e.processors),output:rs(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function lt(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return lt(r.element,n);if(r.type==="set")return lt(r.valueType,n);if(r.type==="lazy")return lt(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return lt(r.innerType,n);if(r.type==="intersection")return lt(r.left,n)||lt(r.right,n);if(r.type==="record"||r.type==="map")return lt(r.keyType,n)||lt(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:lt(r.in,n)||lt(r.out,n);if(r.type==="object"){for(const o in r.shape)if(lt(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(lt(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(lt(o,n))return!0;return!!(r.rest&&lt(r.rest,n))}return!1}const YS=(e,t={})=>n=>{const r=np({...n,processors:t});return rt(e,r),rp(r,e),ip(r,e)},rs=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},i=np({...o??{},target:s,io:t,processors:n});return rt(e,i),rp(i,e),ip(i,e)},wr=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},_r=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Ml=(e,t)=>{wr(e,"minimum",t),_r(e,"maximum",t)},ap=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},cp=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},lp=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},up=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},jl=(e,t)=>wr(e,"minimum",t.minimum),$l=(e,t)=>_r(e,"maximum",t.maximum),zl=e=>(t,n)=>{up(t,n.format);const[r,o]=e[n.format];wr(t,"minimum",r),_r(t,"maximum",o)},Gs={greater_than:(e,t)=>wr(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>_r(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>ap(e,t.value),number_format:zl(Ah),bigint_format:zl(m_),min_length:jl,max_length:$l,length_equals:(e,t)=>Ml(e,t.length),min_size:jl,max_size:$l,size_equals:(e,t)=>Ml(e,t.size),string_format:(e,t)=>{up(e,t.format),t.pattern&&cp(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>lp(e,t.mime)};function Zt(e){var s;const t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(const i of r)(s=Gs[i._zod.def.check])==null||s.call(Gs,t,i._zod.def);const o=e._zod.bag;o.minimum!==void 0&&wr(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&wr(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&_r(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&_r(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&ap(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&lp(t,o.mime);for(const i of o.patterns??[])cp(t,i);return t}const JS={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},XS=new Map([[Hh,gx],[Ya,vx]]),eE=e=>XS.get(e)??e,tE=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u,laxFormat:d}=Zt(e);if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),a&&(o.format=JS[a]??a,o.format===""&&delete o.format,(a==="time"||d)&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){const l=[...c].map(eE);l.length===1?o.pattern=l[0].source:l.length>1&&(o.allOf=[...l.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},nE=(e,t,n,r)=>{const o=n,{minimum:s,maximum:i,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:d}=Zt(e);o.type=d?"integer":"number";const l=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),f=typeof c=="number"&&c<=(i??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";if(l?p?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u:typeof s=="number"&&(o.minimum=s),f?p?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c:typeof i=="number"&&(o.maximum=i),a){const v=new Set;for(const b of a)Number.isFinite(b)&&b!==0?v.add(Math.abs(b)):Rr(e,t,o,r,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);const[g,..._]=v;g!==void 0&&(o.multipleOf=g),_.length&&(o.allOf=[...o.allOf??[],..._.map(b=>({multipleOf:b}))])}},rE=(e,t,n,r)=>{n.type="boolean"},oE=(e,t,n,r)=>{n.not={}},sE=(e,t,n,r)=>{},iE=(e,t,n,r)=>{const o=e._zod.def,s=$i(o.entries);if(s.length===0){n.not={};return}s.every(i=>typeof i=="number")&&(n.type="number"),s.every(i=>typeof i=="string")&&(n.type="string"),n.enum=s},aE=(e,t,n,r)=>{Rr(e,t,n,r,"Custom types cannot be represented in JSON Schema")},cE=(e,t,n,r)=>{Rr(e,t,n,r,"Transforms cannot be represented in JSON Schema")},lE=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:i,maximum:a}=Zt(e);typeof i=="number"&&(o.minItems=i),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=rt(s.element,t,{...r,path:[...r.path,"items"]})};function Bi(e){const t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Bi(t.out):t.type==="catch"?Bi(t.innerType):e._zod.optin}const uE=(e,t,n,r)=>{var u;const o=n,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&Rr(e,t,o,r,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(const d in i)Gn(o.properties,d,rt(i[d],t,{...r,path:[...r.path,"properties",d]}));const c=[];for(const d of Object.keys(i)){const l=s.shape[d];(t.io==="input"?Bi(l)===void 0:l._zod.optout===void 0)&&c.push(d)}c.length>0&&(o.required=c),((u=s.catchall)==null?void 0:u._zod.def.type)==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=rt(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},dE=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>rt(a,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?n.oneOf=i:n.anyOf=i},fE=(e,t,n,r)=>{const o=e._zod.def,s=rt(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=rt(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=c,t.intersections.push(c)},hE=(e,t,n,r)=>{const o=e._zod.def,s=rt(o.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},pE=(e,t,n,r)=>{const o=e._zod.def;rt(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},Ja=Symbol();function dp(e,t,n,r,o){let s=!1;const i=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(s=!0,null));return s?(Rr(t,n,r,o,"BigInt defaults cannot be represented in JSON Schema"),Ja):JSON.parse(i)}const mE=(e,t,n,r)=>{const o=e._zod.def;rt(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;const i=dp(o.defaultValue,e,t,n,r);i!==Ja&&(n.default=i)},gE=(e,t,n,r)=>{const o=e._zod.def;rt(o.innerType,t,r);const s=t.seen.get(e);if(s.ref=o.innerType,t.io!=="input")return;const i=dp(o.defaultValue,e,t,n,r);i!==Ja&&(n._prefault=i)},vE=(e,t,n,r)=>{const o=e._zod.def;rt(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{Rr(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=i},yE=(e,t,n,r)=>{const o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?o.out:o.in:o.out;rt(i,t,r);const a=t.seen.get(e);a.ref=i},bE=(e,t,n,r)=>{const o=e._zod.def;rt(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},fp=(e,t,n,r)=>{const o=e._zod.def;rt(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},Fl=new WeakSet([Object.prototype,Error.prototype]);function Ro(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){const r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}const wE=(e,t)=>{$_.init(e,t),e.name="ZodError";const n=Object.getPrototypeOf(e);Fl.has(n)||(Fl.add(n),Ro(n,"format",r=>o=>L_(r,o)),Ro(n,"flatten",r=>o=>F_(r,o)),Ro(n,"addIssue",r=>o=>{r.issues.push(o),r.message=JSON.stringify(r.issues,zi,2)}),Ro(n,"addIssues",r=>o=>{r.issues.push(...o),r.message=JSON.stringify(r.issues,zi,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},At=M("ZodError",wE,void 0,{Parent:Error}),_E=Wa(At),xE=Ha(At),SE=Ka(At),EE=Ga(At),CE=H_(At),kE=K_(At),OE=G_(At),PE=q_(At),RE=Q_(At),TE=Y_(At),IE=J_(At),AE=X_(At);function NE(){Bt.localeError||Pn(X1())}function Xa(){Bt.memoizer||Pn({memoizer:Q1()})}const Ue=M("ZodType",(e,t)=>(NE(),Ve.init(e,t),e.def=t,e.type=t.type,e),{check(...e){const t=this.def;return this.clone(St(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return On(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(IC(e,t))},superRefine(e,t){return this.check(AC(e,t))},overwrite(e){return this.check(Pr(e))},optional(){return Zl(this)},exactOptional(){return bC(this)},nullable(){return Bl(this)},nullish(){return Zl(Bl(this))},nonoptional(e){return CC(this,e)},array(){return lC(this)},or(e){return hC([this,e])},and(e){return mC(this,e)},transform(e){return Wl(this,yC(e))},default(e){return xC(this,e)},prefault(e){return EC(this,e)},catch(e){return OC(this,e)},pipe(e){return Wl(this,e)},readonly(){return TC(this)},describe(e){const t=this.clone();return Ur.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ur.get(this);const t=this.clone();return Ur.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Ba(this,"~standard",{...Vh(this),jsonSchema:{input:rs(this,"input"),output:rs(this,"output")}})},set"~standard"(e){kn(this,"~standard",e)},parse:function e(t,n){return _E(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await xE(this,t,n,{callee:e})},safeParse(e,t){return SE(this,e,t)},async safeParseAsync(e,t){return EE(this,e,t)},get spa(){return this==null?void 0:this.safeParseAsync},set spa(e){kn(this,"spa",e)},validate(e,t){return Z_(this,e,t)},validateAsync(e,t){return W_(this,e,t)},encode:function e(t,n){return CE(this,t,n,{callee:e})},decode:function e(t,n){return kE(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await OE(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await PE(this,t,n,{callee:e})},safeEncode(e,t){return RE(this,e,t)},safeDecode(e,t){return TE(this,e,t)},async safeEncodeAsync(e,t){return IE(this,e,t)},async safeDecodeAsync(e,t){return AE(this,e,t)},toJSONSchema(e){return YS(this,{})(e)},get description(){var e;return(e=Ur.get(this))==null?void 0:e.description},get _def(){return this._zod.def}}),hp=M("_ZodString",(e,t)=>{Qa.init(e,t),Ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>tE(e,n,r)},Dh({format:e=>Zt(e).format??null,minLength:e=>Zt(e).minimum??null,maxLength:e=>Zt(e).maximum??null},{regex(...e){return this.check(DS(...e))},includes(...e){return this.check($S(...e))},startsWith(...e){return this.check(zS(...e))},endsWith(...e){return this.check(FS(...e))},min(...e){return this.check(ns(...e))},max(...e){return this.check(ep(...e))},length(...e){return this.check(tp(...e))},nonempty(...e){return this.check(ns(1,...e))},lowercase(e){return this.check(MS(e))},uppercase(e){return this.check(jS(e))},trim(){return this.check(US())},normalize(...e){return this.check(VS(...e))},toLowerCase(){return this.check(ZS())},toUpperCase(){return this.check(BS())},slugify(){return this.check(WS())}})),DE=M("ZodString",(e,t)=>{Qa.init(e,t),hp.init(e,t)},{email(e){return this.check(rS(FE,e))},url(e){return this.check(lS(VE,e))},jwt(e){return this.check(ES(nC,e))},emoji(e){return this.check(uS(UE,e))},guid(e){return this.check(oS(LE,e))},uuid(e){return this.check(sS(To,e))},uuidv4(e){return this.check(iS(To,e))},uuidv6(e){return this.check(aS(To,e))},uuidv7(e){return this.check(cS(To,e))},nanoid(e){return this.check(dS(ZE,e))},cuid(e){return this.check(fS(BE,e))},cuid2(e){return this.check(hS(WE,e))},ulid(e){return this.check(pS(HE,e))},base64(e){return this.check(_S(XE,e))},base64url(e){return this.check(xS(eC,e))},xid(e){return this.check(mS(KE,e))},ksuid(e){return this.check(gS(GE,e))},ipv4(e){return this.check(vS(qE,e))},ipv6(e){return this.check(yS(QE,e))},cidrv4(e){return this.check(bS(YE,e))},cidrv6(e){return this.check(wS(JE,e))},e164(e){return this.check(SS(tC,e))},datetime(e){return this.check(CS(ME,e))},date(e){return this.check(kS(jE,e))},time(e){return this.check(OS($E,e))},duration(e){return this.check(PS(zE,e))}});function Ll(e){return nS(DE,e)}const Ne=M("ZodStringFormat",(e,t)=>{Ie.init(e,t),hp.init(e,t)}),ME=M("ZodISODateTime",(e,t)=>{a1.init(e,t),Ne.init(e,t)}),jE=M("ZodISODate",(e,t)=>{c1.init(e,t),Ne.init(e,t)}),$E=M("ZodISOTime",(e,t)=>{l1.init(e,t),Ne.init(e,t)}),zE=M("ZodISODuration",(e,t)=>{u1.init(e,t),Ne.init(e,t)}),FE=M("ZodEmail",(e,t)=>{Kx.init(e,t),Ne.init(e,t)}),LE=M("ZodGUID",(e,t)=>{Wx.init(e,t),Ne.init(e,t)}),To=M("ZodUUID",(e,t)=>{Hx.init(e,t),Ne.init(e,t)}),VE=M("ZodURL",(e,t)=>{Xx.init(e,t),Ne.init(e,t)}),UE=M("ZodEmoji",(e,t)=>{e1.init(e,t),Ne.init(e,t)}),ZE=M("ZodNanoID",(e,t)=>{t1.init(e,t),Ne.init(e,t)}),BE=M("ZodCUID",(e,t)=>{n1.init(e,t),Ne.init(e,t)}),WE=M("ZodCUID2",(e,t)=>{r1.init(e,t),Ne.init(e,t)}),HE=M("ZodULID",(e,t)=>{o1.init(e,t),Ne.init(e,t)}),KE=M("ZodXID",(e,t)=>{s1.init(e,t),Ne.init(e,t)}),GE=M("ZodKSUID",(e,t)=>{i1.init(e,t),Ne.init(e,t)}),qE=M("ZodIPv4",(e,t)=>{d1.init(e,t),Ne.init(e,t)}),QE=M("ZodIPv6",(e,t)=>{h1.init(e,t),Ne.init(e,t)}),YE=M("ZodCIDRv4",(e,t)=>{p1.init(e,t),Ne.init(e,t)}),JE=M("ZodCIDRv6",(e,t)=>{g1.init(e,t),Ne.init(e,t)}),XE=M("ZodBase64",(e,t)=>{v1.init(e,t),Ne.init(e,t)}),eC=M("ZodBase64URL",(e,t)=>{b1.init(e,t),Ne.init(e,t)}),tC=M("ZodE164",(e,t)=>{w1.init(e,t),Ne.init(e,t)}),nC=M("ZodJWT",(e,t)=>{x1.init(e,t),Ne.init(e,t)}),pp=M("ZodNumber",(e,t)=>{Kh.init(e,t),Ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>nE(e,n,r,o),e.isFinite=!0},Dh({minValue:e=>{const{minimum:t,exclusiveMinimum:n}=Zt(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{const{maximum:t,exclusiveMaximum:n}=Zt(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{const{isInt:t,multipleOf:n}=Zt(e);return!!t||!!(n!=null&&n.some(Number.isSafeInteger))},format:e=>Zt(e).format??null},{gt(e,t){return this.check(Tl(e,t))},gte(e,t){return this.check(Ks(e,t))},min(e,t){return this.check(Ks(e,t))},lt(e,t){return this.check(Rl(e,t))},lte(e,t){return this.check(Hs(e,t))},max(e,t){return this.check(Hs(e,t))},int(e){return this.check(Vl(e))},safe(e){return this.check(Vl(e))},positive(e){return this.check(Tl(0,e))},nonnegative(e){return this.check(Ks(0,e))},negative(e){return this.check(Rl(0,e))},nonpositive(e){return this.check(Hs(0,e))},multipleOf(e,t){return this.check(Il(e,t))},step(e,t){return this.check(Il(e,t))},finite(){return this}}));function Qk(e){return RS(pp,e)}const rC=M("ZodNumberFormat",(e,t)=>{S1.init(e,t),pp.init(e,t)});function Vl(e){return TS(rC,e)}const oC=M("ZodBoolean",(e,t)=>{E1.init(e,t),Ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>rE(e,n,r)});function Yk(e){return IS(oC,e)}const sC=M("ZodUnknown",(e,t)=>{C1.init(e,t),Ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>sE()});function Ul(){return AS(sC)}const iC=M("ZodNever",(e,t)=>{k1.init(e,t),Ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>oE(e,n,r)});function aC(e){return NS(iC,e)}const cC=M("ZodArray",(e,t)=>{Xa(),R1.init(e,t),Ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>lE(e,n,r,o),e.element=t.element},{min(e,t){return this.check(ns(e,t))},nonempty(e){return this.check(ns(1,e))},max(e,t){return this.check(ep(e,t))},length(e,t){return this.check(tp(e,t))},unwrap(){return this.element}});function lC(e,t){return HS(cC,e,t)}const uC=M("ZodObject",(e,t)=>{Xa(),A1.init(e,t),Ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>uE(e,n,r,o),R_(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return gC(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(St(this._zod.def,{catchall:e}))},passthrough(){return this.clone(St(this._zod.def,{catchall:Ul()}))},loose(){return this.clone(St(this._zod.def,{catchall:Ul()}))},strict(){return this.clone(St(this._zod.def,{catchall:aC()}))},strip(){return this.clone(St(this._zod.def,{catchall:void 0}))},extend(e){return y_(this,e)},safeExtend(e){return b_(this,e)},merge(e){return w_(this,e)},pick(e){return g_(this,e)},omit(e){return v_(this,e)},partial(...e){return ul(mp,this,e[0])},exactPartial(...e){return ul(gp,this,e[0],"exactPartial")},required(...e){return __(vp,this,e[0])}});function dC(e,t){const n={type:"object",shape:e??{},...ne(t)};return new uC(n)}const fC=M("ZodUnion",(e,t)=>{N1.init(e,t),Ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>dE(e,n,r,o),e.options=t.options});function hC(e,t){return new fC({type:"union",options:e,...ne(t)})}const pC=M("ZodIntersection",(e,t)=>{D1.init(e,t),Ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fE(e,n,r,o)});function mC(e,t){return new pC({type:"intersection",left:e,right:t})}const Wi=M("ZodEnum",(e,t)=>{M1.init(e,t),Ue.init(e,t),e._zod.processJSONSchema=(r,o,s)=>iE(e,r,o),e.enum=t.entries,e.options=[...e._zod.values];const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const i of r)if(n.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Wi({...t,checks:[],...ne(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const i of r)if(n.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Wi({...t,checks:[],...ne(o),entries:s})}});function gC(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Wi({type:"enum",entries:n,...ne(t)})}const vC=M("ZodTransform",(e,t)=>{Xa(),j1.init(e,t),Ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>cE(e,n,r,o),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Mh(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Jr(s,n.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=e),n.issues.push(Jr(i))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function yC(e){return new vC({type:"transform",transform:e})}const mp=M("ZodOptional",(e,t)=>{Qh.init(e,t),Ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fp(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Zl(e){return new mp({type:"optional",innerType:e})}const gp=M("ZodExactOptional",(e,t)=>{$1.init(e,t),Ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fp(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function bC(e){return new gp({type:"optional",innerType:e})}const wC=M("ZodNullable",(e,t)=>{z1.init(e,t),Ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Bl(e){return new wC({type:"nullable",innerType:e})}const _C=M("ZodDefault",(e,t)=>{F1.init(e,t),Ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function xC(e,t){return new _C({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Th(t)}})}const SC=M("ZodPrefault",(e,t)=>{L1.init(e,t),Ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>gE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function EC(e,t){return new SC({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Th(t)}})}const vp=M("ZodNonOptional",(e,t)=>{V1.init(e,t),Ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>pE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function CC(e,t){return new vp({type:"nonoptional",innerType:e,...ne(t)})}const kC=M("ZodCatch",(e,t)=>{U1.init(e,t),Ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function OC(e,t){return new kC({type:"catch",innerType:e,catchValue:typeof t=="function"?t:I_(t)})}const PC=M("ZodPipe",(e,t)=>{Z1.init(e,t),Ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>yE(e,n,r,o),e.in=t.in,e.out=t.out});function Wl(e,t){return new PC({type:"pipe",in:e,out:t})}const RC=M("ZodReadonly",(e,t)=>{B1.init(e,t),Ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function TC(e){return new RC({type:"readonly",innerType:e})}const yp=M("ZodCustom",(e,t)=>{W1.init(e,t),Ue.init(e,t),e._zod.processJSONSchema=(n,r,o)=>aE(e,n,r,o)});function IC(e,t={}){return KS(yp,e,t)}function AC(e,t){return GS(e,t)}const NC=M("ZodInstanceOf",(e,t)=>{yp.init(e,t)},{properties(e,t){return this.check(LS(e,t))}});function Jk(e,t={}){const n=new NC({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...ne(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}var DC=Object.defineProperty,MC=(e,t)=>DC(e,"name",{value:t,configurable:!0}),bp=h.forwardRef(MC(function(t,n){return m.jsx(Le.label,{...t,ref:n,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=t.onMouseDown)==null||s.call(t,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}})},"Label"));const jC=so("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Hi=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie(jC(),r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(bp,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Hi.displayName=bp.displayName;function qs(e){const t=te.c(10),{id:n,message:r,className:o,assertive:s}=e;let i;t[0]!==s?(i=s?{role:"alert"}:{},t[0]=s,t[1]=i):i=t[1];const a=!r&&"absolute";let c;t[2]!==o||t[3]!==a?(c=ie("text-sm text-destructive",a,o),t[2]=o,t[3]=a,t[4]=c):c=t[4];const u=r??"";let d;return t[5]!==n||t[6]!==i||t[7]!==c||t[8]!==u?(d=m.jsx("p",{id:n,...i,className:c,children:u}),t[5]=n,t[6]=i,t[7]=c,t[8]=u,t[9]=d):d=t[9],d}function $C(e){return Object.entries(e).filter(([t,n])=>t!=="root"&&typeof(n==null?void 0:n.message)=="string").length}const Hl=e=>e===1?"1 field needs attention":`${e} fields need attention`,zC=100;function FC(e){var r,o,s,i;const t=(r=e==null?void 0:e.closest("form"))==null?void 0:r.querySelector('[aria-invalid="true"]');if(!t)return"";if(t!==document.activeElement)return t.focus(),"";const n=(o=t.getAttribute("aria-describedby"))==null?void 0:o.split(" ")[0];return n&&((i=(s=document.getElementById(n))==null?void 0:s.textContent)==null?void 0:i.trim())||""}function LC(e,t){return e?`${/[.!?]$/.test(e)?e:`${e}.`} ${Hl(t)}`:Hl(t)}function VC(e){const t=te.c(5),{errors:n,submitCount:r}=e,o=h.useRef(null),s=$C(n),[i,a]=h.useState(r),[c,u]=h.useState(""),[d,l]=h.useState(null);i!==r?(a(r),u(""),l(s>0?{submit:r,count:s}:null)):s===0&&(c!==""||d!==null)&&(u(""),l(null));let f,p;t[0]!==d?(f=()=>{if(d===null)return;const g=FC(o.current),_=setTimeout(()=>{u(LC(g,d.count)),l(null)},zC);return()=>clearTimeout(_)},p=[d],t[0]=d,t[1]=f,t[2]=p):(f=t[1],p=t[2]),h.useEffect(f,p);let v;return t[3]!==c?(v=m.jsx("p",{ref:o,"aria-live":"polite",className:"sr-only",children:c}),t[3]=c,t[4]=v):v=t[4],v}const ec=8,Xk=`Use at least ${ec} characters`,UC=`Password must be at least ${ec} characters`;function e2(e,t,n){return n?t:e}const ZC=so("rounded-lg bg-card text-card-foreground",{variants:{level:{0:"",1:"shadow-card-1",2:"shadow-card-2",3:"shadow-card-3",4:"shadow-card-4"}},defaultVariants:{level:2}}),wp=h.forwardRef((e,t)=>{const n=te.c(11);let r,o,s;n[0]!==e?({className:r,level:o,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);let i;n[4]!==r||n[5]!==o?(i=ie(ZC({level:o}),r),n[4]=r,n[5]=o,n[6]=i):i=n[6];let a;return n[7]!==s||n[8]!==t||n[9]!==i?(a=m.jsx("div",{ref:t,className:i,...s}),n[7]=s,n[8]=t,n[9]=i,n[10]=a):a=n[10],a});wp.displayName="Card";const _p=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("flex flex-col space-y-1.5 p-6",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});_p.displayName="CardHeader";const xp=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("text-2xl font-semibold leading-none tracking-tight",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});xp.displayName="CardTitle";const Sp=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("text-sm text-muted-foreground",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Sp.displayName="CardDescription";const Ep=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("p-6 pt-0",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Ep.displayName="CardContent";const BC=h.forwardRef((e,t)=>{const n=te.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ie("flex items-center p-6 pt-0",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});BC.displayName="CardFooter";const WC=dC({email:Ll().email("Enter a valid email"),password:Ll().min(ec,UC)});function HC(){var ue,qe,Xe,Ze;const e=te.c(58),t=su(),{resolvedTheme:n}=os(),r=n==="dark"?"/logo-dark.svg":"/logo.svg";let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={queryKey:qo.authStatus,queryFn:a0,staleTime:1/0},e[0]=o):o=e[0];const s=Zo(o),i=Qi();let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={shouldFocusError:!1,resolver:s_(WC)},e[1]=a):a=e[1];const{register:c,handleSubmit:u,setError:d,formState:l}=t_(a),{errors:f,isSubmitting:p,submitCount:v}=l;let g;e[2]!==t||e[3]!==i||e[4]!==d?(g=async function(Be){try{const{status:kt}=await ch.post("/api/v1/auth/login",{email:Be.email,password:Be.password});if(kt!==200){d("root",{message:"Invalid email or password"});return}i.clear(),t("/app-center",{replace:!0})}catch{d("root",{message:"Network error. Please try again."})}},e[2]=t,e[3]=i,e[4]=d,e[5]=g):g=e[5];const _=g;if(((ue=s.data)==null?void 0:ue.initialized)===!1){let De;return e[6]===Symbol.for("react.memo_cache_sentinel")?(De=m.jsx(Gi,{to:"/setup",replace:!0}),e[6]=De):De=e[6],De}let b;e[7]!==r?(b=m.jsx("img",{src:r,alt:"tapflow",className:"w-6 h-6"}),e[7]=r,e[8]=b):b=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=m.jsx("span",{className:"text-base font-semibold tracking-tight",children:"tapflow"}),e[9]=x):x=e[9];let w;e[10]!==b?(w=m.jsxs("div",{className:"flex items-center gap-2",children:[b,x]}),e[10]=b,e[11]=w):w=e[11];let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=m.jsxs(_p,{className:"text-center",children:[m.jsx(xp,{className:"text-2xl tracking-display-md",children:"Welcome back"}),m.jsx(Sp,{children:"Sign in to your team workspace"})]}),e[12]=C):C=e[12];let E;e[13]!==u||e[14]!==_?(E=u(_),e[13]=u,e[14]=_,e[15]=E):E=e[15];let P;e[16]===Symbol.for("react.memo_cache_sentinel")?(P=m.jsx(Hi,{htmlFor:"email",children:"Email"}),e[16]=P):P=e[16];const R=!!f.email,T=f.email?"email-error":void 0;let A;e[17]!==c?(A=c("email"),e[17]=c,e[18]=A):A=e[18];let j;e[19]!==R||e[20]!==T||e[21]!==A?(j=m.jsx(Wo,{id:"email",type:"email",placeholder:"you@company.com",autoComplete:"email","aria-required":"true","aria-invalid":R,"aria-describedby":T,...A}),e[19]=R,e[20]=T,e[21]=A,e[22]=j):j=e[22];const L=(qe=f.email)==null?void 0:qe.message;let z;e[23]!==L?(z=m.jsx(qs,{id:"email-error",message:L}),e[23]=L,e[24]=z):z=e[24];let J;e[25]!==j||e[26]!==z?(J=m.jsxs("div",{className:"grid gap-2",children:[P,j,z]}),e[25]=j,e[26]=z,e[27]=J):J=e[27];let W;e[28]===Symbol.for("react.memo_cache_sentinel")?(W=m.jsx(Hi,{htmlFor:"password",children:"Password"}),e[28]=W):W=e[28];const K=!!f.password,Z=f.password?"password-error":void 0;let X;e[29]!==c?(X=c("password"),e[29]=c,e[30]=X):X=e[30];let re;e[31]!==K||e[32]!==Z||e[33]!==X?(re=m.jsx(Wo,{id:"password",type:"password",autoComplete:"current-password","aria-required":"true","aria-invalid":K,"aria-describedby":Z,...X}),e[31]=K,e[32]=Z,e[33]=X,e[34]=re):re=e[34];const Y=(Xe=f.password)==null?void 0:Xe.message;let ee;e[35]!==Y?(ee=m.jsx(qs,{id:"password-error",message:Y}),e[35]=Y,e[36]=ee):ee=e[36];let G;e[37]!==re||e[38]!==ee?(G=m.jsxs("div",{className:"grid gap-2",children:[W,re,ee]}),e[37]=re,e[38]=ee,e[39]=G):G=e[39];const ve=(Ze=f.root)==null?void 0:Ze.message;let he;e[40]!==ve?(he=m.jsx(qs,{assertive:!0,id:"login-error",message:ve}),e[40]=ve,e[41]=he):he=e[41];const oe=p?"Signing in…":"Sign in";let le;e[42]!==p||e[43]!==oe?(le=m.jsx(ss,{type:"submit",size:"lg",disabled:p,className:"w-full mt-1",children:oe}),e[42]=p,e[43]=oe,e[44]=le):le=e[44];let U;e[45]!==f||e[46]!==v?(U=m.jsx(VC,{errors:f,submitCount:v}),e[45]=f,e[46]=v,e[47]=U):U=e[47];let fe;e[48]!==J||e[49]!==G||e[50]!==he||e[51]!==le||e[52]!==U||e[53]!==E?(fe=m.jsxs(wp,{level:4,className:"w-full",children:[C,m.jsx(Ep,{children:m.jsxs("form",{onSubmit:E,className:"flex flex-col gap-4",children:[J,G,he,le,U]})})]}),e[48]=J,e[49]=G,e[50]=he,e[51]=le,e[52]=U,e[53]=E,e[54]=fe):fe=e[54];let Ee;return e[55]!==fe||e[56]!==w?(Ee=m.jsx("div",{className:"flex min-h-svh items-center justify-center overflow-hidden p-4",children:m.jsxs("div",{className:"flex flex-col items-center gap-6 w-full max-w-sm",children:[w,fe]})}),e[55]=fe,e[56]=w,e[57]=Ee):Ee=e[57],Ee}function KC(){return new xm({defaultOptions:{queries:{retry:0,refetchOnWindowFocus:!0,networkMode:"always"}}})}const GC=h.lazy(()=>Et(()=>import("./Setup-CPa_UWpa.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.Setup}))),qC=h.lazy(()=>Et(()=>import("./Invite-DQBwLaOl.js"),__vite__mapDeps([4,1,2,3,5])).then(e=>({default:e.Invite}))),QC=h.lazy(()=>Et(()=>import("./ResetPassword-inTbbral.js"),__vite__mapDeps([6,1,2,3])).then(e=>({default:e.ResetPassword}))),YC=h.lazy(()=>Et(()=>import("./AppCenter-93hnrrdy.js"),__vite__mapDeps([7,1,8,9,10,11,12,13,14,15,16,17,18,19,3])).then(e=>({default:e.AppCenter}))),JC=h.lazy(()=>Et(()=>import("./QASession-Dnuq0yrN.js"),__vite__mapDeps([20,1,21,22,3,15,23,24,11,8,17,25,10,26,19,9,14,16,27])).then(e=>({default:e.QASession}))),XC=h.lazy(()=>Et(()=>import("./Runs-DqZl9Y6M.js"),__vite__mapDeps([28,1,14,8,12,25,9,10,29,19,18,30,3])).then(e=>({default:e.Runs}))),ek=h.lazy(()=>Et(()=>import("./RunDetail-B3dw8_U0.js"),__vite__mapDeps([31,1,14,12,30,32,10,9,33,22,17,24,3])).then(e=>({default:e.RunDetail}))),tk=h.lazy(()=>Et(()=>import("./AISessionWatch-Bxew762e.js"),__vite__mapDeps([34,1,21,22,33,23,17,3])).then(e=>({default:e.AISessionWatch}))),nk=h.lazy(()=>Et(()=>import("./MacResources-D4LMGxgV.js"),__vite__mapDeps([35,1,21,19,25,27,36,3])).then(e=>({default:e.MacResources}))),rk=h.lazy(()=>Et(()=>import("./Default-BhgcUKBm.js"),__vite__mapDeps([37,1,2,14,16,15,32,10,5,3])).then(e=>({default:e.DefaultSettings}))),ok=h.lazy(()=>Et(()=>import("./Team-DZie8W7R.js"),__vite__mapDeps([38,1,11,15,9,10,29,19,26,18,3])).then(e=>({default:e.TeamSettings}))),sk=h.lazy(()=>Et(()=>import("./Tokens-u3-uRAwd.js"),__vite__mapDeps([39,1,14,15,11,9,10,29,19,26,18,13,3])).then(e=>({default:e.TokenSettings}))),ik=h.lazy(()=>Et(()=>import("./NotFound-DVq_rCKc.js"),__vite__mapDeps([40,1])).then(e=>({default:e.NotFound}))),ak=m.jsx("div",{className:"flex h-screen w-full items-center justify-center text-sm text-muted-foreground",children:"Loading…"}),Io=e=>m.jsx(h.Suspense,{fallback:ak,children:e}),ck=KC();function lk(){const e=te.c(18),{resolvedTheme:t}=os();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx(ot,{path:"/login",element:m.jsx(HC,{})}),e[0]=n):n=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx(ot,{path:"/setup",element:Io(m.jsx(GC,{}))}),e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(ot,{path:"/invite",element:Io(m.jsx(qC,{}))}),e[2]=o):o=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(ot,{path:"/reset-password",element:Io(m.jsx(QC,{}))}),e[3]=s):s=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx(I0,{}),e[4]=i):i=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(ot,{index:!0,element:m.jsx(Gi,{to:"/app-center",replace:!0})}),e[5]=a):a=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx(ot,{path:"/app-center",element:m.jsx(YC,{})}),e[6]=c):c=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(ot,{path:"/app-center/build",element:m.jsx(JC,{})}),e[7]=u):u=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx(ot,{path:"/automation/runs",element:m.jsx(XC,{})}),e[8]=d):d=e[8];let l;e[9]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(ot,{path:"/automation/runs/:runId",element:m.jsx(ek,{})}),e[9]=l):l=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=m.jsx(ot,{path:"/automation/sessions/:sessionId",element:m.jsx(tk,{})}),e[10]=f):f=e[10];let p;e[11]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(ot,{path:"/mac-resources",element:m.jsx(nk,{})}),e[11]=p):p=e[11];let v;e[12]===Symbol.for("react.memo_cache_sentinel")?(v=m.jsx(ot,{path:"/settings/default",element:m.jsx(rk,{})}),e[12]=v):v=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=m.jsx(ot,{path:"/settings/team",element:m.jsx(ok,{})}),e[13]=g):g=e[13];let _;e[14]===Symbol.for("react.memo_cache_sentinel")?(_=m.jsxs(ot,{element:i,children:[a,c,u,d,l,f,p,v,g,m.jsx(ot,{path:"/settings/tokens",element:m.jsx(sk,{})})]}),e[14]=_):_=e[14];let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=m.jsxs($p,{children:[n,r,o,s,_,m.jsx(ot,{path:"*",element:Io(m.jsx(ik,{}))})]}),e[15]=b):b=e[15];const x=t;let w;return e[16]!==x?(w=m.jsx(Qp,{client:ck,children:m.jsxs(zp,{children:[b,m.jsx(cg,{position:"bottom-right",richColors:!0,theme:x})]})}),e[16]=x,e[17]=w):w=e[17],w}Mp.createRoot(document.getElementById("root")).render(m.jsx(h.StrictMode,{children:m.jsx(Up,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,children:m.jsx(lk,{})})}));export{hk as $,et as A,ss as B,wp as C,vt as D,fu as E,qs as F,ft as G,pk as H,Wo as I,Fk as J,Eb as K,Hi as L,Cb as M,ff as N,Og as O,Xk as P,Dc as Q,lh as R,Ho as S,Sb as T,Bk as U,Uk as V,Vk as W,Lk as X,u0 as Y,$k as Z,Jk as _,s_ as a,aa as a$,zk as a0,Zk as a1,ie as a2,Tg as a3,Pe as a4,Le as a5,wu as a6,rn as a7,en as a8,at as a9,If as aA,lw as aB,En as aC,Qk as aD,xv as aE,l0 as aF,wa as aG,Yk as aH,Ik as aI,gC as aJ,Tk as aK,so as aL,Ly as aM,gk as aN,Zy as aO,jd as aP,zd as aQ,Fd as aR,Md as aS,qy as aT,Yd as aU,ha as aV,ls as aW,Id as aX,is as aY,ma as aZ,dd as a_,xa as aa,on as ab,ce as ac,Ak as ad,w0 as ae,Nk as af,xr as ag,Hd as ah,ao as ai,R0 as aj,Wk as ak,zg as al,Ok as am,Sk as an,Ek as ao,Pk as ap,kk as aq,Ck as ar,Kk as as,xk as at,Hk as au,Gk as av,Ag as aw,Dk as ax,Mk as ay,iw as az,Qi as b,Xt as b0,Xd as b1,cb as b2,Qd as b3,kg as b4,mk as b5,Zo as c,_p as d,xp as e,Ep as f,e2 as g,VC as h,ec as i,UC as j,a0 as k,z0 as l,Sp as m,qk as n,dC as o,b0 as p,qo as q,jk as r,Ll as s,oo as t,t_ as u,Rk as v,Ps as w,Hr as x,bm as y,os as z};