@tapflowio/relay 0.29.0 → 0.31.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 (182) hide show
  1. package/dist/RelayServer.d.ts +6 -0
  2. package/dist/RelayServer.d.ts.map +1 -1
  3. package/dist/RelayServer.js +48 -3
  4. package/dist/RelayServer.js.map +1 -1
  5. package/dist/index.d.ts +2 -2
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/lib/config.d.ts +14 -0
  10. package/dist/lib/config.d.ts.map +1 -1
  11. package/dist/lib/config.js +98 -0
  12. package/dist/lib/config.js.map +1 -1
  13. package/dist/lib/launchDefaults.d.ts +25 -0
  14. package/dist/lib/launchDefaults.d.ts.map +1 -0
  15. package/dist/lib/launchDefaults.js +41 -0
  16. package/dist/lib/launchDefaults.js.map +1 -0
  17. package/dist/server.js +2 -2
  18. package/dist/server.js.map +1 -1
  19. package/package.json +4 -4
  20. package/public/assets/{AISessionWatch-BSBkpTom.js → AISessionWatch-DMfOAt_U.js} +7 -7
  21. package/public/assets/AISessionWatch-DMfOAt_U.js.br +0 -0
  22. package/public/assets/AISessionWatch-DMfOAt_U.js.gz +0 -0
  23. package/public/assets/AndroidDeviceScreen-1RaPu10r.js +35 -0
  24. package/public/assets/AndroidDeviceScreen-1RaPu10r.js.br +0 -0
  25. package/public/assets/AndroidDeviceScreen-1RaPu10r.js.gz +0 -0
  26. package/public/assets/{AppCenter-DD_6LQx-.js → AppCenter-BWgstOJH.js} +6 -6
  27. package/public/assets/AppCenter-BWgstOJH.js.br +0 -0
  28. package/public/assets/AppCenter-BWgstOJH.js.gz +0 -0
  29. package/public/assets/{Default-CQ3Ae2mK.js → Default-Obywi6hR.js} +1 -1
  30. package/public/assets/Default-Obywi6hR.js.br +0 -0
  31. package/public/assets/Default-Obywi6hR.js.gz +0 -0
  32. package/public/assets/{Invite-D1uNMm0-.js → Invite-BVRKLYJu.js} +1 -1
  33. package/public/assets/Invite-BVRKLYJu.js.br +0 -0
  34. package/public/assets/Invite-BVRKLYJu.js.gz +0 -0
  35. package/public/assets/{MacResources-D2UeRbKL.js → MacResources-B6_Es8ye.js} +1 -1
  36. package/public/assets/MacResources-B6_Es8ye.js.br +0 -0
  37. package/public/assets/MacResources-B6_Es8ye.js.gz +0 -0
  38. package/public/assets/QASession-BuQdx-pq.js +81 -0
  39. package/public/assets/QASession-BuQdx-pq.js.br +0 -0
  40. package/public/assets/QASession-BuQdx-pq.js.gz +0 -0
  41. package/public/assets/{ResetPassword-B-4Uyfwr.js → ResetPassword-DU97TnMC.js} +1 -1
  42. package/public/assets/ResetPassword-DU97TnMC.js.br +0 -0
  43. package/public/assets/ResetPassword-DU97TnMC.js.gz +0 -0
  44. package/public/assets/{RunDetail-C50RjsuM.js → RunDetail-BspFUFg2.js} +4 -4
  45. package/public/assets/RunDetail-BspFUFg2.js.br +0 -0
  46. package/public/assets/RunDetail-BspFUFg2.js.gz +0 -0
  47. package/public/assets/{Runs-A7RcDLgO.js → Runs-BdCnN_dH.js} +2 -2
  48. package/public/assets/Runs-BdCnN_dH.js.br +0 -0
  49. package/public/assets/Runs-BdCnN_dH.js.gz +0 -0
  50. package/public/assets/{Setup-DK6TZbwh.js → Setup-D4DsciMG.js} +1 -1
  51. package/public/assets/Setup-D4DsciMG.js.br +0 -0
  52. package/public/assets/Setup-D4DsciMG.js.gz +0 -0
  53. package/public/assets/{Team-VoGput2p.js → Team-B2Txvi0a.js} +2 -2
  54. package/public/assets/Team-B2Txvi0a.js.br +0 -0
  55. package/public/assets/Team-B2Txvi0a.js.gz +0 -0
  56. package/public/assets/{Tokens-qkcJgunR.js → Tokens-D-ekP8kU.js} +1 -1
  57. package/public/assets/Tokens-D-ekP8kU.js.br +0 -0
  58. package/public/assets/Tokens-D-ekP8kU.js.gz +0 -0
  59. package/public/assets/WatchedDevice-D-SfDxp8.js +1 -0
  60. package/public/assets/WatchedDevice-D-SfDxp8.js.br +0 -0
  61. package/public/assets/WatchedDevice-D-SfDxp8.js.gz +0 -0
  62. package/public/assets/{aiSession-U7UqgdSb.js → aiSession-p7Uu2swu.js} +6 -6
  63. package/public/assets/aiSession-p7Uu2swu.js.br +0 -0
  64. package/public/assets/aiSession-p7Uu2swu.js.gz +0 -0
  65. package/public/assets/{alert-dialog-C0mRms8g.js → alert-dialog-DPNbpxqG.js} +1 -1
  66. package/public/assets/alert-dialog-DPNbpxqG.js.br +0 -0
  67. package/public/assets/alert-dialog-DPNbpxqG.js.gz +0 -0
  68. package/public/assets/{badge-BjEnOmb0.js → badge-Bjwwchrt.js} +1 -1
  69. package/public/assets/badge-Bjwwchrt.js.br +0 -0
  70. package/public/assets/badge-Bjwwchrt.js.gz +0 -0
  71. package/public/assets/{dialog-Cugbp1C4.js → dialog-CrzZQwxn.js} +1 -1
  72. package/public/assets/dialog-CrzZQwxn.js.br +0 -0
  73. package/public/assets/dialog-CrzZQwxn.js.gz +0 -0
  74. package/public/assets/{field-hint-qmBa0qqN.js → field-hint-CIJmSABE.js} +1 -1
  75. package/public/assets/field-hint-CIJmSABE.js.br +2 -0
  76. package/public/assets/field-hint-CIJmSABE.js.gz +0 -0
  77. package/public/assets/index-CiJwpDAf.js +248 -0
  78. package/public/assets/index-CiJwpDAf.js.br +0 -0
  79. package/public/assets/index-CiJwpDAf.js.gz +0 -0
  80. package/public/assets/index-DKKkUgNI.css +1 -0
  81. package/public/assets/index-DKKkUgNI.css.br +0 -0
  82. package/public/assets/index-DKKkUgNI.css.gz +0 -0
  83. package/public/assets/{list-view-CyM0QUaH.js → list-view-DpnCsTM-.js} +1 -1
  84. package/public/assets/list-view-DpnCsTM-.js.br +0 -0
  85. package/public/assets/list-view-DpnCsTM-.js.gz +0 -0
  86. package/public/assets/{pencil-DUZRZB3S.js → pencil-CE5LnE8i.js} +2 -2
  87. package/public/assets/pencil-CE5LnE8i.js.br +0 -0
  88. package/public/assets/pencil-CE5LnE8i.js.gz +0 -0
  89. package/public/assets/{play-Z1L2Eb91.js → play-BR_CdQzZ.js} +2 -2
  90. package/public/assets/play-BR_CdQzZ.js.br +0 -0
  91. package/public/assets/play-BR_CdQzZ.js.gz +0 -0
  92. package/public/assets/{search-input-B0s9mzRt.js → search-input-2MuvmbBR.js} +2 -2
  93. package/public/assets/search-input-2MuvmbBR.js.br +0 -0
  94. package/public/assets/search-input-2MuvmbBR.js.gz +0 -0
  95. package/public/assets/{select-CHbE6M4S.js → select-7EkQtxVy.js} +3 -3
  96. package/public/assets/select-7EkQtxVy.js.br +0 -0
  97. package/public/assets/select-7EkQtxVy.js.gz +0 -0
  98. package/public/assets/{slider-tyb3JvL2.js → slider-ifEFgQFt.js} +1 -1
  99. package/public/assets/slider-ifEFgQFt.js.br +0 -0
  100. package/public/assets/slider-ifEFgQFt.js.gz +0 -0
  101. package/public/assets/{tabs-Bf7ou-eS.js → tabs-SLpwFQLx.js} +1 -1
  102. package/public/assets/tabs-SLpwFQLx.js.br +0 -0
  103. package/public/assets/tabs-SLpwFQLx.js.gz +0 -0
  104. package/public/assets/{tech-label-KAwM5qZ_.js → tech-label-DpVGqU2Y.js} +1 -1
  105. package/public/assets/tech-label-DpVGqU2Y.js.br +0 -0
  106. package/public/assets/tech-label-DpVGqU2Y.js.gz +0 -0
  107. package/public/assets/{trash-HEJmY7DQ.js → trash-DFsQhdZ1.js} +3 -3
  108. package/public/assets/trash-DFsQhdZ1.js.br +0 -0
  109. package/public/assets/trash-DFsQhdZ1.js.gz +0 -0
  110. package/public/assets/{video-DdHH0Q0l.js → video-D1ajuM3p.js} +2 -2
  111. package/public/assets/video-D1ajuM3p.js.br +0 -0
  112. package/public/assets/video-D1ajuM3p.js.gz +0 -0
  113. package/public/index.html +2 -2
  114. package/public/index.html.br +0 -0
  115. package/public/index.html.gz +0 -0
  116. package/public/assets/AISessionWatch-BSBkpTom.js.br +0 -0
  117. package/public/assets/AISessionWatch-BSBkpTom.js.gz +0 -0
  118. package/public/assets/AndroidDeviceScreen-C55msKfh.js +0 -35
  119. package/public/assets/AndroidDeviceScreen-C55msKfh.js.br +0 -0
  120. package/public/assets/AndroidDeviceScreen-C55msKfh.js.gz +0 -0
  121. package/public/assets/AppCenter-DD_6LQx-.js.br +0 -0
  122. package/public/assets/AppCenter-DD_6LQx-.js.gz +0 -0
  123. package/public/assets/Default-CQ3Ae2mK.js.br +0 -0
  124. package/public/assets/Default-CQ3Ae2mK.js.gz +0 -0
  125. package/public/assets/Invite-D1uNMm0-.js.br +0 -0
  126. package/public/assets/Invite-D1uNMm0-.js.gz +0 -0
  127. package/public/assets/MacResources-D2UeRbKL.js.br +0 -0
  128. package/public/assets/MacResources-D2UeRbKL.js.gz +0 -0
  129. package/public/assets/QASession-d0eOjXXo.js +0 -81
  130. package/public/assets/QASession-d0eOjXXo.js.br +0 -0
  131. package/public/assets/QASession-d0eOjXXo.js.gz +0 -0
  132. package/public/assets/ResetPassword-B-4Uyfwr.js.br +0 -0
  133. package/public/assets/ResetPassword-B-4Uyfwr.js.gz +0 -0
  134. package/public/assets/RunDetail-C50RjsuM.js.br +0 -0
  135. package/public/assets/RunDetail-C50RjsuM.js.gz +0 -0
  136. package/public/assets/Runs-A7RcDLgO.js.br +0 -0
  137. package/public/assets/Runs-A7RcDLgO.js.gz +0 -0
  138. package/public/assets/Setup-DK6TZbwh.js.br +0 -0
  139. package/public/assets/Setup-DK6TZbwh.js.gz +0 -0
  140. package/public/assets/Team-VoGput2p.js.br +0 -0
  141. package/public/assets/Team-VoGput2p.js.gz +0 -0
  142. package/public/assets/Tokens-qkcJgunR.js.br +0 -0
  143. package/public/assets/Tokens-qkcJgunR.js.gz +0 -0
  144. package/public/assets/WatchedDevice-CpaKHa1x.js +0 -1
  145. package/public/assets/WatchedDevice-CpaKHa1x.js.br +0 -0
  146. package/public/assets/WatchedDevice-CpaKHa1x.js.gz +0 -0
  147. package/public/assets/aiSession-U7UqgdSb.js.br +0 -0
  148. package/public/assets/aiSession-U7UqgdSb.js.gz +0 -0
  149. package/public/assets/alert-dialog-C0mRms8g.js.br +0 -0
  150. package/public/assets/alert-dialog-C0mRms8g.js.gz +0 -0
  151. package/public/assets/badge-BjEnOmb0.js.br +0 -0
  152. package/public/assets/badge-BjEnOmb0.js.gz +0 -0
  153. package/public/assets/dialog-Cugbp1C4.js.br +0 -0
  154. package/public/assets/dialog-Cugbp1C4.js.gz +0 -0
  155. package/public/assets/field-hint-qmBa0qqN.js.br +0 -0
  156. package/public/assets/field-hint-qmBa0qqN.js.gz +0 -0
  157. package/public/assets/index-C_3Q51YJ.js +0 -248
  158. package/public/assets/index-C_3Q51YJ.js.br +0 -0
  159. package/public/assets/index-C_3Q51YJ.js.gz +0 -0
  160. package/public/assets/index-h2hiZ2OM.css +0 -1
  161. package/public/assets/index-h2hiZ2OM.css.br +0 -0
  162. package/public/assets/index-h2hiZ2OM.css.gz +0 -0
  163. package/public/assets/list-view-CyM0QUaH.js.br +0 -0
  164. package/public/assets/list-view-CyM0QUaH.js.gz +0 -0
  165. package/public/assets/pencil-DUZRZB3S.js.br +0 -0
  166. package/public/assets/pencil-DUZRZB3S.js.gz +0 -0
  167. package/public/assets/play-Z1L2Eb91.js.br +0 -0
  168. package/public/assets/play-Z1L2Eb91.js.gz +0 -0
  169. package/public/assets/search-input-B0s9mzRt.js.br +0 -0
  170. package/public/assets/search-input-B0s9mzRt.js.gz +0 -0
  171. package/public/assets/select-CHbE6M4S.js.br +0 -0
  172. package/public/assets/select-CHbE6M4S.js.gz +0 -0
  173. package/public/assets/slider-tyb3JvL2.js.br +0 -0
  174. package/public/assets/slider-tyb3JvL2.js.gz +0 -0
  175. package/public/assets/tabs-Bf7ou-eS.js.br +0 -0
  176. package/public/assets/tabs-Bf7ou-eS.js.gz +0 -0
  177. package/public/assets/tech-label-KAwM5qZ_.js.br +0 -0
  178. package/public/assets/tech-label-KAwM5qZ_.js.gz +0 -0
  179. package/public/assets/trash-HEJmY7DQ.js.br +0 -0
  180. package/public/assets/trash-HEJmY7DQ.js.gz +0 -0
  181. package/public/assets/video-DdHH0Q0l.js.br +0 -0
  182. package/public/assets/video-DdHH0Q0l.js.gz +0 -0
@@ -0,0 +1,248 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Setup-D4DsciMG.js","assets/vendor-react-DTSdA8m-.js","assets/field-hint-CIJmSABE.js","assets/vendor-router-B1pQim9Z.js","assets/Invite-BVRKLYJu.js","assets/pencil-CE5LnE8i.js","assets/ResetPassword-DU97TnMC.js","assets/AppCenter-BWgstOJH.js","assets/search-input-2MuvmbBR.js","assets/select-7EkQtxVy.js","assets/index-D17hSi50.js","assets/dialog-CrzZQwxn.js","assets/tech-label-DpVGqU2Y.js","assets/trash-DFsQhdZ1.js","assets/badge-Bjwwchrt.js","assets/alert-dialog-DPNbpxqG.js","assets/build-format-ofd2iIzf.js","assets/play-BR_CdQzZ.js","assets/useFocusAfterSwap-BdItkQCu.js","assets/useShownAfter-By1Yxysz.js","assets/QASession-BuQdx-pq.js","assets/useRelay-CES3I1Mt.js","assets/AndroidDeviceScreen-1RaPu10r.js","assets/aiSession-p7Uu2swu.js","assets/video-D1ajuM3p.js","assets/tabs-SLpwFQLx.js","assets/publicLink-D6zKS_wu.js","assets/resource-health-oWJ8hy9X.js","assets/Runs-BdCnN_dH.js","assets/list-view-DpnCsTM-.js","assets/runs-CFQ6M4rx.js","assets/RunDetail-BspFUFg2.js","assets/slider-ifEFgQFt.js","assets/WatchedDevice-D-SfDxp8.js","assets/AISessionWatch-DMfOAt_U.js","assets/MacResources-B6_Es8ye.js","assets/vendor-charts-BE7R_8yA.js","assets/Default-Obywi6hR.js","assets/Team-B2Txvi0a.js","assets/Tokens-D-ekP8kU.js","assets/NotFound-DVq_rCKc.js"])))=>i.map(i=>d[i]);
2
+ var lc=e=>{throw TypeError(e)};var Is=(e,t,n)=>t.has(e)||lc("Cannot "+n);var C=(e,t,n)=>(Is(e,t,"read from private field"),n?n.call(e):t.get(e)),ie=(e,t,n)=>t.has(e)?lc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),G=(e,t,n,r)=>(Is(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ge=(e,t,n)=>(Is(e,t,"access private method"),n);var wo=(e,t,n,r)=>({set _(o){G(e,t,o,n)},get _(){return C(e,t,r)}});import{r as h,j as m,R as I,a as $p,c as ee,b as Vn,d as lu,u as zp,o as Fp,s as Lp,f as Vp,e as Up,h as Zp,i as Bp,l as Hp,k as Wp,m as Kp}from"./vendor-react-DTSdA8m-.js";import{u as uu,a as du,L as _o,N as ea,O as Gp,R as it,B as qp,b as Qp}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 Yp=(e,t,n,r,o,s,i,a)=>{let c=document.documentElement,u=["light","dark"];function d(p){(Array.isArray(e)?e:[e]).forEach(y=>{let g=y==="class",w=g&&s?o.map(b=>s[b]||b):o;g?(c.classList.remove(...w),c.classList.add(s&&s[p]?s[p]:p)):c.setAttribute(y,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,y=i&&p==="system"?f():p;d(y)}catch{}},uc=["light","dark"],fu="(prefers-color-scheme: dark)",Jp=typeof window>"u",ta=h.createContext(void 0),Xp={setTheme:e=>{},themes:[]},ds=()=>{var e;return(e=h.useContext(ta))!=null?e:Xp},em=e=>h.useContext(ta)?h.createElement(h.Fragment,null,e.children):h.createElement(nm,{...e}),tm=["light","dark"],nm=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:o="theme",themes:s=tm,defaultTheme:i=n?"system":"light",attribute:a="data-theme",value:c,children:u,nonce:d,scriptProps:l})=>{let[f,p]=h.useState(()=>om(o,i)),[y,g]=h.useState(()=>f==="system"?As():f),w=c?Object.values(c):s,b=h.useCallback(E=>{let R=E;if(!R)return;E==="system"&&n&&(R=As());let P=c?c[R]:R,A=t?sm(d):null,M=document.documentElement,$=V=>{V==="class"?(M.classList.remove(...w),P&&M.classList.add(P)):V.startsWith("data-")&&(P?M.setAttribute(V,P):M.removeAttribute(V))};if(Array.isArray(a)?a.forEach($):$(a),r){let V=uc.includes(i)?i:null,D=uc.includes(R)?R:V;M.style.colorScheme=D}A==null||A()},[d]),S=h.useCallback(E=>{let R=typeof E=="function"?E(f):E;p(R);try{localStorage.setItem(o,R)}catch{}},[f]),_=h.useCallback(E=>{let R=As(E);g(R),f==="system"&&n&&!e&&b("system")},[f,e]);h.useEffect(()=>{let E=window.matchMedia(fu);return E.addListener(_),_(E),()=>E.removeListener(_)},[_]),h.useEffect(()=>{let E=R=>{R.key===o&&(R.newValue?p(R.newValue):S(i))};return window.addEventListener("storage",E),()=>window.removeEventListener("storage",E)},[S]),h.useEffect(()=>{b(e??f)},[e,f]);let O=h.useMemo(()=>({theme:f,setTheme:S,forcedTheme:e,resolvedTheme:f==="system"?y:f,themes:n?[...s,"system"]:s,systemTheme:n?y:void 0}),[f,S,e,y,n,s]);return h.createElement(ta.Provider,{value:O},h.createElement(rm,{forcedTheme:e,storageKey:o,attribute:a,enableSystem:n,enableColorScheme:r,defaultTheme:i,value:c,themes:s,nonce:d,scriptProps:l}),u)},rm=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:`(${Yp.toString()})(${d})`}})}),om=(e,t)=>{if(Jp)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},sm=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)}},As=e=>(e||(e=window.matchMedia(fu)),e.matches?"dark":"light");const im="modulepreload",am=function(e){return"/"+e},dc={},xt=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=am(u),u in dc)return;dc[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":im,d||(f.as="script"),f.crossOrigin="",f.href=u,c&&f.setAttribute("nonce",c),document.head.appendChild(f),d)return new Promise((p,y)=>{f.addEventListener("load",p),f.addEventListener("error",()=>y(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)})},hu=h.createContext(void 0),na=e=>{const t=h.useContext(hu);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},cm=({client:e,children:t})=>(h.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),m.jsx(hu.Provider,{value:e,children:t})),lm={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var hn,Xi,Xl,um=(Xl=class{constructor(){ie(this,hn,lm);ie(this,Xi,!1)}setTimeoutProvider(e){G(this,hn,e)}setTimeout(e,t){return C(this,hn).setTimeout(e,t)}clearTimeout(e){C(this,hn).clearTimeout(e)}setInterval(e,t){return C(this,hn).setInterval(e,t)}clearInterval(e){C(this,hn).clearInterval(e)}},hn=new WeakMap,Xi=new WeakMap,Xl);const Rn=new um;function dm(e){setTimeout(e,0)}const fm=typeof window>"u"||"Deno"in globalThis;function gt(){}function hm(e,t){return typeof e=="function"?e(t):e}function pu(e){return typeof e=="number"&&e>=0&&e!==1/0}function mu(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ie(e,t){return typeof e=="function"?e(t):e}function fc(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==ra(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 hc(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 ra(e,t){return((t==null?void 0:t.queryKeyHashFn)||Hr)(e)}function Hr(e){return JSON.stringify(e,(t,n)=>ni(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 pm=Object.prototype.hasOwnProperty;function gu(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=pc(e)&&pc(t);if(!r&&!(ni(e)&&ni(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:pm.call(e,d))&&c++;continue}if(l===null||f===null||typeof l!="object"||typeof f!="object"){a[d]=f;continue}const p=gu(l,f,n+1);a[d]=p,p===l&&c++}return o===i&&c===o?e:a}function Ns(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 pc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ni(e){if(!mc(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!(!mc(r)||!r.hasOwnProperty("isPrototypeOf")||t!==Object.prototype)}function mc(e){return Object.prototype.toString.call(e)==="[object Object]"}function mm(e){return new Promise(t=>{Rn.setTimeout(t,e)})}function ri(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?gu(e,t):t}function I2(e){return e}function gm(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function ym(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}const oa=Symbol();function yu(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===oa?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function vu(e,t){return typeof e=="function"?e(...t):!!e}function vm(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 bm=()=>fm;const sa=()=>bm();var ro=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(){}},Tn,pn,sr,eu,wm=(eu=class extends ro{constructor(){super();ie(this,Tn);ie(this,pn);ie(this,sr);G(this,sr,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){C(this,pn)||this.setEventListener(C(this,sr))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,pn))==null||t.call(this),G(this,pn,void 0))}setEventListener(t){var n;G(this,sr,t),(n=C(this,pn))==null||n.call(this),G(this,pn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){C(this,Tn)!==t&&(G(this,Tn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof C(this,Tn)=="boolean"?C(this,Tn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Tn=new WeakMap,pn=new WeakMap,sr=new WeakMap,eu);const ia=new wm,_m=dm;function xm(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=_m;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 tt=xm();var ir,mn,ar,tu,Sm=(tu=class extends ro{constructor(){super();ie(this,ir,!0);ie(this,mn);ie(this,ar);G(this,ar,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(){C(this,mn)||this.setEventListener(C(this,ar))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,mn))==null||t.call(this),G(this,mn,void 0))}setEventListener(t){var n;G(this,ar,t),(n=C(this,mn))==null||n.call(this),G(this,mn,t(this.setOnline.bind(this)))}setOnline(t){C(this,ir)!==t&&(G(this,ir,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return C(this,ir)}},ir=new WeakMap,mn=new WeakMap,ar=new WeakMap,tu);const Yo=new Sm;function Em(e){return Math.min(1e3*2**e,3e4)}function bu(e){return(e??"online")==="online"?Yo.isOnline():!0}var oi=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function wu(e){let t=!1,n=0,r,o="pending",s,i;const a=new Promise((S,_)=>{s=S,i=_});a.catch(gt);const c=()=>o!=="pending",u=S=>{var _;if(!c()){const O=new oi(S);g(O),(_=e.onCancel)==null||_.call(e,O)}},d=()=>{t=!0},l=()=>{t=!1},f=()=>ia.isFocused()&&(e.networkMode==="always"||Yo.isOnline())&&e.canRun(),p=()=>bu(e.networkMode)&&e.canRun(),y=S=>{c()||(r==null||r(),o="resolved",s(S))},g=S=>{c()||(r==null||r(),o="rejected",i(S))},w=S=>new Promise(_=>{var O;r=E=>{(c()||S())&&_(E)},(O=e.onPause)==null||O.call(e)}).then(()=>{var _;r=void 0,c()||(_=e.onContinue)==null||_.call(e)}),b=()=>{if(c())return;let S;const _=n===0?e.initialPromise:void 0;try{S=_??e.fn()}catch(O){S=Promise.reject(O)}Promise.resolve(S).then(y).catch(O=>{var M;if(c())return;const E=e.retry??(sa()?0:3),R=e.retryDelay??Em,P=typeof R=="function"?R(n,O):R,A=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,O);if(t||!A){g(O);return}n++,(M=e.onFail)==null||M.call(e,n,O),mm(P).then(()=>f()?void 0:w(f)).then(()=>{t?g(O):b()})})};return{promise:a,status:()=>o,cancel:u,continue:()=>(r==null||r(),a),cancelRetry:d,continueRetry:l,canStart:p,start:()=>(p()?b():w(p).then(b),a)}}var In,nu,_u=(nu=class{constructor(){ie(this,In)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),pu(this.gcTime)&&G(this,In,Rn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(sa()?1/0:3e5))}clearGcTimeout(){C(this,In)!==void 0&&(Rn.clearTimeout(C(this,In)),G(this,In,void 0))}},In=new WeakMap,nu);function Cm(e){return{onFetch:(t,n)=>{var d,l,f,p,y;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=((y=t.state.data)==null?void 0:y.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let g=!1;const w=_=>{vm(_,()=>t.signal,()=>g=!0)},b=yu(t.options,t.fetchOptions),S=async(_,O,E)=>{if(g)return Promise.reject(t.signal.reason);if(O==null&&_.pages.length)return Promise.resolve(_);const P=(()=>{const V={client:t.client,queryKey:t.queryKey,pageParam:O,direction:E?"backward":"forward",meta:t.options.meta};return w(V),V})(),A=await b(P),{maxPages:M}=t.options,$=E?ym:gm;return{pages:$(_.pages,A,M),pageParams:$(_.pageParams,O,M)}};if(o&&s.length){const _=o==="backward",O=_?km:gc,E={pages:s,pageParams:i};a=await S(E,O(r,E),_)}else{const _=e??s.length;do{const O=c===0?i[0]===void 0?r.initialPageParam:i[0]:gc(r,a);if(c>0&&O==null)break;a=await S(a,O),c++}while(c<_)}return a};t.options.persister?t.fetchFn=()=>{var g,w;return(w=(g=t.options).persister)==null?void 0:w.call(g,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function gc(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 km(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 cr,An,lr,kt,Nn,Ge,Jr,Dn,At,Qt,ru,Om=(ru=class extends _u{constructor(t){super();ie(this,At);ie(this,cr);ie(this,An);ie(this,lr);ie(this,kt);ie(this,Nn);ie(this,Ge);ie(this,Jr);ie(this,Dn);G(this,Dn,!1),G(this,Jr,t.defaultOptions),this.setOptions(t.options),this.observers=[],G(this,Nn,t.client),G(this,kt,C(this,Nn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,G(this,An,vc(this.options)),this.state=t.state??C(this,An),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return C(this,cr)}get promise(){var t;return(t=C(this,Ge))==null?void 0:t.promise}setOptions(t){if(this.options={...C(this,Jr),...t},t!=null&&t._type&&G(this,cr,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=vc(this.options);n.data!==void 0&&(this.setState(yc(n.data,n.dataUpdatedAt)),G(this,An,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,kt).remove(this)}setData(t,n){const r=ri(this.state.data,t,this.options);return ge(this,At,Qt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){ge(this,At,Qt).call(this,{type:"setState",state:t})}cancel(t){var r,o;const n=(r=C(this,Ge))==null?void 0:r.promise;return(o=C(this,Ge))==null||o.cancel(t),n?n.then(gt).catch(gt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return C(this,An)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Ie(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===oa||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ie(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:!mu(this.state.dataUpdatedAt,t)}onFocus(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||t.refetch({cancelRefetch:!1}),(n=C(this,Ge))==null||n.continue()}onOnline(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||t.refetch({cancelRefetch:!1}),(n=C(this,Ge))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),C(this,kt).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||(C(this,Ge)&&(C(this,Dn)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?C(this,Ge).cancel({revert:!0}):C(this,Ge).cancelRetry()),this.scheduleGc()),C(this,kt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ge(this,At,Qt).call(this,{type:"invalidate"})}async fetch(t,n){var u,d,l,f,p,y,g,w,b,S,_,O;if(this.state.fetchStatus!=="idle"&&((u=C(this,Ge))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(C(this,Ge))return C(this,Ge).continueRetry(),C(this,Ge).promise}if(t&&this.setOptions(t),!this.options.queryFn){const E=this.observers.find(R=>R.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,o=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(G(this,Dn,!0),r.signal)})},s=()=>{const E=yu(this.options,n),P=(()=>{const A={client:C(this,Nn),queryKey:this.queryKey,meta:this.meta};return o(A),A})();return G(this,Dn,!1),this.options.persister?this.options.persister(E,P,this):E(P)},a=(()=>{const E={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:C(this,Nn),state:this.state,fetchFn:s};return o(E),E})();(d=C(this,cr)==="infinite"?Cm(this.options.pages):this.options.behavior)==null||d.onFetch(a,this),G(this,lr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((l=a.fetchOptions)==null?void 0:l.meta))&&ge(this,At,Qt).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta});const c=G(this,Ge,wu({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:E=>{E instanceof oi&&E.revert&&this.setState({...C(this,lr),fetchStatus:"idle"}),r.abort()},onFail:(E,R)=>{ge(this,At,Qt).call(this,{type:"failed",failureCount:E,error:R})},onPause:()=>{ge(this,At,Qt).call(this,{type:"pause"})},onContinue:()=>{ge(this,At,Qt).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),(y=(p=C(this,kt).config).onSuccess)==null||y.call(p,E,this),(w=(g=C(this,kt).config).onSettled)==null||w.call(g,E,this.state.error,this),E}catch(E){if(E instanceof oi){if(E.silent)return C(this,Ge).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw ge(this,At,Qt).call(this,{type:"error",error:E}),(S=(b=C(this,kt).config).onError)==null||S.call(b,E,this),(O=(_=C(this,kt).config).onSettled)==null||O.call(_,this.state.data,E,this),E}finally{C(this,Ge)===c&&G(this,Ge,void 0),this.scheduleGc()}}},cr=new WeakMap,An=new WeakMap,lr=new WeakMap,kt=new WeakMap,Nn=new WeakMap,Ge=new WeakMap,Jr=new WeakMap,Dn=new WeakMap,At=new WeakSet,Qt=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,...xu(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...yc(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return G(this,lr,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),tt.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),C(this,kt).notify({query:this,type:"updated",action:t})})},ru);function xu(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:bu(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function yc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function vc(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,ve,Xr,dt,Mn,ur,Xt,eo,dr,fr,jn,$n,gn,hr,xe,zr,si,ii,ai,ci,li,ui,di,fi,ou,Rm=(ou=class extends ro{constructor(t,n){super();ie(this,xe);ie(this,ut);ie(this,ve);ie(this,Xr);ie(this,dt);ie(this,Mn);ie(this,ur);ie(this,Xt);ie(this,eo);ie(this,dr);ie(this,fr);ie(this,jn);ie(this,$n);ie(this,gn);ie(this,hr,new Set);this.options=n,G(this,ut,t),G(this,Xt,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(C(this,ve).addObserver(this),bc(C(this,ve),this.options)?ge(this,xe,zr).call(this):this.updateResult(),ge(this,xe,li).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return hi(C(this,ve),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return hi(C(this,ve),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ge(this,xe,ui).call(this),ge(this,xe,di).call(this),C(this,ve).removeObserver(this)}setOptions(t){const n=this.options,r=C(this,ve);if(this.options=C(this,ut).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ie(this.options.enabled,C(this,ve))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ge(this,xe,fi).call(this),C(this,ve).setOptions(this.options),n._defaulted&&!Ns(this.options,n)&&C(this,ut).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,ve),observer:this});const o=this.hasListeners();o&&wc(C(this,ve),r,this.options,n)&&ge(this,xe,zr).call(this),this.updateResult(),o&&(C(this,ve)!==r||Ie(this.options.enabled,C(this,ve))!==Ie(n.enabled,C(this,ve))||Ie(this.options.staleTime,C(this,ve))!==Ie(n.staleTime,C(this,ve)))&&ge(this,xe,ii).call(this);const s=ge(this,xe,ai).call(this);o&&(C(this,ve)!==r||Ie(this.options.enabled,C(this,ve))!==Ie(n.enabled,C(this,ve))||s!==C(this,gn))&&ge(this,xe,ci).call(this,s)}getOptimisticResult(t){const n=C(this,ut).getQueryCache().build(C(this,ut),t),r=this.createResult(n,t);return Ns(this.getCurrentResult(),r)||(G(this,dt,r),G(this,ur,this.options),G(this,Mn,C(this,ve).state)),r}getCurrentResult(){return C(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){C(this,hr).add(t)}getCurrentQuery(){return C(this,ve)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=C(this,ut).defaultQueryOptions(t),r=C(this,ut).getQueryCache().build(C(this,ut),n);let o=()=>{},s;const i=new Promise(a=>{s=a,o=C(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(n).then(()=>{const a=this.createResult(r,n);return s==null||s(a),a}).finally(()=>{o()}),i])}fetch(t){return ge(this,xe,zr).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,dt)))}createResult(t,n){var R;const r=C(this,ve),o=this.options,s=C(this,dt),i=C(this,Mn),a=C(this,ur),c=t!==r?t.state:C(this,Xr),{state:u}=t;let d={...u},l=!1,f;if(n._optimisticResults){const P=this.hasListeners(),A=!P&&bc(t,n),M=P&&wc(t,r,n,o);(A||M)&&(d={...d,...xu(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:y,status:g}=d;f=d.data;let w=!1;if(n.placeholderData!==void 0&&f===void 0&&g==="pending"){let P;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(P=s.data,w=!0):P=typeof n.placeholderData=="function"?n.placeholderData((R=C(this,fr))==null?void 0:R.state.data,C(this,fr)):n.placeholderData,P!==void 0&&(g="success",f=ri(s==null?void 0:s.data,P,n),l=!0)}if(n.select&&f!==void 0&&!w)if(s&&f===(i==null?void 0:i.data)&&n.select===C(this,eo))f=C(this,dr);else try{G(this,eo,n.select),f=n.select(f),f=ri(s==null?void 0:s.data,f,n),G(this,dr,f),G(this,Xt,null)}catch(P){G(this,Xt,P)}else f===void 0&&G(this,Xt,null);C(this,Xt)&&(p=C(this,Xt),f=C(this,dr),y=Date.now(),g="error",l=!1);const b=d.fetchStatus==="fetching",S=g==="pending",_=g==="error",O=S&&b,E=f!==void 0;return{status:g,fetchStatus:d.fetchStatus,isPending:S,isSuccess:g==="success",isError:_,isInitialLoading:O,isLoading:O,data:f,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:y,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&&!S,isLoadingError:_&&!E,isPaused:d.fetchStatus==="paused",isPlaceholderData:l,isRefetchError:_&&E,isStale:aa(t,n),refetch:this.refetch,isEnabled:Ie(n.enabled,t)!==!1}}updateResult(){const t=C(this,dt),n=this.createResult(C(this,ve),this.options);if(G(this,Mn,C(this,ve).state),G(this,ur,this.options),C(this,Mn).data!==void 0&&G(this,fr,C(this,ve)),Ns(n,t))return;G(this,dt,n);const o=(()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!C(this,hr).size)return!0;const a=new Set(i??C(this,hr));return this.options.throwOnError&&a.add("error"),Object.keys(C(this,dt)).some(c=>{const u=c;return C(this,dt)[u]!==t[u]&&a.has(u)})})();tt.batch(()=>{o&&this.listeners.forEach(s=>{s(C(this,dt))}),C(this,ut).getQueryCache().notify({query:C(this,ve),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ge(this,xe,li).call(this)}},ut=new WeakMap,ve=new WeakMap,Xr=new WeakMap,dt=new WeakMap,Mn=new WeakMap,ur=new WeakMap,Xt=new WeakMap,eo=new WeakMap,dr=new WeakMap,fr=new WeakMap,jn=new WeakMap,$n=new WeakMap,gn=new WeakMap,hr=new WeakMap,xe=new WeakSet,zr=function(t){ge(this,xe,fi).call(this);let n=C(this,ve).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(gt)),n},si=function(t){return!sa()&&Ie(this.options.enabled,C(this,ve))!==!1&&pu(t)},ii=function(){ge(this,xe,ui).call(this);const t=Ie(this.options.staleTime,C(this,ve));if(C(this,dt).isStale||!ge(this,xe,si).call(this,t))return;const n=mu(C(this,dt).dataUpdatedAt,t)+1;G(this,jn,Rn.setTimeout(()=>{C(this,dt).isStale||this.updateResult()},n))},ai=function(){return Ie(this.options.refetchInterval,C(this,ve))??!1},ci=function(t){ge(this,xe,di).call(this),G(this,gn,t),!(C(this,gn)===0||!ge(this,xe,si).call(this,C(this,gn)))&&G(this,$n,Rn.setInterval(()=>{(this.options.refetchIntervalInBackground||ia.isFocused())&&ge(this,xe,zr).call(this)},C(this,gn)))},li=function(){ge(this,xe,ii).call(this),ge(this,xe,ci).call(this,ge(this,xe,ai).call(this))},ui=function(){C(this,jn)!==void 0&&(Rn.clearTimeout(C(this,jn)),G(this,jn,void 0))},di=function(){C(this,$n)!==void 0&&(Rn.clearInterval(C(this,$n)),G(this,$n,void 0))},fi=function(){const t=C(this,ut).getQueryCache().build(C(this,ut),this.options);if(t===C(this,ve))return;const n=C(this,ve);G(this,ve,t),G(this,Xr,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},ou);function Pm(e,t){return Ie(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ie(t.retryOnMount,e)===!1)}function bc(e,t){return Pm(e,t)||e.state.data!==void 0&&hi(e,t,t.refetchOnMount)}function hi(e,t,n){if(Ie(t.enabled,e)!==!1&&Ie(t.staleTime,e)!=="static"){const r=Ie(n,e);return r==="always"||r!==!1&&aa(e,t)}return!1}function wc(e,t,n,r){return(e!==t||Ie(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&aa(e,n)}function aa(e,t){return Ie(t.enabled,e)!==!1&&e.isStaleByTime(Ie(t.staleTime,e))}var to,Ft,at,zn,Lt,un,su,Tm=(su=class extends _u{constructor(t){super();ie(this,Lt);ie(this,to);ie(this,Ft);ie(this,at);ie(this,zn);G(this,to,t.client),this.mutationId=t.mutationId,G(this,at,t.mutationCache),G(this,Ft,[]),this.state=t.state||Im(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){C(this,Ft).includes(t)||(C(this,Ft).push(t),this.clearGcTimeout(),C(this,at).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){G(this,Ft,C(this,Ft).filter(n=>n!==t)),this.scheduleGc(),C(this,at).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){C(this,Ft).length||(this.state.status==="pending"?this.scheduleGc():C(this,at).remove(this))}continue(){var t;return((t=C(this,zn))==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,y,g,w,b,S,_,O,E,R,P,A;const n=()=>{ge(this,Lt,un).call(this,{type:"continue"})},r={client:C(this,to),meta:this.options.meta,mutationKey:this.options.mutationKey},o=G(this,zn,wu({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,$)=>{ge(this,Lt,un).call(this,{type:"failed",failureCount:M,error:$})},onPause:()=>{ge(this,Lt,un).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,at).canRun(this)})),s=this.state.status==="pending",i=!o.canStart();try{if(s)n();else{ge(this,Lt,un).call(this,{type:"pending",variables:t,isPaused:i}),C(this,at).config.onMutate&&await C(this,at).config.onMutate(t,this,r);const $=await((c=(a=this.options).onMutate)==null?void 0:c.call(a,t,r));$!==this.state.context&&ge(this,Lt,un).call(this,{type:"pending",context:$,variables:t,isPaused:i})}const M=await o.start();return await((d=(u=C(this,at).config).onSuccess)==null?void 0:d.call(u,M,t,this.state.context,this,r)),await((f=(l=this.options).onSuccess)==null?void 0:f.call(l,M,t,this.state.context,r)),await((y=(p=C(this,at).config).onSettled)==null?void 0:y.call(p,M,null,this.state.variables,this.state.context,this,r)),await((w=(g=this.options).onSettled)==null?void 0:w.call(g,M,null,t,this.state.context,r)),ge(this,Lt,un).call(this,{type:"success",data:M}),M}catch(M){try{await((S=(b=C(this,at).config).onError)==null?void 0:S.call(b,M,t,this.state.context,this,r))}catch($){Promise.reject($)}try{await((O=(_=this.options).onError)==null?void 0:O.call(_,M,t,this.state.context,r))}catch($){Promise.reject($)}try{await((R=(E=C(this,at).config).onSettled)==null?void 0:R.call(E,void 0,M,this.state.variables,this.state.context,this,r))}catch($){Promise.reject($)}try{await((A=(P=this.options).onSettled)==null?void 0:A.call(P,void 0,M,t,this.state.context,r))}catch($){Promise.reject($)}throw ge(this,Lt,un).call(this,{type:"error",error:M}),M}finally{C(this,zn)===o&&G(this,zn,void 0),C(this,at).runNext(this)}}},to=new WeakMap,Ft=new WeakMap,at=new WeakMap,zn=new WeakMap,Lt=new WeakSet,un=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),tt.batch(()=>{C(this,Ft).forEach(r=>{r.onMutationUpdate(t)}),C(this,at).notify({mutation:this,type:"updated",action:t})})},su);function Im(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var yn,Nt,no,iu,Am=(iu=class extends ro{constructor(t={}){super();ie(this,yn);ie(this,Nt);ie(this,no);this.config=t,G(this,yn,new Set),G(this,Nt,new Map),G(this,no,0)}build(t,n,r){const o=new Tm({client:t,mutationCache:this,mutationId:++wo(this,no)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){C(this,yn).add(t);const n=xo(t);if(typeof n=="string"){const r=C(this,Nt).get(n);r?r.push(t):C(this,Nt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(C(this,yn).delete(t)){const n=xo(t);if(typeof n=="string"){const r=C(this,Nt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&C(this,Nt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=xo(t);if(typeof n=="string"){const o=(r=C(this,Nt).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=xo(t);return typeof n=="string"?((o=(r=C(this,Nt).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused))==null?void 0:o.continue())??Promise.resolve():Promise.resolve()}clear(){tt.batch(()=>{const t=this.getAll();C(this,yn).clear(),C(this,Nt).clear(),t.forEach(n=>{this.notify({type:"removed",mutation:n})})})}getAll(){return Array.from(C(this,yn))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>hc(n,r))}findAll(t={}){return this.getAll().filter(n=>hc(t,n))}notify(t){tt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return tt.batch(()=>Promise.all(t.map(n=>n.continue().catch(gt))))}},yn=new WeakMap,Nt=new WeakMap,no=new WeakMap,iu);function xo(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Vt,au,Nm=(au=class extends ro{constructor(t={}){super();ie(this,Vt);this.config=t,G(this,Vt,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??ra(o,n);let i=this.get(s);return i||(i=new Om({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){C(this,Vt).has(t.queryHash)||(C(this,Vt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){C(this,Vt).get(t.queryHash)===t&&(t.destroy(),C(this,Vt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){tt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return C(this,Vt).get(t)}getAll(){return[...C(this,Vt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>fc(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>fc(t,r)):n}notify(t){tt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){tt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){tt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Vt=new WeakMap,au),De,vn,bn,pr,mr,wn,gr,yr,cu,Dm=(cu=class{constructor(e={}){ie(this,De);ie(this,vn);ie(this,bn);ie(this,pr);ie(this,mr);ie(this,wn);ie(this,gr);ie(this,yr);G(this,De,e.queryCache||new Nm),G(this,vn,e.mutationCache||new Am),G(this,bn,e.defaultOptions||{}),G(this,pr,new Map),G(this,mr,new Map),G(this,wn,0)}mount(){wo(this,wn)._++,C(this,wn)===1&&(G(this,gr,ia.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,De).onFocus())})),G(this,yr,Yo.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,De).onOnline())})))}unmount(){var e,t;wo(this,wn)._--,C(this,wn)===0&&((e=C(this,gr))==null||e.call(this),G(this,gr,void 0),(t=C(this,yr))==null||t.call(this),G(this,yr,void 0))}isFetching(e){return C(this,De).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return C(this,vn).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=C(this,De).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=C(this,De).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ie(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return C(this,De).findAll(e).map(({queryKey:t,state:n})=>[t,n.data])}setQueryData(e,t,n){var i;const r=this.defaultQueryOptions({queryKey:e}),o=(i=C(this,De).get(r.queryHash))==null?void 0:i.state.data,s=hm(t,o);if(s!==void 0)return C(this,De).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return tt.batch(()=>C(this,De).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=C(this,De).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=C(this,De);tt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=C(this,De);return tt.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=tt.batch(()=>C(this,De).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(gt).catch(gt)}invalidateQueries(e,t={}){return tt.batch(()=>(C(this,De).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=tt.batch(()=>C(this,De).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(gt)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(gt)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=C(this,De).build(this,t),r=n.isStaleByTime(Ie(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=C(this,De).build(this,t);return n.isStaleByTime(Ie(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(gt).catch(gt)}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(gt).catch(gt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Yo.isOnline()?C(this,vn).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,De)}getMutationCache(){return C(this,vn)}getDefaultOptions(){return C(this,bn)}setDefaultOptions(e){G(this,bn,e)}setQueryDefaults(e,t){C(this,pr).set(Hr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...C(this,pr).values()],n={};return t.forEach(r=>{vr(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){C(this,mr).set(Hr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...C(this,mr).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={...C(this,bn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ra(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===oa&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...C(this,bn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){C(this,De).clear(),C(this,vn).clear()}},De=new WeakMap,vn=new WeakMap,bn=new WeakMap,pr=new WeakMap,mr=new WeakMap,wn=new WeakMap,gr=new WeakMap,yr=new WeakMap,cu);const Su=h.createContext(!1),Mm=()=>h.useContext(Su);Su.Provider;function jm(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const $m=h.createContext(jm()),zm=()=>h.useContext($m),Fm=(e,t,n)=>{const r=(n==null?void 0:n.state.status)==="error"&&typeof e.throwOnError=="function"?vu(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Lm=e=>{h.useEffect(()=>{e.clearReset()},[e])},Vm=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||vu(n,[e.error,r])),Um=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))}},Zm=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Bm=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Hm(e,t,n){const r=Mm(),o=zm(),s=na(),i=s.defaultQueryOptions(e),a=s.getQueryCache().get(i.queryHash),c=e.subscribed!==!1;i._optimisticResults=r?"isRestoring":c?"optimistic":void 0,Um(i),Fm(i,o,a),Lm(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(tt.batchCalls(f)):gt;return u.updateResult(),p},[u,l]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),h.useEffect(()=>{u.setOptions(i)},[i,u]),Zm(i,d))throw Bm(i,u,o);if(Vm({result:d,errorResetBoundary:o,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw d.error;return i.notifyOnChangeProps?d:u.trackResult(d)}function Jo(e,t){return Hm(e,Rm)}/**
3
+ * @license lucide-react v1.61.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 Wm=e=>e==null?void 0:e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
8
+ * @license lucide-react v1.61.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 Km(e,t,n=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:Wm(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}/**
13
+ * @license lucide-react v1.61.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 Gm=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.61.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 qm=e=>{const t=Gm(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
23
+ * @license lucide-react v1.61.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 pi=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
28
+ * @license lucide-react v1.61.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 On={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.61.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 Ds(e){return e!=null}function Qm(e,t={}){var f,p;const n=t.attributeNames??{},r=y=>n[y]??y,o=e.size??e.width??On.width,s=e.size??e.height??On.height,i=((f=e.aliases)==null?void 0:f.filter(y=>typeof y=="string"&&y.trim()!=="").map(y=>`lucide-${y}`))??[],a=[...e.name?[`lucide-${e.name}`]:[],...i],c=((p=t.className)==null?void 0:p.split(" ").filter(Boolean))??[],u=t.includeDefaultClasses===!1?pi(...c):pi("lucide",...a,...c),d=t.absoluteStrokeWidth?Number(t.strokeWidth??On["stroke-width"])*Number(e.size??e.width??On.width)/Number(t.size??t.width??On.width):t.strokeWidth??On["stroke-width"];return["svg",{...Object.entries(On).reduce((y,[g,w])=>(y[r(g)]=w,y),{}),..."color"in t&&t.color&&{[r("stroke")]:t.color},..."size"in t&&Ds(t.size)&&{[r("width")]:t.size,[r("height")]:t.size},..."width"in t&&Ds(t.width)&&{[r("width")]:t.width},..."height"in t&&Ds(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(y=>{const[g,w,b]=y,S=t.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...w}:w;return b?[g,S,b]:[g,S]})]}/**
38
+ * @license lucide-react v1.61.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 Ym(e,t={}){return Qm(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
43
+ * @license lucide-react v1.61.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 Jm=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Xm=h.createContext({}),eg=()=>h.useContext(Xm),tg=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:y=2,absoluteStrokeWidth:g=!1,nonScalingStroke:w=!1,color:b="currentColor",className:S=""}=eg()??{},_=!!c||Jm(l),[O,E,R=[]]=Ym(d,{color:e??b,width:n??t??p,height:r??t??p,strokeWidth:o??y,absoluteStrokeWidth:s??g,nonScalingStroke:i??w,className:pi(S,a),hasA11yProp:_,attributes:l});return h.createElement(O,{ref:f,...E},[...R.map(([P,A])=>h.createElement(P,A)),...Array.isArray(c)?c:[c]])});/**
48
+ * @license lucide-react v1.61.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 Ke(e,t=[],n=[]){const r=typeof e=="string"?Km(e,t,n):e,o=h.forwardRef(({className:s,...i},a)=>h.createElement(tg,{ref:a,icon:r,className:s,...i}));return r.name&&(o.displayName=qm(r.name)),o}/**
53
+ * @license lucide-react v1.61.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 Eu={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"}]]};Eu.node;const ng=Ke(Eu);/**
58
+ * @license lucide-react v1.61.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 Cu={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};Cu.node;const rg=Ke(Cu);/**
63
+ * @license lucide-react v1.61.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 ku={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};ku.node;const og=Ke(ku);/**
68
+ * @license lucide-react v1.61.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 Ou={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};Ou.node;const sg=Ke(Ou);/**
73
+ * @license lucide-react v1.61.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 Ru={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};Ru.node;const ig=Ke(Ru);/**
78
+ * @license lucide-react v1.61.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 Pu={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};Pu.node;const ag=Ke(Pu);/**
83
+ * @license lucide-react v1.61.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 Tu={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"}]]};Tu.node;const cg=Ke(Tu);/**
88
+ * @license lucide-react v1.61.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 Iu={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"}]]};Iu.node;const lg=Ke(Iu);/**
93
+ * @license lucide-react v1.61.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 Au={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};Au.node;const ug=Ke(Au);/**
98
+ * @license lucide-react v1.61.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 Nu={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"}]]};Nu.node;const dg=Ke(Nu);/**
103
+ * @license lucide-react v1.61.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 Du={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"}]]};Du.node;const fg=Ke(Du);/**
108
+ * @license lucide-react v1.61.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 Mu={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"}]]};Mu.node;const hg=Ke(Mu);/**
113
+ * @license lucide-react v1.61.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 ju={name:"octagon-x",size:24,node:[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-octagon"]};ju.node;const pg=Ke(ju);/**
118
+ * @license lucide-react v1.61.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 $u={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"]};$u.node;const mg=Ke($u);/**
123
+ * @license lucide-react v1.61.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 zu={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"}]]};zu.node;const Fu=Ke(zu);/**
128
+ * @license lucide-react v1.61.0 - ISC
129
+ *
130
+ * This source code is licensed under the ISC license.
131
+ * See the LICENSE file in the root directory of this source tree.
132
+ */const Lu={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"]};Lu.node;const gg=Ke(Lu);/**
133
+ * @license lucide-react v1.61.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */const Vu={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"}]]};Vu.node;const yg=Ke(Vu);/**
138
+ * @license lucide-react v1.61.0 - ISC
139
+ *
140
+ * This source code is licensed under the ISC license.
141
+ * See the LICENSE file in the root directory of this source tree.
142
+ */const Uu={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};Uu.node;const vg=Ke(Uu);/**
143
+ * @license lucide-react v1.61.0 - ISC
144
+ *
145
+ * This source code is licensed under the ISC license.
146
+ * See the LICENSE file in the root directory of this source tree.
147
+ */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 bg=Ke(Zu);/**
148
+ * @license lucide-react v1.61.0 - ISC
149
+ *
150
+ * This source code is licensed under the ISC license.
151
+ * See the LICENSE file in the root directory of this source tree.
152
+ */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 wg=Ke(Bu);function _g(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 xg=e=>{switch(e){case"success":return Cg;case"info":return Og;case"warning":return kg;case"error":return Rg;default:return null}},Sg=Array(12).fill(0),Eg=({visible:e,className:t})=>I.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},I.createElement("div",{className:"sonner-spinner"},Sg.map((n,r)=>I.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Cg=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"})),kg=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"})),Og=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"})),Rg=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"})),Pg=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"})),Tg=()=>{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 Ig=1;const Ag=100,_c=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:Ig++};class Ng{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-Ag;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=_c(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(Mg(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,y=typeof l=="object"&&!I.isValidElement(l)?l:{message:l};this.create({id:r,type:"error",description:f,...y})}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,y=typeof l=="object"&&!I.isValidElement(l)?l:{message:l};this.create({id:r,type:"error",description:f,...y})}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,y=typeof l=="object"&&!I.isValidElement(l)?l:{message:l};this.create({id:r,type:"success",description:f,...y})}}).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=_c(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 mt=new Ng,Dg=(e,t)=>mt.message(e,t),Mg=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",jg=Dg,$g=()=>mt.toasts,zg=()=>mt.getActiveToasts(),A2=Object.assign(jg,{success:mt.success,info:mt.info,warning:mt.warning,error:mt.error,custom:mt.custom,message:mt.message,promise:mt.promise,dismiss:mt.dismiss,loading:mt.loading},{getHistory:$g,getToasts:zg});_g("[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 So(e){return e.label!==void 0}const Fg=3,Lg="24px",Vg="16px",xc=4e3,Ug=356,Zg=14,Bg=45,Hg=200;function $t(...e){return e.filter(Boolean).join(" ")}function Wg(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Kg=e=>{var t,n,r,o,s,i,a,c,u;const{invert:d,toast:l,unstyled:f,interacting:p,setHeights:y,visibleToasts:g,heights:w,index:b,toasts:S,expanded:_,removeToast:O,defaultRichColors:E,closeButton:R,style:P,cancelButtonStyle:A,actionButtonStyle:M,className:$="",descriptionClassName:V="",duration:D,position:Q,gap:U,expandByDefault:K,classNames:H,icons:Y,closeButtonAriaLabel:ne="Close toast"}=e,[te,X]=I.useState(null),[q,ye]=I.useState(null),[me,le]=I.useState(!1),[re,W]=I.useState(!1),[ae,be]=I.useState(!1),[se,Te]=I.useState(!1),[Se,ke]=I.useState(!1),[je,Fe]=I.useState(0),[Et,Ct]=I.useState(0),Oe=I.useRef(l.duration||D||xc),Wn=I.useRef(null),ht=I.useRef(null),Kn=b===0,Ht=b+1<=g,$e=l.type,fo=$e??"default",Wt=l.dismissible!==!1,Ir=l.className||"",Gn=l.descriptionClassName||"",qn=I.useMemo(()=>w.findIndex(x=>x.toastId===l.id)||0,[w,l.id]),ho=I.useMemo(()=>{var x;return(x=l.closeButton)!=null?x:R},[l.closeButton,R]),po=I.useMemo(()=>l.duration||D||xc,[l.duration,D]),kn=I.useRef(0),Kt=I.useRef(0),Qn=I.useRef(0),jt=I.useRef(null),[Rs,mo]=Q.split("-"),go=I.useMemo(()=>w.reduce((x,T,N)=>N>=qn?x:x+T.height,0),[w,qn]),Ar=Tg(),bt=I.useMemo(()=>{var x;return(x=e.swipeDirections)!=null?x:Wg(Q)},[e.swipeDirections,Q]),Ps=l.invert||d,Nr=$e==="loading";Kt.current=I.useMemo(()=>qn*U+go,[qn,go]),I.useEffect(()=>{Oe.current=po},[po]),I.useEffect(()=>{le(!0)},[]),I.useEffect(()=>{const x=ht.current;if(x){const T=x.getBoundingClientRect().height;return Ct(T),y(N=>[{toastId:l.id,height:T,position:l.position},...N]),()=>y(N=>N.filter(B=>B.toastId!==l.id))}},[y,l.id]),I.useLayoutEffect(()=>{if(!me)return;const x=ht.current,T=x.style.height;x.style.height="auto";const N=x.getBoundingClientRect().height;x.style.height=T,Ct(N),y(B=>B.find(L=>L.toastId===l.id)?B.map(L=>L.toastId===l.id?{...L,height:N}:L):[{toastId:l.id,height:N,position:l.position},...B])},[me,l.title,l.description,y,l.id,l.jsx,l.action,l.cancel]);const Gt=I.useCallback(()=>{W(!0),Fe(Kt.current),y(x=>x.filter(T=>T.toastId!==l.id)),setTimeout(()=>{O(l)},Hg)},[l,O,y,Kt]);I.useEffect(()=>{if(l.promise&&$e==="loading"||l.duration===1/0||l.type==="loading")return;let x;return _||p||Ar?(()=>{if(Qn.current<kn.current){const B=new Date().getTime()-kn.current;Oe.current=Oe.current-B}Qn.current=new Date().getTime()})():(()=>{Oe.current!==1/0&&(kn.current=new Date().getTime(),x=setTimeout(()=>{l.onAutoClose==null||l.onAutoClose.call(l,l),Gt()},Oe.current))})(),()=>clearTimeout(x)},[_,p,l,$e,Ar,Gt]),I.useEffect(()=>{l.delete&&(Gt(),l.onDismiss==null||l.onDismiss.call(l,l))},[Gt,l.delete]);function Ts(){var x;if(Y!=null&&Y.loading){var T;return I.createElement("div",{className:$t(H==null?void 0:H.loader,l==null||(T=l.classNames)==null?void 0:T.loader,"sonner-loader"),"data-visible":$e==="loading"},Y.loading)}return I.createElement(Eg,{className:$t(H==null?void 0:H.loader,l==null||(x=l.classNames)==null?void 0:x.loader),visible:$e==="loading"})}const yo=l.icon||(Y==null?void 0:Y[$e])||xg($e);var v,k;return I.createElement("li",{tabIndex:0,ref:ht,className:$t($,Ir,H==null?void 0:H.toast,l==null||(t=l.classNames)==null?void 0:t.toast,H==null?void 0:H[fo],l==null||(n=l.classNames)==null?void 0:n[fo]),"data-sonner-toast":"","data-rich-colors":(v=l.richColors)!=null?v:E,"data-styled":!(l.jsx||l.unstyled||f),"data-mounted":me,"data-promise":!!l.promise,"data-swiped":Se,"data-removed":re,"data-visible":Ht,"data-y-position":Rs,"data-x-position":mo,"data-index":b,"data-front":Kn,"data-swiping":ae,"data-dismissible":Wt,"data-type":$e,"data-invert":Ps,"data-swipe-out":se,"data-swipe-direction":q,"data-expanded":!!(_||K&&me),"data-testid":l.testId,style:{"--index":b,"--toasts-before":b,"--z-index":S.length-b,"--offset":`${re?je:Kt.current}px`,"--initial-height":K?"auto":`${Et}px`,...P,...l.style},onDragEnd:()=>{be(!1),X(null),jt.current=null},onPointerDown:x=>{x.button!==2&&(Nr||!Wt||(Wn.current=new Date,Fe(Kt.current),x.target.setPointerCapture(x.pointerId),x.target.tagName!=="BUTTON"&&(be(!0),jt.current={x:x.clientX,y:x.clientY})))},onPointerUp:()=>{var x,T,N;if(se||!Wt)return;jt.current=null;const B=Number(((x=ht.current)==null?void 0:x.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),F=Number(((T=ht.current)==null?void 0:T.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),L=new Date().getTime()-((N=Wn.current)==null?void 0:N.getTime()),z=te==="x"?B:F,J=Math.abs(z)/L;if((te==="x"?bt.includes(B>0?"right":"left"):bt.includes(F>0?"bottom":"top"))&&(Math.abs(z)>=Bg||J>.11)){Fe(Kt.current),l.onDismiss==null||l.onDismiss.call(l,l),ye(te==="x"?B>0?"right":"left":F>0?"down":"up"),Gt(),Te(!0);return}else{var he,Ye;(he=ht.current)==null||he.style.setProperty("--swipe-amount-x","0px"),(Ye=ht.current)==null||Ye.style.setProperty("--swipe-amount-y","0px")}ke(!1),be(!1),X(null)},onPointerMove:x=>{var T,N,B;if(!jt.current||!Wt||((T=window.getSelection())==null?void 0:T.toString().length)>0)return;const L=x.clientY-jt.current.y,z=x.clientX-jt.current.x;!te&&(Math.abs(z)>1||Math.abs(L)>1)&&X(Math.abs(z)>Math.abs(L)?"x":"y");let J={x:0,y:0};const de=he=>1/(1.5+Math.abs(he)/20);if(te==="y"){if(bt.includes("top")||bt.includes("bottom"))if(bt.includes("top")&&L<0||bt.includes("bottom")&&L>0)J.y=L;else{const he=L*de(L);J.y=Math.abs(he)<Math.abs(L)?he:L}}else if(te==="x"&&(bt.includes("left")||bt.includes("right")))if(bt.includes("left")&&z<0||bt.includes("right")&&z>0)J.x=z;else{const he=z*de(z);J.x=Math.abs(he)<Math.abs(z)?he:z}(Math.abs(J.x)>0||Math.abs(J.y)>0)&&ke(!0),(N=ht.current)==null||N.style.setProperty("--swipe-amount-x",`${J.x}px`),(B=ht.current)==null||B.style.setProperty("--swipe-amount-y",`${J.y}px`)}},ho&&!l.jsx&&$e!=="loading"?I.createElement("button",{"aria-label":ne,"data-disabled":Nr,"data-close-button":!0,onClick:Nr||!Wt?()=>{}:()=>{Gt(),l.onDismiss==null||l.onDismiss.call(l,l)},className:$t(H==null?void 0:H.closeButton,l==null||(r=l.classNames)==null?void 0:r.closeButton)},(k=Y==null?void 0:Y.close)!=null?k:Pg):null,($e||l.icon||l.promise)&&l.icon!==null&&((Y==null?void 0:Y[$e])!==null||l.icon)?I.createElement("div",{"data-icon":"",className:$t(H==null?void 0:H.icon,l==null||(o=l.classNames)==null?void 0:o.icon)},$e==="loading"?l.icon||Ts():l.promise?Ts():null,$e!=="loading"?yo:null):null,I.createElement("div",{"data-content":"",className:$t(H==null?void 0:H.content,l==null||(s=l.classNames)==null?void 0:s.content)},I.createElement("div",{"data-title":"",className:$t(H==null?void 0:H.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(V,Gn,H==null?void 0:H.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&&So(l.cancel)?I.createElement("button",{"data-button":!0,"data-cancel":!0,style:l.cancelButtonStyle||A,onClick:x=>{So(l.cancel)&&Wt&&(l.cancel.onClick==null||l.cancel.onClick.call(l.cancel,x),Gt())},className:$t(H==null?void 0:H.cancelButton,l==null||(c=l.classNames)==null?void 0:c.cancelButton)},l.cancel.label):null,I.isValidElement(l.action)?l.action:l.action&&So(l.action)?I.createElement("button",{"data-button":!0,"data-action":!0,style:l.actionButtonStyle||M,onClick:x=>{So(l.action)&&(l.action.onClick==null||l.action.onClick.call(l.action,x),!x.defaultPrevented&&Gt())},className:$t(H==null?void 0:H.actionButton,l==null||(u=l.classNames)==null?void 0:u.actionButton)},l.action.label):null)};function Sc(){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 Gg(e,t){const n={};return[e,t].forEach((r,o)=>{const s=o===1,i=s?"--mobile-offset":"--offset",a=s?Vg:Lg;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 qg=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:y,style:g,visibleToasts:w=Fg,toastOptions:b,dir:S=Sc(),gap:_=Zg,icons:O,customAriaLabel:E,containerAriaLabel:R="Notifications"}=t,[P,A]=I.useState([]),M=I.useMemo(()=>r?P.filter(le=>le.toasterId===r):P.filter(le=>!le.toasterId),[P,r]),$=I.useMemo(()=>Array.from(new Set([s].concat(M.filter(le=>le.position).map(le=>le.position)))),[M,s]),[V,D]=I.useState([]),[Q,U]=I.useState(!1),[K,H]=I.useState(!1),[Y,ne]=I.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),te=I.useRef(null),X=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),q=I.useRef(null),ye=I.useRef(!1),me=I.useCallback(le=>{A(re=>{var W;return(W=re.find(ae=>ae.id===le.id))!=null&&W.delete||mt.dismiss(le.id),re.filter(({id:ae})=>ae!==le.id)})},[]);return I.useEffect(()=>mt.subscribe(le=>{if(le.dismiss){requestAnimationFrame(()=>{A(re=>re.map(W=>W.id===le.id?{...W,delete:!0}:W))});return}setTimeout(()=>{$p.flushSync(()=>{A(re=>{const W=re.findIndex(ae=>ae.id===le.id);return W!==-1?[...re.slice(0,W),{...re[W],...le},...re.slice(W+1)]:[le,...re]})})})}),[]),I.useEffect(()=>{if(f!=="system"){ne(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ne("dark"):ne("light")),typeof window>"u")return;const le=window.matchMedia("(prefers-color-scheme: dark)");try{le.addEventListener("change",({matches:re})=>{ne(re?"dark":"light")})}catch{le.addListener(({matches:W})=>{try{ne(W?"dark":"light")}catch(ae){console.error(ae)}})}},[f]),I.useEffect(()=>{P.length<=1&&U(!1)},[P]),I.useEffect(()=>{const le=re=>{var W;if(i.length>0&&i.every(se=>re[se]||re.code===se)){var be;U(!0),(be=te.current)==null||be.focus()}re.code==="Escape"&&(document.activeElement===te.current||(W=te.current)!=null&&W.contains(document.activeElement))&&U(!1)};return document.addEventListener("keydown",le),()=>document.removeEventListener("keydown",le)},[i]),I.useEffect(()=>{if(te.current)return()=>{q.current&&(q.current.focus({preventScroll:!0}),q.current=null,ye.current=!1)}},[te.current]),I.createElement("section",{ref:n,"aria-label":E??`${R} ${X}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},$.map((le,re)=>{var W;const[ae,be]=le.split("-");return M.length?I.createElement("ol",{key:le,dir:S==="auto"?Sc():S,tabIndex:-1,ref:te,className:u,"data-sonner-toaster":!0,"data-sonner-theme":Y,"data-y-position":ae,"data-x-position":be,style:{"--front-toast-height":`${((W=V[0])==null?void 0:W.height)||0}px`,"--width":`${Ug}px`,"--gap":`${_}px`,...g,...Gg(d,l)},onBlur:se=>{ye.current&&!se.currentTarget.contains(se.relatedTarget)&&(ye.current=!1,q.current&&(q.current.focus({preventScroll:!0}),q.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||ye.current||(ye.current=!0,q.current=se.relatedTarget)},onMouseEnter:()=>U(!0),onMouseMove:()=>U(!0),onMouseLeave:()=>{K||U(!1)},onDragEnd:()=>U(!1),onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},M.filter(se=>!se.position&&re===0||se.position===le).map((se,Te)=>{var Se,ke;return I.createElement(Kg,{key:se.id,icons:O,index:Te,toast:se,defaultRichColors:p,duration:(Se=b==null?void 0:b.duration)!=null?Se:y,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:o,visibleToasts:w,closeButton:(ke=b==null?void 0:b.closeButton)!=null?ke:c,interacting:K,position:le,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:me,toasts:M.filter(je=>je.position==se.position),heights:V.filter(je=>je.position==se.position),setHeights:D,expandByDefault:a,gap:_,expanded:Q,swipeDirections:t.swipeDirections})})):null}))}),Qg=e=>{const t=ee.c(7);let n;t[0]!==e?({...n}=e,t[0]=e,t[1]=n):n=t[1];const{theme:r}=ds(),s=r===void 0?"system":r;let i,a;t[2]===Symbol.for("react.memo_cache_sentinel")?(i={success:m.jsx(sg,{className:"size-4"}),info:m.jsx(ag,{className:"size-4"}),warning:m.jsx(vg,{className:"size-4"}),error:m.jsx(pg,{className:"size-4"}),loading:m.jsx(ug,{className:"size-4 animate-spin"})},a={"--normal-bg":"hsl(var(--popover))","--normal-text":"hsl(var(--popover-foreground))","--normal-border":"hsl(var(--border))","--border-radius":"var(--radius)",fontFamily:"inherit"},t[2]=i,t[3]=a):(i=t[2],a=t[3]);let c;return t[4]!==n||t[5]!==s?(c=m.jsx(qg,{theme:s,className:"toaster group",icons:i,style:a,...n}),t[4]=n,t[5]=s,t[6]=c):c=t[6],c};var Yg=Object.defineProperty,ca=(e,t)=>Yg(e,"name",{value:t,configurable:!0});function mi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}ca(mi,"setRef");function Hu(...e){return t=>{let n=!1;const r=e.map(o=>{const s=mi(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():mi(e[o],null)}}}}ca(Hu,"composeRefs");function Pe(...e){return h.useCallback(Hu(...e),e)}ca(Pe,"useComposedRefs");var Jg=Object.defineProperty,St=(e,t)=>Jg(e,"name",{value:t,configurable:!0});function tn(e){const t=h.forwardRef((n,r)=>{let{children:o,...s}=n,i=null,a=!1;const c=[];o=Ju(o),h.Children.forEach(o,f=>{var p;if(Qu(f)){a=!0;const y=f;let g="child"in y.props?y.props.child:y.props.children;for(;la(g)&&typeof Xo=="function";)g=Xo(g._payload);i=Xg(y,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?qu(i):void 0,d=Pe(r,u);if(!i){if(o||o===0)throw new Error(a?ny(e):ty(e));return o}const l=Gu(s,i.props??{});return i.type!==h.Fragment&&(l.ref=r?d:u),h.cloneElement(i,l)});return t.displayName=`${e}.Slot`,t}St(tn,"createSlot");var xr=tn("Slot"),Wu=Symbol.for("radix.slottable");function Ku(e){const t=St(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=Wu,t}St(Ku,"createSlottable");var Xg=St((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 Gu(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]=Xu(s,o))}return{...e,...n}}St(Gu,"mergeProps");function qu(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)}St(qu,"getElementRef");function Qu(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Wu}St(Qu,"isSlottable");var ey=Symbol.for("react.lazy");function la(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===ey&&"_payload"in e&&Yu(e._payload)}St(la,"isLazyComponent");function Yu(e){return typeof e=="object"&&e!==null&&"then"in e}St(Yu,"isPromiseLike");function Ju(e){let t=e;for(;la(t)&&typeof Xo=="function";)t=Xo(t._payload);return t}St(Ju,"useUnwrappedLazy");function Xu(...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}St(Xu,"concatAriaDescribedby");var ty=St(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),ny=St(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Xo=Vn[" use ".trim().toString()];function ed(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=ed(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function td(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=ed(e))&&(r&&(r+=" "),r+=t);return r}const Ec=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Cc=td,oo=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Cc(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=Ec(d)||Ec(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(y=>{let[g,w]=y;return Array.isArray(w)?w.includes({...s,...a}[g]):{...s,...a}[g]===w})?[...u,l,f]:u},[]);return Cc(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},ry=768,nd=`(max-width: ${ry-1}px)`;function oy(e){const t=window.matchMedia(nd);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function sy(){return h.useSyncExternalStore(oy,ay,iy)}function iy(){return!1}function ay(){return window.matchMedia(nd).matches}const ua="-",cy=e=>{const t=uy(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(ua);return a[0]===""&&a.length!==1&&a.shift(),rd(a,t)||ly(i)},getConflictingClassGroupIds:(i,a)=>{const c=n[i]||[];return a&&r[i]?[...c,...r[i]]:c}}},rd=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?rd(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(ua);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},kc=/^\[(.+)\]$/,ly=e=>{if(kc.test(e)){const t=kc.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},uy=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return fy(Object.entries(e.classGroups),n).forEach(([s,i])=>{gi(i,r,s,t)}),r},gi=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Oc(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(dy(o)){gi(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{gi(i,Oc(t,s),n,r)})})},Oc=(e,t)=>{let n=e;return t.split(ua).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},dy=e=>e.isThemeGetter,fy=(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,hy=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)}}},od="!",py=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 w=0;w<a.length;w++){let b=a[w];if(u===0){if(b===o&&(r||a.slice(w,w+s)===t)){c.push(a.slice(d,w)),d=w+s;continue}if(b==="/"){l=w;continue}}b==="["?u++:b==="]"&&u--}const f=c.length===0?a:a.substring(d),p=f.startsWith(od),y=p?f.substring(1):f,g=l&&l>d?l-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:i}):i},my=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},gy=e=>({cache:hy(e.cacheSize),parseClassName:py(e),...cy(e)}),yy=/\s+/,vy=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(yy);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 y=!!p,g=r(y?f.substring(0,p):f);if(!g){if(!y){a=u+(a.length>0?" "+a:a);continue}if(g=r(f),!g){a=u+(a.length>0?" "+a:a);continue}y=!1}const w=my(d).join(":"),b=l?w+od:w,S=b+g;if(s.includes(S))continue;s.push(S);const _=o(g,y);for(let O=0;O<_.length;++O){const E=_[O];s.push(b+E)}a=u+(a.length>0?" "+a:a)}return a};function by(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=sd(t))&&(r&&(r+=" "),r+=n);return r}const sd=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=sd(e[r]))&&(n&&(n+=" "),n+=t);return n};function wy(e,...t){let n,r,o,s=i;function i(c){const u=t.reduce((d,l)=>l(d),e());return n=gy(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=vy(c,n);return o(c,d),d}return function(){return s(by.apply(null,arguments))}}const Re=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},id=/^\[(?:([a-z-]+):)?(.+)\]$/i,_y=/^\d+\/\d+$/,xy=new Set(["px","full","screen"]),Sy=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ey=/\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$/,Cy=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ky=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Oy=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qt=e=>rr(e)||xy.has(e)||_y.test(e),cn=e=>Sr(e,"length",My),rr=e=>!!e&&!Number.isNaN(Number(e)),Ms=e=>Sr(e,"number",rr),Mr=e=>!!e&&Number.isInteger(Number(e)),Ry=e=>e.endsWith("%")&&rr(e.slice(0,-1)),fe=e=>id.test(e),ln=e=>Sy.test(e),Py=new Set(["length","size","percentage"]),Ty=e=>Sr(e,Py,ad),Iy=e=>Sr(e,"position",ad),Ay=new Set(["image","url"]),Ny=e=>Sr(e,Ay,$y),Dy=e=>Sr(e,"",jy),jr=()=>!0,Sr=(e,t,n)=>{const r=id.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},My=e=>Ey.test(e)&&!Cy.test(e),ad=()=>!1,jy=e=>ky.test(e),$y=e=>Oy.test(e),zy=()=>{const e=Re("colors"),t=Re("spacing"),n=Re("blur"),r=Re("brightness"),o=Re("borderColor"),s=Re("borderRadius"),i=Re("borderSpacing"),a=Re("borderWidth"),c=Re("contrast"),u=Re("grayscale"),d=Re("hueRotate"),l=Re("invert"),f=Re("gap"),p=Re("gradientColorStops"),y=Re("gradientColorStopPositions"),g=Re("inset"),w=Re("margin"),b=Re("opacity"),S=Re("padding"),_=Re("saturate"),O=Re("scale"),E=Re("sepia"),R=Re("skew"),P=Re("space"),A=Re("translate"),M=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",fe,t],D=()=>[fe,t],Q=()=>["",qt,cn],U=()=>["auto",rr,fe],K=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>["start","end","center","between","around","evenly","stretch"],te=()=>["","0",fe],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[rr,fe];return{cacheSize:500,separator:":",theme:{colors:[jr],spacing:[qt,cn],blur:["none","",ln,fe],brightness:q(),borderColor:[e],borderRadius:["none","","full",ln,fe],borderSpacing:D(),borderWidth:Q(),contrast:q(),grayscale:te(),hueRotate:q(),invert:te(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[Ry,cn],inset:V(),margin:V(),opacity:q(),padding:D(),saturate:q(),scale:q(),sepia:te(),skew:q(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",fe]}],container:["container"],columns:[{columns:[ln]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"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(),fe]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],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,fe]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",fe]}],grow:[{grow:te()}],shrink:[{shrink:te()}],order:[{order:["first","last","none",Mr,fe]}],"grid-cols":[{"grid-cols":[jr]}],"col-start-end":[{col:["auto",{span:["full",Mr,fe]},fe]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[jr]}],"row-start-end":[{row:["auto",{span:[Mr,fe]},fe]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",fe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",fe]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...ne()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ne(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ne(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",fe,t]}],"min-w":[{"min-w":[fe,t,"min","max","fit"]}],"max-w":[{"max-w":[fe,t,"none","full","min","max","fit","prose",{screen:[ln]},ln]}],h:[{h:[fe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[fe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[fe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[fe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ln,cn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ms]}],"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",fe]}],"line-clamp":[{"line-clamp":["none",rr,Ms]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",qt,fe]}],"list-image":[{"list-image":["none",fe]}],"list-style-type":[{list:["none","disc","decimal",fe]}],"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:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",qt,cn]}],"underline-offset":[{"underline-offset":["auto",qt,fe]}],"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:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fe]}],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",fe]}],"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(),Iy]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ty]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Ny]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"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:[...H(),"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:H()}],"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:["",...H()]}],"outline-offset":[{"outline-offset":[qt,fe]}],"outline-w":[{outline:[qt,cn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[qt,cn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ln,Dy]}],"shadow-color":[{shadow:[jr]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...Y(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Y()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",ln,fe]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[l]}],saturate:[{saturate:[_]}],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":[_]}],"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",fe]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",fe]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",fe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[O]}],"scale-x":[{"scale-x":[O]}],"scale-y":[{"scale-y":[O]}],rotate:[{rotate:[Mr,fe]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",fe]}],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",fe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",fe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[qt,cn,Ms]}],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"]}}},Fy=wy(zy);function ce(...e){return Fy(td(e))}const Ly=oo("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"}}),fs=h.forwardRef((e,t)=>{const n=ee.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=ce(Ly({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});fs.displayName="Button";const es=h.forwardRef((e,t)=>{const n=ee.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=ce("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});es.displayName="Input";var Vy=Object.defineProperty,Uy=(e,t)=>Vy(e,"name",{value:t,configurable:!0}),Zy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ze=Zy.reduce((e,t)=>{const n=tn(`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 da(e,t){e&&lu.flushSync(()=>e.dispatchEvent(t))}Uy(da,"dispatchDiscreteCustomEvent");var By=Object.defineProperty,cd=(e,t)=>By(e,"name",{value:t,configurable:!0}),fa={Horizontal:"horizontal",Vertical:"vertical"},Rc=fa.Horizontal,Hy=Object.values(fa),ld=h.forwardRef(cd(function(t,n){const{decorative:r,orientation:o=Rc,...s}=t,i=ud(o)?o:Rc,a=i===fa.Vertical?i:void 0,c=r?{role:"none"}:{"aria-orientation":a,role:"separator"};return m.jsx(Ze.div,{"data-orientation":i,...c,...s,ref:n})},"Separator"));function ud(e){return Hy.includes(e)}cd(ud,"isValidOrientation");const ts=h.forwardRef((e,t)=>{const n=ee.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=ce("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(ld,{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});ts.displayName=ld.displayName;var Wy=Object.defineProperty,Er=(e,t)=>Wy(e,"name",{value:t,configurable:!0}),dd=!!(typeof window<"u"&&window.document&&window.document.createElement);function ue(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(ue,"composeEventHandlers");function Ky(e){var t;if(!dd)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(Ky,"getOwnerWindow");function yi(e){if(!dd)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Er(yi,"getOwnerDocument");function fd(e,t=!1){const{activeElement:n}=yi(e);if(!(n!=null&&n.nodeName))return null;if(hd(n)&&n.contentDocument)return fd(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=yi(n).getElementById(r);if(o)return o}}return n}Er(fd,"getActiveElement");function hd(e){return e.tagName==="IFRAME"}Er(hd,"isFrame");var Gy=Object.defineProperty,Ot=(e,t)=>Gy(e,"name",{value:t,configurable:!0});function qy(e,t){const n=h.createContext(t);n.displayName=e+"Context";const r=Ot(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 Ot(o,"useContext"),[r,o]}Ot(qy,"createContext");function sn(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=Ot(l=>{var b;const{scope:f,children:p,...y}=l,g=((b=f==null?void 0:f[e])==null?void 0:b[c])||a,w=h.useMemo(()=>y,Object.values(y));return m.jsx(g.Provider,{value:w,children:p})},"Provider");u.displayName=s+"Provider";function d(l,f,p={}){var b;const{optional:y=!1}=p,g=((b=f==null?void 0:f[e])==null?void 0:b[c])||a,w=h.useContext(g);if(w)return w;if(i!==void 0)return i;if(!y)throw new Error(`\`${l}\` must be used within \`${s}\``)}return Ot(d,"useContext"),[u,d]}Ot(r,"createContext");const o=Ot(()=>{const s=n.map(i=>h.createContext(i));return Ot(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,pd(o,...t)]}Ot(sn,"createContextScope");function pd(...e){const t=e[0];if(e.length===1)return t;const n=Ot(()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return Ot(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}Ot(pd,"composeContextScopes");var ct=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},Qy=Object.defineProperty,Yy=(e,t)=>Qy(e,"name",{value:t,configurable:!0}),Jy=Vn[" useId ".trim().toString()]||(()=>{}),Xy=0;function _n(e){const[t,n]=h.useState(Jy());return ct(()=>{e||n(r=>r??String(Xy++))},[e]),e||(t?`radix-${t}`:"")}Yy(_n,"useId");var ev=Object.defineProperty,tv=(e,t)=>ev(e,"name",{value:t,configurable:!0}),Pc=Vn[" useEffectEvent ".trim().toString()],Tc=Vn[" useInsertionEffect ".trim().toString()];function md(e){if(typeof Pc=="function")return Pc(e);const t=h.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Tc=="function"?Tc(()=>{t.current=e}):ct(()=>{t.current=e}),h.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}tv(md,"useEffectEvent");var nv=Object.defineProperty,so=(e,t)=>nv(e,"name",{value:t,configurable:!0}),rv=Vn[" useInsertionEffect ".trim().toString()]||ct;function io({prop:e,defaultProp:t,onChange:n=so(()=>{},"onChange"),caller:r}){const[o,s,i]=gd({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o,u=h.useCallback(d=>{var l;if(a){const f=yd(d)?d(e):d;f!==e&&((l=i.current)==null||l.call(i,f))}else s(d)},[a,e,s,i]);return[c,u]}so(io,"useControllableState");function gd({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),o=h.useRef(n),s=h.useRef(t);return rv(()=>{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]}so(gd,"useUncontrolledState");function yd(e){return typeof e=="function"}so(yd,"isFunction");var Ic=Symbol("RADIX:SYNC_STATE");function ov(e,t,n,r){const{prop:o,defaultProp:s,onChange:i,caller:a}=t,c=o!==void 0,u=md(i),d=[{...n,state:s}];r&&d.push(r);const[l,f]=h.useReducer((w,b)=>{if(b.type===Ic)return{...w,state:b.state};const S=e(w,b);return c&&!Object.is(S.state,w.state)&&u(S.state),S},...d),p=l.state,y=h.useRef(p);h.useEffect(()=>{y.current!==p&&(y.current=p,c||u(p))},[p,y,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:Ic,state:o})},[o,l.state,c]),[g,f]}so(ov,"useControllableStateReducer");var sv=Object.defineProperty,iv=(e,t)=>sv(e,"name",{value:t,configurable:!0}),Ac=Vn[" useInsertionEffect ".trim().toString()];function nn(e){const t=h.useRef(e);return typeof Ac=="function"?Ac(()=>{t.current=e}):ct(()=>{t.current=e}),h.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}iv(nn,"useCallbackRef");var av=Object.defineProperty,Xe=(e,t)=>av(e,"name",{value:t,configurable:!0}),vi="dismissableLayer.update",cv="dismissableLayer.pointerDownOutside",lv="dismissableLayer.focusOutside",Nc,vd=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ha=h.forwardRef(Xe(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(vd),[f,p]=h.useState(null),y=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=h.useState({}),w=Pe(n,p),b=Array.from(l.layers),[S]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=S?b.indexOf(S):-1,O=f?b.indexOf(f):-1,E=l.layersWithOutsidePointerEventsDisabled.size>0,R=O>=_,P=h.useRef(!1),A=wd(D=>{i==null||i(D),c==null||c(D),D.defaultPrevented||u==null||u()},{ownerDocument:y,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:P,dismissableSurfaces:l.dismissableSurfaces,shouldHandlePointerDownOutside:h.useCallback(D=>{if(!(D instanceof Node))return!1;const Q=[...l.branches].some(U=>U.contains(D));return R&&!Q},[l.branches,R])}),M=_d(D=>{if(o&&P.current)return;const Q=D.target;[...l.branches].some(K=>K.contains(Q))||(a==null||a(D),c==null||c(D),D.defaultPrevented||u==null||u())},y),$=f?O===b.length-1:!1,V=nn(D=>{D.key==="Escape"&&(s==null||s(D),!D.defaultPrevented&&u&&(D.preventDefault(),u()))});return h.useEffect(()=>{if($)return y.addEventListener("keydown",V,{capture:!0}),()=>y.removeEventListener("keydown",V,{capture:!0})},[y,$,V]),h.useEffect(()=>{if(f)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Nc=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),bi(),()=>{r&&(l.layersWithOutsidePointerEventsDisabled.delete(f),l.layersWithOutsidePointerEventsDisabled.size===0&&(y.body.style.pointerEvents=Nc))}},[f,y,r,l]),h.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),bi())},[f,l]),h.useEffect(()=>{const D=Xe(()=>g({}),"handleUpdate");return document.addEventListener(vi,D),()=>document.removeEventListener(vi,D)},[]),m.jsx(Ze.div,{...d,ref:w,style:{pointerEvents:E?R?"auto":"none":void 0,...t.style},onFocusCapture:ue(t.onFocusCapture,M.onFocusCapture),onBlurCapture:ue(t.onBlurCapture,M.onBlurCapture),onPointerDownCapture:ue(t.onPointerDownCapture,A.onPointerDownCapture)})},"DismissableLayer"));function bd(){const e=h.useContext(vd),[t,n]=h.useState(null);return h.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Xe(bd,"useDismissableLayerSurface");var uv=Xe(()=>!0,"IS_TRUE");function wd(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:i=uv}=t,a=nn(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()}Xe(f,"resetOutsideInteraction");function p(){return Array.from(d.current.values()).some(Boolean)}Xe(p,"isOutsideInteractionIntercepted");function y(_){if(!u.current)return;const O=_.target;O instanceof Node&&[...s].some(R=>R.contains(O))||d.current.set(_.type,!0),_.type==="click"&&window.setTimeout(()=>{u.current&&l.current()},0)}Xe(y,"handleInteractionCapture");function g(_){u.current&&d.current.set(_.type,!1)}Xe(g,"handleInteractionBubble");const w=Xe(_=>{if(_.target&&!c.current){let O=function(){n.removeEventListener("click",l.current);const R=p();f(),R||pa(cv,a,E,{discrete:!0})};if(Xe(O,"handleAndDispatchPointerDownOutsideEvent"),!i(_.target)){n.removeEventListener("click",l.current),f(),c.current=!1;return}const E={originalEvent:_};u.current=!0,o.current=r&&_.button===0,d.current.clear(),!r||_.button!==0?O():(n.removeEventListener("click",l.current),l.current=O,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 _ of b)n.addEventListener(_,y,!0),n.addEventListener(_,g);const S=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(S),n.removeEventListener("pointerdown",w),n.removeEventListener("click",l.current);for(const _ of b)n.removeEventListener(_,y,!0),n.removeEventListener(_,g)}},[n,a,r,o,s,i]),{onPointerDownCapture:Xe(()=>c.current=!0,"onPointerDownCapture")}}Xe(wd,"usePointerDownOutside");function _d(e,t=globalThis==null?void 0:globalThis.document){const n=nn(e),r=h.useRef(!1);return h.useEffect(()=>{const o=Xe(s=>{s.target&&!r.current&&pa(lv,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:Xe(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Xe(()=>r.current=!1,"onBlurCapture")}}Xe(_d,"useFocusOutside");function bi(){const e=new CustomEvent(vi);document.dispatchEvent(e)}Xe(bi,"dispatchUpdate");function pa(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?da(o,s):o.dispatchEvent(s)}Xe(pa,"handleAndDispatchCustomEvent");var dv=Object.defineProperty,We=(e,t)=>dv(e,"name",{value:t,configurable:!0}),js="focusScope.autoFocusOnMount",$s="focusScope.autoFocusOnUnmount",Dc={bubbles:!1,cancelable:!0},xd=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=nn(i),f=nn(a),p=h.useRef(null),y=Pe(n,d),g=h.useRef(s);h.useEffect(()=>{g.current=s});const w=h.useCallback(_=>{var O;return _?u!=null&&u.contains(_)?!0:!!((O=g.current)!=null&&O.some(E=>E.contains(_))):!1},[u]),b=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(o){let _=function(P){if(b.paused||!u)return;const A=P.target;w(A)?p.current=A:Jt(p.current,{select:!0})},O=function(P){if(b.paused||!u)return;const A=P.relatedTarget;A!==null&&(w(A)||Jt(p.current,{select:!0}))},E=function(P){if(document.activeElement===document.body)for(const M of P)M.removedNodes.length>0&&Jt(u)};We(_,"handleFocusIn"),We(O,"handleFocusOut"),We(E,"handleMutations"),document.addEventListener("focusin",_),document.addEventListener("focusout",O);const R=new MutationObserver(E);return u&&R.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",_),document.removeEventListener("focusout",O),R.disconnect()}}},[o,u,b.paused,w]),h.useEffect(()=>{if(u){Mc.add(b);const _=document.activeElement;if(!u.contains(_)){const E=new CustomEvent(js,Dc);u.addEventListener(js,l),u.dispatchEvent(E),E.defaultPrevented||(Ed(Pd(va(u)),{select:!0}),document.activeElement===_&&Jt(u))}return()=>{u.removeEventListener(js,l);const E=u.ownerDocument,R=CustomEvent;setTimeout(()=>{const P=new R($s,Dc);u.addEventListener($s,f),u.dispatchEvent(P),P.defaultPrevented||Jt(_??E.body,{select:!0}),u.removeEventListener($s,f),Mc.remove(b)},0)}}},[u,l,f,b]);const S=h.useCallback(_=>{if(!r&&!o||b.paused)return;const O=_.key==="Tab"&&!_.altKey&&!_.ctrlKey&&!_.metaKey,E=document.activeElement;if(O&&E){const R=_.currentTarget,[P,A]=Cd(R);P&&A?!_.shiftKey&&E===A?(_.preventDefault(),r&&Jt(P,{select:!0})):_.shiftKey&&E===P&&(_.preventDefault(),r&&Jt(A,{select:!0})):E===R&&_.preventDefault()}},[r,o,b.paused]);return m.jsx(Ze.div,{tabIndex:-1,...c,ref:y,onKeyDown:S})},"FocusScope")),Sd=h.createContext(null);function ma({registry:e,children:t}){return e?m.jsx(Sd.Provider,{value:e,children:t}):t}We(ma,"FocusScopeBranchProvider");function ga(){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(ga,"useFocusScopeBranchRegistry");function ya(e){const t=h.useContext(Sd);h.useEffect(()=>{if(!(!e||!t))return t.add(e),()=>t.remove(e)},[e,t])}We(ya,"useFocusScopeBranch");function Ed(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Jt(r,{select:t}),document.activeElement!==n)return}We(Ed,"focusFirst");function Cd(e){const t=va(e),n=wi(t,e),r=wi(t.reverse(),e);return[n,r]}We(Cd,"getTabbableEdges");function va(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(va,"getTabbableCandidates");function wi(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):kd(r,{upTo:t})))return r}We(wi,"findVisible");function kd(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(kd,"isHidden");function Od(e){return e.tagName==="INPUT"&&typeof e.select=="function"}We(Od,"isSelectableInput");function Jt(e,{select:t=!1}={}){if(e&&e.focus){const r=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==r&&Od(e)&&t&&e.select()}}We(Jt,"focus");var Mc=Rd();function Rd(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=_i(e,t),e.unshift(t)},remove(t){var n;e=_i(e,t),(n=e[0])==null||n.resume()}}}We(Rd,"createFocusScopesStack");function _i(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}We(_i,"arrayRemove");function Pd(e){return e.filter(t=>t.tagName!=="A")}We(Pd,"removeLinks");var fv=Object.defineProperty,hv=(e,t)=>fv(e,"name",{value:t,configurable:!0}),ba=h.forwardRef(hv(function(t,n){var c;const{container:r,...o}=t,[s,i]=h.useState(!1);ct(()=>i(!0),[]);const a=r||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?lu.createPortal(m.jsx(Ze.div,{...o,ref:n}),a):null},"Portal")),pv=Object.defineProperty,rn=(e,t)=>pv(e,"name",{value:t,configurable:!0});function Td(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}rn(Td,"useStateMachine");var an=rn(e=>{const{present:t,children:n}=e,r=Id(t),o=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),s=Ad(r.ref,Nd(o));return typeof n=="function"||r.isPresent?h.cloneElement(o,{ref:s}):null},"Presence");function Id(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]=Td(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??nr(r.current),i.current=void 0):s.current="none"},[c]),ct(()=>{const d=r.current,l=o.current;if(l!==e){const p=s.current,y=nr(d);e?(i.current=y,u("MOUNT")):y==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(l&&p!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),ct(()=>{if(t){let d;const l=t.ownerDocument.defaultView??window,f=rn(y=>{const w=nr(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&w&&(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=rn(y=>{y.target===t&&(s.current=nr(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=nr(l)}else r.current=null;n(d)},[])}}rn(Id,"usePresence");function xi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}rn(xi,"setRef");function Ad(...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=xi(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():xi(r[i],null)}}},[])}rn(Ad,"useStableComposedRefs");function nr(e){return(e==null?void 0:e.animationName)||"none"}rn(nr,"getAnimationName");function Nd(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)}rn(Nd,"getElementRef");var mv=Object.defineProperty,wa=(e,t)=>mv(e,"name",{value:t,configurable:!0}),Eo=0,zt=null;function gv(e){return hs(),e.children}wa(gv,"FocusGuards");function hs(){h.useEffect(()=>{zt||(zt={start:Si(),end:Si()});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),Eo++,()=>{Eo===1&&(zt==null||zt.start.remove(),zt==null||zt.end.remove(),zt=null),Eo=Math.max(0,Eo-1)}},[])}wa(hs,"useFocusGuards");function Si(){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}wa(Si,"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 Dd(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 yv(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 Fo="right-scroll-bar-position",Lo="width-before-scroll-bar",vv="with-scroll-bars-hidden",bv="--removed-body-scroll-bar-size";function zs(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function wv(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 _v=typeof window<"u"?h.useLayoutEffect:h.useEffect,jc=new WeakMap;function xv(e,t){var n=wv(null,function(r){return e.forEach(function(o){return zs(o,r)})});return _v(function(){var r=jc.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||zs(a,null)}),s.forEach(function(a){o.has(a)||zs(a,i)})}jc.set(n,e)},[e]),n}function Sv(e){return e}function Ev(e,t){t===void 0&&(t=Sv);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 Cv(e){e===void 0&&(e={});var t=Ev(null);return t.options=Ut({async:!0,ssr:!1},e),t}var Md=function(e){var t=e.sideCar,n=Dd(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))};Md.isSideCarExport=!0;function kv(e,t){return e.useMedium(t),Md}var jd=Cv(),Fs=function(){},ps=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:Fs,onWheelCapture:Fs,onTouchMoveCapture:Fs}),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,y=e.noIsolation,g=e.inert,w=e.allowPinchZoom,b=e.as,S=b===void 0?"div":b,_=e.gapMode,O=Dd(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,R=xv([n,t]),P=Ut(Ut({},O),o);return h.createElement(h.Fragment,null,d&&h.createElement(E,{sideCar:jd,removeScrollBar:u,shards:l,noRelative:p,noIsolation:y,inert:g,setCallbacks:s,allowPinchZoom:!!w,lockRef:n,gapMode:_}),i?h.cloneElement(h.Children.only(a),Ut(Ut({},P),{ref:R})):h.createElement(S,Ut({},P,{className:c,ref:R}),a))});ps.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ps.classNames={fullWidth:Lo,zeroRight:Fo};var Ov=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Rv(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Ov();return t&&e.setAttribute("nonce",t),e}function Pv(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Tv(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Iv=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Rv())&&(Pv(t,n),Tv(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Av=function(){var e=Iv();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},$d=function(){var e=Av(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Nv={left:0,top:0,right:0,gap:0},Ls=function(e){return parseInt(e||"",10)||0},Dv=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[Ls(n),Ls(r),Ls(o)]},Mv=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Nv;var t=Dv(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])}},jv=$d(),or="data-scroll-locked",$v=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
153
+ .`.concat(vv,` {
154
+ overflow: hidden `).concat(r,`;
155
+ padding-right: `).concat(a,"px ").concat(r,`;
156
+ }
157
+ body[`).concat(or,`] {
158
+ overflow: hidden `).concat(r,`;
159
+ overscroll-behavior: contain;
160
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
161
+ padding-left: `.concat(o,`px;
162
+ padding-top: `).concat(s,`px;
163
+ padding-right: `).concat(i,`px;
164
+ margin-left:0;
165
+ margin-top:0;
166
+ margin-right: `).concat(a,"px ").concat(r,`;
167
+ `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
168
+ }
169
+
170
+ .`).concat(Fo,` {
171
+ right: `).concat(a,"px ").concat(r,`;
172
+ }
173
+
174
+ .`).concat(Lo,` {
175
+ margin-right: `).concat(a,"px ").concat(r,`;
176
+ }
177
+
178
+ .`).concat(Fo," .").concat(Fo,` {
179
+ right: 0 `).concat(r,`;
180
+ }
181
+
182
+ .`).concat(Lo," .").concat(Lo,` {
183
+ margin-right: 0 `).concat(r,`;
184
+ }
185
+
186
+ body[`).concat(or,`] {
187
+ `).concat(bv,": ").concat(a,`px;
188
+ }
189
+ `)},$c=function(){var e=parseInt(document.body.getAttribute(or)||"0",10);return isFinite(e)?e:0},zv=function(){h.useEffect(function(){return document.body.setAttribute(or,($c()+1).toString()),function(){var e=$c()-1;e<=0?document.body.removeAttribute(or):document.body.setAttribute(or,e.toString())}},[])},Fv=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;zv();var s=h.useMemo(function(){return Mv(o)},[o]);return h.createElement(jv,{styles:$v(s,!t,o,n?"":"!important")})},Ei=!1;if(typeof window<"u")try{var Co=Object.defineProperty({},"passive",{get:function(){return Ei=!0,!0}});window.addEventListener("test",Co,Co),window.removeEventListener("test",Co,Co)}catch{Ei=!1}var Yn=Ei?{passive:!1}:!1,Lv=function(e){return e.tagName==="TEXTAREA"},zd=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Lv(e)&&n[t]==="visible")},Vv=function(e){return zd(e,"overflowY")},Uv=function(e){return zd(e,"overflowX")},zc=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Fd(e,r);if(o){var s=Ld(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Zv=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Bv=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Fd=function(e,t){return e==="v"?Vv(t):Uv(t)},Ld=function(e,t){return e==="v"?Zv(t):Bv(t)},Hv=function(e,t){return e==="h"&&t==="rtl"?-1:1},Wv=function(e,t,n,r,o){var s=Hv(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=Ld(e,a),y=p[0],g=p[1],w=p[2],b=g-w-s*y;(y||b)&&Fd(e,a)&&(l+=b,f+=y);var S=a.parentNode;a=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}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},ko=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Fc=function(e){return[e.deltaX,e.deltaY]},Lc=function(e){return e&&"current"in e?e.current:e},Kv=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Gv=function(e){return`
190
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
191
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
192
+ `)},qv=0,Jn=[];function Qv(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(qv++)[0],s=h.useState($d)[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=yv([e.lockRef.current],(e.shards||[]).map(Lc),!0).filter(Boolean);return g.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(g,w){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var b=ko(g),S=n.current,_="deltaX"in g?g.deltaX:S[0]-b[0],O="deltaY"in g?g.deltaY:S[1]-b[1],E,R=g.target,P=Math.abs(_)>Math.abs(O)?"h":"v";if("touches"in g&&P==="h"&&R.type==="range")return!1;var A=window.getSelection(),M=A&&A.anchorNode,$=M?M===R||M.contains(R):!1;if($)return!1;var V=zc(P,R);if(!V)return!0;if(V?E=P:(E=P==="v"?"h":"v",V=zc(P,R)),!V)return!1;if(!r.current&&"changedTouches"in g&&(_||O)&&(r.current=E),!E)return!0;var D=r.current||E;return Wv(D,w,g,D==="h"?_:O)},[]),c=h.useCallback(function(g){var w=g;if(!(!Jn.length||Jn[Jn.length-1]!==s)){var b="deltaY"in w?Fc(w):ko(w),S=t.current.filter(function(E){return E.name===w.type&&(E.target===w.target||w.target===E.shadowParent)&&Kv(E.delta,b)})[0];if(S&&S.should){w.cancelable&&w.preventDefault();return}if(!S){var _=(i.current.shards||[]).map(Lc).filter(Boolean).filter(function(E){return E.contains(w.target)}),O=_.length>0?a(w,_[0]):!i.current.noIsolation;O&&w.cancelable&&w.preventDefault()}}},[]),u=h.useCallback(function(g,w,b,S){var _={name:g,delta:w,target:b,should:S,shadowParent:Yv(b)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(O){return O!==_})},1)},[]),d=h.useCallback(function(g){n.current=ko(g),r.current=void 0},[]),l=h.useCallback(function(g){u(g.type,Fc(g),g.target,a(g,e.lockRef.current))},[]),f=h.useCallback(function(g){u(g.type,ko(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,y=e.inert;return h.createElement(h.Fragment,null,y?h.createElement(s,{styles:Gv(o)}):null,p?h.createElement(Fv,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Yv(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Jv=kv(jd,Qv);var _a=h.forwardRef(function(e,t){return h.createElement(ps,Ut({},e,{ref:t,sideCar:Jv}))});_a.classNames=ps.classNames;var Xv=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Xn=new WeakMap,Oo=new WeakMap,Ro={},Vs=0,Vd=function(e){return e&&(e.host||Vd(e.parentNode))},eb=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Vd(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})},tb=function(e,t,n,r){var o=eb(t,Array.isArray(e)?e:[e]);Ro[n]||(Ro[n]=new WeakMap);var s=Ro[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),y=p!==null&&p!=="false",g=(Xn.get(f)||0)+1,w=(s.get(f)||0)+1;Xn.set(f,g),s.set(f,w),i.push(f),g===1&&y&&Oo.set(f,!0),w===1&&f.setAttribute(n,"true"),y||f.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return d(t),a.clear(),Vs++,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||(Oo.has(l)||l.removeAttribute(r),Oo.delete(l)),p||l.removeAttribute(n)}),Vs--,Vs||(Xn=new WeakMap,Xn=new WeakMap,Oo=new WeakMap,Ro={})}},Ud=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Xv(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),tb(r,o,n,"aria-hidden")):function(){return null}},nb=Object.defineProperty,vt=(e,t)=>nb(e,"name",{value:t,configurable:!0}),xa="Dialog",[Zd,N2]=sn(xa),[rb,Mt]=Zd(xa),ob=vt(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}=ga(),[l,f]=io({prop:r,defaultProp:o??!1,onChange:s,caller:xa}),[p,y]=h.useState(0),[g,w]=h.useState(0);return m.jsx(rb,{scope:t,triggerRef:a,contentRef:c,contentId:_n(),titleId:_n(),descriptionId:_n(),titlePresent:p>0,descriptionPresent:g>0,setTitleCount:y,setDescriptionCount:w,open:l,onOpenChange:f,onOpenToggle:h.useCallback(()=>f(b=>!b),[f]),modal:i,branchNodes:u,branchRegistry:d,children:n})},"Dialog"),sb="DialogTrigger",D2=h.forwardRef(vt(function(t,n){const{__scopeDialog:r,...o}=t,s=Mt(sb,r),i=Pe(n,s.triggerRef);return m.jsx(Ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":ms(s.open),...o,ref:i,onClick:ue(t.onClick,s.onOpenToggle)})},"DialogTrigger")),Bd="DialogPortal",[ib,Hd]=Zd(Bd,{forceMount:void 0}),ab=vt(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Mt(Bd,t);return m.jsx(ib,{scope:t,forceMount:n,children:h.Children.map(r,i=>m.jsx(an,{present:n||s.open,children:m.jsx(ba,{asChild:!0,container:o,children:i})}))})},"DialogPortal"),Ci="DialogOverlay",Wd=h.forwardRef(vt(function(t,n){const r=Hd(Ci,t.__scopeDialog),{forceMount:o=r.forceMount,...s}=t,i=Mt(Ci,t.__scopeDialog);return i.modal?m.jsx(an,{present:o||i.open,children:m.jsx(lb,{...s,ref:n})}):null},"DialogOverlay")),cb=tn("DialogOverlay.RemoveScroll"),lb=h.forwardRef(vt(function(t,n){const{__scopeDialog:r,...o}=t,s=Mt(Ci,r),i=bd(),a=Pe(n,i);return m.jsx(_a,{as:cb,allowPinchZoom:!0,shards:h.useMemo(()=>[s.contentRef,...s.branchNodes.map(c=>({current:c}))],[s.contentRef,s.branchNodes]),children:m.jsx(Ze.div,{"data-state":ms(s.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),Wr="DialogContent",Kd=h.forwardRef(vt(function(t,n){const r=Hd(Wr,t.__scopeDialog),{forceMount:o=r.forceMount,...s}=t,i=Mt(Wr,t.__scopeDialog);return m.jsx(an,{present:o||i.open,children:i.modal?m.jsx(ub,{...s,ref:n}):m.jsx(db,{...s,ref:n})})},"DialogContent")),ub=h.forwardRef(vt(function(t,n){const r=Mt(Wr,t.__scopeDialog),o=h.useRef(null),s=Pe(n,r.contentRef,o);return h.useEffect(()=>{const i=o.current;if(i)return Ud(i)},[]),m.jsx(Gd,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:ue(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:ue(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&i.preventDefault()}),onFocusOutside:ue(t.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),db=h.forwardRef(vt(function(t,n){const r=Mt(Wr,t.__scopeDialog),o=h.useRef(!1),s=h.useRef(!1);return m.jsx(Gd,{...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")),Gd=h.forwardRef(vt(function(t,n){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,"aria-describedby":a,children:c,...u}=t,d=Mt(Wr,r);return hs(),m.jsx(ma,{registry:d.branchRegistry,children:m.jsx(xd,{asChild:!0,loop:!0,trapped:o,branches:d.branchNodes,onMountAutoFocus:s,onUnmountAutoFocus:i,children:m.jsx(ha,{role:"dialog",id:d.contentId,"aria-labelledby":d.titlePresent?d.titleId:void 0,"aria-describedby":d.descriptionPresent?Yd(a,d.descriptionId):a,"data-state":ms(d.open),...u,ref:n,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1),children:c})})})},"DialogContentImpl")),qd=h.forwardRef(vt(function(t,n){const{__scopeDialog:r,...o}=t,s=Mt("DialogTitle",r),{setTitleCount:i}=s;return ct(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),m.jsx(Ze.h2,{id:s.titleId,...o,ref:n})},"DialogTitle")),Qd=h.forwardRef(vt(function(t,n){const{__scopeDialog:r,...o}=t,s=Mt("DialogDescription",r),{setDescriptionCount:i}=s;return ct(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),m.jsx(Ze.p,{id:s.descriptionId,...o,ref:n})},"DialogDescription")),fb="DialogClose",hb=h.forwardRef(vt(function(t,n){const{__scopeDialog:r,...o}=t,s=Mt(fb,r);return m.jsx(Ze.button,{type:"button",...o,ref:n,onClick:ue(t.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function Yd(...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}vt(Yd,"concatAriaDescribedby");function ms(e){return e?"open":"closed"}vt(ms,"getState");const pb=ob,mb=ab,Jd=h.forwardRef((e,t)=>{const n=ee.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=ce("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(Wd,{className:s,...o,ref:t}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Jd.displayName=Wd.displayName;const gb=oo("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"}}),Xd=h.forwardRef((e,t)=>{const n=ee.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(Jd,{}),n[5]=c):c=n[5];let u;n[6]!==o||n[7]!==a?(u=ce(gb({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(hb,{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(wg,{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(mb,{children:[c,m.jsxs(Kd,{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});Xd.displayName=Kd.displayName;const ef=e=>{const t=ee.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=ce("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};ef.displayName="SheetHeader";const tf=h.forwardRef((e,t)=>{const n=ee.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=ce("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(qd,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});tf.displayName=qd.displayName;const nf=h.forwardRef((e,t)=>{const n=ee.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=ce("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(Qd,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});nf.displayName=Qd.displayName;function Vc(e){const t=ee.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=ce("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 yb=Object.defineProperty,vb=(e,t)=>yb(e,"name",{value:t,configurable:!0});function rf(e){const[t,n]=h.useState(void 0);return ct(()=>{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}vb(rf,"useSize");var bb=Object.defineProperty,xn=(e,t)=>bb(e,"name",{value:t,configurable:!0}),Uc={Partial:"partial"},Zc={Optimized:"optimized",Always:"always"},of="Popper",[sf,gs]=sn(of),[wb,af]=sf(of),cf=xn(e=>{const{__scopePopper:t,children:n}=e,[r,o]=h.useState(null),[s,i]=h.useState(void 0);return m.jsx(wb,{scope:t,anchor:r,onAnchorChange:o,placementState:s,setPlacementState:i,children:n})},"Popper"),_b="PopperAnchor",lf=h.forwardRef(xn(function(t,n){const{__scopePopper:r,virtualRef:o,...s}=t,i=af(_b,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&&ys(i.placementState),p=f==null?void 0:f[0],y=f==null?void 0:f[1];return o?null:m.jsx(Ze.div,{"data-radix-popper-side":p,"data-radix-popper-align":y,...s,ref:d})},"PopperAnchor")),uf="PopperContent",[xb,M2]=sf(uf),df=h.forwardRef(xn(function(t,n){var se,Te,Se,ke,je,Fe,Et;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=Uc.Partial,hideWhenDetached:p=!1,updatePositionStrategy:y=Zc.Optimized,onPlaced:g,...w}=t,b=af(uf,r),[S,_]=h.useState(null),O=Pe(n,_),[E,R]=h.useState(null),P=rf(E),A=(P==null?void 0:P.width)??0,M=(P==null?void 0:P.height)??0,$=o+(i!=="center"?"-"+i:""),V=typeof l=="number"?l:{top:0,right:0,bottom:0,left:0,...l},D=Array.isArray(d)?d:[d],Q=D.length>0,U={padding:V,boundary:D.filter(ff),altBoundary:Q},{refs:K,floatingStyles:H,placement:Y,isPositioned:ne,middlewareData:te}=zp({strategy:"fixed",placement:$,whileElementsMounted:xn((...Ct)=>Wp(...Ct,{animationFrame:y===Zc.Always}),"whileElementsMounted"),elements:{reference:b.anchor},middleware:[Fp({mainAxis:s+M,alignmentAxis:a}),u&&Lp({mainAxis:!0,crossAxis:!1,...f===Uc.Partial?{limiter:Hp()}:{},...U}),u&&Vp({...U}),Up({...U,apply:xn(({elements:Ct,rects:Oe,availableWidth:Wn,availableHeight:ht})=>{const{width:Kn,height:Ht}=Oe.reference,$e=Ct.floating.style;$e.setProperty("--radix-popper-available-width",`${Wn}px`),$e.setProperty("--radix-popper-available-height",`${ht}px`),$e.setProperty("--radix-popper-anchor-width",`${Kn}px`),$e.setProperty("--radix-popper-anchor-height",`${Ht}px`)},"apply")}),E&&Zp({element:E,padding:c}),Sb({arrowWidth:A,arrowHeight:M}),p&&Bp(Q?{strategy:"referenceHidden",...U}:{strategy:"referenceHidden",padding:U.padding,altBoundary:U.altBoundary})]}),X=b.setPlacementState;ct(()=>(X(Y),()=>{X(void 0)}),[Y,X]);const[q,ye]=ys(Y),me=nn(g);ct(()=>{ne&&(me==null||me())},[ne,me]);const le=(se=te.arrow)==null?void 0:se.x,re=(Te=te.arrow)==null?void 0:Te.y,W=((Se=te.arrow)==null?void 0:Se.centerOffset)!==0,[ae,be]=h.useState();return ct(()=>{S&&be(window.getComputedStyle(S).zIndex)},[S]),m.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:ne?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[(ke=te.transformOrigin)==null?void 0:ke.x,(je=te.transformOrigin)==null?void 0:je.y].join(" "),...((Fe=te.hide)==null?void 0:Fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:m.jsx(xb,{scope:r,placedSide:q,placedAlign:ye,onArrowChange:R,arrowX:le,arrowY:re,shouldHideArrow:W,children:m.jsx(Ze.div,{"data-side":q,"data-align":ye,...w,ref:O,style:{...w.style,animation:ne?(Et=w.style)==null?void 0:Et.animation:"none"}})})})},"PopperContent"));function ff(e){return e!==null}xn(ff,"isNotNull");var Sb=xn(e=>({name:"transformOrigin",options:e,fn(t){var w,b,S;const{placement:n,rects:r,middlewareData:o}=t,i=((w=o.arrow)==null?void 0:w.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,d]=ys(n),l={start:"0%",center:"50%",end:"100%"}[d],f=(((b=o.arrow)==null?void 0:b.x)??0)+a/2,p=(((S=o.arrow)==null?void 0:S.y)??0)+c/2;let y="",g="";return u==="bottom"?(y=i?l:`${f}px`,g=`${-c}px`):u==="top"?(y=i?l:`${f}px`,g=`${r.floating.height+c}px`):u==="right"?(y=`${-c}px`,g=i?l:`${p}px`):u==="left"&&(y=`${r.floating.width+c}px`,g=i?l:`${p}px`),{data:{x:y,y:g}}}}),"transformOrigin");function ys(e){const[t,n="center"]=e.split("-");return[t,n]}xn(ys,"getSideAndAlignFromPlacement");var Eb=Object.defineProperty,Cb=(e,t)=>Eb(e,"name",{value:t,configurable:!0}),kb=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"}),Ob=h.forwardRef(Cb(function(t,n){return m.jsx(Ze.span,{...t,ref:n,style:{...kb,...t.style}})},"VisuallyHidden")),Rb=Object.defineProperty,Qe=(e,t)=>Rb(e,"name",{value:t,configurable:!0}),[Sa,j2]=sn("Tooltip",[gs]),Ea=gs(),Pb="TooltipProvider",Tb=700,ki="tooltip.open",[Ib,Ca]=Sa(Pb),Ab=Qe(e=>{const{__scopeTooltip:t,delayDuration:n=Tb,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(Ib,{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"),Oi="Tooltip",[Nb,ao]=Sa(Oi),Db=Qe(e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,c=Ca(Oi,e.__scopeTooltip),u=Ea(t),[d,l]=h.useState(null),[f,p]=h.useState(void 0),y=_n(),g=h.useRef(0),w=i??c.disableHoverableContent,b=a??c.delayDuration,S=h.useRef(!1),[_,O]=io({prop:r,defaultProp:o??!1,onChange:Qe($=>{$?(c.onOpen(),document.dispatchEvent(new CustomEvent(ki))):c.onClose(),s==null||s($)},"onChange"),caller:Oi}),E=h.useMemo(()=>_?S.current?"delayed-open":"instant-open":"closed",[_]),R=h.useCallback(()=>{window.clearTimeout(g.current),g.current=0,S.current=!1,O(!0)},[O]),P=h.useCallback(()=>{window.clearTimeout(g.current),g.current=0,O(!1)},[O]),A=h.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{S.current=!0,O(!0),g.current=0},b)},[b,O]);h.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]);const M=f??y;return m.jsx(cf,{...u,children:m.jsx(Nb,{scope:t,contentId:M,setContentId:p,open:_,stateAttribute:E,trigger:d,onTriggerChange:l,onTriggerEnter:h.useCallback(()=>{c.isOpenDelayedRef.current?A():R()},[c.isOpenDelayedRef,A,R]),onTriggerLeave:h.useCallback(()=>{w?P():(window.clearTimeout(g.current),g.current=0)},[P,w]),onOpen:R,onClose:P,disableHoverableContent:w,children:n})})},"Tooltip"),Bc="TooltipTrigger",Mb=h.forwardRef(Qe(function(t,n){const{__scopeTooltip:r,"aria-describedby":o,...s}=t,i=ao(Bc,r),a=Ca(Bc,r),c=Ea(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(lf,{asChild:!0,...c,children:m.jsx(Ze.button,{"aria-describedby":i.open?xf(o,i.contentId):o,"data-state":i.stateAttribute,...s,ref:d,onPointerMove:ue(t.onPointerMove,y=>{y.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),f.current=!0)}),onPointerLeave:ue(t.onPointerLeave,()=>{i.onTriggerLeave(),f.current=!1}),onPointerDown:ue(t.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:ue(t.onFocus,()=>{l.current||i.onOpen()}),onBlur:ue(t.onBlur,i.onClose),onClick:ue(t.onClick,i.onClose)})})},"TooltipTrigger")),hf="TooltipPortal",[jb,$b]=Sa(hf,{forceMount:void 0}),zb=Qe(e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=ao(hf,t);return m.jsx(jb,{scope:t,forceMount:n,children:m.jsx(an,{present:n||s.open,children:m.jsx(ba,{asChild:!0,container:o,children:r})})})},"TooltipPortal"),Kr="TooltipContent",pf=h.forwardRef(Qe(function(t,n){const r=$b(Kr,t.__scopeTooltip),{forceMount:o=r.forceMount,side:s="top",...i}=t,a=ao(Kr,t.__scopeTooltip);return m.jsx(an,{present:o||a.open,children:a.disableHoverableContent?m.jsx(mf,{side:s,...i,ref:n}):m.jsx(Fb,{side:s,...i,ref:n})})},"TooltipContent")),Fb=h.forwardRef(Qe(function(t,n){const r=ao(Kr,t.__scopeTooltip),o=Ca(Kr,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]),y=h.useCallback((g,w)=>{const b=g.currentTarget,S={x:g.clientX,y:g.clientY},_=gf(S,b.getBoundingClientRect()),O=yf(S,_),E=vf(w.getBoundingClientRect()),R=wf([...O,...E]);c(R),f(!0)},[f]);return h.useEffect(()=>()=>p(),[p]),h.useEffect(()=>{if(u&&l){const g=Qe(b=>y(b,l),"handleTriggerLeave"),w=Qe(b=>y(b,u),"handleContentLeave");return u.addEventListener("pointerleave",g),l.addEventListener("pointerleave",w),()=>{u.removeEventListener("pointerleave",g),l.removeEventListener("pointerleave",w)}}},[u,l,y,p]),h.useEffect(()=>{if(a){const g=Qe(w=>{const b=w.target,S={x:w.clientX,y:w.clientY},_=(u==null?void 0:u.contains(b))||(l==null?void 0:l.contains(b)),O=!bf(S,a);_?p():O&&(p(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[u,l,a,d,p]),m.jsx(mf,{...t,ref:i})},"TooltipContentHoverable")),Lb=Ku("TooltipContent"),mf=h.forwardRef(Qe(function(t,n){const{__scopeTooltip:r,children:o,"aria-label":s,id:i,onEscapeKeyDown:a,onPointerDownOutside:c,...u}=t,d=ao(Kr,r),l=Ea(r),{onClose:f}=d,[p,y]=h.useState(null),g=Pe(n,y);ya(p),h.useEffect(()=>(document.addEventListener(ki,f),()=>document.removeEventListener(ki,f)),[f]),h.useEffect(()=>{if(d.trigger){const b=Qe(S=>{S.target instanceof Node&&S.target.contains(d.trigger)&&f()},"handleScroll");return window.addEventListener("scroll",b,{capture:!0}),()=>window.removeEventListener("scroll",b,{capture:!0})}},[d.trigger,f]);const{setContentId:w}=d;return ct(()=>(w(i),()=>{w(void 0)}),[i,w]),m.jsx(ha,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:b=>b.preventDefault(),onDismiss:f,children:m.jsxs(df,{"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(Lb,{children:o}),s?m.jsx(Ob,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function gf(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")}}Qe(gf,"getExitSideFromRect");function yf(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}Qe(yf,"getPaddedExitPoints");function vf(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}]}Qe(vf,"getPointsFromRect");function bf(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}Qe(bf,"isPointInPolygon");function wf(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),_f(t)}Qe(wf,"getHull");function _f(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)}Qe(_f,"getHullPresorted");function xf(...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}Qe(xf,"concatAriaDescribedby");const Vb=Ab,Ub=Db,Zb=Mb,Sf=h.forwardRef((e,t)=>{const n=ee.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=ce("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(zb,{children:m.jsx(pf,{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});Sf.displayName=pf.displayName;const Bb="sidebar_state",Hb=3600*24*7,Wb="16rem",Kb="18rem",Gb="3rem",qb="b",Ef=h.createContext(null);function co(){const e=h.useContext(Ef);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Cf=h.forwardRef((e,t)=>{const n=ee.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=sy(),[f,p]=h.useState(!1),[y,g]=h.useState(d),w=s??y;let b;n[8]!==w||n[9]!==a?(b=K=>{const H=typeof K=="function"?K(w):K;a?a(H):g(H),document.cookie=`${Bb}=${H}; path=/; max-age=${Hb}`},n[8]=w,n[9]=a,n[10]=b):b=n[10];const S=b;let _;n[11]!==l||n[12]!==S?(_=()=>l?p(aw):S(cw),n[11]=l,n[12]=S,n[13]=_):_=n[13];const O=_;let E,R;n[14]!==O?(E=()=>{const K=H=>{H.key===qb&&(H.metaKey||H.ctrlKey)&&(H.preventDefault(),O())};return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},R=[O],n[14]=O,n[15]=E,n[16]=R):(E=n[15],R=n[16]),h.useEffect(E,R);const P=w?"expanded":"collapsed";let A;n[17]!==l||n[18]!==w||n[19]!==f||n[20]!==S||n[21]!==P||n[22]!==O?(A={state:P,open:w,setOpen:S,isMobile:l,openMobile:f,setOpenMobile:p,toggleSidebar:O},n[17]=l,n[18]=w,n[19]=f,n[20]=S,n[21]=P,n[22]=O,n[23]=A):A=n[23];const M=A;let $;n[24]!==c?($={"--sidebar-width":Wb,"--sidebar-width-icon":Gb,...c},n[24]=c,n[25]=$):$=n[25];const V=$;let D;n[26]!==o?(D=ce("group/sidebar-wrapper flex h-svh w-full has-[[data-variant=inset]]:bg-sidebar",o),n[26]=o,n[27]=D):D=n[27];let Q;n[28]!==r||n[29]!==i||n[30]!==t||n[31]!==V||n[32]!==D?(Q=m.jsx(Vb,{delayDuration:0,children:m.jsx("div",{style:V,className:D,ref:t,...i,children:r})}),n[28]=r,n[29]=i,n[30]=t,n[31]=V,n[32]=D,n[33]=Q):Q=n[33];let U;return n[34]!==M||n[35]!==Q?(U=m.jsx(Ef.Provider,{value:M,children:Q}),n[34]=M,n[35]=Q,n[36]=U):U=n[36],U});Cf.displayName="SidebarProvider";const kf=h.forwardRef((e,t)=>{const n=ee.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:y,setOpenMobile:g}=co();if(l==="none"){let $;n[7]!==o?($=ce("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),n[7]=o,n[8]=$):$=n[8];let V;return n[9]!==r||n[10]!==s||n[11]!==t||n[12]!==$?(V=m.jsx("div",{className:$,ref:t,...s,children:r}),n[9]=r,n[10]=s,n[11]=t,n[12]=$,n[13]=V):V=n[13],V}if(f){let $;n[14]===Symbol.for("react.memo_cache_sentinel")?($={"--sidebar-width":Kb},n[14]=$):$=n[14];let V;n[15]===Symbol.for("react.memo_cache_sentinel")?(V=m.jsxs(ef,{className:"sr-only",children:[m.jsx(tf,{children:"Sidebar"}),m.jsx(nf,{children:"Displays the mobile sidebar."})]}),n[15]=V):V=n[15];let D;n[16]!==r?(D=m.jsx("div",{className:"flex h-full w-full flex-col",children:r}),n[16]=r,n[17]=D):D=n[17];let Q;n[18]!==u||n[19]!==D?(Q=m.jsxs(Xd,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:$,side:u,children:[V,D]}),n[18]=u,n[19]=D,n[20]=Q):Q=n[20];let U;return n[21]!==y||n[22]!==s||n[23]!==g||n[24]!==Q?(U=m.jsx(pb,{open:y,onOpenChange:g,...s,children:Q}),n[21]=y,n[22]=s,n[23]=g,n[24]=Q,n[25]=U):U=n[25],U}const w=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 S;n[26]!==b?(S=ce("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]=S):S=n[27];let _;n[28]!==S?(_=m.jsx("div",{className:S}),n[28]=S,n[29]=_):_=n[29];const O=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 R;n[30]!==o||n[31]!==O||n[32]!==E?(R=ce("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",O,E,o),n[30]=o,n[31]=O,n[32]=E,n[33]=R):R=n[33];let P;n[34]!==r?(P=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]=P):P=n[35];let A;n[36]!==s||n[37]!==R||n[38]!==P?(A=m.jsx("div",{className:R,...s,children:P}),n[36]=s,n[37]=R,n[38]=P,n[39]=A):A=n[39];let M;return n[40]!==t||n[41]!==u||n[42]!==p||n[43]!==A||n[44]!==w||n[45]!==_||n[46]!==d?(M=m.jsxs("div",{ref:t,className:"group peer hidden text-sidebar-foreground md:block","data-state":p,"data-collapsible":w,"data-variant":d,"data-side":u,children:[_,A]}),n[40]=t,n[41]=u,n[42]=p,n[43]=A,n[44]=w,n[45]=_,n[46]=d,n[47]=M):M=n[47],M});kf.displayName="Sidebar";const Of=h.forwardRef((e,t)=>{const n=ee.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}=co();let a;n[4]!==r?(a=ce("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(mg,{}),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(fs,{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});Of.displayName="SidebarTrigger";const Qb=h.forwardRef((e,t)=>{const n=ee.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}=co();let i;n[3]!==r?(i=ce("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});Qb.displayName="SidebarRail";const Rf=h.forwardRef((e,t)=>{const n=ee.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=ce("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});Rf.displayName="SidebarInset";const Yb=h.forwardRef((e,t)=>{const n=ee.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=ce("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(es,{ref:t,"data-sidebar":"input",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Yb.displayName="SidebarInput";const Pf=h.forwardRef((e,t)=>{const n=ee.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=ce("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});Pf.displayName="SidebarHeader";const Tf=h.forwardRef((e,t)=>{const n=ee.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=ce("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});Tf.displayName="SidebarFooter";const Jb=h.forwardRef((e,t)=>{const n=ee.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=ce("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(ts,{ref:t,"data-sidebar":"separator",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Jb.displayName="SidebarSeparator";const If=h.forwardRef((e,t)=>{const n=ee.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=ce("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});If.displayName="SidebarContent";const Vo=h.forwardRef((e,t)=>{const n=ee.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=ce("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});Vo.displayName="SidebarGroup";const Ri=h.forwardRef((e,t)=>{const n=ee.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=ce("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});Ri.displayName="SidebarGroupLabel";const Xb=h.forwardRef((e,t)=>{const n=ee.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=ce("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});Xb.displayName="SidebarGroupAction";const Uo=h.forwardRef((e,t)=>{const n=ee.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=ce("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});Uo.displayName="SidebarGroupContent";const Zo=h.forwardRef((e,t)=>{const n=ee.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=ce("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});Zo.displayName="SidebarMenu";const Bo=h.forwardRef((e,t)=>{const n=ee.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=ce("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});Bo.displayName="SidebarMenuItem";const ew=oo("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"}}),Ho=h.forwardRef((e,t)=>{const n=ee.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,y=d?xr:"button",{isMobile:g,state:w}=co();let b;n[8]!==r||n[9]!==p||n[10]!==f?(b=ce(ew({variant:f,size:p}),r),n[8]=r,n[9]=p,n[10]=f,n[11]=b):b=n[11];let S;n[12]!==y||n[13]!==l||n[14]!==o||n[15]!==t||n[16]!==p||n[17]!==b?(S=m.jsx(y,{ref:t,"data-sidebar":"menu-button","data-size":p,"data-active":l,className:b,...o}),n[12]=y,n[13]=l,n[14]=o,n[15]=t,n[16]=p,n[17]=b,n[18]=S):S=n[18];const _=S;if(!u)return _;if(typeof u=="string"){let A;n[19]!==u?(A={children:u},n[19]=u,n[20]=A):A=n[20],u=A}let O;n[21]!==_?(O=m.jsx(Zb,{asChild:!0,children:_}),n[21]=_,n[22]=O):O=n[22];const E=w!=="collapsed"||g;let R;n[23]!==E||n[24]!==u?(R=m.jsx(Sf,{side:"right",align:"center",hidden:E,...u}),n[23]=E,n[24]=u,n[25]=R):R=n[25];let P;return n[26]!==O||n[27]!==R?(P=m.jsxs(Ub,{children:[O,R]}),n[26]=O,n[27]=R,n[28]=P):P=n[28],P});Ho.displayName="SidebarMenuButton";const tw=h.forwardRef((e,t)=>{const n=ee.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=ce("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});tw.displayName="SidebarMenuAction";const nw=h.forwardRef((e,t)=>{const n=ee.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=ce("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});nw.displayName="SidebarMenuBadge";const rw=h.forwardRef((e,t)=>{const n=ee.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=ce("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(Vc,{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(Vc,{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});rw.displayName="SidebarMenuSkeleton";const ow=h.forwardRef((e,t)=>{const n=ee.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=ce("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});ow.displayName="SidebarMenuSub";const sw=h.forwardRef((e,t)=>{const n=ee.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});sw.displayName="SidebarMenuSubItem";const iw=h.forwardRef((e,t)=>{const n=ee.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=ce("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 y;return n[10]!==d||n[11]!==o||n[12]!==s||n[13]!==t||n[14]!==u||n[15]!==p?(y=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]=y):y=n[16],y});iw.displayName="SidebarMenuSubButton";function aw(e){return!e}function cw(e){return!e}var lw=Object.defineProperty,qe=(e,t)=>lw(e,"name",{value:t,configurable:!0});function ka(e){const t=e+"CollectionProvider",[n,r]=sn(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=qe(g=>{const{scope:w,children:b}=g,S=h.useRef(null),_=h.useRef(new Map).current;return m.jsx(o,{scope:w,itemMap:_,collectionRef:S,children:b})},"CollectionProvider");i.displayName=t;const a=e+"CollectionSlot",c=tn(a),u=h.forwardRef((g,w)=>{const{scope:b,children:S}=g,_=s(a,b),O=Pe(w,_.collectionRef);return m.jsx(c,{ref:O,children:S})});u.displayName=a;const d=e+"CollectionItemSlot",l="data-radix-collection-item",f=tn(d),p=h.forwardRef((g,w)=>{const{scope:b,children:S,..._}=g,O=h.useRef(null),E=Pe(w,O),R=s(d,b);return h.useEffect(()=>(R.itemMap.set(O,{ref:O,..._}),()=>void R.itemMap.delete(O))),m.jsx(f,{[l]:"",ref:E,children:S})});p.displayName=d;function y(g){const w=s(e+"CollectionConsumer",g);return h.useCallback(()=>{const S=w.collectionRef.current;if(!S)return[];const _=Array.from(S.querySelectorAll(`[${l}]`));return Array.from(w.itemMap.values()).sort((R,P)=>_.indexOf(R.ref.current)-_.indexOf(P.ref.current))},[w.collectionRef,w.itemMap])}return qe(y,"useCollection"),[{Provider:i,Slot:u,ItemSlot:p},y,r]}qe(ka,"createCollection");var Hc=new WeakMap,Ue,wt,Po=(wt=class extends Map{constructor(n){super(n);ie(this,Ue);G(this,Ue,[...super.keys()]),Hc.set(this,!0)}set(n,r){return Hc.get(this)&&!this.has(n)&&C(this,Ue).push(n),super.set(n,r),this}insert(n,r,o){const s=this.has(r),i=s?this.size:this.size+1,a=Oa(n),c=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(s?C(this,Ue).indexOf(r)===c:c===this.size)return this.set(r,o),this;const u=C(this,Ue).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 wt(this);return s.insert(n,r,o),s}before(n){const r=C(this,Ue).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,o){const s=C(this,Ue).indexOf(n);if(s===-1)return this;const i=C(this,Ue).indexOf(r),a=i!==-1&&i<s?s-1:s;return this.insert(a,r,o)}after(n){let r=C(this,Ue).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=C(this,Ue).indexOf(n);if(s===-1)return this;const i=C(this,Ue).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 G(this,Ue,[]),super.clear()}delete(n){const r=super.delete(n);return r&&C(this,Ue).splice(C(this,Ue).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=Wo(C(this,Ue),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=Wo(C(this,Ue),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return C(this,Ue).indexOf(n)}keyAt(n){return Wo(C(this,Ue),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 wt(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 wt(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 wt(r)}toReversed(){const n=new wt;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 wt(r)}slice(n,r){const o=new wt;for(const s of C(this,Ue).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}},Ue=new WeakMap,qe(wt,"OrderedDict"),wt);function Wo(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=Af(e,t);return n===-1?void 0:e[n]}qe(Wo,"at");function Af(e,t){const n=e.length,r=Oa(t),o=r>=0?r:n+r;return o<0||o>=n?-1:o}qe(Af,"toSafeIndex");function Oa(e){return e!==e||e===0?0:Math.trunc(e)}qe(Oa,"toSafeInteger");function uw(e){const t=e+"CollectionProvider",[n,r]=sn(t),[o,s]=n(t);o.displayName=e+"CollectionStableContextProvider";const[i,a]=n(t);i.displayName=e+"CollectionStatefulContextProvider";const c=qe(({state:R,...P})=>R?m.jsx(d,{...P,state:R}):m.jsx(u,{...P}),"CollectionProvider");c.displayName=t;const u=qe(R=>{const P=S();return m.jsx(d,{...R,state:P})},"CollectionInit");u.displayName=e+"CollectionInit";const d=qe(R=>{const{scope:P,children:A,state:M}=R,$=h.useRef(null),[V,D]=h.useState(null),Q=Pe($,D),[U,K]=M,H=h.useRef(new Po),Y=h.useCallback(()=>{const ne=H.current;return Mf(ne)||ne.sort(Ko),ne},[]);return h.useEffect(()=>{if(!V)return;const ne=jf(()=>{K(te=>{const X=te.toSorted(Ko);return X.some(([ye],me)=>te.keyAt(me)!==ye)?X:te})});return ne.observe(V,{childList:!0,subtree:!0}),()=>{ne.disconnect()}},[V,K]),m.jsx(o,{scope:P,collectionElementRef:Q,collectionElementRefObject:$,getCollection:Y,setCollection:K,registryRef:H,children:m.jsx(i,{scope:P,collectionElement:V,collection:U,children:A})})},"CollectionProviderImpl");d.displayName=e+"CollectionProviderImpl";const l=e+"CollectionSlot",f=tn(l),p=h.forwardRef((R,P)=>{const{scope:A,children:M}=R,$=s(l,A),V=Pe(P,$.collectionElementRef);return m.jsx(f,{ref:V,children:M})});p.displayName=l;const y=e+"CollectionItemSlot",g="data-radix-collection-item",w=tn(y),b=h.forwardRef((R,P)=>{const{scope:A,children:M,...$}=R,V=h.useRef(null),D=s(y,A),{setCollection:Q,registryRef:U}=D,K=h.useRef($);Nf(K.current,$)||(K.current=$);const H=K.current,Y=h.useCallback(X=>{const q=U.current;X?q.set(X,{...K.current,element:X}):V.current&&q.delete(V.current)},[U]),ne=Pe(P,Y,V);ct(()=>{const X=V.current,q=U.current;X&&q.has(X)&&q.set(X,{...H,element:X})},[H,U]);const te=h.useRef(null);return h.useEffect(()=>{const X=V.current,q=te.current;((q==null?void 0:q.element)??null)===X&&(!X||(q==null?void 0:q.itemData)===H)||(te.current=X?{element:X,itemData:H}:null,Q(ye=>{const me=new Po(ye);return q&&q.element!==X&&me.delete(q.element),X&&me.set(X,{...H,element:X}),me.sort(Ko)}))}),h.useEffect(()=>()=>{const X=te.current;te.current=null,X&&Q(q=>{if(!q.has(X.element))return q;const ye=new Po(q);return ye.delete(X.element),ye})},[Q]),m.jsx(w,{[g]:"",ref:ne,children:M})});b.displayName=y;function S(){return h.useState(new Po)}qe(S,"useInitCollection");function _(R){const{collection:P}=a(e+"CollectionConsumer",R);return P}qe(_,"useCollection");function O(R){const{getCollection:P}=s(e+"CollectionConsumer",R);return P}return qe(O,"useGetCollection"),[{Provider:c,Slot:p,ItemSlot:b},{createCollectionScope:r,useCollection:_,useGetCollection:O,useInitCollection:S}]}qe(uw,"createCollection");function Nf(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}qe(Nf,"shallowEqual");function Df(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}qe(Df,"isElementPreceding");function Mf(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}qe(Mf,"isInDocumentOrder");function Ko(e,t){return!e[1].element||!t[1].element?0:Df(e[1].element,t[1].element)?-1:1}qe(Ko,"sortByDocumentPosition");function jf(e){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){e();return}})}qe(jf,"getChildListObserver");var dw=Object.defineProperty,fw=(e,t)=>dw(e,"name",{value:t,configurable:!0}),hw={LTR:"ltr"},pw=h.createContext(void 0);function Ra(e){const t=h.useContext(pw);return e||t||hw.LTR}fw(Ra,"useDirection");var mw=Object.defineProperty,Pa=(e,t)=>mw(e,"name",{value:t,configurable:!0}),Us=!1;function $f(){const[e,t]=h.useState(Us);return h.useEffect(()=>{Us||(Us=!0,t(!0))},[]),e}Pa($f,"useIsHydrated");var zf=Vn[" useSyncExternalStore ".trim().toString()];function Ff(){return()=>{}}Pa(Ff,"subscribe");function Lf(){return zf(Ff,()=>!0,()=>!1)}Pa(Lf,"useIsHydratedModern");var gw=typeof zf=="function"?Lf:$f,yw=Object.defineProperty,Un=(e,t)=>yw(e,"name",{value:t,configurable:!0}),Zs="rovingFocusGroup.onEntryFocus",vw={bubbles:!1,cancelable:!0},vs="RovingFocusGroup",[Pi,Vf,bw]=ka(vs),[ww,Uf]=sn(vs,[bw]),Wc={Vertical:"vertical",Horizontal:"horizontal"},_w={RTL:"rtl"},[xw,Sw]=ww(vs),Ew=h.forwardRef(Un(function(t,n){return m.jsx(Pi.Provider,{scope:t.__scopeRovingFocusGroup,children:m.jsx(Pi.Slot,{scope:t.__scopeRovingFocusGroup,children:m.jsx(Cw,{...t,ref:n})})})},"RovingFocusGroup")),Cw=h.forwardRef(Un(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),y=Pe(n,p),g=Ra(i),[w,b]=io({prop:a,defaultProp:c??null,onChange:u,caller:vs}),[S,_]=h.useState(!1),O=nn(d),E=Vf(r),R=h.useRef(!1),[P,A]=h.useState(0);return h.useEffect(()=>{const M=p.current;if(M)return M.addEventListener(Zs,O),()=>M.removeEventListener(Zs,O)},[O]),m.jsx(xw,{scope:r,orientation:o,dir:g,loop:s,currentTabStopId:w,onItemFocus:h.useCallback(M=>b(M),[b]),onItemShiftTab:h.useCallback(()=>_(!0),[]),onFocusableItemAdd:h.useCallback(()=>A(M=>M+1),[]),onFocusableItemRemove:h.useCallback(()=>A(M=>M-1),[]),children:m.jsx(Ze.div,{tabIndex:S||P===0?-1:0,"data-orientation":o,...f,ref:y,style:{outline:"none",...t.style},onMouseDown:ue(t.onMouseDown,()=>{R.current=!0}),onFocus:ue(t.onFocus,M=>{const $=!R.current;if(M.target===M.currentTarget&&$&&!S){const V=new CustomEvent(Zs,vw);if(M.currentTarget.dispatchEvent(V),!V.defaultPrevented){const D=E().filter(Y=>Y.focusable),Q=D.find(Y=>Y.active),U=D.find(Y=>Y.id===w),H=[Q,U,...D].filter(Boolean).map(Y=>Y.ref.current);Ta(H,l)}}R.current=!1}),onBlur:ue(t.onBlur,()=>_(!1))})})},"RovingFocusGroupImpl")),kw="RovingFocusGroupItem",Ow=h.forwardRef(Un(function(t,n){const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:i,children:a,...c}=t,u=_n(),d=i||u,l=Sw(kw,r),f=l.currentTabStopId===d,p=Vf(r),{onFocusableItemAdd:y,onFocusableItemRemove:g,currentTabStopId:w}=l,b=gw();return ct(()=>{if(!(!b||!o))return y(),()=>g()},[b,o,y,g]),h.useEffect(()=>{if(!(b||!o))return y(),()=>g()},[b,o,y,g]),m.jsx(Pi.ItemSlot,{scope:r,id:d,focusable:o,active:s,children:m.jsx(Ze.span,{tabIndex:f?0:-1,"data-orientation":l.orientation,...c,ref:n,onMouseDown:ue(t.onMouseDown,S=>{o?l.onItemFocus(d):S.preventDefault()}),onFocus:ue(t.onFocus,()=>l.onItemFocus(d)),onKeyDown:ue(t.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){l.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const _=Bf(S,l.orientation,l.dir);if(_!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let E=p().filter(R=>R.focusable).map(R=>R.ref.current);if(_==="last")E.reverse();else if(_==="prev"||_==="next"){_==="prev"&&E.reverse();const R=E.indexOf(S.currentTarget);E=l.loop?Hf(E,R+1):E.slice(R+1)}setTimeout(()=>Ta(E))}}),children:typeof a=="function"?a({isCurrentTabStop:f,hasTabStop:w!=null}):a})})},"RovingFocusGroupItem")),Rw={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Zf(e,t){return t!==_w.RTL?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Un(Zf,"getDirectionAwareKey");function Bf(e,t,n){const r=Zf(e.key,n);if(!(t===Wc.Vertical&&["ArrowLeft","ArrowRight"].includes(r))&&!(t===Wc.Horizontal&&["ArrowUp","ArrowDown"].includes(r)))return Rw[r]}Un(Bf,"getFocusIntent");function Ta(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Un(Ta,"focusFirst");function Hf(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Un(Hf,"wrapArray");var Pw=Object.defineProperty,_e=(e,t)=>Pw(e,"name",{value:t,configurable:!0}),Tw={RTL:"rtl"},Ti=["Enter"," "],Iw=["ArrowDown","PageUp","Home"],Wf=["ArrowUp","PageDown","End"],Aw=[...Iw,...Wf],Nw={ltr:[...Ti,"ArrowRight"],rtl:[...Ti,"ArrowLeft"]},Dw={ltr:["ArrowLeft"],rtl:["ArrowRight"]},bs="Menu",[Gr,Mw,jw]=ka(bs),[Zn,Kf]=sn(bs,[jw,gs,Uf]),Ia=gs(),Gf=Uf(),[$w,Bn]=Zn(bs),[zw,lo]=Zn(bs),Fw=_e(e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=Ia(t),[c,u]=h.useState(null),d=h.useRef(!1),l=nn(s),f=Ra(o);return h.useEffect(()=>{const p=_e(()=>{d.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},"handleKeyDown"),y=_e(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{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(cf,{...a,children:m.jsx($w,{scope:t,open:n,onOpenChange:l,content:c,onContentChange:u,children:m.jsx(zw,{scope:t,onClose:h.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:d,dir:f,modal:i,children:r})})})},"Menu"),qf=h.forwardRef(_e(function(t,n){const{__scopeMenu:r,...o}=t,s=Ia(r);return m.jsx(lf,{...s,...o,ref:n})},"MenuAnchor")),Qf="MenuPortal",[Lw,Yf]=Zn(Qf,{forceMount:void 0}),Vw=_e(e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Bn(Qf,t);return m.jsx(Lw,{scope:t,forceMount:n,children:m.jsx(an,{present:n||s.open,children:m.jsx(ba,{asChild:!0,container:o,children:r})})})},"MenuPortal"),Dt="MenuContent",[Uw,Aa]=Zn(Dt),Zw=h.forwardRef(_e(function(t,n){const r=Yf(Dt,t.__scopeMenu),{forceMount:o=r.forceMount,...s}=t,i=Bn(Dt,t.__scopeMenu),a=lo(Dt,t.__scopeMenu);return m.jsx(Gr.Provider,{scope:t.__scopeMenu,children:m.jsx(an,{present:o||i.open,children:m.jsx(Gr.Slot,{scope:t.__scopeMenu,children:a.modal?m.jsx(Bw,{...s,ref:n}):m.jsx(Hw,{...s,ref:n})})})})},"MenuContent")),Bw=h.forwardRef(_e(function(t,n){const r=Bn(Dt,t.__scopeMenu),o=h.useRef(null),s=Pe(n,o);return h.useEffect(()=>{const i=o.current;if(i)return Ud(i)},[]),m.jsx(Na,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ue(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),Hw=h.forwardRef(_e(function(t,n){const r=Bn(Dt,t.__scopeMenu);return m.jsx(Na,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),Ww=tn("MenuContent.ScrollLock"),Na=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:y,disableOutsideScroll:g,...w}=t,b=Bn(Dt,r),S=lo(Dt,r),_=Ia(r),O=Gf(r),E=Mw(r),[R,P]=h.useState(null),A=h.useRef(null),[M,$]=h.useState(null);ya(M);const{nodes:V,registry:D}=ga(),Q=!!(s||g),U=Pe(n,A,b.onContentChange,$),K=h.useRef(0),H=h.useRef(""),Y=h.useRef(0),ne=h.useRef(null),te=h.useRef("right"),X=h.useRef(0),q=h.useMemo(()=>g?[A,...V.map(W=>({current:W}))]:[],[A,V,g]),ye=g?_a:h.Fragment,me=g?{as:Ww,allowPinchZoom:!0,shards:q}:void 0,le=_e(W=>{var Et,Ct;const ae=H.current+W,be=E().filter(Oe=>!Oe.disabled),se=document.activeElement,Te=(Et=be.find(Oe=>Oe.ref.current===se))==null?void 0:Et.textValue,Se=be.map(Oe=>Oe.textValue),ke=oh(Se,ae,Te),je=(Ct=be.find(Oe=>Oe.textValue===ke))==null?void 0:Ct.ref.current;function Fe(Oe){H.current=Oe,window.clearTimeout(K.current),Oe!==""&&(K.current=window.setTimeout(()=>Fe(""),1e3))}_e(Fe,"updateSearch"),Fe(ae),je&&setTimeout(()=>je.focus())},"handleTypeaheadSearch");h.useEffect(()=>()=>window.clearTimeout(K.current),[]),hs();const re=h.useCallback(W=>{var be,se;return te.current===((be=ne.current)==null?void 0:be.side)&&ih(W,(se=ne.current)==null?void 0:se.area)},[]);return m.jsx(Uw,{scope:r,searchRef:H,onItemEnter:h.useCallback(W=>{re(W)&&W.preventDefault()},[re]),onItemLeave:h.useCallback(W=>{var ae;re(W)||((ae=A.current)==null||ae.focus(),P(null))},[re]),onTriggerLeave:h.useCallback(W=>{re(W)&&W.preventDefault()},[re]),pointerGraceTimerRef:Y,onPointerGraceIntentChange:h.useCallback(W=>{ne.current=W},[]),children:m.jsx(ma,{registry:Q?D:null,children:m.jsx(ye,{...me,children:m.jsx(xd,{asChild:!0,trapped:s,branches:V,onMountAutoFocus:ue(i,W=>{var ae;W.preventDefault(),(ae=A.current)==null||ae.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:m.jsx(ha,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:l,onFocusOutside:f,onInteractOutside:p,onDismiss:y,children:m.jsx(Ew,{asChild:!0,...O,dir:S.dir,orientation:"vertical",loop:o,currentTabStopId:R,onCurrentTabStopIdChange:P,onEntryFocus:ue(u,W=>{S.isUsingKeyboardRef.current||W.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(df,{role:"menu","aria-orientation":"vertical","data-state":Ma(b.open),"data-radix-menu-content":"",dir:S.dir,..._,...w,ref:U,style:{outline:"none",...w.style},onKeyDown:ue(w.onKeyDown,W=>{const be=W.target.closest("[data-radix-menu-content]")===W.currentTarget,se=W.ctrlKey||W.altKey||W.metaKey,Te=W.key.length===1;be&&(W.key==="Tab"&&W.preventDefault(),!se&&Te&&le(W.key));const Se=A.current;if(W.target!==Se||!Aw.includes(W.key))return;W.preventDefault();const je=E().filter(Fe=>!Fe.disabled).map(Fe=>Fe.ref.current);Wf.includes(W.key)&&je.reverse(),nh(je)}),onBlur:ue(t.onBlur,W=>{W.currentTarget.contains(W.target)||(window.clearTimeout(K.current),H.current="")}),onPointerMove:ue(t.onPointerMove,br(W=>{const ae=W.target,be=X.current!==W.clientX;if(W.currentTarget.contains(ae)&&be){const se=W.clientX>X.current?"right":"left";te.current=se,X.current=W.clientX}}))})})})})})})})},"MenuContentImpl")),Kw=h.forwardRef(_e(function(t,n){const{__scopeMenu:r,...o}=t;return m.jsx(Ze.div,{...o,ref:n})},"MenuLabel")),Ii="MenuItem",Kc="menu.itemSelect",Da=h.forwardRef(_e(function(t,n){const{disabled:r=!1,onSelect:o,...s}=t,i=h.useRef(null),a=lo(Ii,t.__scopeMenu),c=Aa(Ii,t.__scopeMenu),u=Pe(n,i),d=h.useRef(!1),l=_e(()=>{const f=i.current;if(!r&&f){const p=new CustomEvent(Kc,{bubbles:!0,cancelable:!0});f.addEventListener(Kc,y=>o==null?void 0:o(y),{once:!0}),da(f,p),p.defaultPrevented?d.current=!1:a.onClose()}},"handleSelect");return m.jsx(Jf,{...s,ref:u,disabled:r,onClick:ue(t.onClick,l),onPointerDown:f=>{var p;(p=t.onPointerDown)==null||p.call(t,f),d.current=!0},onPointerUp:ue(t.onPointerUp,f=>{var p;d.current||(p=f.currentTarget)==null||p.click()}),onKeyDown:ue(t.onKeyDown,f=>{r||f.target!==f.currentTarget||c.searchRef.current!==""&&f.key===" "||Ti.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})},"MenuItem")),Jf=h.forwardRef(_e(function(t,n){const{__scopeMenu:r,disabled:o=!1,textValue:s,...i}=t,a=Aa(Ii,r),c=Gf(r),u=h.useRef(null),d=Pe(n,u),[l,f]=h.useState(!1),[p,y]=h.useState("");return h.useEffect(()=>{const g=u.current;g&&y((g.textContent??"").trim())},[i.children]),m.jsx(Gr.ItemSlot,{scope:r,disabled:o,textValue:s??p,children:m.jsx(Ow,{asChild:!0,...c,focusable:!o,children:m.jsx(Ze.div,{role:"menuitem","data-highlighted":l?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:d,onPointerMove:ue(t.onPointerMove,br(g=>{o?a.onItemLeave(g):(a.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ue(t.onPointerLeave,br(g=>a.onItemLeave(g))),onFocus:ue(t.onFocus,()=>f(!0)),onBlur:ue(t.onBlur,()=>f(!1))})})})},"MenuItemImpl")),Gw=h.forwardRef(_e(function(t,n){const{checked:r=!1,onCheckedChange:o,...s}=t;return m.jsx(eh,{scope:t.__scopeMenu,checked:r,children:m.jsx(Da,{role:"menuitemcheckbox","aria-checked":qr(r)?"mixed":r,...s,ref:n,"data-state":ws(r),onSelect:ue(s.onSelect,()=>o==null?void 0:o(qr(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),qw="MenuRadioGroup",[$2,Qw]=Zn(qw,{value:void 0,onValueChange:_e(()=>{},"onValueChange")}),Yw="MenuRadioItem",Jw=h.forwardRef(_e(function(t,n){const{value:r,...o}=t,s=Qw(Yw,t.__scopeMenu),i=r===s.value;return m.jsx(eh,{scope:t.__scopeMenu,checked:i,children:m.jsx(Da,{role:"menuitemradio","aria-checked":i,...o,ref:n,"data-state":ws(i),onSelect:ue(o.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,r)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),Xf="MenuItemIndicator",[eh,Xw]=Zn(Xf,{checked:!1}),e0=h.forwardRef(_e(function(t,n){const{__scopeMenu:r,forceMount:o,...s}=t,i=Xw(Xf,r);return m.jsx(an,{present:o||qr(i.checked)||i.checked===!0,children:m.jsx(Ze.span,{...s,ref:n,"data-state":ws(i.checked)})})},"MenuItemIndicator")),t0=h.forwardRef(_e(function(t,n){const{__scopeMenu:r,...o}=t;return m.jsx(Ze.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})},"MenuSeparator")),n0="MenuSub",[z2,th]=Zn(n0),To="MenuSubTrigger",r0=h.forwardRef(_e(function(t,n){const r=Bn(To,t.__scopeMenu),o=lo(To,t.__scopeMenu),s=th(To,t.__scopeMenu),i=Aa(To,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(qf,{asChild:!0,...d,children:m.jsx(Jf,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?s.contentId:void 0,"data-state":Ma(r.open),...t,ref:f,onClick:p=>{var y;(y=t.onClick)==null||y.call(t,p),!(t.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ue(t.onPointerMove,br(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:ue(t.onPointerLeave,br(p=>{var g,w;l();const y=(g=r.content)==null?void 0:g.getBoundingClientRect();if(y){const b=(w=r.content)==null?void 0:w.dataset.side,S=b==="right",_=S?-5:5,O=y[S?"left":"right"],E=y[S?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+_,y:p.clientY},{x:O,y:y.top},{x:E,y:y.top},{x:E,y:y.bottom},{x:O,y:y.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:ue(t.onKeyDown,p=>{var g;t.disabled||p.target!==p.currentTarget||i.searchRef.current!==""&&p.key===" "||Nw[o.dir].includes(p.key)&&(r.onOpenChange(!0),(g=r.content)==null||g.focus(),p.preventDefault())})})})},"MenuSubTrigger")),o0="MenuSubContent",s0=h.forwardRef(_e(function(t,n){const r=Yf(Dt,t.__scopeMenu),{forceMount:o=r.forceMount,align:s="start",...i}=t,a=Bn(Dt,t.__scopeMenu),c=lo(Dt,t.__scopeMenu),u=th(o0,t.__scopeMenu),d=h.useRef(null),l=Pe(n,d);return m.jsx(Gr.Provider,{scope:t.__scopeMenu,children:m.jsx(an,{present:o||a.open,children:m.jsx(Gr.Slot,{scope:t.__scopeMenu,children:m.jsx(Na,{id:u.contentId,"aria-labelledby":u.triggerId,...i,ref:l,align:s,side:c.dir===Tw.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:ue(t.onFocusOutside,f=>{f.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:ue(t.onEscapeKeyDown,f=>{c.onClose(),f.preventDefault()}),onKeyDown:ue(t.onKeyDown,f=>{var g;const p=f.currentTarget.contains(f.target),y=Dw[c.dir].includes(f.key);p&&y&&(a.onOpenChange(!1),(g=u.trigger)==null||g.focus(),f.preventDefault())})})})})})},"MenuSubContent"));function Ma(e){return e?"open":"closed"}_e(Ma,"getOpenState");function qr(e){return e==="indeterminate"}_e(qr,"isIndeterminate");function ws(e){return qr(e)?"indeterminate":e?"checked":"unchecked"}_e(ws,"getCheckedState");function nh(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}_e(nh,"focusFirst");function rh(e,t){return e.map((n,r)=>e[(t+r)%e.length])}_e(rh,"wrapArray");function oh(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=rh(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(oh,"getNextMatch");function sh(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(sh,"isPointInPolygon");function ih(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return sh(n,t)}_e(ih,"isPointerInGraceArea");function br(e){return t=>t.pointerType==="mouse"?e(t):void 0}_e(br,"whenMouse");var i0=Object.defineProperty,Pt=(e,t)=>i0(e,"name",{value:t,configurable:!0}),ja="DropdownMenu",[a0,F2]=sn(ja,[Kf]),Tt=Kf(),[c0,ah]=a0(ja),l0=Pt(e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=Tt(t),u=h.useRef(null),[d,l]=io({prop:o,defaultProp:s??!1,onChange:i,caller:ja});return m.jsx(c0,{scope:t,triggerId:_n(),triggerRef:u,contentId:_n(),open:d,onOpenChange:l,onOpenToggle:h.useCallback(()=>l(f=>!f),[l]),modal:a,children:m.jsx(Fw,{...c,open:d,onOpenChange:l,dir:r,modal:a,children:n})})},"DropdownMenu"),u0="DropdownMenuTrigger",d0=h.forwardRef(Pt(function(t,n){const{__scopeDropdownMenu:r,disabled:o=!1,...s}=t,i=ah(u0,r),a=Tt(r),c=Pe(n,i.triggerRef);return m.jsx(qf,{asChild:!0,...a,children:m.jsx(Ze.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:ue(t.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:ue(t.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),f0=Pt(e=>{const{__scopeDropdownMenu:t,...n}=e,r=Tt(t);return m.jsx(Vw,{...r,...n})},"DropdownMenuPortal"),h0="DropdownMenuContent",ch=h.forwardRef(Pt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=ah(h0,r),i=Tt(r),a=h.useRef(!1);return m.jsx(Zw,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...o,ref:n,onCloseAutoFocus:ue(t.onCloseAutoFocus,c=>{var u;a.current||(u=s.triggerRef.current)==null||u.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:ue(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")),lh=h.forwardRef(Pt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=Tt(r);return m.jsx(Kw,{...s,...o,ref:n})},"DropdownMenuLabel")),uh=h.forwardRef(Pt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=Tt(r);return m.jsx(Da,{...s,...o,ref:n})},"DropdownMenuItem")),dh=h.forwardRef(Pt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=Tt(r);return m.jsx(Gw,{...s,...o,ref:n})},"DropdownMenuCheckboxItem")),fh=h.forwardRef(Pt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=Tt(r);return m.jsx(Jw,{...s,...o,ref:n})},"DropdownMenuRadioItem")),hh=h.forwardRef(Pt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=Tt(r);return m.jsx(e0,{...s,...o,ref:n})},"DropdownMenuItemIndicator")),ph=h.forwardRef(Pt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=Tt(r);return m.jsx(t0,{...s,...o,ref:n})},"DropdownMenuSeparator")),mh=h.forwardRef(Pt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=Tt(r);return m.jsx(r0,{...s,...o,ref:n})},"DropdownMenuSubTrigger")),gh=h.forwardRef(Pt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=Tt(r);return m.jsx(s0,{...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 p0=l0,m0=d0,g0=h.forwardRef((e,t)=>{const n=ee.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=ce("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(mh,{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});g0.displayName=mh.displayName;const y0=h.forwardRef((e,t)=>{const n=ee.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=ce("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(gh,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});y0.displayName=gh.displayName;const yh=h.forwardRef((e,t)=>{const n=ee.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=ce("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(f0,{children:m.jsx(ch,{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});yh.displayName=ch.displayName;const Ai=h.forwardRef((e,t)=>{const n=ee.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=ce("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(uh,{ref:t,className:a,...s}),n[7]=s,n[8]=t,n[9]=a,n[10]=c):c=n[10],c});Ai.displayName=uh.displayName;const v0=h.forwardRef((e,t)=>{const n=ee.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=ce("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(hh,{children:m.jsx(rg,{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(dh,{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});v0.displayName=dh.displayName;const b0=h.forwardRef((e,t)=>{const n=ee.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=ce("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(hh,{children:m.jsx(ig,{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(fh,{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});b0.displayName=fh.displayName;const w0=h.forwardRef((e,t)=>{const n=ee.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=ce("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(lh,{ref:t,className:a,...s}),n[7]=s,n[8]=t,n[9]=a,n[10]=c):c=n[10],c});w0.displayName=lh.displayName;const vh=h.forwardRef((e,t)=>{const n=ee.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=ce("-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(ph,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});vh.displayName=ph.displayName;const _0=1,x0=1,S0=2,Gc=9;function E0(e,t){const n=new DataView(e),r=[];let o=0;for(;o+Gc<=e.byteLength;){const s=n.getUint8(o),i=n.getUint32(o+1),a=n.getUint32(o+5),c=o+Gc;if(c+a>e.byteLength)break;if(s===x0)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 L2(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(...E0(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 y=n[p+1];if(y&&y.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:y.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]]:[]));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,name:p.name||f.name,...p.status?{status:p.status}:{}}:f})}}function V2(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 U2(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 Z2(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 B2(e){const t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function H2(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 W2(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 Ni="";async function Io(e,t,n,r){const o=await fetch(`${Ni}${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 bh={get:e=>Io("GET",e),post:(e,t)=>Io("POST",e,t),patch:(e,t)=>Io("PATCH",e,t),delete:e=>Io("DELETE",e),upload:async(e,t)=>{const n=await fetch(`${Ni}${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(`${Ni}${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"}}},ns={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 C0(){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 k0(){const{data:e,status:t}=await bh.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 K2(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 O0=()=>Cr("/api/v1/settings"),G2=()=>Cr("/api/v1/tokens"),q2=()=>Cr("/api/v1/team/members"),Q2=e=>Cr(`/api/v1/comments?build_id=${e}`),Y2=e=>Cr(`/api/v1/recordings?buildId=${e}`),J2=()=>Cr("/api/v1/agents");async function X2(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 ek(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 tk(){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 nk({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 rk(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 R0 extends Error{}async function $a(e){if(e.status!==403)return;const t=await e.json().catch(()=>null);throw new R0((t==null?void 0:t.error)??"You do not have permission to do this")}async function ok(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 $a(n),!n.ok)throw new Error(`PATCH /api/v1/builds/${e} failed with ${n.status}`)}async function sk(e){const t=await fetch(`/api/v1/builds/${e}/schedule-deletion`,{method:"POST",credentials:"include"});if(await $a(t),!t.ok)throw new Error(`Failed to schedule deletion (${t.status})`);return(await t.json()).delete_after}async function ik(e){const t=await fetch(`/api/v1/builds/${e}/schedule-deletion`,{method:"DELETE",credentials:"include"});if(await $a(t),!t.ok)throw new Error(`Failed to cancel scheduled deletion (${t.status})`)}async function ak(e){const t=await fetch(`/api/v1/builds/${e}`,{credentials:"include"});return t.ok?t.json():null}function ck(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 P0=1e4;function za(e){const t=new AbortController,n=setTimeout(()=>t.abort(new DOMException("timed out","TimeoutError")),P0);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 T0=25;async function I0(e){const t=await fetch("/api/v1/runs?limit=1",{credentials:"include",signal:za(e)});if(!t.ok)throw new Error(`GET /api/v1/runs failed with ${t.status}`);return(await t.json()).items.length>0}async function lk(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(T0));const o=`/api/v1/runs${r.size?`?${r}`:""}`,s=await fetch(o,{credentials:"include",signal:za(n)});if(!s.ok)throw new Error(`GET /api/v1/runs failed with ${s.status}`);return s.json()}async function uk(e,t){const n=await fetch(`/api/v1/runs/${encodeURIComponent(e)}`,{credentials:"include",signal:za(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 dk(e,t,n){const r=await fetch(A0(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!==_0)return{kind:"unsupported"};const s=await fetch(N0(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 A0(e,t){return`/api/v1/runs/${encodeURIComponent(e)}/flows/${t}/video/index`}function N0(e,t){return`/api/v1/runs/${encodeURIComponent(e)}/flows/${t}/video`}function fk(e,t){return`/api/v1/runs/${encodeURIComponent(e)}/flows/${t}/screenshot`}function wh(){const e=ee.c(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:ns.me,queryFn:k0},e[0]=t):t=e[0];const n=Jo(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 D0={"/settings/team":["Admin"],"/settings/tokens":["Admin","Developer","QA"]};function _h(e,t){const n=Object.entries(D0).find(([r])=>e.startsWith(r));return!n||t!==void 0&&n[1].includes(t)}const M0=6;function j0(e){let t=0;for(const n of e)t=t*31+n.charCodeAt(0)&4294967295;return Math.abs(t)}function $0(e){const t=j0(e)%M0+1;return{bg:`hsl(var(--avatar-${t}-bg))`,fg:`hsl(var(--avatar-${t}-fg))`}}function z0(e){const t=ee.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 S;return t[6]!==r||t[7]!==n||t[8]!==b?(S=m.jsx("img",{src:r,alt:n,style:b}),t[6]=r,t[7]=n,t[8]=b,t[9]=S):S=t[9],S}let l;t[10]!==n?(l=$0(n),t[10]=n,t[11]=l):l=t[11];const{bg:f,fg:p}=l,y=s*.42;let g;t[12]!==f||t[13]!==p||t[14]!==d||t[15]!==y?(g={...d,background:f,display:"inline-flex",alignItems:"center",justifyContent:"center",color:p,fontSize:y,fontWeight:600,userSelect:"none"},t[12]=f,t[13]=p,t[14]=d,t[15]=y,t[16]=g):g=t[16];let w;return t[17]!==c||t[18]!==g?(w=m.jsx("span",{style:g,children:c}),t[17]=c,t[18]=g,t[19]=w):w=t[19],w}const Di="/automation/runs",F0=[{label:"App Center",href:"/app-center",icon:lg},{label:"Flow Runs",href:Di,icon:gg},{label:"Mac Resources",href:"/mac-resources",icon:fg}],L0=[{label:"Default",href:"/settings/default",icon:Fu},{label:"Team",href:"/settings/team",icon:bg},{label:"Tokens",href:"/settings/tokens",icon:cg}],V0=[{label:"Docs",href:"https://www.tapflow.dev/get-started/teammates",icon:ng}];function U0(){const e=ee.c(87),{pathname:t}=uu(),n=du(),{user:r}=wh(),{resolvedTheme:o}=ds(),s=o==="dark"?"/logo-dark.svg":"/logo.svg";let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={queryKey:ns.settings,queryFn:O0},e[0]=i):i=e[0];const a=Jo(i).data,c=(a==null?void 0:a.logo_url)??null,u=(a==null?void 0:a.team_name)||"tapflow",d=na(),{setOpenMobile:l}=co();let f;e[1]!==l?(f=()=>l(!1),e[1]=l,e[2]=f):f=e[2];const p=f;let y;e[3]!==l?(y=()=>{l(!1)},e[3]=l,e[4]=y):y=e[4];let g;e[5]!==t||e[6]!==l?(g=[t,l],e[5]=t,e[6]=l,e[7]=g):g=e[7],h.useEffect(y,g);let w;e[8]===Symbol.for("react.memo_cache_sentinel")?(w={queryKey:ns.anyRun,queryFn:Z0},e[8]=w):w=e[8];const b=Jo(w);let S;e[9]!==b.data||e[10]!==b.isError||e[11]!==t?(S=b.data===!0||b.isError||t.startsWith(Di),e[9]=b.data,e[10]=b.isError,e[11]=t,e[12]=S):S=e[12];const _=S;let O,E,R,P,A,M,$,V,D;if(e[13]!==p||e[14]!==s||e[15]!==c||e[16]!==n||e[17]!==t||e[18]!==d||e[19]!==_||e[20]!==u){let re;e[30]!==_?(re=ke=>ke.href!==Di||_,e[30]=_,e[31]=re):re=e[31];const W=F0.filter(re);let ae;e[32]!==n||e[33]!==d?(ae=async function(){await fetch("/api/v1/auth/logout",{method:"POST",credentials:"include"}),d.clear(),n("/login",{replace:!0})},e[32]=n,e[33]=d,e[34]=ae):ae=e[34],M=ae,A=kf,V="icon";const be=c??s;let se;e[35]!==be?(se=m.jsx("img",{src:be,alt:"tapflow",className:"w-6 h-6 min-w-6 shrink-0"}),e[35]=be,e[36]=se):se=e[36];let Te;e[37]!==u?(Te=m.jsx("span",{className:"text-base font-semibold tracking-tight truncate text-sidebar-accent-foreground group-data-[collapsible=icon]:hidden",children:u}),e[37]=u,e[38]=Te):Te=e[38],e[39]!==p||e[40]!==se||e[41]!==Te?(D=m.jsx(Pf,{className:"p-2",children:m.jsxs(_o,{to:"/app-center",onClick:p,className:"flex items-center gap-2 p-1",children:[se,Te]})}),e[39]=p,e[40]=se,e[41]=Te,e[42]=D):D=e[42],P=If,R=Vo,E=Uo,O=Zo;let Se;e[43]!==p||e[44]!==t?(Se=ke=>m.jsx(Bo,{children:m.jsx(Ho,{asChild:!0,isActive:t.startsWith(ke.href),tooltip:ke.label,children:m.jsxs(_o,{to:ke.href,onClick:p,children:[m.jsx(ke.icon,{}),m.jsx("span",{children:ke.label})]})})},ke.href),e[43]=p,e[44]=t,e[45]=Se):Se=e[45],$=W.map(Se),e[13]=p,e[14]=s,e[15]=c,e[16]=n,e[17]=t,e[18]=d,e[19]=_,e[20]=u,e[21]=O,e[22]=E,e[23]=R,e[24]=P,e[25]=A,e[26]=M,e[27]=$,e[28]=V,e[29]=D}else O=e[21],E=e[22],R=e[23],P=e[24],A=e[25],M=e[26],$=e[27],V=e[28],D=e[29];let Q;e[46]!==O||e[47]!==$?(Q=m.jsx(O,{children:$}),e[46]=O,e[47]=$,e[48]=Q):Q=e[48];let U;e[49]!==E||e[50]!==Q?(U=m.jsx(E,{children:Q}),e[49]=E,e[50]=Q,e[51]=U):U=e[51];let K;e[52]!==R||e[53]!==U?(K=m.jsx(R,{children:U}),e[52]=R,e[53]=U,e[54]=K):K=e[54];let H;e[55]===Symbol.for("react.memo_cache_sentinel")?(H=m.jsx(Ri,{children:"Settings"}),e[55]=H):H=e[55];let Y;if(e[56]!==p||e[57]!==t||e[58]!==(r==null?void 0:r.role)){let re;e[60]!==(r==null?void 0:r.role)?(re=ae=>_h(ae.href,r==null?void 0:r.role),e[60]=r==null?void 0:r.role,e[61]=re):re=e[61];let W;e[62]!==p||e[63]!==t?(W=ae=>m.jsx(Bo,{children:m.jsx(Ho,{asChild:!0,isActive:t===ae.href,tooltip:ae.label,children:m.jsxs(_o,{to:ae.href,onClick:p,children:[m.jsx(ae.icon,{}),m.jsx("span",{children:ae.label})]})})},ae.href),e[62]=p,e[63]=t,e[64]=W):W=e[64],Y=L0.filter(re).map(W),e[56]=p,e[57]=t,e[58]=r==null?void 0:r.role,e[59]=Y}else Y=e[59];let ne;e[65]!==Y?(ne=m.jsxs(Vo,{children:[H,m.jsx(Uo,{children:m.jsx(Zo,{children:Y})})]}),e[65]=Y,e[66]=ne):ne=e[66];let te;e[67]===Symbol.for("react.memo_cache_sentinel")?(te=m.jsx(Ri,{children:"Reference"}),e[67]=te):te=e[67];let X;e[68]!==p?(X=V0.map(re=>m.jsx(Bo,{children:m.jsx(Ho,{asChild:!0,tooltip:re.label,children:m.jsxs("a",{href:re.href,target:"_blank",rel:"noopener noreferrer",onClick:p,children:[m.jsx(re.icon,{}),m.jsx("span",{children:re.label})]})})},re.href)),e[68]=p,e[69]=X):X=e[69];let q;e[70]!==X?(q=m.jsxs(Vo,{children:[te,m.jsx(Uo,{children:m.jsx(Zo,{children:X})})]}),e[70]=X,e[71]=q):q=e[71];let ye;e[72]!==P||e[73]!==K||e[74]!==ne||e[75]!==q?(ye=m.jsxs(P,{children:[K,ne,q]}),e[72]=P,e[73]=K,e[74]=ne,e[75]=q,e[76]=ye):ye=e[76];let me;e[77]!==p||e[78]!==M||e[79]!==r?(me=r&&m.jsx(Tf,{className:"px-3 py-3",children:m.jsxs(p0,{children:[m.jsx(m0,{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(z0,{name:r.displayName??"",avatarUrl:r.avatarUrl,size:28}),m.jsxs("div",{className:"flex flex-col min-w-0 flex-1 group-data-[collapsible=icon]:sr-only",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(yh,{side:"top",align:"start",className:"w-56",children:[m.jsx(Ai,{asChild:!0,children:m.jsxs(_o,{to:"/settings/default",onClick:p,children:[m.jsx(Fu,{className:"mr-2 h-4 w-4"}),"Settings"]})}),m.jsx(vh,{}),m.jsxs(Ai,{onClick:M,className:"text-destructive focus:text-destructive",children:[m.jsx(dg,{className:"mr-2 h-4 w-4"}),"Log out"]})]})]})}),e[77]=p,e[78]=M,e[79]=r,e[80]=me):me=e[80];let le;return e[81]!==A||e[82]!==ye||e[83]!==me||e[84]!==V||e[85]!==D?(le=m.jsxs(A,{collapsible:V,children:[D,ye,me]}),e[81]=A,e[82]=ye,e[83]=me,e[84]=V,e[85]=D,e[86]=le):le=e[86],le}function Z0(e){const{signal:t}=e;return I0(t)}function B0(){const e=ee.c(7),{theme:t,setTheme:n}=ds();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(yg,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),s=m.jsx(hg,{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(fs,{variant:"ghost",size:"icon",onClick:r,"aria-label":"Toggle theme",children:[o,s]}),e[5]=r,e[6]=i):i=e[6],i}const xh=h.createContext({node:null,setNode:()=>{}});function H0(e){const t=ee.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(xh.Provider,{value:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function W0(){return h.useContext(xh)}function K0(){const e=ee.c(8),{node:t}=W0();let n,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx(Of,{className:"-ml-1"}),r=m.jsx(ts,{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(B0,{}),i=m.jsx(ts,{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 G0(){const e=ee.c(5),{user:t,loading:n}=wh(),r=uu();if(n)return null;if(!t){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(ea,{to:"/login",replace:!0}),e[0]=a):a=e[0],a}if(!_h(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(U0,{}),e[2]=o):o=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(K0,{}),e[3]=s):s=e[3];let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx(H0,{children:m.jsxs(Cf,{children:[o,m.jsxs(Rf,{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(Gp,{})})})]})]})}),e[4]=i):i=e[4],i}var kr=e=>e.type==="checkbox",_s=e=>e.type==="file",Pn=e=>e instanceof Date,ze=e=>e==null;const Fa=e=>typeof e=="object";var Ae=e=>!ze(e)&&!Array.isArray(e)&&Fa(e)&&!Pn(e),Mi=e=>Ae(e)&&e.target?kr(e.target)?e.target.checked:_s(e.target)?e.target.files:e.target.value:e;const q0=/[.[\]'"]/;var Or=e=>e.split(q0).filter(Boolean);function Q0(e,t){const n=Or(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 Sh=(e,t)=>t.split(".").some((n,r,o)=>!isNaN(Number(n))&&e.has(o.slice(0,r).join("."))),xs=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ee(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(xs&&(t||n))return e;const r=Array.isArray(e),o=Object.getPrototypeOf(e);if(!r&&o&&o.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]=Ee(e[i]));return s}const fn={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},Rt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Je={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Y0=[Je.required,Je.min,Je.max,Je.minLength,Je.maxLength,Je.pattern,Je.validate],Fr="form",Eh="root",La=["__proto__","constructor","prototype"],J0=/^\w*$/;var uo=e=>J0.test(e),pe=e=>e===void 0,Z=(e,t,n)=>{if(!t||!Ae(e))return n;const r=uo(t)?[t]:Or(t);if(r.some(s=>La.includes(s)))return n;const o=r.reduce((s,i)=>ze(s)?void 0:s[i],e);return pe(o)||o===e?pe(e[t])?n:e[t]:o},yt=e=>typeof e=="boolean",nt=e=>typeof e=="function",we=(e,t,n)=>{let r=-1;const o=uo(t)?[t]:Or(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=Ae(u)||Array.isArray(u)?u:isNaN(+o[r+1])?{}:[]}if(La.includes(a))return;e[a]=c,e=e[a]}};const Ch=I.createContext(null);Ch.displayName="HookFormControlContext";const Va=()=>I.useContext(Ch);var kh=(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 Ua=xs?I.useLayoutEffect:I.useEffect;var X0=e=>{const t=e.constructor&&e.constructor.prototype;return Ae(t)&&t.hasOwnProperty("isPrototypeOf")},ji=e=>ze(e)||!Fa(e);const qc=(e,t)=>t.length===0&&!Array.isArray(e)&&Object.getPrototypeOf(e)!==null&&!X0(e);function et(e,t,n=!1,r=new WeakMap){if(e===t)return!0;if(ji(e)||ji(t))return Object.is(e,t);if(Pn(e)&&Pn(t))return Object.is(e.getTime(),t.getTime());if(Array.isArray(e)&&Array.isArray(t)&&e.length!==t.length)return!1;const o=Object.keys(e),s=Object.keys(t);if(o.length!==s.length)return!1;if(qc(e,o)||qc(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(!Object.prototype.hasOwnProperty.call(t,a))return!1;if(!n||a!=="ref"){const u=t[a];if(Pn(c)&&Pn(u)||(Ae(c)||Array.isArray(c))&&(Ae(u)||Array.isArray(u))?!et(c,u,n,r):!Object.is(c,u))return!1}}return!0}function Za(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=Ee(e()));const s=I.useCallback((a,c,u)=>{if(a&&(t.current||n.current&&o.current>1)){const d=c();et(r.current,d)||u(d)}t.current=!0},[]),i=I.useCallback((a,c)=>{a&&(r.current=Ee(c()))},[]);return{resyncIfNeeded:s,snapshot:i}}function e_(e){const t=Va(),{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}=Za(i);return Ua(()=>{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(()=>kh(a,n,u.current,!1),[a,n])}var rt=e=>typeof e=="string",$i=(e,t,n,r,o)=>rt(e)?(r&&t.watch.add(e),Z(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),Z(n,s,Z(o,s)))):(r&&(t.watchAll=!0),n);function t_(e){const t=Va(),{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 $=n._getWatch(r,c.current);return u.current?u.current($):$},[p,y]=I.useState(f),g=I.useRef(p),w=I.useCallback($=>{const V=$i(r,n._names,$||n._formValues,!1,c.current);return u.current?u.current(V):V},[n._formValues,n._names,r]),b=I.useCallback($=>{if(!s){const V=$i(r,n._names,$||n._formValues,!1,c.current);if(u.current){const D=u.current(V);et(D,g.current)||(y(D),g.current=D)}else y(V)}},[n._formValues,n._names,s,r]),{resyncIfNeeded:S,snapshot:_}=Za(f),O=I.useRef(b);O.current=b;const E=I.useRef(w);E.current=w,Ua(()=>{d.current!==n||!et(l.current,r)?(d.current=n,l.current=r,O.current()):S(!s,()=>E.current(),V=>{const D=Ee(V);y(D),g.current=D});const $=n._subscribe({name:r,formState:{values:!0},exact:i,callback:V=>{O.current(V.values)}});return()=>{$(),_(!s,()=>E.current())}},[n,i,r,s,S,_]),I.useEffect(()=>n._removeUnmounted());const R=d.current!==n,P=l.current,A=I.useMemo(()=>!R&&!et(P,r),[R,r,P]);return(R||A)&&(c.current=o),!s&&(R||A)?w():p}function n_(e){const t=Va(),{name:n,disabled:r,control:o=t,shouldUnregister:s,defaultValue:i,exact:a=!0}=e,c=Sh(o._names.array,n),u=I.useMemo(()=>{const O=Z(o._formValues,n,Z(o._defaultValues,n,i));return pe(O)?Q0(o,n):O},[o,n,i]),d=t_({control:o,name:n,defaultValue:u,exact:a}),l=e_({control:o,name:n,exact:a}),f=I.useRef(e),p=I.useRef(null),y=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:()=>!!Z(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!Z(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Z(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Z(l.validatingFields,n)},error:{enumerable:!0,get:()=>Z(l.errors,n)}}),[l,n]),w=I.useCallback(O=>{const E=Mi(O);return Z(o._fields,n)||(y.current=o.register(n,{...f.current.rules,value:E})),y.current.onChange({target:{value:Mi(O),name:n},type:fn.CHANGE})},[n,o]),b=I.useCallback(()=>{const O=Z(o._formValues,n);return Z(o._fields,n)||(y.current=o.register(n,{...f.current.rules,value:O})),y.current.onBlur({target:{value:O,name:n},type:fn.BLUR})},[n,o]),S=I.useCallback(O=>{O&&(p.current={focus:()=>nt(O.focus)&&O.focus(),select:()=>nt(O.select)&&O.select(),setCustomValidity:R=>nt(O.setCustomValidity)&&O.setCustomValidity(R),reportValidity:()=>nt(O.reportValidity)&&O.reportValidity()});const E=Z(o._fields,n);E&&E._f&&O&&(E._f.ref=p.current,E._f._c=!0)},[o._fields,n]),_=I.useMemo(()=>({name:n,value:d,...yt(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:w,onBlur:b,ref:S}),[n,r,l.disabled,w,b,S,d]);return I.useEffect(()=>{const O=o._options.shouldUnregister||s;y.current=o.register(n,{...f.current.rules,...yt(f.current.disabled)?{disabled:f.current.disabled}:{}});const E=(R,P)=>{const A=Z(o._fields,R);A&&A._f&&(A._f.mount=P,A._f._c=P)};if(E(n,!0),O){const R=Ee(Z(s?o._defaultValues:o._options.values||o._defaultValues,n,Z(o._options.defaultValues,n,f.current.defaultValue)));we(o._defaultValues,n,R),pe(Z(o._formValues,n))&&we(o._formValues,n,R)}if(!c&&o.register(n,{...f.current.rules,...yt(f.current.disabled)?{disabled:f.current.disabled}:{}}),p.current){const R=Z(o._fields,n);R&&R._f&&(R._f.ref=p.current)}return()=>{(c?O&&!o._state.action:O)?o.unregister(n):E(n,!1)}},[n,o,c,s]),I.useEffect(()=>{o._setDisabledField({disabled:r,name:n})},[r,n,o]),I.useMemo(()=>({field:_,formState:l,fieldState:g}),[_,l,g])}const hk=e=>e.render(n_(e));var Ao=e=>({isOnSubmit:!e||e===Rt.onSubmit,isOnBlur:e===Rt.onBlur,isOnChange:e===Rt.onChange,isOnAll:e===Rt.all,isOnTouch:e===Rt.onTouched}),Bs=(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 Ur=(e,t,n)=>{for(const r of n||Object.keys(e)){if(r==="_f")continue;const o=n?Z(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(Ur(o,t))return!0}else if((Ae(o)||Array.isArray(o))&&Ur(o,t))return!0}}};var Qc=(e,t,n)=>{const r=Z(e,n),o=Array.isArray(r)?r:[];return we(o,Eh,t[n]),we(e,n,o),e},Ve=e=>Ae(e)&&!Object.keys(e).length,rs=e=>{if(!xs)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Ss=e=>e.type==="radio",os=e=>e instanceof RegExp,Ba=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{};const Yc={value:!1,isValid:!1},Jc={value:!0,isValid:!0};var Oh=e=>{if(!Array.isArray(e))return Yc;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?Yc:!t.attributes||!("value"in t.attributes)||pe(t.value)||t.value===""?Jc:{value:t.value,isValid:!0}};const Xc={isValid:!1,value:null};var Rh=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Xc):Xc;function el(e,t,n="validate"){if(rt(e)||Array.isArray(e)&&e.length&&e.every(rt)||yt(e)&&!e)return{type:n,message:rt(e)?e:"",ref:t}}var er=e=>Ae(e)&&!os(e)?e:{value:e,message:""},tl=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:y,name:g,valueAsNumber:w,mount:b,_c:S}=e._f,_=Z(n,g);if(!b||t.has(g))return{};const O=a?a[0]:i,E=U=>{if(o&&O.reportValidity){const K=yt(U)?"":U||"";a?a.forEach(H=>nt(H.setCustomValidity)&&H.setCustomValidity(K)):O.setCustomValidity(K),O.reportValidity()}},R={},P=!S&&Ss(i),A=!S&&kr(i),M=P||A,$=(w||_s(i))&&pe(i.value)&&pe(_)||rs(i)&&i.value===""&&!S||_===""||Array.isArray(_)&&!_.length,V=Ba.bind(null,g,r,R),D=(U,K,H,Y=Je.maxLength,ne=Je.minLength)=>{const te=U?K:H;R[g]={type:U?Y:ne,message:te,ref:i,...V(U?Y:ne,te)}};if(s?!Array.isArray(_)||!_.length:c&&(!M&&($||ze(_))||yt(_)&&!_||A&&!Oh(a).isValid||P&&!Rh(a).isValid)){const{value:U,message:K}=rt(c)?{value:!!c,message:c}:er(c);if(U&&(R[g]={type:Je.required,message:K,ref:O,...V(Je.required,K)},!r))return E(K),R}if(!$&&(!ze(l)||!ze(f))){let U,K;const H=er(f),Y=er(l);if(!ze(_)&&!Pn(_)&&!isNaN(_)){const ne=!S&&i.valueAsNumber||_&&+_;ze(H.value)||(U=ne>H.value),ze(Y.value)||(K=ne<Y.value)}else{const ne=!S&&i.valueAsDate||new Date(_),te=ye=>new Date(new Date().toDateString()+" "+ye),X=i.type=="time",q=i.type=="week";rt(H.value)&&_&&(U=X?te(_)>te(H.value):q?_>H.value:ne>new Date(H.value)),rt(Y.value)&&_&&(K=X?te(_)<te(Y.value):q?_<Y.value:ne<new Date(Y.value))}if((U||K)&&(D(!!U,H.message,Y.message,Je.max,Je.min),!r))return E(R[g].message),R}if((!ze(u)||!ze(d))&&!$&&(rt(_)||s&&Array.isArray(_))){const U=er(u),K=er(d),H=!ze(U.value)&&_.length>+U.value,Y=!ze(K.value)&&_.length<+K.value;if((H||Y)&&(D(H,U.message,K.message),!r))return E(R[g].message),R}if(p&&!$&&rt(_)){const{value:U,message:K}=er(p);if(os(U)&&!_.match(U)&&(R[g]={type:Je.pattern,message:K,ref:i,...V(Je.pattern,K)},!r))return E(K),R}if(y){if(nt(y)){const U=await y(_,n),K=el(U,O);if(K&&(R[g]={...K,...V(Je.validate,K.message)},!r))return E(K.message),R}else if(Ae(y)){let U={};for(const K in y){if(!Ve(U)&&!r)break;const H=el(await y[K](_,n),O,K);H&&(U={...H,...V(K,H.message)},r||E(H.message),r&&(R[g]=U))}if(!Ve(U)&&(R[g]={ref:O,...U},!r))return R}}const Q=R[g];return E(Q?Q.message:!0),R},Hs=e=>Array.isArray(e)?e:[e],Ph=e=>Array.isArray(e)?e.filter(Boolean):[];function r_(e,t){const n=t.length-1;let r=0;for(;r<n;){if(ze(e)){e=void 0;break}e=e[t[r]],r++}return e}function o_(e){for(const t in e)if(e.hasOwnProperty(t)&&!pe(e[t]))return!1;return!0}function Le(e,t){if(rt(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const n=Array.isArray(t)?t:uo(t)?[t]:Or(t);if(n.some(i=>La.includes(String(i))))return e;const r=n.length===1?e:r_(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(Ae(r)&&Ve(r)||Array.isArray(r)&&o_(r))&&Le(e,n.slice(0,-1)),e}var nl=()=>{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 Th(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&&(Ae(o)||Array.isArray(o))&&s?n[r]=Th(o,s):e[r]&&(n[r]=s)}return n}const rl=(e,t)=>e!==null&&Fa(e)&&Object.prototype.hasOwnProperty.call(e,t);var Ws=(e,t)=>{if(!t)return!1;let n=e;for(const r of uo(t)?[t]:Or(t)){if(!rl(n,r))return rl(e,t);n=n[r]}return!0},Ha=e=>e.type==="select-multiple";const s_=e=>{const t=[...e.options];return!e.multiple&&e.size<2&&!t.some(n=>n.defaultSelected)?e.selectedIndex!==t.findIndex(n=>!n.disabled):t.some(n=>n.selected!==n.defaultSelected)};var i_=e=>kr(e)?e.checked!==e.defaultChecked:e.type==="select-one"||Ha(e)?s_(e):!Ss(e)&&"defaultValue"in e&&e.value!==e.defaultValue,a_=e=>Ss(e)||kr(e),Ks=e=>rs(e)&&e.isConnected;function ol(e){return Array.isArray(e)||Ae(e)}function Ih(e,t,n="",r=[]){for(const o in e){const s=n?`${n}.${o}`:o,i=e[o];ol(i)&&ol(Z(t,s))?Ih(i,t,s,r):r.push(s)}return r}var c_=e=>{for(const t in e)if(nt(e[t]))return!0;return!1};function Ah(e){return Array.isArray(e)||Ae(e)&&!c_(e)}function Nh(e){return!!(e&&"_f"in e)}function Dh(e){return Array.isArray(e)?!e.some(t=>!pe(t)):!Object.keys(e).length}function zi(e,t){Array.isArray(e)?e[t]=void 0:delete e[t]}function Fi(e,t={},n){for(const r in e){const o=e[r],s=n&&n[r];Ah(o)&&(!Array.isArray(o)||!Nh(s))?(t[r]=Array.isArray(o)?[]:{},Fi(o,t[r],s),Dh(t[r])&&zi(t,r)):pe(o)||(t[r]=!0)}return t}function Yt(e,t,n,r){n||(n=Fi(t,Array.isArray(ze(t)?e:t)?[]:{},r));for(const o in e){const s=e[o],i=r&&r[o];Ah(s)&&(!Array.isArray(s)||!Nh(i))?(pe(t)||ji(n[o])?n[o]=Fi(s,Array.isArray(s)?[]:{},i):Yt(s,ze(t)?{}:t[o],n[o],i),Dh(n[o])&&zi(n,o)):et(s,ze(t)?void 0:t[o])?zi(n,o):n[o]=!0}return n}var l_=(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},Li=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>pe(e)?e:t?e===""?NaN:e&&+e:n&&rt(e)?new Date(e):r?r(e):e;function sl(e){const t=e.ref;return _s(t)?t.files:Ss(t)?Rh(e.refs).value:Ha(t)?[...t.selectedOptions].map(({value:n})=>n):kr(t)?Oh(e.refs).value:Li(t.value,e)}var u_=(e,t,n,r)=>{const o={};for(const s of e){const i=Z(t,s);i&&we(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},tr=e=>pe(e)?e:os(e)?e.source:Ae(e)?os(e.value)?e.value.source:e.value:e;const il="AsyncFunction";var d_=e=>{if(!e||!e.validate)return!1;if(nt(e.validate))return e.validate.constructor.name===il;if(Ae(e.validate)){for(const t in e.validate)if(e.validate[t].constructor.name===il)return!0}return!1},f_=e=>e.mount&&(e.required||!pe(e.required)&&e.required!==!1||!pe(e.min)||!pe(e.max)||!pe(e.maxLength)||!pe(e.minLength)||e.pattern||e.validate);function al(e,t,n){const r=Z(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=Z(t,s),a=Z(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 h_=(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 cl=(e,t,n)=>n?e===t||e.startsWith(t+"."):e.startsWith(t)||t.startsWith(e);var ll=(e,t,n)=>{if(!e||!t||e===t)return!0;if(!Array.isArray(e))return cl(e,t,n);for(const r of e)if(r&&cl(r,t,n))return!0;return!1},p_=(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,m_=(e,t)=>{const n=Z(e,t);!Ph(n).length&&!(n&&n.root)&&Le(e,t)};const Go={mode:Rt.onSubmit,reValidateMode:Rt.onChange,shouldFocusError:!0},g_=(e,t)=>{for(const n in e)delete e[n];Object.assign(e,t)},Mh={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function y_(e={}){let t={...Go,...e},n={...Ee(Mh),isLoading:nt(t.defaultValues),errors:Ee(t.errors)||{},disabled:t.disabled||!1},r={},o=Ae(t.defaultValues)||Ae(t.values)?Ee(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:Ee(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=Ao(t.mode),p=Ao(t.reValidateMode);const y={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},g={...y},w={},b=(...v)=>v.some(k=>g[k]||w[k]),S=v=>{for(const k of l)if(ll(k.name,v,k.exact))return!0;return!1},_={array:nl(),state:nl()};let O=0,E=0,R=0;const P={};let A=t.criteriaMode===Rt.all;const M=(v,k)=>x=>{clearTimeout(d[v]),d[v]=setTimeout(k,x)},$=v=>{clearTimeout(d[v]),delete d[v],delete u[v]},V=v=>{$(v);const k=`${v}.`;for(const x of Object.keys(u))x.startsWith(k)&&$(x)},D=async v=>{if(!i.keepIsValid&&!t.disabled&&(b("isValid")||v)){const k=++O;let x;t.resolver?(x=Ve((await W()).errors),k===O&&U()):x=await se({fields:r,onlyCheckValid:!0,eventType:fn.VALID}),k===O&&x!==n.isValid&&_.state.next({isValid:x})}},Q=(v,k)=>{const x=[...v];if(!x.some(N=>N&&(k?Z(n.validatingFields,N)!==!0:Ws(n.validatingFields,N))))return;const T=Ee(n.validatingFields);for(const N of x)N&&(k?we(T,N,!0):Le(T,N));et(n.validatingFields,T)||(n.validatingFields=T)},U=(v,k)=>{!t.disabled&&b("isValidating","validatingFields")&&(Q(v||c.mount,k),_.state.next({validatingFields:n.validatingFields,isValidating:!Ve(n.validatingFields)}))},K=()=>{n.dirtyFields=Yt(o,s,void 0,r)},H=(v,k=[],x,T,N=!0,B=!0)=>{if(T&&x&&!t.disabled){i.action=!0,i.keepIsValid=!1;const F=Z(r,v),L=F&&F._f,z=L?Object.assign([],F):F;if(i.actionArrayLengths.has(v)||i.actionArrayLengths.set(v,Array.isArray(z)?z.length:0),B&&Array.isArray(z)){const st=x(z,T.argA,T.argB)||z;L?we(r,v,{...st,_f:L}):N&&we(r,v,st)}const J=Z(n.errors,v);if(B&&Array.isArray(J)){const st=J.root,pt=x(J,T.argA,T.argB)||J;st&&(pt.root=st),N&&we(n.errors,v,pt),m_(n.errors,v),n.errors={...n.errors}}const de=Z(n.touchedFields,v),he=B&&Array.isArray(de);if(he){const st=x(de,T.argA,T.argB);N&&we(n.touchedFields,v,st)}const Ye=Z(n.dirtyFields,v);if(B&&Array.isArray(Ye)){const st=x(Ye,T.argA,T.argB)||Ye;N&&we(n.dirtyFields,v,st)}b("dirtyFields")?K():a=!0,_.state.next({name:v,isDirty:Se(v,k),dirtyFields:n.dirtyFields,...he&&{touchedFields:n.touchedFields},errors:n.errors,isValid:n.isValid})}else we(s,v,k)},Y=(v,k)=>{we(n.errors,v,k),n.errors={...n.errors},_.state.next({errors:n.errors})},ne=v=>{Object.keys(u).forEach($);const k=!Ve(v);n.errors=Ee(v),_.state.next({errors:n.errors,...k?{isValid:!1}:{}}),!k&&i.mount&&D()},te=v=>uo(v)?[v]:Or(v),X=v=>{const k=te(v);let x=s,T=o;for(let N=0;N<k.length-1;N++){const B=k[N];if(x=ze(x)?x:x[B],T=ze(T)?T:T[B],x===null&&T!==null)return!0}return!1},q=v=>{if(!i.actionArrayLengths.size)return!1;const k=te(v);let x=s,T="",N=-1,B=0;for(let F=0;F<k.length;F++){if(ze(x))return!1;const L=k[F];if(T=T?`${T}.${L}`:L,Array.isArray(x)&&+L>=x.length)return N===-1?!1:F===N?+L<B:!0;if(i.actionArrayLengths.has(T)&&(N=F+1,B=i.actionArrayLengths.get(T)),x=x[L],pe(x)&&N!==-1&&F>N&&+k[N]<B)return!0}return!1},ye=v=>{let k=s;for(const x of te(v)){if(Array.isArray(k)&&+x>=k.length)return!0;k=k&&k[x]}return!1},me=(v,k,x,T)=>{const N=Z(r,v);if(N){if(X(v)||q(v))return;const B=pe(Z(s,v)),F=Z(s,v,pe(x)?Z(o,v):x),L=!!T&&!n.isReady&&i_(T);if(pe(F)||T&&T.defaultChecked||L||k){const z=k?F:sl(N._f);(!pe(z)||!ye(v))&&(b("dirtyFields")&&!et(Z(s,v),z)&&(a=!0),we(s,v,z),L&&le(v,z))}else Fe(v,F);i.mount&&!i.action&&(t.resolver&&b("isValidating","validatingFields")?Promise.resolve().then(()=>D()):D(),B&&n.isDirty&&b("isDirty")&&(Se()||(n.isDirty=!1,_.state.next({...n}))),t.shouldUnregister&&B&&!pe(Z(s,v))&&Bs(v,c)&&(i.watch=!0))}},le=(v,k,x,T,N)=>{let B=!1,F=!1;const L={name:v};if(!t.disabled||T===!0){if(!x||T){const z=et(Z(o,v),k);if(b("isDirty")&&(F=n.isDirty,n.isDirty=L.isDirty=!z||Se(),B=F!==L.isDirty),F=!!Z(n.dirtyFields,v),z)Le(n.dirtyFields,v);else{const de=Z(o,v),he=Z(r,v),Ye=!(he&&he._f)&&(Ae(de)||Array.isArray(de))?Yt(de,k,void 0,he):!0;we(n.dirtyFields,v,Ye)}let J=!1;if(a||z&&(b("isDirty")?n.isDirty:Se())){a=!1;const de=Yt(o,s,void 0,r);et(n.dirtyFields,de)||(J=!0,g_(n.dirtyFields,de))}L.dirtyFields=n.dirtyFields,B=B||b("dirtyFields")&&(J||F!==!z)}if(x){const z=Ws(n.touchedFields,v)?Z(n.touchedFields,v):void 0;z||(we(n.touchedFields,v,x),L.touchedFields=n.touchedFields,B=B||b("touchedFields")&&z!==x)}B&&N&&_.state.next(L)}return B?L:{}},re=(v,k,x,T)=>{const N=Z(n.errors,v),B=b("isValid")&&yt(k)&&n.isValid!==k;if(t.delayError&&x?(u[v]=M(v,()=>Y(v,x)),u[v](t.delayError)):($(v),x?we(n.errors,v,x):Le(n.errors,v),n.errors={...n.errors}),(x?!et(N,x,!0):N)||!Ve(T)||B){const F={...T,...B&&yt(k)?{isValid:k}:{},errors:n.errors,name:v};_.state.next(F)}},W=async v=>(U(v,!0),await t.resolver(s,t.context,u_(v||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),ae=async v=>{const k=E,x=R,T=v?v.filter(B=>Z(r,B)):[],{errors:N}=await W(v);if(k!==E)return N;if(U(v),v){for(const B of v){if(T.includes(B)&&(!Z(r,B)||P[B]>x)){Le(N,B);continue}const F=Z(N,B);V(B);const L=c.array.has(B)&&Ae(F)&&!Object.keys(F).some(de=>!Number.isNaN(Number(de))),z=Z(r,B),J=Ae(z)&&Object.keys(z).some(de=>de!=="_f");L?Qc(n.errors,{[B]:F},B):F&&(F.type||F.message)||Array.isArray(F)||Ae(F)&&J?we(n.errors,B,F):Le(n.errors,B)}n.errors={...n.errors}}else Object.keys(u).forEach($),n.errors=N;return N},be=async({name:v,eventType:k})=>{if(t.validate){const x=E,T=await t.validate({formValues:s,formState:n,name:v,eventType:k});if(x!==E)return!0;if(Ae(T)){let N=!0;Ir(Fr);for(const B in T){const F=T[B];F&&(N=!1,Gn(`${Fr}.${B}`,{message:rt(F.message)?F.message:"",type:F.type||Je.validate}))}return N}else return rt(T)||!T?(Gn(Fr,{message:T||"",type:Je.validate}),!1):(Ir(Fr),!0)}return!0},se=async({fields:v,onlyCheckValid:k,name:x,eventType:T,context:N={valid:!0,runRootValidation:!1}})=>{const B=E;if(t.validate&&!N.runRootValidation&&(N.runRootValidation=!0,!await be({name:x,eventType:T})&&(N.valid=!1,k)))return N.valid;for(const F in v){const L=v[F];if(L){const{_f:z,...J}=L;if(z){const de=c.array.has(z.name),he=L._f&&d_(L._f),Ye=b("isValidating","validatingFields");he&&Ye&&U([z.name],!0);const st=R,pt=await tl(L,c.disabled,s,A,t.shouldUseNativeValidation&&!k,de);if(B!==E)return N.valid;if(he&&Ye&&U([z.name]),!Z(r,z.name)||P[z.name]>st)continue;if(pt[z.name]&&(N.valid=!1,k)||(k||($(z.name),Z(pt,z.name)?de?Qc(n.errors,pt,z.name):we(n.errors,z.name,pt[z.name]):Le(n.errors,z.name)),t.shouldUseNativeValidation&&pt[z.name]))break}!Ve(J)&&await se({context:N,onlyCheckValid:k,fields:J,name:F,eventType:T})}}return N.valid},Te=()=>{for(const v of c.unMount){const k=Z(r,v);k&&(k._f.refs?k._f.refs.every(x=>!Ks(x)):!Ks(k._f.ref))&&kn(v)}c.unMount=new Set},Se=(v,k)=>(v&&!pe(k)&&we(s,v,k),!et(i.mount?s:o,o)),ke=(v,k,x)=>{const T=i.mount?s:pe(k)||!pe(v)?o:k;return $i(v,c,pe(v)?{...T}:T,x,k)},je=v=>Ph(Z(i.mount?s:o,v,t.shouldUnregister?Z(o,v,[]):[])),Fe=(v,k,x={},T=!1,N=!1,B=!1)=>{const F=Z(r,v);let L=k;if(F){const z=F._f;z&&(!z.disabled&&we(s,v,Li(k,z)),L=rs(z.ref)&&ze(k)?"":k,Ha(z.ref)?[...z.ref.options].forEach(J=>J.selected=L.includes(J.value)):z.refs?kr(z.ref)?z.refs.forEach(J=>{(!J.defaultChecked||!J.disabled)&&(Array.isArray(L)?J.checked=!!L.find(de=>de===J.value):J.checked=L===J.value||!!L)}):z.refs.forEach(J=>J.checked=J.value===L):_s(z.ref)?z.ref.value="":(z.ref.value=L,!z.ref.type&&!N&&!B&&_.state.next({name:v,values:T?s:S(v)?Ee(s):void 0})))}(x.shouldDirty||x.shouldTouch)&&le(v,F&&F._f&&!F._f.disabled&&(F._f.valueAsNumber||F._f.valueAsDate||F._f.setValueAs)?Li(k,F._f):L,x.shouldTouch,x.shouldDirty,!N),x.shouldValidate&&Ht(v,{delayError:x.delayError}),x.shouldValidate&&F&&F._f&&F._f.deps&&(!Array.isArray(F._f.deps)||F._f.deps.length>0)&&Ht(F._f.deps)},Et=(v,k,x,T=!1,N=!1,B=!1)=>{for(const F in k){if(!Object.prototype.hasOwnProperty.call(k,F))continue;const L=k[F],z=v+"."+F,J=Z(r,z);c.array.has(z)&&_.array.next({name:z,values:T?s:Ee(s)}),(c.array.has(v)||Ae(L)||J&&!J._f)&&!Pn(L)?Et(z,L,x,T,N,B):Fe(z,L,x,T,N,B)}},Ct=(v,k,x,T,N=!1)=>{const B=Z(r,v),F=c.array.has(v),L=T?k:Ee(k),z=Z(s,v),J=et(z,L);if(J||we(s,v,L),F)_.array.next({name:v,values:T?s:Ee(s)}),b("isDirty","dirtyFields")&&x.shouldDirty&&(K(),n.isDirty=Se(v,L),N||_.state.next({name:v,dirtyFields:n.dirtyFields,isDirty:n.isDirty})),x.shouldValidate&&Ht(v,{delayError:x.delayError});else{const de=Array.isArray(L)&&!L.length||Ve(L),he=!J&&!N;!B||B._f||ze(L)||de?Fe(v,L,x,T,N,he):Et(v,L,x,T,N,he)}if(!J&&!N){const de=Bs(v,c),he=i.mount||de?v:void 0,Ye=F?[]:l_(c.array,v),st=T?s:S(he)||Ye.some(S)?Ee(s):void 0;_.state.next({...de&&n,name:he,values:st});for(const pt of Ye)_.state.next({name:pt,values:st})}},Oe=(v,k,x={})=>Ct(v,k,x,!1),Wn=(v,k={})=>{const x=nt(v)?v(s):v;if(!et(s,x)){s={...s,...x};for(const T of new Set([...c.mount,...c.array]))Ws(x,T)&&Ct(T,Z(x,T),k,!0,!0);_.state.next({...n,name:void 0,type:void 0,...l.size?{values:s}:{}}),k.shouldValidate&&D()}},ht=async v=>{i.mount=!0;const k=v.target;let x=k.name,T=!0;const N=Z(r,x),B=R,F=L=>{T=!!Z(r,x)&&!(P[x]>B)&&et(L,Z(s,x,L))};if(N){i.keepIsValid=!1;let L,z,J=!1;const de=k.type?sl(N._f):Mi(v),he=v.type===fn.BLUR||v.type===fn.FOCUS_OUT,Ye=!f_(N._f)&&!t.validate&&!t.resolver&&!Z(n.errors,x)&&!N._f.deps,st=Ye||p_(he,Z(n.touchedFields,x),n.isSubmitted,p,f),pt=Bs(x,c,he);we(s,x,Ee(de)),he?(!k||!k.readOnly)&&(N._f.onBlur&&N._f.onBlur(v),Object.prototype.hasOwnProperty.call(u,x)&&(J=!0,u[x](0))):N._f.onChange&&N._f.onChange(v);const Dr=le(x,de,he),Mp=!Ve(Dr)||pt;if(!he&&_.state.next({name:x,type:v.type,...S(x)?{values:Ee(s)}:{}}),st)return(!Ye||!n.isValid)&&b("isValid")&&(t.mode==="onBlur"?he&&D():he||D()),Mp&&_.state.next({name:x,...pt?{}:Dr});if(!t.resolver&&t.validate&&await be({name:x,eventType:v.type}),!he&&pt&&_.state.next({...n}),t.resolver){const vo=E,{errors:bo}=await W([x]);if(vo!==E)return;if(U([x]),F(de),!T){!Ve(Dr)&&_.state.next(Dr);return}const jp=al(n.errors,r,x),cc=al(bo,r,jp.name||x);L=cc.error,x=cc.name,z=Ve(bo)}else{const vo=E,bo=++O;if(U([x],!0),L=(await tl(N,c.disabled,s,A,t.shouldUseNativeValidation))[x],vo!==E)return;if(U([x]),F(de),T){if(L)z=!1;else if(b("isValid")){if(z=await se({fields:r,onlyCheckValid:!0,name:x,eventType:v.type}),vo!==E)return;F(de),bo!==O&&(z=void 0)}}}T&&(N._f.deps&&(!Array.isArray(N._f.deps)||N._f.deps.length>0)&&Ht(N._f.deps),re(x,z,L,Dr),J&&Object.prototype.hasOwnProperty.call(u,x)&&u[x](0))}},Kn=(v,k)=>{if(Z(n.errors,k)&&v.focus)return v.focus(),1},Ht=async(v,k={})=>{i.keepIsValid=!1;let x,T;const N=Hs(v),B=E;if(t.resolver){const F=await ae(pe(v)?v:N);x=Ve(F),T=v?!N.some(L=>Z(F,L)):x}else v?(T=(await Promise.all(N.map(async F=>{const L=Z(r,F);return await se({fields:L&&L._f?{[F]:L}:L,eventType:fn.TRIGGER})}))).every(Boolean),!(!T&&!n.isValid)&&D()):T=x=await se({fields:r,name:v,eventType:fn.TRIGGER});if(B!==E)return T;if(k.delayError&&t.delayError&&rt(v)){const F=Z(n.errors,v);F?(Le(n.errors,v),u[v]=M(v,()=>Y(v,F)),u[v](t.delayError)):$(v)}if(k.shouldTouch)for(const F of v?N:c.mount)!c.array.has(F)&&we(n.touchedFields,F,!0);return n.errors={...n.errors},_.state.next({...!rt(v)||b("isValid")&&x!==n.isValid?{}:{name:v},...t.resolver||!v?{isValid:x}:{},...k.shouldTouch&&b("touchedFields")?{touchedFields:n.touchedFields}:{},errors:n.errors}),k.shouldFocus&&!T&&Ur(r,Kn,v?N:c.mount),T},$e=((v,k)=>{let x=pe(v)&&!k?{...i.mount?s:o}:i.mount?s:o;return k&&(x=Th(k.dirtyFields?n.dirtyFields:n.touchedFields,x)),pe(v)?x:rt(v)?Z(x,v):v.map(T=>Z(x,T))}),fo=(v=>pe(v)?{...n.errors}:rt(v)?Z(n.errors,v):v.map(k=>Z(n.errors,k))),Wt=(v,k)=>{const x=k||n,T=Z(x.errors,v);return{invalid:!!T,isDirty:!!Z(x.dirtyFields,v),error:T,isValidating:!!Z(x.validatingFields,v),isTouched:!!Z(x.touchedFields,v)}},Ir=v=>{const k=v?Hs(v):void 0;k?k.forEach(x=>{V(x),Le(n.errors,x),n.errors={...n.errors},_.state.next({name:x,errors:n.errors})}):(Object.keys(u).forEach($),n.errors={},_.state.next({errors:n.errors}))},Gn=(v,k,x)=>{V(v);const T=Z(r,v,{_f:{}}),N=T._f&&T._f.ref,B=Z(n.errors,v)||{},{ref:F,message:L,type:z,types:J,...de}=B;we(n.errors,v,{...de,...k,ref:N}),n.errors={...n.errors},_.state.next({name:v,errors:n.errors,isValid:!1}),x&&x.shouldFocus&&N&&N.focus&&N.focus()},qn=(v,k)=>{if(nt(v)){const x={};l.add(x);const{unsubscribe:T}=_.state.subscribe({next:N=>"values"in N&&v(N.values||ke(void 0,k),N)});return{unsubscribe:()=>{l.delete(x),T()}}}return ke(v,k,!0)},ho=v=>{const k={name:v.name,exact:v.exact};v.formState&&v.formState.values&&l.add(k);const{unsubscribe:x}=_.state.subscribe({next:T=>{if(ll(v.name,T.name,v.exact)&&h_(T,v.formState||g,v.reRenderRoot)){const N=T.values||{...s};v.callback({...n,...T,validatingFields:n.validatingFields,isValidating:n.isValidating,values:N,defaultValues:o})}}});return()=>{l.delete(k),x()}},po=v=>{i.mount=!0;const k=Object.keys(v.formState||{}).filter(T=>v.formState&&v.formState[T]);for(const T of k)w[T]=(w[T]||0)+1;const x=ho({...v,formState:{...y,...v.formState}});return()=>{for(const T of k.splice(0))w[T]--;x()}},kn=(v,k={})=>{const x=v?Hs(v):c.mount;k.keepIsValidating||Q(x);for(const T of x)c.mount.delete(T),c.array.delete(T),c.disabled.delete(T),Le(r,T),!k.keepValue&&Le(s,T),k.keepError||(V(T),Le(n.errors,T)),!k.keepDirty&&Le(n.dirtyFields,T),!k.keepTouched&&Le(n.touchedFields,T),!t.shouldUnregister&&!k.keepDefaultValue&&Le(o,T);k.keepError||(n.errors={...n.errors}),l.size&&_.state.next({values:Ee(s)}),_.state.next({...n,...k.keepDirty?{}:{isDirty:Se()},...k.keepIsValidating?{}:{isValidating:!Ve(n.validatingFields)}}),!k.keepIsValid&&D()},Kt=({disabled:v,name:k})=>{if(yt(v)&&i.mount||v||c.disabled.has(k)){const N=c.disabled.has(k)!==!!v;v?c.disabled.add(k):c.disabled.delete(k),N&&i.mount&&!i.action&&D()}},Qn=(v,k={})=>{let x=Z(r,v);const T=yt(k.disabled)||yt(t.disabled),N=!c.registerName.has(v)&&x&&x._f&&!x._f.mount;if((!x||!x._f)&&(P[v]=++R),we(r,v,{...x||{},_f:{...x&&x._f?x._f:{ref:{name:v}},name:v,mount:!0,...k}}),c.mount.add(v),x&&x._f){const B=Z(r,v);for(const F of Y0)F in k||delete B._f[F]}return x&&!N?Kt({disabled:yt(k.disabled)?k.disabled:t.disabled,name:v}):me(v,!0,k.value),{...T?{disabled:k.disabled||t.disabled}:{},...t.progressive?{required:!!tr(k.required),min:tr(k.min),max:tr(k.max),minLength:tr(k.minLength),maxLength:tr(k.maxLength),pattern:tr(k.pattern)}:{},name:v,onChange:ht,onBlur:ht,ref:B=>{if(B){c.registerName.add(v),Qn(v,k),c.registerName.delete(v),x=Z(r,v);const F=pe(B.value)&&B.querySelectorAll&&B.querySelectorAll("input,select,textarea")[0]||B,L=a_(F),z=x._f.refs||[];if(L?z.find(de=>de===F):F===x._f.ref)return;const J={...x._f};L?(J.refs=[...z.filter(Ks),F,...Array.isArray(Z(o,v))?[{}]:[]],J.ref={type:F.type,name:v}):(J.ref=F,delete J.refs),we(r,v,{_f:J}),me(v,!1,void 0,F)}else x=Z(r,v,{}),x._f&&(x._f.mount=!1),(t.shouldUnregister||k.shouldUnregister)&&!(Sh(c.array,v)&&i.action)&&c.unMount.add(v)}}},jt=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Ur(r,Kn,c.mount),Rs=v=>{yt(v)&&(_.state.next({disabled:v}),Ur(r,(k,x)=>{const T=Z(r,x);T&&(k.disabled=T._f.disabled||v,Array.isArray(T._f.refs)&&T._f.refs.forEach(N=>{N.disabled=T._f.disabled||v}))},0))},mo=(v,k)=>async x=>{let T,N;x&&(x.preventDefault&&x.preventDefault(),x.persist&&x.persist());let B=Ee(s);_.state.next({isSubmitting:!0});const F=E,L=z=>{throw F===E&&_.state.next({isSubmitting:!1}),z};if(t.resolver){let z;try{z=await W()}catch(he){L(he)}const{errors:J,values:de}=z;if(F!==E)return;U(),Object.keys(u).forEach($),n.errors=J,B=Ee(de)}else{try{await se({fields:r,eventType:fn.SUBMIT})}catch(z){L(z)}if(F!==E)return;Le(n.errors,Eh),n.errors={...n.errors}}if(c.disabled.size)for(const z of c.disabled)Le(B,z);if(Ve(n.errors)){_.state.next({errors:{}});try{T=await v(B,x)}catch(z){N=z}}else{if(k)try{await k({...n.errors},x)}catch(z){L(z)}jt(),setTimeout(jt)}if(_.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ve(n.errors)&&!N,submitCount:n.submitCount+1,errors:n.errors}),N)throw N;return T},go=(v,k={})=>{Z(r,v)&&(Q([v]),pe(k.defaultValue)?Oe(v,Ee(Z(o,v))):(Oe(v,k.defaultValue),we(o,v,Ee(k.defaultValue))),k.keepTouched||Le(n.touchedFields,v),k.keepDirty||(Le(n.dirtyFields,v),n.isDirty=pe(k.defaultValue)?Se():Se(v,Ee(Z(o,v)))),k.keepError||(V(v),Le(n.errors,v),n.errors={...n.errors},D()),_.state.next({...n,isValidating:!Ve(n.validatingFields)}))},Ar=(v,k={})=>{E++,O++;const x=v?Ee(v):o,T=Ee(x),N=Ve(v),B=T,F=r;if(Object.keys(u).forEach($),k.keepDefaultValues||(o=x),!k.keepValues){if(k.keepDirtyValues){const L=new Set([...c.mount,...Ih(Yt(o,s,void 0,F),n.dirtyFields)]);for(const z of L){const J=Z(n.dirtyFields,z),de=Z(s,z),he=Z(B,z);J&&!pe(de)?we(B,z,de):!J&&!pe(he)&&Oe(z,he)}}else{if(xs&&pe(v))for(const L of c.mount){const z=Z(r,L);if(z&&z._f){const J=Array.isArray(z._f.refs)?z._f.refs[0]:z._f.ref;if(rs(J)){const de=J.closest("form");if(de){de.reset();break}}}}if(k.keepFieldsRef)for(const L of c.mount)Oe(L,Z(B,L));else r={}}if(t.shouldUnregister){if(s=k.keepDefaultValues?Ee(o):{},k.keepFieldsRef)for(const L of c.mount)we(s,L,Z(B,L))}else s=Ee(B);_.array.next({values:{...B}}),_.state.next({name:void 0,type:void 0,values:{...B}})}c={mount:k.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:k.keepValues||k.keepDirtyValues||k.keepFieldsRef?new Set([...c.disabled].filter(L=>Z(r,L))):new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!g.isValid||!!k.keepIsValid||!!k.keepDirtyValues||!t.shouldUnregister&&!Ve(B),i.watch=!!t.shouldUnregister,i.keepIsValid=!!k.keepIsValid,i.action=!1,i.actionArrayLengths.clear(),a=!1,k.keepErrors||(n.errors={}),_.state.next({submitCount:k.keepSubmitCount?n.submitCount:0,isDirty:N?!1:k.keepDirty?n.isDirty:k.keepValues?Se():!!(k.keepDefaultValues&&v&&!et(v,o)),isSubmitted:k.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:N?{}:k.keepDirtyValues?k.keepDefaultValues&&s?Yt(o,s,void 0,F):n.dirtyFields:k.keepDefaultValues&&v?Yt(o,v,void 0,F):k.keepDirty?n.dirtyFields:k.keepValues?Yt(o,s,void 0,F):{},touchedFields:k.keepTouched?n.touchedFields:{},...!k.keepIsValidating&&(n.isValidating||!Ve(n.validatingFields))?{validatingFields:{},isValidating:!1}:null,errors:k.keepErrors?n.errors:{},isSubmitSuccessful:k.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},bt=(v,k)=>Ar(nt(v)?v(s):v,{...t.resetOptions,...k}),Ps=(v,k={})=>{const x=Z(r,v),T=x&&x._f;if(T){const N=T.refs?T.refs[0]:T.ref;N.focus&&setTimeout(()=>{N.focus(),k.shouldSelect&&nt(N.select)&&N.select()})}},Nr=v=>{const{name:k,type:x,values:T,...N}=v;Object.keys(N).length&&(n={...n,...N})};_.state.subscribe({next:Nr});const yo={control:{register:Qn,unregister:kn,getFieldState:Wt,handleSubmit:mo,setError:Gn,_subscribe:ho,_runSchema:W,_updateIsValidating:U,_focusError:jt,_getWatch:ke,_getDirty:Se,_setValid:D,_setFieldArray:H,_setDisabledField:Kt,_setErrors:ne,_getFieldArray:je,_reset:Ar,_resetDefaultValues:()=>nt(t.defaultValues)&&t.defaultValues().then(v=>{bt(v,t.resetOptions),_.state.next({isLoading:!1})}),_removeUnmounted:Te,_disableForm:Rs,_subjects:_,_proxyFormState:g,get _fields(){return r},get _formValues(){return s},get _state(){return i},set _state(v){i=v},get _defaultValues(){return o},get _names(){return c},set _names(v){c=v},get _formState(){return n},get _options(){return t},set _options(v){t={...t,...v},f=Ao(t.mode),p=Ao(t.reValidateMode),A=t.criteriaMode===Rt.all}},subscribe:po,trigger:Ht,register:Qn,handleSubmit:mo,watch:qn,setValue:Oe,setValues:Wn,getValues:$e,getErrors:fo,reset:bt,resetField:go,resetDefaultValues:(v,k={})=>{if(o=Ee(v),!k.keepDirty){const x=Yt(o,s,void 0,r);n.dirtyFields=x,n.isDirty=!Ve(x)}k.keepIsValid||D(),_.state.next({...n,defaultValues:o})},clearErrors:Ir,unregister:kn,setError:Gn,setFocus:Ps,getFieldState:Wt};return{...yo,formControl:yo}}const ul={mode:Go.mode,reValidateMode:Go.reValidateMode,shouldFocusError:Go.shouldFocusError,resolver:void 0,criteriaMode:void 0,delayError:void 0,shouldUnregister:void 0,shouldUseNativeValidation:void 0,context:void 0,progressive:void 0,resetOptions:void 0};function v_(e={}){const t=I.useRef(void 0),n=I.useRef(void 0),r=I.useRef(e.formControl),o=I.useRef(!1),s=I.useRef(!!e.validate),i=I.useRef(!!e.errors),a=I.useRef(!1),[c,u]=I.useState(()=>({...Ee(Mh),isLoading:nt(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:nt(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&r.current!==e.formControl)if(r.current=e.formControl,o.current=!1,e.formControl)t.current={...e.formControl,formState:c},e.defaultValues&&!nt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:w,...b}=y_(e);t.current={...b,formState:c}}const d=t.current.control,l=d._options,f={};for(const w in ul)w in l&&!(w in e)&&(f[w]=ul[w]);o.current&&!e.disabled&&(f.disabled=!1),d._options={...f,...e,validate:e.validate};const p=()=>({...d._formState,defaultValues:d._defaultValues}),{resyncIfNeeded:y,snapshot:g}=Za(p);return Ua(()=>{y(!0,p,u);const w=d._subscribe({formState:d._proxyFormState,callback:()=>u({...d._formState,defaultValues:d._defaultValues}),reRenderRoot:!0});return u(b=>({...b,isReady:!0})),d._formState.isReady=!0,d._subjects.state.next({isReady:!0}),()=>{w(),g(!0,p)}},[d,y,g]),I.useEffect(()=>{d._disableForm(o.current&&!e.disabled?!1:e.disabled),o.current=!!e.disabled},[d,e.disabled]),I.useEffect(()=>{e.mode&&(d._options.mode=e.mode),e.reValidateMode&&(d._options.reValidateMode=e.reValidateMode)},[d,e.mode,e.reValidateMode]),I.useEffect(()=>{e.errors?(d._setErrors(e.errors),d._focusError()):i.current&&d._setErrors({}),i.current=!!e.errors},[d,e.errors]),I.useEffect(()=>{s.current&&!e.validate&&t.current&&t.current.clearErrors(Fr),s.current=!!e.validate},[e.validate]),I.useEffect(()=>{e.shouldUnregister&&d._subjects.state.next({values:d._getWatch()})},[d,e.shouldUnregister]),I.useEffect(()=>{if(d._proxyFormState.isDirty){const w=d._getDirty();w!==c.isDirty&&d._subjects.state.next({isDirty:w})}},[d,c.isDirty]),I.useEffect(()=>{e.values&&!et(e.values,n.current)?(d._reset(e.values,{keepFieldsRef:!0,...d._options.resetOptions}),d._options.resetOptions&&d._options.resetOptions.keepIsValid||d._setValid(),n.current=e.values,u(w=>({...w}))):d._resetDefaultValues()},[d,e.values]),I.useEffect(()=>{(!d._state.mount||!a.current&&!e.values)&&(d._setValid(),d._state.mount=!0),a.current=!0,d._state.watch&&(d._state.watch=!1,d._subjects.state.next({...d._formState})),d._removeUnmounted()}),t.current.formState=I.useMemo(()=>kh(c,d),[d,c]),t.current}const b_=I.createContext(null);b_.displayName="HookFormContext";const dl=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Z(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Vi=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?dl(r.ref,n,e):r&&r.refs&&r.refs.forEach(o=>dl(o,n,e))}},fl=(e,t)=>{t.shouldUseNativeValidation&&Vi(e,t);const n={};for(const r in e){const o=Z(t.fields,r),s=Object.assign(e[r]||{},{ref:o&&o.refs?o.refs[0]:o&&o.ref});if(w_(t.names||Object.keys(e),r)){const i=Object.assign({},Z(n,r));we(i,"root",s),we(n,r,i)}else we(n,r,s)}return n},w_=(e,t)=>{const n=hl(t).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(r=>hl(r).match(`^${n}\\.\\d+`))};function hl(e){return e.replace(/\[(\d+)]/g,".$1").replace(/[[\]]/g,"")}function Ui(){return Ui=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},Ui.apply(null,arguments)}function pl(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function __(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]=Ba(i,t,n,o,l?[].concat(l,r.message):r.message)}e.shift()}return n}function x_(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,y){return y.length<p.length?y: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(y){return e.push(Ui({},y,{path:[].concat(o.path,y.path)}))})}),t){var l=n[a].types,f=l&&l[o.code];n[a]=Ba(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(pl(function(){function i(c){return s.shouldUseNativeValidation&&Vi({},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:fl(x_(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(pl(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(i){return s.shouldUseNativeValidation&&Vi({},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:fl(__(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 Zi(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 ml(e,t="|"){return e.map(n=>Vh(n)).join(t)}function Bi(e,t){return typeof t=="bigint"?t.toString():t}class E_{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 Wa(e){return new E_(e)}function C_(e){return e==null}function Ka(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function k_(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 Hn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function jh(e){const t=Object.getOwnPropertyDescriptor(e,"shape");return t!=null&&t.get?t.get.raw:t==null?void 0:t.value}function on(e){return jh(e._zod.def)??e._zod.def.shape}function $h(e,t,n){Object.defineProperty(e,t,{get(){const r=n();return Hn(this,t,r),r},enumerable:!0,configurable:!0})}function zh(e,t,n){t in e?Hn(e,t,n):e[t]=n}function Ln(e,t,n,r){const o=on(t);for(const s of n){const i=Object.getOwnPropertyDescriptor(o,s);i.enumerable&&(i.get?$h(e,s,()=>{const a=t._zod.def.shape[s];return r?r(a,s):a}):zh(e,s,r?r(i.value,s):i.value))}}function O_(e,t){for(const n of Reflect.ownKeys(t)){const r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?$h(e,n,()=>t[n]):zh(e,n,r.value))}}function _t(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function R_(e){return JSON.stringify(e)}function P_(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Fh="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ss(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const T_=Wa(()=>{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 Qr(e){if(ss(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ss(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Lh(e){return Qr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const I_=new Set(["string","number","symbol"]);function Es(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function En(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 oe(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 Vh(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function A_(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}const Uh={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]},N_={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function D_(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 Ln(s,e,Cs(e,t)),En(e,_t(n,{shape:s,checks:[]}))}function Cs(e,t){var o;const n=on(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 M_(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(Cs(e,t)),i={};return Ln(i,e,Reflect.ownKeys(on(e)).filter(a=>!s.has(a))),En(e,_t(n,{shape:i,checks:[]}))}function j_(e,t){if(!Qr(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=on(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 En(e,_t(e._zod.def,{shape:Zh(e,t)}))}function Zh(e,t){const n={};return Ln(n,e,Reflect.ownKeys(on(e))),O_(n,t),n}function $_(e,t){if(!Qr(t))throw new Error("Invalid input to safeExtend: expected a plain object");return En(e,_t(e._zod.def,{shape:Zh(e,t)}))}function z_(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={};Ln(n,e,Reflect.ownKeys(on(e))),Ln(n,t,Reflect.ownKeys(on(t)));const r=_t(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return En(e,r)}function gl(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(Cs(t,n)):void 0,c={};return Ln(c,t,Reflect.ownKeys(on(t)),e&&((u,d)=>a&&!a.has(d)?u:new e({type:"optional",innerType:u}))),En(t,_t(t._zod.def,{shape:c,checks:[]}))}function F_(e,t,n){const r=n?new Set(Cs(t,n)):void 0,o={};return Ln(o,t,Reflect.ownKeys(on(t)),(s,i)=>r&&!r.has(i)?s:new e({type:"nonoptional",innerType:s})),En(t,_t(t._zod.def,{shape:o}))}function en(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 L_(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 Ga(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function $r(e){return typeof e=="string"?e:e==null?void 0:e.message}function yl(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 Hi(e,t,n){var r;for(let o=t;o<e.length;o++)(r=e[o]).schema??(r.schema=n)}function Rr(e,t,n){var c,u,d,l,f,p,y,g,w,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:$r((y=(p=(f=e.inst)==null?void 0:f._zod.def)==null?void 0:p.error)==null?void 0:y.call(p,e))??$r(s==null?void 0:s(e))??$r((g=t==null?void 0:t.error)==null?void 0:g.call(t,e))??$r((w=n.customError)==null?void 0:w.call(n,e))??$r((b=n.localeError)==null?void 0:b.call(n,e))??"Invalid input",a={};for(const S of Object.keys(e))S==="inst"||S==="schema"||S==="continue"||S==="input"||S==="__proto__"||(a[S]=e[S]);return a.path??(a.path=[]),a.message=i,t!=null&&t.reportInput&&(a.input=e.input),a}const V_=/[\uD800-\uDBFF]/;function qa(e){const t=e.length;if(!V_.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 Qa(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function U_(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 Yr(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function Z_(e,t){for(const n in t){const r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):B_(e,n,r.value)}}function Sn(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Ya(e,t,n){return Sn(e,t,n,!1)}function Bh(e,t){for(const n in e){const r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Sn(this,n,r(this))},set(o){Sn(this,n,o)}})}return t}function B_(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Sn(this,t,n.bind(this))},set(r){Sn(this,t,r)}})}function H_(e,t){const n=Object.getPrototypeOf(e);return t in n?void 0:n}let Gs,dn=!1;const W_={configurable:!0,get(){dn=!0}};function Ce(e,t,n){const r=Object.getPrototypeOf(e._zod);if(t in r&&Gs!==e._zod){Gs=void 0;return}Gs=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,W_);const o=dn;dn=!1;try{const s=n(this);return dn?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),dn=dn||o,s}catch(s){throw delete this[t],dn=dn||o,s}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function K_(e,t,n,r){const o=H_(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 G_="~constantCatch";function q_(e){const t=()=>e;return t[G_]=!0,t}var vl;const qs={value:void 0,enumerable:!1};let bl="captureStackTrace"in Error?Error:null;function Q_(e){const t=bl;if(t){const n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return bl=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function j(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{qs.value=new s(p);try{Object.defineProperty(f,"_zod",qs)}finally{qs.value=void 0}}if(f._zod.traits.add(e),t(f,p),a){const g=Object.getPrototypeOf(f),w=f._zod.constr.prototype;let b=g;for(;b&&b!==w;)b=Object.getPrototypeOf(b);const S=b??g;a.has(S)||(a.add(S),Z_(S,i))}const y=l.prototype;for(const g in y)Object.prototype.hasOwnProperty.call(y,g)&&(g in f||(f[g]=y[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 w;const p=r!=null&&r.Parent?Q_(d):this;c(p,f);const y=p._zod.deferred;if(y){for(const b of y)b();p._zod.deferred=void 0}const g=(w=globalThis.__zod_globalConfig)==null?void 0:w.postProcessor;return g&&g(p),p}return Object.defineProperty(l,"init",{value:c}),Object.defineProperty(l,Symbol.hasInstance,{value:f=>{var p,y;return r!=null&&r.Parent&&f instanceof r.Parent?!0:(y=(p=f==null?void 0:f._zod)==null?void 0:p.traits)==null?void 0:y.has(e)}}),Object.defineProperty(l,"name",{value:e}),l}class Fn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Hh extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(vl=globalThis).__zod_globalConfig??(vl.__zod_globalConfig={});const Bt=globalThis.__zod_globalConfig;function Cn(e){return e&&Object.assign(Bt,e),Bt}function Y_(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Bi,2)),e.message}function J_(e){this._zod.message=e}const X_={get:Y_,set:J_,enumerable:!0,configurable:!0},Qs={value:void 0,enumerable:!1},wl=new WeakSet([Object.prototype,Error.prototype]),e1=(e,t)=>{e.name="$ZodError",Qs.value=t,Object.defineProperty(e,"issues",Qs),Qs.value=void 0,Object.defineProperty(e,"message",X_);const n=Object.getPrototypeOf(e);wl.has(n)||(wl.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})}}))},t1=j("$ZodError",e1);function n1(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 r1(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?n1(n,o.path[0],()=>[]).push(t(o)):r.push(t(o));return{formErrors:r,fieldErrors:n}}function o1(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 ks(e,t){return{callee:(t==null?void 0:t.callee)??e,Err:t==null?void 0:t.Err}}const Ja=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 Fn;if(a.issues.length){const c=new((s==null?void 0:s.Err)??e)(a.issues.map(u=>Rr(u,i,Cn())));throw Fh(c,(s==null?void 0:s.callee)??t),c}return a.value};return t},Xa=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=>Rr(u,i,Cn())));throw Fh(c,(s==null?void 0:s.callee)??t),c}return a.value};return t},ec=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 Fn;return s.issues.length?Wh(e,s.issues,o):{success:!0,data:s.value}};function Wh(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(o=>Rr(o,n,Cn()))),t=void 0,n=void 0),r},set error(o){r=o,t=void 0,n=void 0}}}const tc=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?Wh(e,s.issues,o):{success:!0,data:s.value}},s1=Symbol.for("zod.compile.invalid"),i1=Symbol.for("zod.compile.fallback"),a1=((e,t,n)=>{const r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==s1)return!0;if(r.definite===!0&&n===void 0)return!1}return c1(e,t,n)});function c1(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[i1]=!0,s=o({value:t,issues:[]},r)):s=e._zod.run({value:t,issues:[]},r),s instanceof Promise)throw new Fn;return s.issues.length===0}const l1=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},u1=e=>{const t=Ja(e),n=(r,o,s,i)=>{const a=s?{...s,direction:"backward"}:{direction:"backward"};return t(r,o,a,ks(n,i))};return n},d1=e=>{const t=Ja(e),n=(r,o,s,i)=>t(r,o,s,ks(n,i));return n},f1=e=>{const t=Xa(e),n=async(r,o,s,i)=>{const a=s?{...s,direction:"backward"}:{direction:"backward"};return await t(r,o,a,ks(n,i))};return n},h1=e=>{const t=Xa(e),n=async(r,o,s,i)=>await t(r,o,s,ks(n,i));return n},p1=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return ec(e)(t,n,o)},m1=e=>(t,n,r)=>ec(e)(t,n,r),g1=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return tc(e)(t,n,o)},y1=e=>async(t,n,r)=>tc(e)(t,n,r),v1=/^[cC][0-9a-z]{6,}$/,b1=/^[0-9a-z]+$/,w1=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,_1=/^[0-9a-vA-V]{20}$/,x1=/^[A-Za-z0-9]{27}$/,S1=/^[a-zA-Z0-9_-]{21}$/;function E1(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const C1=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,k1=/^([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})$/,_l=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)$/,O1=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,R1="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function P1(){return new RegExp(R1,"u")}const T1=/^(?:(?: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])$/,I1=/^(([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}|:))$/,A1=/^((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])$/,N1=/^(([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])$/,D1=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,M1=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,j1=/^https?$/,$1=/^\+[1-9]\d{6,14}$/,Kh="(?:(?:\\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 z1(e){return new RegExp(`^${e}$`)}const F1=z1(Kh);function Wi(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 L1(e){return new RegExp(`^${Wi(e)}$`)}function V1(e){const t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${Wi({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${Wi({precision:e.precision})}`:n;return new RegExp(`^${Kh}T(?:${r})$`)}const U1=/^[\s\S]{0,}$/,Z1=/^-?\d+(?:\.\d+)?$/,B1=/^(?:true|false)$/i,H1=/^[^A-Z]*$/,W1=/^[^a-z]*$/,ft=j("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),nc=e=>{const t=e.value;return!C_(t)&&t.length!==void 0},is={number:"number",bigint:"bigint",object:"date"},Gh=j("$ZodCheckLessThan",(e,t)=>{ft.init(e,t);const n=is[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:is[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})}}),qh=j("$ZodCheckGreaterThan",(e,t)=>{ft.init(e,t);const n=is[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:is[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})}}),K1=j("$ZodCheckMultipleOf",(e,t)=>{ft.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):k_(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})}}),G1=j("$ZodCheckNumberFormat",(e,t)=>{var i;ft.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]=Uh[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})}}),q1=j("$ZodCheckMaxLength",(e,t)=>{var n;ft.init(e,t),(n=e._zod.def).when??(n.when=nc),e._zod.check=r=>{const o=r.value,s=o.length;if((typeof o=="string"&&s>t.maximum?qa(o):s)<=t.maximum)return;const a=Qa(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Q1=j("$ZodCheckMinLength",(e,t)=>{var n;ft.init(e,t),(n=e._zod.def).when??(n.when=nc),e._zod.check=r=>{const o=r.value,s=o.length;if((typeof o=="string"&&s>=t.minimum&&s<t.minimum*2?qa(o):s)>=t.minimum)return;const a=Qa(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Y1=j("$ZodCheckLengthEquals",(e,t)=>{var n;ft.init(e,t),(n=e._zod.def).when??(n.when=nc),e._zod.check=r=>{const o=r.value,s=o.length,i=typeof o=="string"&&s>=t.length&&s<=t.length*2?qa(o):s;if(i===t.length)return;const a=Qa(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})}}),Os=j("$ZodCheckStringFormat",(e,t)=>{var n,r;ft.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=()=>{})}),J1=j("$ZodCheckRegex",(e,t)=>{Os.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})}}),X1=j("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=H1),Os.init(e,t)}),ex=j("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=W1),Os.init(e,t)}),tx=j("$ZodCheckIncludes",(e,t)=>{ft.init(e,t);const n=Es(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})}}),nx=j("$ZodCheckStartsWith",(e,t)=>{ft.init(e,t);const n=new RegExp(`^${Es(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})}}),rx=j("$ZodCheckEndsWith",(e,t)=>{ft.init(e,t);const n=new RegExp(`.*${Es(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 xl(e,t,n){e.issues.length&&t.issues.push(...Ga(n,e.issues))}const ox=j("$ZodCheckProperties",(e,t)=>{ft.init(e,t),Ya(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=>xl(u,r,i)))):xl(c,r,i)}if(s)return Promise.all(s).then(()=>{})}}),sx=j("$ZodCheckOverwrite",(e,t)=>{ft.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class ix{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(`
193
+ `).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(", ")}) {
194
+ ${n.join(`
195
+ `)}
196
+ };`)(...Object.values(this.closed))}}const ax={major:4,minor:6,patch:7},Be=j("$ZodType",(e,t)=>{var s;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ax;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=en(c),f;for(const p of u){if(p._zod.def.when){if(L_(c)||!p._zod.def.when(c))continue}else if(l)continue;const y=c.issues.length,g=p._zod.check(c);if(g instanceof Promise&&(d==null?void 0:d.async)===!1)throw new Fn;if(f||g instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await g,c.issues.length!==y&&(Hi(c.issues,y,e),l||(l=en(c,y)))});else{if(c.issues.length===y)continue;Hi(c.issues,y,e),l||(l=en(c,y))}}return f?f.then(()=>c):c},a=(c,u,d)=>{if(en(c))return c.aborted=!0,c;const l=i(u,o,d);if(l instanceof Promise){if(d.async===!1)throw new Fn;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 Fn;return d.then(l=>i(l,o,u))}return i(d,o,u)}}},{get"~standard"(){return Ya(this,"~standard",Yh(this))},set"~standard"(e){Sn(this,"~standard",e)}}),Qh=(e,t)=>e.issues.length?{issues:e.issues.map(n=>Rr(n,t,Cn()))}:{value:e.value};async function cx(e,t){const n={async:!0};return Qh(await e._zod.run({value:t,issues:[]},n),n)}function Yh(e){return{validate:t=>{const n={async:!1};try{const r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Qh(r,n)}catch{}return cx(e,t)},vendor:"zod",version:1}}const rc=j("$ZodString",(e,t)=>{Be.init(e,t),e._zod.pattern=t.pattern??U1,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}}),Ne=j("$ZodStringFormat",(e,t)=>{Os.init(e,t),rc.init(e,t)}),lx=j("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=k1),Ne.init(e,t)}),ux=j("$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=_l(r))}else t.pattern??(t.pattern=_l());Ne.init(e,t)}),dx=j("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=O1),Ne.init(e,t)}),Jh=1,as=2;function Xh(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function fx(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?Xh(e)||as:hx(e,t)}function hx(e,t){var n;if(!t.normalize&&((n=t.protocol)==null?void 0:n.source)===j1.source&&!/^https?:\/\//i.test(e))return Jh;try{if(typeof URL<"u"){const r=URL;if(typeof r.parse=="function")return r.parse(e)??as}return new URL(e)}catch{return as}}const px=/[\t\n\r]/g;function Sl(e){return e.replace(px,"")}function mx(e,t){return t.lastIndex=0,t.test(e.hostname)}function gx(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}const yx=j("$ZodURL",(e,t)=>{Ne.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=fx(r,t);if(o===Jh){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(o===as){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}if(o===!0){n.value=Sl(r);return}t.hostname&&!mx(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&&!gx(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:Sl(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),vx=j("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=P1()),Ne.init(e,t)}),bx=j("$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?S1:E1(t.length)),Ne.init(e,t)}),wx=j("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=v1),Ne.init(e,t)}),_x=j("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=b1),Ne.init(e,t)}),xx=j("$ZodULID",(e,t)=>{t.pattern??(t.pattern=w1),Ne.init(e,t)}),Sx=j("$ZodXID",(e,t)=>{t.pattern??(t.pattern=_1),Ne.init(e,t)}),Ex=j("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=x1),Ne.init(e,t)}),Cx=j("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=V1(t)),Ne.init(e,t)}),kx=j("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=F1),Ne.init(e,t)}),Ox=j("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=L1(t)),Ne.init(e,t)}),Rx=j("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=C1),Ne.init(e,t)}),Px=j("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=T1),Ne.init(e,t)}),Tx=/^[0-9a-fA-F:.]+$/;function ep(e){return Tx.test(e)?Xh(`http://[${e}]`):!1}const Ix=j("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=I1),Ne.init(e,t),e._zod.check=n=>{ep(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),Ax=j("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=A1),Ne.init(e,t)});function Nx(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:ep(n)}const Dx=j("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=N1),Ne.init(e,t),e._zod.check=n=>{Nx(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function tp(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const np=/^[0-9a-zA-Z+/]*={0,2}$/,Mx=j("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=np),Ne.init(e,t),e._zod.check=n=>{tp(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),oc=/^[A-Za-z0-9_-]*$/;function jx(e){if(!oc.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return tp(n)}const $x=j("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=oc),Ne.init(e,t),e._zod.check=n=>{jx(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),zx=j("$ZodE164",(e,t)=>{t.pattern??(t.pattern=$1),Ne.init(e,t)});function Fx(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 Lx=j("$ZodJWT",(e,t)=>{Ne.init(e,t),e._zod.check=n=>{Fx(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),rp=j("$ZodNumber",(e,t)=>{Be.init(e,t),e._zod.pattern=Z1,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}}),Vx=j("$ZodNumberFormat",(e,t)=>{G1.init(e,t),rp.init(e,t)}),Ux=j("$ZodBoolean",(e,t)=>{Be.init(e,t),e._zod.pattern=B1,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}}),Zx=j("$ZodUnknown",(e,t)=>{Be.init(e,t),e._zod.parse=n=>n}),Bx=j("$ZodNever",(e,t)=>{Be.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Hx(e,t){const n=yl(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 yl(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,Hi(s.issues,d,e),s}}return o(s,i)}}const Wx=e=>Array.isArray(e)?e.length:-1;function El(e,t,n){e.issues.length&&t.issues.push(...Ga(n,e.issues)),t.value[n]=e.value}const Kx=j("$ZodArray",(e,t)=>{Be.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=>El(l,r,c)));else if(El(d,r,c),a&&d.issues.length!==0&&en(d))break}return i.length?Promise.all(i).then(()=>r):r},Hx(e,Wx)});function cs(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(...Ga(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 Gx=[];function op(e){var i,a,c,u;const t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Gx,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=A_(e.shape);return{...e,allKeys:o,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function sp(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 y in t){if(i&&n.issues.length!==p){if(en(n,p))break;p=n.issues.length}if(c.has(y))continue;if(y==="__proto__"){d==="never"&&a.push(y);continue}if(d==="never"){a.push(y);continue}const g=u.run({value:t[y],issues:[]},r);g instanceof Promise?e.push(g.then(w=>cs(w,n,y,t,l,f))):cs(g,n,y,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 qx=j("$ZodObject",(e,t)=>{Be.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=Wa(()=>op(t));Ce(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)||Hn(l,f,new Set);for(const y of p.values)l[f].add(y);p.optin!==void 0&&l[f].add(void 0)}}return l});const s=ss,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,y=d==null?void 0:d.abortEarly;let g=u.issues.length;for(const w of a.allKeys){if(y&&u.issues.length!==g){if(en(u,g))break;g=u.issues.length}if(w==="__proto__")continue;const b=p[w],S=b._zod.optin,_=b._zod.optout,O=b._zod.run({value:l[w],issues:[]},d);O instanceof Promise?f.push(O.then(E=>cs(E,u,w,l,S,_))):cs(O,u,w,l,S,_)}return i?sp(f,l,u,d,o.value,e,y===!0):f.length?Promise.all(f).then(()=>u):u}}),Qx=j("$ZodObjectJIT",(e,t)=>{qx.init(e,t);const n=e._zod.parse,r=Wa(()=>op(t)),o=Bt.memoizer,s=p=>{var E,R;const y=r.value,g=y.symbolKeys,w=new ix(["payload","ctx"],{shape:p,inst:e,memo:o,syms:g}),b=P=>`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`,S=(P,A)=>`
197
+ let ${P}_ab = false;
198
+ for (let i = 0; i < ${P}.issues.length; i++) {
199
+ const iss = ${P}.issues[i];
200
+ iss.path = iss.path ? [${A}, ...iss.path] : [${A}];
201
+ payload.issues.push(iss);
202
+ if (iss.continue !== true) ${P}_ab = true;
203
+ }
204
+ if (${P}_ab && ctx && ctx.abortEarly) {
205
+ payload.value = newResult;
206
+ return payload;
207
+ }`;w.write("const input = payload.value;");const _=Object.create(null);let O=0;for(const P of y.allKeys)_[P]=`key_${O++}`;w.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const P of y.allKeys){if(P==="__proto__")continue;const A=_[P],M=typeof P=="symbol"?`syms[${g.indexOf(P)}]`:R_(P),$=`${M} in input`,V=p[P],D=(E=V==null?void 0:V._zod)==null?void 0:E.optin,Q=D!==void 0,U=((R=V==null?void 0:V._zod)==null?void 0:R.optout)==="optional";if(w.write(`const ${A} = ${b(M)};`),Q&&U){const K=D==="optional"?`${A}_present`:`${A}.value !== undefined || ${A}_present`;w.write(`
208
+ const ${A}_present = ${$};
209
+ if (!${A}.issues.length || ${A}_present) {
210
+ if (${A}.issues.length) {${S(A,M)}
211
+ }
212
+
213
+ if (${K}) {
214
+ newResult[${M}] = ${A}.value;
215
+ }
216
+ }
217
+
218
+ `)}else Q?(w.write(`
219
+ if (${A}.issues.length) {${S(A,M)}
220
+ }
221
+ `),D==="defaulted"?w.write(`newResult[${M}] = ${A}.value;`):w.write(`
222
+ if (${A}.value !== undefined || ${$}) {
223
+ newResult[${M}] = ${A}.value;
224
+ }
225
+ `)):w.write(`
226
+ const ${A}_present = ${$};
227
+ if (${A}.issues.length) {${S(A,M)}
228
+ }
229
+ if (!${A}_present && !${A}.issues.length) {
230
+ payload.issues.push({
231
+ code: "invalid_type",
232
+ expected: "nonoptional",
233
+ input: undefined,
234
+ path: [${M}]
235
+ });
236
+ if (ctx && ctx.abortEarly) {
237
+ payload.value = newResult;
238
+ return payload;
239
+ }
240
+ }
241
+
242
+ if (${A}_present) {
243
+ newResult[${M}] = ${A}.value;
244
+ }
245
+
246
+ `)}return w.write("payload.value = newResult;"),w.write("return payload;"),w.compile()};let i;const a=ss,c=!Bt.jitless,d=c&&T_.value,l=t.catchall;let f;e._zod.parse=(p,y)=>{f??(f=r.value);const g=p.value;return a(g)?c&&d&&(y==null?void 0:y.async)===!1&&y.jitless!==!0?(i||(i=s(t.shape)),p=i(p,y),l?sp([],g,p,y,f,e,(y==null?void 0:y.abortEarly)===!0):p):n(p,y):(p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p)}});function Cl(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=>!en(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=>Rr(i,r,Cn())))}),t)}const Yx=j("$ZodUnion",(e,t)=>{Be.init(e,t),Ce(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),Ce(e,"optout",r=>r.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Ce(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)))}),Ce(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=>Ka(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=>Cl(a,r,e,o)):Cl(i,r,e,o)}}),Jx=j("$ZodIntersection",(e,t)=>{Be.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])=>kl(n,c,u)):kl(n,s,i)}});function Ki(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(Qr(e)&&Qr(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=Ki(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=Ki(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 kl(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 y=String(u.path[0]);s.has(y)||s.set(y,u),l=[y]}else return!1;for(const y of l)r.has(y)||r.set(y,{}),r.get(y)[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=Ki(t.value,n.value);if(!c.valid){if(en(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const Xx=j("$ZodEnum",(e,t)=>{Be.init(e,t);const n=Zi(t.entries),r=new Set(n);e._zod.values=r,Ce(e,"pattern",o=>{const s=Zi(o.def.entries).filter(i=>I_.has(typeof i));return new RegExp(s.length?`^(${s.map(i=>Es(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}}),eS=j("$ZodTransform",(e,t)=>{var n;Be.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 Hh(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 Fn;return r.value=s,r}});function Ol(e,t){return e.value=t.issues.length?void 0:t.value,e}const ip=j("$ZodOptional",(e,t)=>{Be.init(e,t),Ce(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Ce(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),Ce(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${Ka(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=>Ol(n,s)):Ol(n,o)}return t.innerType._zod.run(n,r)}}),tS=j("$ZodExactOptional",(e,t)=>{ip.init(e,t),Ce(e,"values",n=>n.def.innerType._zod.values),Ce(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),nS=j("$ZodNullable",(e,t)=>{Be.init(e,t),Ce(e,"optin",n=>n.def.innerType._zod.optin),Ce(e,"optout",n=>n.def.innerType._zod.optout),Ce(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${Ka(r.source)}|null)$`):void 0}),Ce(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)}),rS=j("$ZodDefault",(e,t)=>{Be.init(e,t),e._zod.optin="defaulted",Ce(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=>Rl(s,t)):Rl(o,t)}});function Rl(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const oS=j("$ZodPrefault",(e,t)=>{Be.init(e,t),e._zod.optin="defaulted",Ce(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))}),sS=j("$ZodNonOptional",(e,t)=>{Be.init(e,t),Ce(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=>Pl(s,e)):Pl(o,e)}});function Pl(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 Tl(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>Rr(o,r,Cn()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const iS=j("$ZodCatch",(e,t)=>{Be.init(e,t),Ce(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Ce(e,"optout",n=>n.def.innerType._zod.optout),Ce(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=>Tl(n,s,t,r)):Tl(n,o,t,r)}}),aS=j("$ZodPipe",(e,t)=>{Be.init(e,t),Ce(e,"values",n=>n.def.in._zod.values),Ce(e,"optin",n=>n.def.in._zod.optin),Ce(e,"optout",n=>n.def.out._zod.optout),Ce(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=>No(i,t.in,r)):No(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>No(s,t.out,r)):No(o,t.out,r)}});function No(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 cS=j("$ZodReadonly",(e,t)=>{Be.init(e,t),Ce(e,"propValues",n=>n.def.innerType._zod.propValues),Ce(e,"values",n=>n.def.innerType._zod.values),Ce(e,"optin",n=>{var r,o;return(o=(r=n.def.innerType)==null?void 0:r._zod)==null?void 0:o.optin}),Ce(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(Il):Il(o)}});function Il(e){return e.memo||(e.value=Object.freeze(e.value)),e}const lS=j("$ZodCustom",(e,t)=>{ft.init(e,t),Be.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=>Al(s,n,r,e));Al(o,n,r,e)}});function Al(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(Yr(o))}}class uS extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const Gi="~memo",Nl=[];function ap(e){return e!==null&&typeof e=="object"}function Ys(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}const cp=new WeakMap,Lr=0,qo=1,Zr=2;function Qo(e,t,n){const r=cp.get(e);if(r!==void 0)return r?Zr:Lr;if(t.has(e))return Zr;t.add(e);let o=Lr;const s=d=>{if(o!==Zr&&(d!=null&&d._zod)){const l=Qo(d,t);l>o&&(o=l)}},i=(d,l)=>{var p;let f=Lr;for(const y of Reflect.ownKeys(d)){const g=Object.getOwnPropertyDescriptor(d,y);if(!g.enumerable)continue;const w=g.get?qo:(p=g.value)!=null&&p._zod?Qo(g.value,t):Lr;w>f&&(f=w)}return f},a=d=>{d>o&&(o=d)},c=e._zod.def;switch(c.type){case"object":{const d=jh(c);a(d?i(d):qo),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?Qo(d,t):qo);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),dS(e,o)}function dS(e,t){return t!==qo&&cp.set(e,t===Zr),t}function fS(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}let Do;const Mo=[],hS={alloc(e,t,n){const r=Do;if(!r)return n;Do=void 0;const o={value:n,issues:null};return r.set(t.value,o),Mo.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"&&mS(s,o.value))throw new uS;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=Qo(e,new Set);if(b===Lr)return e._zod.parse=i,e._zod.run===a&&(e._zod.run=i),i(c,u);b===Zr||r?n=!0:r=!0}const d=c.value;if(!ap(d))return i(c,u);let l=u[Gi];l||(l={buckets:new WeakMap,backEdges:void 0},u[Gi]=l);let f;o===u?f=s:(f=fS(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(...Ys(p.issues)):(c.memo=!0,l.backEdges??(l.backEdges=new WeakSet),l.backEdges.add(p.value)),c;Do=f;const y=Mo.length,g=i(c,u);Do=void 0;const w=Mo.length>y?Mo.pop():void 0;return g instanceof Promise?g.then(b=>(w&&(w.issues=b.issues.length?Ys(b.issues):Nl),b)):(w&&(w.issues=g.issues.length?Ys(g.issues):Nl),g)};e._zod.parse=a,e._zod.run===i&&(e._zod.run=a)})}};function pS(){return hS}function mS(e,t){var r;const n=(r=e[Gi])==null?void 0:r.backEdges;return n!==void 0&&ap(t)&&n.has(t)}const gS=()=>{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=U_(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 ${Vh(s.values[0])}`:`Invalid option: expected one of ${ml(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":""}: ${ml(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 yS(){return{localeError:gS()}}var Dl;class vS{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 bS(){return new vS}(Dl=globalThis).__zod_globalRegistry??(Dl.__zod_globalRegistry=bS());const Vr=globalThis.__zod_globalRegistry;function lp(e){return e.checks&&(e.checks=[...e.checks]),e}function wS(e,t){return new e(lp({type:"string",...oe(t)}))}function _S(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...oe(t)})}function xS(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...oe(t)})}function SS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...oe(t)})}function ES(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...oe(t)})}function CS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...oe(t)})}function kS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...oe(t)})}function OS(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...oe(t)})}function RS(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...oe(t)})}function PS(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...oe(t)})}function TS(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...oe(t)})}function IS(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...oe(t)})}function AS(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...oe(t)})}function NS(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...oe(t)})}function DS(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...oe(t)})}function MS(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...oe(t)})}function jS(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...oe(t)})}function $S(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...oe(t)})}function zS(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...oe(t)})}function FS(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...oe(t)})}function LS(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...oe(t)})}function VS(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...oe(t)})}function US(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...oe(t)})}function ZS(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...oe(t)})}function BS(e,t){return new e({type:"string",format:"date",check:"string_format",...oe(t)})}function HS(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...oe(t)})}function WS(e,t){return new e({type:"string",format:"duration",check:"string_format",...oe(t)})}function KS(e,t){return new e(lp({type:"number",checks:[],...oe(t)}))}function GS(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...oe(t)})}function qS(e,t){return new e({type:"boolean",...oe(t)})}function QS(e){return new e({type:"unknown"})}function YS(e,t){return new e({type:"never",...oe(t)})}function Ml(e,t){return new Gh({check:"less_than",...oe(t),value:e,inclusive:!1})}function Js(e,t){return new Gh({check:"less_than",...oe(t),value:e,inclusive:!0})}function jl(e,t){return new qh({check:"greater_than",...oe(t),value:e,inclusive:!1})}function Xs(e,t){return new qh({check:"greater_than",...oe(t),value:e,inclusive:!0})}function $l(e,t){return new K1({check:"multiple_of",...oe(t),value:e})}function up(e,t){return new q1({check:"max_length",...oe(t),maximum:e})}function ls(e,t){return new Q1({check:"min_length",...oe(t),minimum:e})}function dp(e,t){return new Y1({check:"length_equals",...oe(t),length:e})}function JS(e,t){return new J1({check:"string_format",format:"regex",...oe(t),pattern:e})}function XS(e){return new X1({check:"string_format",format:"lowercase",...oe(e)})}function eE(e){return new ex({check:"string_format",format:"uppercase",...oe(e)})}function tE(e,t){return new tx({check:"string_format",format:"includes",...oe(t),includes:e})}function nE(e,t){return new nx({check:"string_format",format:"starts_with",...oe(t),prefix:e})}function rE(e,t){return new rx({check:"string_format",format:"ends_with",...oe(t),suffix:e})}function oE(e,t){return new ox({check:"properties",shape:e,...oe(t)})}function Pr(e){return new sx({check:"overwrite",tx:e})}function sE(e){return Pr(t=>t.normalize(e))}function iE(){return Pr(e=>e.trim())}function aE(){return Pr(e=>e.toLowerCase())}function cE(){return Pr(e=>e.toUpperCase())}function lE(){return Pr(e=>P_(e))}function uE(e,t,n){return new e({type:"array",element:t,...oe(n)})}function dE(e,t,n){return new e({type:"custom",check:"custom",fn:t,...oe(n)})}function fE(e,t){const n=hE(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(Yr(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(Yr(s))}},e(r.value,r)),t);return n}function hE(e,t){const n=new ft({check:"custom",...oe(t)});return n._zod.check=e,n}function Br(e,...t){for(const n of t)for(const r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&Hn(e,r,n[r]);return e}function fp(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)??Vr,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 Tr(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 ot(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 y=i.schema,g=t.processors[o.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);g(e,t,y,f)}const p=e._zod.parent;p&&(i.ref||(i.ref=p),ot(p,t,f),t.seen.get(p).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Br(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 zl(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function hp(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 w=(g=e.external.registry.get(d[0]))==null?void 0:g.id,b=e.external.uri??(_=>_);if(w)return{ref:b(w)};const S=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=S,{defId:S,ref:`${b("__shared")}#/${l}/${zl(S)}`}}const f="#",p=`${f}/${l}/`;if(d[1]===n&&!d[1].schema.id)return{ref:f};const y=d[1].schema.id??`__schema${e.counter++}`;return{defId:y,ref:p+zl(y)}},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 y=l.schema;for(const g in y)delete y[g];y.$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>
247
+
248
+ 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 pp(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;pp(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 mp=new Set(["type","properties","required","additionalProperties"]),Fl=["oneOf","anyOf"];function Ll(e){const t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function qi(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(!mp.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])??Ll(d);l!=null&&(c.some(f=>JSON.stringify(f)===JSON.stringify(l))||c.push(l))}const u=c.length===1?c[0]:qi(c)??{allOf:c};Hn(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=Ll(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 pE(e){const t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(const o of mp)if(o in e)return;const n=t.filter(o=>Fl.some(s=>Array.isArray(o[s])));let r=null;if(!n.length)r=qi(t);else{const o=n[0],s=Fl.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=>qi([...i,c]));if(a.some(c=>!c))return;r={[s]:a}}r&&(delete e.allOf,Br(e,r))}function gp(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,y={...p},g=f.ref;if(f.ref=null,g){r(g);const b=e.seen.get(g),S=b.schema;if(S.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(S)):Br(p,S),Br(p,y),l._zod.parent===g)for(const O in p)O==="$ref"||O==="allOf"||O in y||delete p[O];if(S.$ref&&b.def)for(const O in p)O==="$ref"||O==="allOf"||O in b.def&&JSON.stringify(p[O])===JSON.stringify(b.def[O])&&delete p[O]}const w=l._zod.parent;if(w&&w!==g){r(w);const b=e.seen.get(w);if(b!=null&&b.schema.$ref&&(p.$ref=b.schema.$ref,b.def))for(const S in p)S==="$ref"||S==="allOf"||S in b.def&&JSON.stringify(p[S])===JSON.stringify(b.def[S])&&delete p[S]}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())pp(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 y=p==null?void 0:p.allOf;if(!Array.isArray(y))continue;const g=l.get(y);g?g.push(p):l.set(y,[p])}for(const f of e.intersections)for(const p of l.get(f)??[])pE(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)}Br(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,Hn(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:us(t,"input",e.processors),output:us(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 mE=(e,t={})=>n=>{const r=fp({...n,processors:t});return ot(e,r),hp(r,e),gp(r,e)},us=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},i=fp({...o??{},target:s,io:t,processors:n});return ot(e,i),hp(i,e),gp(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)},Vl=(e,t)=>{wr(e,"minimum",t),_r(e,"maximum",t)},yp=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},vp=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},bp=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},wp=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},Ul=(e,t)=>wr(e,"minimum",t.minimum),Zl=(e,t)=>_r(e,"maximum",t.maximum),Bl=e=>(t,n)=>{wp(t,n.format);const[r,o]=e[n.format];wr(t,"minimum",r),_r(t,"maximum",o)},ei={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)=>yp(e,t.value),number_format:Bl(Uh),bigint_format:Bl(N_),min_length:Ul,max_length:Zl,length_equals:(e,t)=>Vl(e,t.length),min_size:Ul,max_size:Zl,size_equals:(e,t)=>Vl(e,t.size),string_format:(e,t)=>{wp(e,t.format),t.pattern&&vp(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)=>bp(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=ei[i._zod.def.check])==null||s.call(ei,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&&yp(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&bp(t,o.mime);for(const i of o.patterns??[])vp(t,i);return t}const gE={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},yE=new Map([[np,D1],[oc,M1]]),vE=e=>yE.get(e)??e,bE=(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=gE[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(vE);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}))])}},wE=(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 y=new Set;for(const b of a)Number.isFinite(b)&&b!==0?y.add(Math.abs(b)):Tr(e,t,o,r,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);const[g,...w]=y;g!==void 0&&(o.multipleOf=g),w.length&&(o.allOf=[...o.allOf??[],...w.map(b=>({multipleOf:b}))])}},_E=(e,t,n,r)=>{n.type="boolean"},xE=(e,t,n,r)=>{n.not={}},SE=(e,t,n,r)=>{},EE=(e,t,n,r)=>{const o=e._zod.def,s=Zi(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},CE=(e,t,n,r)=>{Tr(e,t,n,r,"Custom types cannot be represented in JSON Schema")},kE=(e,t,n,r)=>{Tr(e,t,n,r,"Transforms cannot be represented in JSON Schema")},OE=(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=ot(s.element,t,{...r,path:[...r.path,"items"]})};function Qi(e){const t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Qi(t.out):t.type==="catch"?Qi(t.innerType):e._zod.optin}const RE=(e,t,n,r)=>{var u;const o=n,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&Tr(e,t,o,r,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(const d in i)Hn(o.properties,d,ot(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"?Qi(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=ot(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},PE=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>ot(a,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?n.oneOf=i:n.anyOf=i},TE=(e,t,n,r)=>{const o=e._zod.def,s=ot(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=ot(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)},IE=(e,t,n,r)=>{const o=e._zod.def,s=ot(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"}]},AE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},sc=Symbol();function _p(e,t,n,r,o){let s=!1;const i=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(s=!0,null));return s?(Tr(t,n,r,o,"BigInt defaults cannot be represented in JSON Schema"),sc):JSON.parse(i)}const NE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;const i=_p(o.defaultValue,e,t,n,r);i!==sc&&(n.default=i)},DE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);if(s.ref=o.innerType,t.io!=="input")return;const i=_p(o.defaultValue,e,t,n,r);i!==sc&&(n._prefault=i)},ME=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{Tr(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=i},jE=(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;ot(i,t,r);const a=t.seen.get(e);a.ref=i},$E=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},xp=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},Hl=new WeakSet([Object.prototype,Error.prototype]);function jo(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 zE=(e,t)=>{t1.init(e,t),e.name="ZodError";const n=Object.getPrototypeOf(e);Hl.has(n)||(Hl.add(n),jo(n,"format",r=>o=>o1(r,o)),jo(n,"flatten",r=>o=>r1(r,o)),jo(n,"addIssue",r=>o=>{r.issues.push(o),r.message=JSON.stringify(r.issues,Bi,2)}),jo(n,"addIssues",r=>o=>{r.issues.push(...o),r.message=JSON.stringify(r.issues,Bi,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},It=j("ZodError",zE,void 0,{Parent:Error}),FE=Ja(It),LE=Xa(It),VE=ec(It),UE=tc(It),ZE=u1(It),BE=d1(It),HE=f1(It),WE=h1(It),KE=p1(It),GE=m1(It),qE=g1(It),QE=y1(It);function YE(){Bt.localeError||Cn(yS())}function ic(){Bt.memoizer||Cn({memoizer:pS()})}const He=j("ZodType",(e,t)=>(YE(),Be.init(e,t),e.def=t,e.type=t.type,e),{check(...e){const t=this.def;return this.clone(_t(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 En(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(qC(e,t))},superRefine(e,t){return this.check(QC(e,t))},overwrite(e){return this.check(Pr(e))},optional(){return ql(this)},exactOptional(){return $C(this)},nullable(){return Ql(this)},nullish(){return ql(Ql(this))},nonoptional(e){return ZC(this,e)},array(){return OC(this)},or(e){return IC([this,e])},and(e){return NC(this,e)},transform(e){return Yl(this,jC(e))},default(e){return LC(this,e)},prefault(e){return UC(this,e)},catch(e){return HC(this,e)},pipe(e){return Yl(this,e)},readonly(){return GC(this)},describe(e){const t=this.clone();return Vr.add(t,{description:e}),t},meta(...e){if(e.length===0)return Vr.get(this);const t=this.clone();return Vr.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 Ya(this,"~standard",{...Yh(this),jsonSchema:{input:us(this,"input"),output:us(this,"output")}})},set"~standard"(e){Sn(this,"~standard",e)},parse:function e(t,n){return FE(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await LE(this,t,n,{callee:e})},safeParse(e,t){return VE(this,e,t)},async safeParseAsync(e,t){return UE(this,e,t)},get spa(){return this==null?void 0:this.safeParseAsync},set spa(e){Sn(this,"spa",e)},validate(e,t){return a1(this,e,t)},validateAsync(e,t){return l1(this,e,t)},encode:function e(t,n){return ZE(this,t,n,{callee:e})},decode:function e(t,n){return BE(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await HE(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await WE(this,t,n,{callee:e})},safeEncode(e,t){return KE(this,e,t)},safeDecode(e,t){return GE(this,e,t)},async safeEncodeAsync(e,t){return qE(this,e,t)},async safeDecodeAsync(e,t){return QE(this,e,t)},toJSONSchema(e){return mE(this,{})(e)},get description(){var e;return(e=Vr.get(this))==null?void 0:e.description},get _def(){return this._zod.def}}),Sp=j("_ZodString",(e,t)=>{rc.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bE(e,n,r)},Bh({format:e=>Zt(e).format??null,minLength:e=>Zt(e).minimum??null,maxLength:e=>Zt(e).maximum??null},{regex(...e){return this.check(JS(...e))},includes(...e){return this.check(tE(...e))},startsWith(...e){return this.check(nE(...e))},endsWith(...e){return this.check(rE(...e))},min(...e){return this.check(ls(...e))},max(...e){return this.check(up(...e))},length(...e){return this.check(dp(...e))},nonempty(...e){return this.check(ls(1,...e))},lowercase(e){return this.check(XS(e))},uppercase(e){return this.check(eE(e))},trim(){return this.check(iE())},normalize(...e){return this.check(sE(...e))},toLowerCase(){return this.check(aE())},toUpperCase(){return this.check(cE())},slugify(){return this.check(lE())}})),JE=j("ZodString",(e,t)=>{rc.init(e,t),Sp.init(e,t)},{email(e){return this.check(_S(rC,e))},url(e){return this.check(OS(sC,e))},jwt(e){return this.check(US(wC,e))},emoji(e){return this.check(RS(iC,e))},guid(e){return this.check(xS(oC,e))},uuid(e){return this.check(SS($o,e))},uuidv4(e){return this.check(ES($o,e))},uuidv6(e){return this.check(CS($o,e))},uuidv7(e){return this.check(kS($o,e))},nanoid(e){return this.check(PS(aC,e))},cuid(e){return this.check(TS(cC,e))},cuid2(e){return this.check(IS(lC,e))},ulid(e){return this.check(AS(uC,e))},base64(e){return this.check(FS(yC,e))},base64url(e){return this.check(LS(vC,e))},xid(e){return this.check(NS(dC,e))},ksuid(e){return this.check(DS(fC,e))},ipv4(e){return this.check(MS(hC,e))},ipv6(e){return this.check(jS(pC,e))},cidrv4(e){return this.check($S(mC,e))},cidrv6(e){return this.check(zS(gC,e))},e164(e){return this.check(VS(bC,e))},datetime(e){return this.check(ZS(XE,e))},date(e){return this.check(BS(eC,e))},time(e){return this.check(HS(tC,e))},duration(e){return this.check(WS(nC,e))}});function Wl(e){return wS(JE,e)}const Me=j("ZodStringFormat",(e,t)=>{Ne.init(e,t),Sp.init(e,t)}),XE=j("ZodISODateTime",(e,t)=>{Cx.init(e,t),Me.init(e,t)}),eC=j("ZodISODate",(e,t)=>{kx.init(e,t),Me.init(e,t)}),tC=j("ZodISOTime",(e,t)=>{Ox.init(e,t),Me.init(e,t)}),nC=j("ZodISODuration",(e,t)=>{Rx.init(e,t),Me.init(e,t)}),rC=j("ZodEmail",(e,t)=>{dx.init(e,t),Me.init(e,t)}),oC=j("ZodGUID",(e,t)=>{lx.init(e,t),Me.init(e,t)}),$o=j("ZodUUID",(e,t)=>{ux.init(e,t),Me.init(e,t)}),sC=j("ZodURL",(e,t)=>{yx.init(e,t),Me.init(e,t)}),iC=j("ZodEmoji",(e,t)=>{vx.init(e,t),Me.init(e,t)}),aC=j("ZodNanoID",(e,t)=>{bx.init(e,t),Me.init(e,t)}),cC=j("ZodCUID",(e,t)=>{wx.init(e,t),Me.init(e,t)}),lC=j("ZodCUID2",(e,t)=>{_x.init(e,t),Me.init(e,t)}),uC=j("ZodULID",(e,t)=>{xx.init(e,t),Me.init(e,t)}),dC=j("ZodXID",(e,t)=>{Sx.init(e,t),Me.init(e,t)}),fC=j("ZodKSUID",(e,t)=>{Ex.init(e,t),Me.init(e,t)}),hC=j("ZodIPv4",(e,t)=>{Px.init(e,t),Me.init(e,t)}),pC=j("ZodIPv6",(e,t)=>{Ix.init(e,t),Me.init(e,t)}),mC=j("ZodCIDRv4",(e,t)=>{Ax.init(e,t),Me.init(e,t)}),gC=j("ZodCIDRv6",(e,t)=>{Dx.init(e,t),Me.init(e,t)}),yC=j("ZodBase64",(e,t)=>{Mx.init(e,t),Me.init(e,t)}),vC=j("ZodBase64URL",(e,t)=>{$x.init(e,t),Me.init(e,t)}),bC=j("ZodE164",(e,t)=>{zx.init(e,t),Me.init(e,t)}),wC=j("ZodJWT",(e,t)=>{Lx.init(e,t),Me.init(e,t)}),Ep=j("ZodNumber",(e,t)=>{rp.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>wE(e,n,r,o),e.isFinite=!0},Bh({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(jl(e,t))},gte(e,t){return this.check(Xs(e,t))},min(e,t){return this.check(Xs(e,t))},lt(e,t){return this.check(Ml(e,t))},lte(e,t){return this.check(Js(e,t))},max(e,t){return this.check(Js(e,t))},int(e){return this.check(Kl(e))},safe(e){return this.check(Kl(e))},positive(e){return this.check(jl(0,e))},nonnegative(e){return this.check(Xs(0,e))},negative(e){return this.check(Ml(0,e))},nonpositive(e){return this.check(Js(0,e))},multipleOf(e,t){return this.check($l(e,t))},step(e,t){return this.check($l(e,t))},finite(){return this}}));function pk(e){return KS(Ep,e)}const _C=j("ZodNumberFormat",(e,t)=>{Vx.init(e,t),Ep.init(e,t)});function Kl(e){return GS(_C,e)}const xC=j("ZodBoolean",(e,t)=>{Ux.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_E(e,n,r)});function mk(e){return qS(xC,e)}const SC=j("ZodUnknown",(e,t)=>{Zx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>SE()});function Gl(){return QS(SC)}const EC=j("ZodNever",(e,t)=>{Bx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xE(e,n,r)});function CC(e){return YS(EC,e)}const kC=j("ZodArray",(e,t)=>{ic(),Kx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>OE(e,n,r,o),e.element=t.element},{min(e,t){return this.check(ls(e,t))},nonempty(e){return this.check(ls(1,e))},max(e,t){return this.check(up(e,t))},length(e,t){return this.check(dp(e,t))},unwrap(){return this.element}});function OC(e,t){return uE(kC,e,t)}const RC=j("ZodObject",(e,t)=>{ic(),Qx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>RE(e,n,r,o),K_(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return DC(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(_t(this._zod.def,{catchall:e}))},passthrough(){return this.clone(_t(this._zod.def,{catchall:Gl()}))},loose(){return this.clone(_t(this._zod.def,{catchall:Gl()}))},strict(){return this.clone(_t(this._zod.def,{catchall:CC()}))},strip(){return this.clone(_t(this._zod.def,{catchall:void 0}))},extend(e){return j_(this,e)},safeExtend(e){return $_(this,e)},merge(e){return z_(this,e)},pick(e){return D_(this,e)},omit(e){return M_(this,e)},partial(...e){return gl(Cp,this,e[0])},exactPartial(...e){return gl(kp,this,e[0],"exactPartial")},required(...e){return F_(Op,this,e[0])}});function PC(e,t){const n={type:"object",shape:e??{},...oe(t)};return new RC(n)}const TC=j("ZodUnion",(e,t)=>{Yx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>PE(e,n,r,o),e.options=t.options});function IC(e,t){return new TC({type:"union",options:e,...oe(t)})}const AC=j("ZodIntersection",(e,t)=>{Jx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>TE(e,n,r,o)});function NC(e,t){return new AC({type:"intersection",left:e,right:t})}const Yi=j("ZodEnum",(e,t)=>{Xx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(r,o,s)=>EE(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 Yi({...t,checks:[],...oe(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 Yi({...t,checks:[],...oe(o),entries:s})}});function DC(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Yi({type:"enum",entries:n,...oe(t)})}const MC=j("ZodTransform",(e,t)=>{ic(),eS.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>kE(e,n,r,o),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Hh(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Yr(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(Yr(i))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function jC(e){return new MC({type:"transform",transform:e})}const Cp=j("ZodOptional",(e,t)=>{ip.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xp(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function ql(e){return new Cp({type:"optional",innerType:e})}const kp=j("ZodExactOptional",(e,t)=>{tS.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xp(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function $C(e){return new kp({type:"optional",innerType:e})}const zC=j("ZodNullable",(e,t)=>{nS.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>IE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Ql(e){return new zC({type:"nullable",innerType:e})}const FC=j("ZodDefault",(e,t)=>{rS.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>NE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function LC(e,t){return new FC({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Lh(t)}})}const VC=j("ZodPrefault",(e,t)=>{oS.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>DE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function UC(e,t){return new VC({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Lh(t)}})}const Op=j("ZodNonOptional",(e,t)=>{sS.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>AE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function ZC(e,t){return new Op({type:"nonoptional",innerType:e,...oe(t)})}const BC=j("ZodCatch",(e,t)=>{iS.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ME(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function HC(e,t){return new BC({type:"catch",innerType:e,catchValue:typeof t=="function"?t:q_(t)})}const WC=j("ZodPipe",(e,t)=>{aS.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>jE(e,n,r,o),e.in=t.in,e.out=t.out});function Yl(e,t){return new WC({type:"pipe",in:e,out:t})}const KC=j("ZodReadonly",(e,t)=>{cS.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>$E(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function GC(e){return new KC({type:"readonly",innerType:e})}const Rp=j("ZodCustom",(e,t)=>{lS.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>CE(e,n,r,o)});function qC(e,t={}){return dE(Rp,e,t)}function QC(e,t){return fE(e,t)}const YC=j("ZodInstanceOf",(e,t)=>{Rp.init(e,t)},{properties(e,t){return this.check(oE(e,t))}});function gk(e,t={}){const n=new YC({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...oe(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 JC=Object.defineProperty,XC=(e,t)=>JC(e,"name",{value:t,configurable:!0}),Pp=h.forwardRef(XC(function(t,n){return m.jsx(Ze.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 e2=oo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ji=h.forwardRef((e,t)=>{const n=ee.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=ce(e2(),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(Pp,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Ji.displayName=Pp.displayName;function ti(e){const t=ee.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=ce("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 t2(e){return Object.entries(e).filter(([t,n])=>t!=="root"&&typeof(n==null?void 0:n.message)=="string").length}const Jl=e=>e===1?"1 field needs attention":`${e} fields need attention`,n2=100;function r2(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 o2(e,t){return e?`${/[.!?]$/.test(e)?e:`${e}.`} ${Jl(t)}`:Jl(t)}function s2(e){const t=ee.c(5),{errors:n,submitCount:r}=e,o=h.useRef(null),s=t2(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=r2(o.current),w=setTimeout(()=>{u(o2(g,d.count)),l(null)},n2);return()=>clearTimeout(w)},p=[d],t[0]=d,t[1]=f,t[2]=p):(f=t[1],p=t[2]),h.useEffect(f,p);let y;return t[3]!==c?(y=m.jsx("p",{ref:o,"aria-live":"polite",className:"sr-only",children:c}),t[3]=c,t[4]=y):y=t[4],y}const ac=8,yk=`Use at least ${ac} characters`,i2=`Password must be at least ${ac} characters`;function vk(e,t,n){return n?t:e}const a2=oo("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}}),Tp=h.forwardRef((e,t)=>{const n=ee.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=ce(a2({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});Tp.displayName="Card";const Ip=h.forwardRef((e,t)=>{const n=ee.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=ce("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});Ip.displayName="CardHeader";const Ap=h.forwardRef((e,t)=>{const n=ee.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=ce("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});Ap.displayName="CardTitle";const Np=h.forwardRef((e,t)=>{const n=ee.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=ce("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});Np.displayName="CardDescription";const Dp=h.forwardRef((e,t)=>{const n=ee.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=ce("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});Dp.displayName="CardContent";const c2=h.forwardRef((e,t)=>{const n=ee.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=ce("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});c2.displayName="CardFooter";const l2=PC({email:Wl().email("Enter a valid email"),password:Wl().min(ac,i2)});function u2(){var se,Te,Se,ke;const e=ee.c(58),t=du(),{resolvedTheme:n}=ds(),r=n==="dark"?"/logo-dark.svg":"/logo.svg";let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={queryKey:ns.authStatus,queryFn:C0,staleTime:1/0},e[0]=o):o=e[0];const s=Jo(o),i=na();let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={shouldFocusError:!1,resolver:S_(l2)},e[1]=a):a=e[1];const{register:c,handleSubmit:u,setError:d,formState:l}=v_(a),{errors:f,isSubmitting:p,submitCount:y}=l;let g;e[2]!==t||e[3]!==i||e[4]!==d?(g=async function(Fe){try{const{status:Et}=await bh.post("/api/v1/auth/login",{email:Fe.email,password:Fe.password});if(Et!==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 w=g;if(((se=s.data)==null?void 0:se.initialized)===!1){let je;return e[6]===Symbol.for("react.memo_cache_sentinel")?(je=m.jsx(ea,{to:"/setup",replace:!0}),e[6]=je):je=e[6],je}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 S;e[9]===Symbol.for("react.memo_cache_sentinel")?(S=m.jsx("span",{className:"text-base font-semibold tracking-tight",children:"tapflow"}),e[9]=S):S=e[9];let _;e[10]!==b?(_=m.jsxs("div",{className:"flex items-center gap-2",children:[b,S]}),e[10]=b,e[11]=_):_=e[11];let O;e[12]===Symbol.for("react.memo_cache_sentinel")?(O=m.jsxs(Ip,{className:"text-center",children:[m.jsx(Ap,{className:"text-2xl tracking-display-md",children:"Welcome back"}),m.jsx(Np,{children:"Sign in to your team workspace"})]}),e[12]=O):O=e[12];let E;e[13]!==u||e[14]!==w?(E=u(w),e[13]=u,e[14]=w,e[15]=E):E=e[15];let R;e[16]===Symbol.for("react.memo_cache_sentinel")?(R=m.jsx(Ji,{htmlFor:"email",children:"Email"}),e[16]=R):R=e[16];const P=!!f.email,A=f.email?"email-error":void 0;let M;e[17]!==c?(M=c("email"),e[17]=c,e[18]=M):M=e[18];let $;e[19]!==P||e[20]!==A||e[21]!==M?($=m.jsx(es,{id:"email",type:"email",placeholder:"you@company.com",autoComplete:"email","aria-required":"true","aria-invalid":P,"aria-describedby":A,...M}),e[19]=P,e[20]=A,e[21]=M,e[22]=$):$=e[22];const V=(Te=f.email)==null?void 0:Te.message;let D;e[23]!==V?(D=m.jsx(ti,{id:"email-error",message:V}),e[23]=V,e[24]=D):D=e[24];let Q;e[25]!==$||e[26]!==D?(Q=m.jsxs("div",{className:"grid gap-2",children:[R,$,D]}),e[25]=$,e[26]=D,e[27]=Q):Q=e[27];let U;e[28]===Symbol.for("react.memo_cache_sentinel")?(U=m.jsx(Ji,{htmlFor:"password",children:"Password"}),e[28]=U):U=e[28];const K=!!f.password,H=f.password?"password-error":void 0;let Y;e[29]!==c?(Y=c("password"),e[29]=c,e[30]=Y):Y=e[30];let ne;e[31]!==K||e[32]!==H||e[33]!==Y?(ne=m.jsx(es,{id:"password",type:"password",autoComplete:"current-password","aria-required":"true","aria-invalid":K,"aria-describedby":H,...Y}),e[31]=K,e[32]=H,e[33]=Y,e[34]=ne):ne=e[34];const te=(Se=f.password)==null?void 0:Se.message;let X;e[35]!==te?(X=m.jsx(ti,{id:"password-error",message:te}),e[35]=te,e[36]=X):X=e[36];let q;e[37]!==ne||e[38]!==X?(q=m.jsxs("div",{className:"grid gap-2",children:[U,ne,X]}),e[37]=ne,e[38]=X,e[39]=q):q=e[39];const ye=(ke=f.root)==null?void 0:ke.message;let me;e[40]!==ye?(me=m.jsx(ti,{assertive:!0,id:"login-error",message:ye}),e[40]=ye,e[41]=me):me=e[41];const le=p?"Signing in…":"Sign in";let re;e[42]!==p||e[43]!==le?(re=m.jsx(fs,{type:"submit",size:"lg",disabled:p,className:"w-full mt-1",children:le}),e[42]=p,e[43]=le,e[44]=re):re=e[44];let W;e[45]!==f||e[46]!==y?(W=m.jsx(s2,{errors:f,submitCount:y}),e[45]=f,e[46]=y,e[47]=W):W=e[47];let ae;e[48]!==Q||e[49]!==q||e[50]!==me||e[51]!==re||e[52]!==W||e[53]!==E?(ae=m.jsxs(Tp,{level:4,className:"w-full",children:[O,m.jsx(Dp,{children:m.jsxs("form",{onSubmit:E,className:"flex flex-col gap-4",children:[Q,q,me,re,W]})})]}),e[48]=Q,e[49]=q,e[50]=me,e[51]=re,e[52]=W,e[53]=E,e[54]=ae):ae=e[54];let be;return e[55]!==ae||e[56]!==_?(be=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:[_,ae]})}),e[55]=ae,e[56]=_,e[57]=be):be=e[57],be}function d2(){return new Dm({defaultOptions:{queries:{retry:0,refetchOnWindowFocus:!0,networkMode:"always"}}})}const f2=h.lazy(()=>xt(()=>import("./Setup-D4DsciMG.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.Setup}))),h2=h.lazy(()=>xt(()=>import("./Invite-BVRKLYJu.js"),__vite__mapDeps([4,1,2,3,5])).then(e=>({default:e.Invite}))),p2=h.lazy(()=>xt(()=>import("./ResetPassword-DU97TnMC.js"),__vite__mapDeps([6,1,2,3])).then(e=>({default:e.ResetPassword}))),m2=h.lazy(()=>xt(()=>import("./AppCenter-BWgstOJH.js"),__vite__mapDeps([7,1,8,9,10,11,12,13,14,15,16,17,18,19,3])).then(e=>({default:e.AppCenter}))),g2=h.lazy(()=>xt(()=>import("./QASession-BuQdx-pq.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}))),y2=h.lazy(()=>xt(()=>import("./Runs-BdCnN_dH.js"),__vite__mapDeps([28,1,14,8,12,25,9,10,29,19,18,30,3])).then(e=>({default:e.Runs}))),v2=h.lazy(()=>xt(()=>import("./RunDetail-BspFUFg2.js"),__vite__mapDeps([31,1,14,12,30,32,10,9,33,22,17,24,3])).then(e=>({default:e.RunDetail}))),b2=h.lazy(()=>xt(()=>import("./AISessionWatch-DMfOAt_U.js"),__vite__mapDeps([34,1,21,22,33,23,17,3])).then(e=>({default:e.AISessionWatch}))),w2=h.lazy(()=>xt(()=>import("./MacResources-B6_Es8ye.js"),__vite__mapDeps([35,1,21,19,25,27,36,3])).then(e=>({default:e.MacResources}))),_2=h.lazy(()=>xt(()=>import("./Default-Obywi6hR.js"),__vite__mapDeps([37,1,2,14,16,15,32,10,5,3])).then(e=>({default:e.DefaultSettings}))),x2=h.lazy(()=>xt(()=>import("./Team-B2Txvi0a.js"),__vite__mapDeps([38,1,11,15,9,10,29,19,26,18,3])).then(e=>({default:e.TeamSettings}))),S2=h.lazy(()=>xt(()=>import("./Tokens-D-ekP8kU.js"),__vite__mapDeps([39,1,14,15,11,9,10,29,19,26,18,13,3])).then(e=>({default:e.TokenSettings}))),E2=h.lazy(()=>xt(()=>import("./NotFound-DVq_rCKc.js"),__vite__mapDeps([40,1])).then(e=>({default:e.NotFound}))),C2=m.jsx("div",{className:"flex h-screen w-full items-center justify-center text-sm text-muted-foreground",children:"Loading…"}),zo=e=>m.jsx(h.Suspense,{fallback:C2,children:e}),k2=d2();function O2(){const e=ee.c(16);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=m.jsx(it,{path:"/login",element:m.jsx(u2,{})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx(it,{path:"/setup",element:zo(m.jsx(f2,{}))}),e[1]=n):n=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx(it,{path:"/invite",element:zo(m.jsx(h2,{}))}),e[2]=r):r=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(it,{path:"/reset-password",element:zo(m.jsx(p2,{}))}),e[3]=o):o=e[3];let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(G0,{}),e[4]=s):s=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx(it,{index:!0,element:m.jsx(ea,{to:"/app-center",replace:!0})}),e[5]=i):i=e[5];let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(it,{path:"/app-center",element:m.jsx(m2,{})}),e[6]=a):a=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx(it,{path:"/app-center/build",element:m.jsx(g2,{})}),e[7]=c):c=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(it,{path:"/automation/runs",element:m.jsx(y2,{})}),e[8]=u):u=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx(it,{path:"/automation/runs/:runId",element:m.jsx(v2,{})}),e[9]=d):d=e[9];let l;e[10]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(it,{path:"/automation/sessions/:sessionId",element:m.jsx(b2,{})}),e[10]=l):l=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=m.jsx(it,{path:"/mac-resources",element:m.jsx(w2,{})}),e[11]=f):f=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(it,{path:"/settings/default",element:m.jsx(_2,{})}),e[12]=p):p=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=m.jsx(it,{path:"/settings/team",element:m.jsx(x2,{})}),e[13]=y):y=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=m.jsxs(it,{element:s,children:[i,a,c,u,d,l,f,p,y,m.jsx(it,{path:"/settings/tokens",element:m.jsx(S2,{})})]}),e[14]=g):g=e[14];let w;return e[15]===Symbol.for("react.memo_cache_sentinel")?(w=m.jsx(cm,{client:k2,children:m.jsxs(qp,{children:[m.jsxs(Qp,{children:[t,n,r,o,g,m.jsx(it,{path:"*",element:zo(m.jsx(E2,{}))})]}),m.jsx(Qg,{position:"bottom-right",richColors:!0})]})}),e[15]=w):w=e[15],w}Kp.createRoot(document.getElementById("root")).render(m.jsx(h.StrictMode,{children:m.jsx(em,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,children:m.jsx(O2,{})})}));export{I2 as $,tt as A,fs as B,Tp as C,gt as D,vu as E,ti as F,Ke as G,A2 as H,es as I,rk as J,Ub as K,Ji as L,Zb as M,Sf as N,og as O,yk as P,Vc as Q,wh as R,ts as S,Vb as T,ck as U,ik as V,sk as W,ok as X,R0 as Y,tk as Z,gk as _,S_ as a,_a as a$,nk as a0,ak as a1,ce as a2,ug as a3,lg as a4,Pe as a5,Ze as a6,Ku as a7,sn as a8,nn as a9,X2 as aA,Ew as aB,Uf as aC,Ow as aD,_n as aE,pk as aF,Ly as aG,O0 as aH,ka as aI,mk as aJ,q2 as aK,DC as aL,G2 as aM,oo as aN,ob as aO,D2 as aP,ab as aQ,Kd as aR,qd as aS,Qd as aT,Wd as aU,hb as aV,lf as aW,ba as aX,gs as aY,Ud as aZ,hs as a_,ct as aa,Ra as ab,an as ac,ue as ad,Q2 as ae,z0 as af,Y2 as ag,xr as ah,rf as ai,io as aj,W0 as ak,lk as al,wg as am,H2 as an,V2 as ao,U2 as ap,W2 as aq,B2 as ar,Z2 as as,dk as at,L2 as au,uk as av,fk as aw,sg as ax,fg as ay,J2 as az,na as b,xd as b0,ha as b1,tn as b2,df as b3,kb as b4,cf as b5,rg as b6,N2 as b7,Jo as c,Ip as d,Ap as e,Dp as f,vk as g,s2 as h,ac as i,i2 as j,C0 as k,t_ as l,Np as m,hk as n,PC as o,$0 as p,ns as q,ek as r,Wl as s,ro as t,v_ as u,K2 as v,Ns as w,Hr as x,Im as y,ds as z};