@open-mercato/cezar 0.9.2 → 0.10.0-pr892.1298

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 (269) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +169 -38
  3. package/dist/agent-config/account-identity.d.ts +44 -0
  4. package/dist/agent-config/account-identity.js +128 -0
  5. package/dist/agent-config/account-identity.js.map +1 -0
  6. package/dist/agent-config/catalog.d.ts +8 -0
  7. package/dist/agent-config/catalog.js +18 -0
  8. package/dist/agent-config/catalog.js.map +1 -1
  9. package/dist/agent-config/model-settings/claude.d.ts +2 -0
  10. package/dist/agent-config/model-settings/claude.js +11 -0
  11. package/dist/agent-config/model-settings/claude.js.map +1 -0
  12. package/dist/agent-config/model-settings/codex.d.ts +2 -0
  13. package/dist/agent-config/model-settings/codex.js +16 -0
  14. package/dist/agent-config/model-settings/codex.js.map +1 -0
  15. package/dist/agent-config/model-settings/opencode.d.ts +2 -0
  16. package/dist/agent-config/model-settings/opencode.js +8 -0
  17. package/dist/agent-config/model-settings/opencode.js.map +1 -0
  18. package/dist/agent-config/model-settings/pi.d.ts +12 -0
  19. package/dist/agent-config/model-settings/pi.js +18 -0
  20. package/dist/agent-config/model-settings/pi.js.map +1 -0
  21. package/dist/agent-config/model-settings/shared.d.ts +9 -0
  22. package/dist/agent-config/model-settings/shared.js +93 -0
  23. package/dist/agent-config/model-settings/shared.js.map +1 -0
  24. package/dist/agent-config/model-settings/types.d.ts +9 -0
  25. package/dist/agent-config/model-settings/types.js +2 -0
  26. package/dist/agent-config/model-settings/types.js.map +1 -0
  27. package/dist/agent-config/models.d.ts +9 -0
  28. package/dist/agent-config/models.js +32 -0
  29. package/dist/agent-config/models.js.map +1 -0
  30. package/dist/agent-config/service.js +4 -4
  31. package/dist/agent-config/service.js.map +1 -1
  32. package/dist/automations/types.d.ts +4 -0
  33. package/dist/automations/types.js +2 -1
  34. package/dist/automations/types.js.map +1 -1
  35. package/dist/config.d.ts +10 -1
  36. package/dist/config.js +48 -5
  37. package/dist/config.js.map +1 -1
  38. package/dist/contract/agent-config.d.ts +2 -0
  39. package/dist/contract/agent-profiles.d.ts +347 -0
  40. package/dist/contract/automations.d.ts +24 -0
  41. package/dist/contract/events.d.ts +59 -0
  42. package/dist/contract/github.d.ts +88 -0
  43. package/dist/contract/health.d.ts +7 -1
  44. package/dist/contract/index.d.ts +1 -0
  45. package/dist/contract/index.js +1005 -555
  46. package/dist/contract/projects.d.ts +33 -5
  47. package/dist/contract/runs.d.ts +247 -0
  48. package/dist/contract/skills.d.ts +7 -0
  49. package/dist/contract/workflows.d.ts +6 -0
  50. package/dist/contract/workspace.d.ts +137 -2
  51. package/dist/core/agent-env.js +41 -16
  52. package/dist/core/agent-env.js.map +1 -1
  53. package/dist/core/agent-model-policy.d.ts +10 -0
  54. package/dist/core/agent-model-policy.js +36 -0
  55. package/dist/core/agent-model-policy.js.map +1 -0
  56. package/dist/core/agent-profiles.d.ts +62 -0
  57. package/dist/core/agent-profiles.js +90 -0
  58. package/dist/core/agent-profiles.js.map +1 -0
  59. package/dist/core/agent-runner.d.ts +37 -6
  60. package/dist/core/agent-runner.js +35 -3
  61. package/dist/core/agent-runner.js.map +1 -1
  62. package/dist/core/backend-detect.d.ts +5 -5
  63. package/dist/core/backend-detect.js +44 -7
  64. package/dist/core/backend-detect.js.map +1 -1
  65. package/dist/core/claude-cli-runner.js +10 -5
  66. package/dist/core/claude-cli-runner.js.map +1 -1
  67. package/dist/core/codex-app-server-runner.js +13 -3
  68. package/dist/core/codex-app-server-runner.js.map +1 -1
  69. package/dist/core/codex-app-server-transport.js +7 -2
  70. package/dist/core/codex-app-server-transport.js.map +1 -1
  71. package/dist/core/model-identity.d.ts +23 -11
  72. package/dist/core/model-identity.js +41 -24
  73. package/dist/core/model-identity.js.map +1 -1
  74. package/dist/core/model-presets.d.ts +8 -2
  75. package/dist/core/model-presets.js +51 -8
  76. package/dist/core/model-presets.js.map +1 -1
  77. package/dist/core/opencode-model-catalog.d.ts +32 -0
  78. package/dist/core/opencode-model-catalog.js +153 -0
  79. package/dist/core/opencode-model-catalog.js.map +1 -0
  80. package/dist/core/opencode-server-runner.d.ts +2 -0
  81. package/dist/core/opencode-server-runner.js +42 -11
  82. package/dist/core/opencode-server-runner.js.map +1 -1
  83. package/dist/core/pi-runner.d.ts +24 -0
  84. package/dist/core/pi-runner.js +349 -0
  85. package/dist/core/pi-runner.js.map +1 -0
  86. package/dist/core/pi-ui-mapper.d.ts +34 -0
  87. package/dist/core/pi-ui-mapper.js +270 -0
  88. package/dist/core/pi-ui-mapper.js.map +1 -0
  89. package/dist/core/provider-auth.d.ts +95 -3
  90. package/dist/core/provider-auth.js +234 -15
  91. package/dist/core/provider-auth.js.map +1 -1
  92. package/dist/core/provider-availability.d.ts +1 -1
  93. package/dist/core/provider-availability.js +2 -1
  94. package/dist/core/provider-availability.js.map +1 -1
  95. package/dist/core/runner-factory.js +3 -0
  96. package/dist/core/runner-factory.js.map +1 -1
  97. package/dist/core/shell-env.d.ts +28 -0
  98. package/dist/core/shell-env.js +56 -0
  99. package/dist/core/shell-env.js.map +1 -0
  100. package/dist/core/ui-events.d.ts +1 -1
  101. package/dist/core/usage-limit.d.ts +42 -0
  102. package/dist/core/usage-limit.js +209 -0
  103. package/dist/core/usage-limit.js.map +1 -0
  104. package/dist/git-diff-base.d.ts +51 -26
  105. package/dist/git-diff-base.js +163 -37
  106. package/dist/git-diff-base.js.map +1 -1
  107. package/dist/git-worktree.d.ts +15 -6
  108. package/dist/git-worktree.js +10 -3
  109. package/dist/git-worktree.js.map +1 -1
  110. package/dist/index.js +3 -2
  111. package/dist/index.js.map +1 -1
  112. package/dist/paths.d.ts +53 -5
  113. package/dist/paths.js +63 -9
  114. package/dist/paths.js.map +1 -1
  115. package/dist/planner.js +6 -0
  116. package/dist/planner.js.map +1 -1
  117. package/dist/release/snapshot.d.ts +13 -2
  118. package/dist/release/snapshot.js +25 -1
  119. package/dist/release/snapshot.js.map +1 -1
  120. package/dist/runs/agent-tmpdir.d.ts +41 -0
  121. package/dist/runs/agent-tmpdir.js +183 -0
  122. package/dist/runs/agent-tmpdir.js.map +1 -0
  123. package/dist/runs/auto-name.js +6 -1
  124. package/dist/runs/auto-name.js.map +1 -1
  125. package/dist/runs/event-history.d.ts +50 -0
  126. package/dist/runs/event-history.js +613 -0
  127. package/dist/runs/event-history.js.map +1 -0
  128. package/dist/runs/run-index.d.ts +19 -0
  129. package/dist/runs/run-index.js +43 -0
  130. package/dist/runs/run-index.js.map +1 -0
  131. package/dist/runs/store.d.ts +78 -19
  132. package/dist/runs/store.js +175 -43
  133. package/dist/runs/store.js.map +1 -1
  134. package/dist/server/capabilities.d.ts +15 -1
  135. package/dist/server/capabilities.js +16 -1
  136. package/dist/server/capabilities.js.map +1 -1
  137. package/dist/server/forge/github.d.ts +169 -0
  138. package/dist/server/forge/github.js +511 -0
  139. package/dist/server/forge/github.js.map +1 -1
  140. package/dist/server/forge/index.d.ts +9 -0
  141. package/dist/server/forge/index.js +14 -0
  142. package/dist/server/forge/index.js.map +1 -1
  143. package/dist/server/git-changes.d.ts +7 -5
  144. package/dist/server/git-changes.js +15 -10
  145. package/dist/server/git-changes.js.map +1 -1
  146. package/dist/server/github.d.ts +2 -2
  147. package/dist/server/github.js +1 -1
  148. package/dist/server/github.js.map +1 -1
  149. package/dist/server/open-in-app.d.ts +2 -1
  150. package/dist/server/open-in-app.js +3 -1
  151. package/dist/server/open-in-app.js.map +1 -1
  152. package/dist/server/open-in-terminal.d.ts +46 -1
  153. package/dist/server/open-in-terminal.js +72 -13
  154. package/dist/server/open-in-terminal.js.map +1 -1
  155. package/dist/server/provider-action-gate.js +3 -1
  156. package/dist/server/provider-action-gate.js.map +1 -1
  157. package/dist/server/server.d.ts +2206 -434
  158. package/dist/server/server.js +1219 -136
  159. package/dist/server/server.js.map +1 -1
  160. package/dist/server-install/engine.js +5 -18
  161. package/dist/server-install/engine.js.map +1 -1
  162. package/dist/server-install/steps.js +6 -2
  163. package/dist/server-install/steps.js.map +1 -1
  164. package/dist/skills.js +4 -0
  165. package/dist/skills.js.map +1 -1
  166. package/dist/workflows/run.d.ts +229 -9
  167. package/dist/workflows/run.js +877 -147
  168. package/dist/workflows/run.js.map +1 -1
  169. package/dist/workflows/types.d.ts +3 -0
  170. package/dist/workflows/types.js +11 -2
  171. package/dist/workflows/types.js.map +1 -1
  172. package/dist/workspace/agent-accounts.d.ts +153 -0
  173. package/dist/workspace/agent-accounts.js +304 -0
  174. package/dist/workspace/agent-accounts.js.map +1 -0
  175. package/dist/workspace/agent-profiles.d.ts +78 -0
  176. package/dist/workspace/agent-profiles.js +115 -0
  177. package/dist/workspace/agent-profiles.js.map +1 -0
  178. package/dist/workspace/config.d.ts +27 -1
  179. package/dist/workspace/config.js +83 -2
  180. package/dist/workspace/config.js.map +1 -1
  181. package/dist/workspace/projects-cli.js +54 -4
  182. package/dist/workspace/projects-cli.js.map +1 -1
  183. package/dist/workspace/projects.d.ts +19 -1
  184. package/dist/workspace/projects.js +34 -1
  185. package/dist/workspace/projects.js.map +1 -1
  186. package/dist/workspace/semaphore.d.ts +46 -1
  187. package/dist/workspace/semaphore.js +41 -4
  188. package/dist/workspace/semaphore.js.map +1 -1
  189. package/dist/workspace/ui-state.d.ts +3 -2
  190. package/dist/workspace/ui-state.js +3 -2
  191. package/dist/workspace/ui-state.js.map +1 -1
  192. package/package.json +3 -3
  193. package/scripts/mock-claude.mjs +20 -0
  194. package/scripts/mock-pi-rpc.mjs +83 -0
  195. package/web/dist/assets/{alert-dialog-ghffK6g9.js → alert-dialog-Byp42_IG.js} +1 -1
  196. package/web/dist/assets/arrow-down-CGDbDYKD.js +1 -0
  197. package/web/dist/assets/arrow-left-ESCjr1Hq.js +1 -0
  198. package/web/dist/assets/centered-state-LfAW-igm.js +43 -0
  199. package/web/dist/assets/chevron-right-Du-P1IUd.js +1 -0
  200. package/web/dist/assets/{collapsible-B0JVzd0B.js → collapsible-CBiiqDJM.js} +1 -1
  201. package/web/dist/assets/{commit-list-wm6DPHNs.js → commit-list-6PPve7PE.js} +1 -1
  202. package/web/dist/assets/{compare-variants-DbdP4Y5T.js → compare-variants-BDnp6mXJ.js} +1 -1
  203. package/web/dist/assets/{diff-Bizc96qe.js → diff-_jK0OWpF.js} +2 -2
  204. package/web/dist/assets/{diff-stat-Dyfg3ltF.js → diff-stat-CIrTu4Ym.js} +1 -1
  205. package/web/dist/assets/{diff-view-CG8ek6tC.js → diff-view-COA_5IyY.js} +1 -1
  206. package/web/dist/assets/dropdown-menu-BofYpFFw.js +1 -0
  207. package/web/dist/assets/editable-title-_J0zFDl-.js +1 -0
  208. package/web/dist/assets/{ellipsis-vertical-DpGTRqC2.js → ellipsis-vertical-BeMR-l62.js} +1 -1
  209. package/web/dist/assets/{file-DlUGpUlb.js → file-DY996Pee.js} +1 -1
  210. package/web/dist/assets/{folder-BAY6Vddy.js → folder-NO3Ec-TY.js} +1 -1
  211. package/web/dist/assets/git-toolbar-BqJeUWcD.js +1 -0
  212. package/web/dist/assets/github-C96HPV9E.js +1 -0
  213. package/web/dist/assets/{image-preview-BWGk5fPX.js → image-preview-D9cCDfKQ.js} +1 -1
  214. package/web/dist/assets/index-Bx-grqa9.css +2 -0
  215. package/web/dist/assets/index-DoVvGDfW.js +7 -0
  216. package/web/dist/assets/{markdown-BGBOGCA_.js → markdown-DDzk11zj.js} +1 -1
  217. package/web/dist/assets/new-task-form-BNLLgC6P.js +1 -0
  218. package/web/dist/assets/pill-CVM1EmV4.js +1 -0
  219. package/web/dist/assets/{project-router-Cx8NPoqn.js → project-router-LRCtP48W.js} +1 -1
  220. package/web/dist/assets/prompt-templates-DFOvYgtW.js +15 -0
  221. package/web/dist/assets/{refresh-cw-BoGdAykg.js → refresh-cw-D1ys6QY2.js} +1 -1
  222. package/web/dist/assets/repo-git-CzUnsgWY.js +1 -0
  223. package/web/dist/assets/{run-diff-EcOkf3ti.js → run-diff-BlnqwfSS.js} +2 -2
  224. package/web/dist/assets/run-header-Bn7cN0Z1.js +1 -0
  225. package/web/dist/assets/{search-x-X3EpVhgs.js → search-x-D6FSpxId.js} +1 -1
  226. package/web/dist/assets/{skill-empty-hint-CZLALx6l.js → skill-empty-hint-iwpCcqgI.js} +1 -1
  227. package/web/dist/assets/skills-CezbOaol.js +1 -0
  228. package/web/dist/assets/{sparkles-Dt4q7pbG.js → sparkles-MrQrgCI9.js} +1 -1
  229. package/web/dist/assets/{square-terminal-hwBL8XsC.js → square-terminal-TTH64lO7.js} +1 -1
  230. package/web/dist/assets/tab-link-FYksz037.js +1 -0
  231. package/web/dist/assets/task-changes-ClWlnzBL.js +1 -0
  232. package/web/dist/assets/{task-commits-BTTA5k5T.js → task-commits-Crbrl86b.js} +1 -1
  233. package/web/dist/assets/{task-files-Da8_4C9g.js → task-files-uSCWyD0-.js} +2 -2
  234. package/web/dist/assets/task-thread-DPmamBA1.js +9 -0
  235. package/web/dist/assets/{textarea-CUdokhkv.js → textarea-B9Ahj4E4.js} +1 -1
  236. package/web/dist/assets/thread-loading-BH_ypQoy.js +1 -0
  237. package/web/dist/assets/{trash-2-DhVIdWv8.js → trash-2-D8S3V3fu.js} +1 -1
  238. package/web/dist/assets/{triangle-alert-XYT0DGCI.js → triangle-alert-bB7p9n5E.js} +1 -1
  239. package/web/dist/assets/{upload-BKjN59-1.js → upload-Bd5oRLPV.js} +1 -1
  240. package/web/dist/assets/{use-desktop-Bf5LS_P4.js → use-desktop-BNvbRBeZ.js} +1 -1
  241. package/web/dist/assets/{use-submit-shortcut-CzVyoAMd.js → use-submit-shortcut-B-xhu4Bf.js} +1 -1
  242. package/web/dist/assets/utils-BhpbVMwN.js +64 -0
  243. package/web/dist/assets/{workflows-o2QU_pvU.js → workflows-RmfbM9Vy.js} +3 -3
  244. package/web/dist/assets/{zoomable-image-7WyUiaVD.js → zoomable-image-BCW6ZBV0.js} +1 -1
  245. package/web/dist/index.html +24 -23
  246. package/web/dist/assets/arrow-down-Cz8qb71e.js +0 -1
  247. package/web/dist/assets/arrow-left-wcYKQXI_.js +0 -1
  248. package/web/dist/assets/centered-state-ZtnFHA-n.js +0 -43
  249. package/web/dist/assets/chevron-right-G4caF2QV.js +0 -1
  250. package/web/dist/assets/circle-check--KvBxXWp.js +0 -1
  251. package/web/dist/assets/circle-x-C3EFZ3xf.js +0 -1
  252. package/web/dist/assets/dropdown-menu-C1Dlf35P.js +0 -1
  253. package/web/dist/assets/editable-title-5rC_QRBZ.js +0 -1
  254. package/web/dist/assets/git-pull-request-agOG0iGM.js +0 -1
  255. package/web/dist/assets/git-toolbar-DGiNMmtY.js +0 -1
  256. package/web/dist/assets/github-Vp7lxYGQ.js +0 -1
  257. package/web/dist/assets/index-DSxyJpuK.css +0 -2
  258. package/web/dist/assets/index-DiawI6RX.js +0 -6
  259. package/web/dist/assets/new-task-form-BpAw_Dks.js +0 -1
  260. package/web/dist/assets/pill-Dvs-P0xy.js +0 -1
  261. package/web/dist/assets/prompt-templates-CSBYBR1I.js +0 -15
  262. package/web/dist/assets/repo-git-PmX-BNMo.js +0 -1
  263. package/web/dist/assets/run-header-BGiv6_qX.js +0 -1
  264. package/web/dist/assets/skills-CC91ouGH.js +0 -1
  265. package/web/dist/assets/tab-link-DIlR5T07.js +0 -1
  266. package/web/dist/assets/task-changes-XkHDxzQA.js +0 -1
  267. package/web/dist/assets/task-thread-DoNXUsHr.js +0 -9
  268. package/web/dist/assets/thread-loading-B8q8ukXJ.js +0 -1
  269. package/web/dist/assets/utils-DsLuRXwV.js +0 -64
@@ -1,43 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{a as i,c as a,d as o,i as s,o as c,r as l,s as u,t as d}from"./utils-DsLuRXwV.js";import{i as f,r as p}from"./bundle-mjs-BT31bpU6.js";var m=/^[\w!#$%&'*.^`|~+-]+$/,h=(e,t,n={})=>{if(!m.test(e))throw Error(`Invalid cookie name`);let r=`${e}=${t}`;if(e.startsWith(`__Secure-`)&&!n.secure)throw Error(`__Secure- Cookie must have Secure attributes`);if(e.startsWith(`__Host-`)){if(!n.secure)throw Error(`__Host- Cookie must have Secure attributes`);if(n.path!==`/`)throw Error(`__Host- Cookie must have Path attributes with "/"`);if(n.domain)throw Error(`__Host- Cookie must not have Domain attributes`)}for(let e of[`domain`,`path`,`sameSite`,`priority`])if(n[e]&&/[;\r\n]/.test(n[e]))throw Error(`${e} must not contain ";", "\\r", or "\\n"`);if(n&&typeof n.maxAge==`number`&&n.maxAge>=0){if(n.maxAge>3456e4)throw Error(`Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.`);r+=`; Max-Age=${n.maxAge|0}`}if(n.domain&&n.prefix!==`host`&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw Error(`Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.`);r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+=`; HttpOnly`),n.secure&&(r+=`; Secure`),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.priority&&(r+=`; Priority=${n.priority.charAt(0).toUpperCase()+n.priority.slice(1)}`),n.partitioned){if(!n.secure)throw Error(`Partitioned Cookie must have Secure attributes`);r+=`; Partitioned`}return r},g=(e,t,n)=>(t=encodeURIComponent(t),h(e,t,n)),_=(e,t)=>(e=e.replace(/\/+$/,``),e+=`/`,t=t.replace(/^\/+/,``),e+t),v=(e,t)=>{for(let[n,r]of Object.entries(t)){let t=RegExp(`/:`+n+`(?:{[^/]+})?\\??`);e=e.replace(t,r?`/${r}`:``)}return e},y=e=>{let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.set(n,r);return t},b=(e,t)=>{switch(t){case`ws`:return e.replace(/^http/,`ws`);case`http`:return e.replace(/^ws/,`http`)}},x=e=>/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e)?e.replace(/\/index(?=\?|$)/,`/`):e.replace(/\/index(?=\?|$)/,``);function S(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function C(e,t){if(!S(e)&&!S(t))return t;let n={...e};for(let e in t){let r=t[e];S(n[e])&&S(r)?n[e]=C(n[e],r):n[e]=r}return n}var w=(e,t)=>new Proxy(()=>{},{get(n,r){if(!(typeof r!=`string`||r===`then`))return w(e,[...t,r])},apply(n,r,i){return e({path:t,args:i})}}),ee=class{url;method;buildSearchParams;queryParams=void 0;pathParams={};rBody;cType=void 0;constructor(e,t,n){this.url=e,this.method=t,this.buildSearchParams=n.buildSearchParams}fetch=async(e,t)=>{if(e){if(e.query&&(this.queryParams=this.buildSearchParams(e.query)),e.form){let t=new FormData;for(let[n,r]of Object.entries(e.form))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.append(n,r);this.rBody=t}e.json&&(this.rBody=JSON.stringify(e.json),this.cType=`application/json`),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase(),r={...e?.header,...typeof t?.headers==`function`?await t.headers():t?.headers};if(e?.cookie){let t=[];for(let[n,r]of Object.entries(e.cookie))t.push(g(n,r,{path:`/`}));r.Cookie=t.join(`,`)}this.cType&&(r[`Content-Type`]=this.cType);let i=new Headers(r??void 0),a=this.url;a=x(a),a=v(a,this.pathParams),this.queryParams&&(a=a+`?`+this.queryParams.toString()),n=this.method.toUpperCase();let o=!(n===`GET`||n===`HEAD`);return(t?.fetch||fetch)(a,{body:o?this.rBody:void 0,method:n,headers:i,...t?.init})}},te=(e,t)=>w(function n(r){let i=t?.buildSearchParams??y,a=[...r.path],o=a.slice(-3).reverse();if(o[0]===`toString`)return o[1]===`name`?o[2]||``:n.toString();if(o[0]===`valueOf`)return o[1]===`name`?o[2]||``:n;let s=``;if(/^\$/.test(o[0])){let e=a.pop();e&&(s=e.replace(/^\$/,``))}let c=_(e,a.join(`/`));if(s===`url`||s===`path`){let t=c;return r.args[0]&&(r.args[0].param&&(t=v(c,r.args[0].param)),r.args[0].query&&(t=t+`?`+i(r.args[0].query).toString())),t=x(t),s===`url`?new URL(t):t.slice(e.replace(/\/+$/,``).length).replace(/^\/?/,`/`)}if(s===`ws`){let e=b(r.args[0]&&r.args[0].param?v(c,r.args[0].param):c,`ws`),n=new URL(e),i=r.args[0]?.query;return i&&Object.entries(i).forEach(([e,t])=>{Array.isArray(t)?t.forEach(t=>n.searchParams.append(e,t)):n.searchParams.set(e,t)}),((...e)=>t?.webSocket!==void 0&&typeof t.webSocket==`function`?t.webSocket(...e):new WebSocket(...e))(n.toString())}let l=new ee(c,s,{buildSearchParams:i});if(s){t??={};let e={...r.args[1]},n=t.headers,i=e.headers;n&&i&&(e.headers=async()=>({...typeof n==`function`?await n():n,...typeof i==`function`?await i():i}));let a=C(t,e);return l.fetch(r.args[0],a)}return l},[]);function ne(e={}){let{baseUrl:t=``,token:n,headers:r,fetch:i}=e;return te(t,{headers:{...n?{Authorization:`Bearer ${n}`}:{},...r},...i?{fetch:i}:{}})}var T=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(){}},re=new class extends T{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},ie={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},E=new class{#e=ie;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function ae(e){setTimeout(e,0)}var oe=typeof window>`u`||`Deno`in globalThis;function D(){}function se(e,t){return typeof e==`function`?e(t):e}function ce(e){return typeof e==`number`&&e>=0&&e!==1/0}function le(e,t){return Math.max(e+(t||0)-Date.now(),0)}function O(e,t){return typeof e==`function`?e(t):e}function k(e,t){return typeof e==`function`?e(t):e}function ue(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==fe(o,t.options))return!1}else if(!pe(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function de(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(A(t.options.mutationKey)!==A(a))return!1}else if(!pe(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function fe(e,t){return(t?.queryKeyHashFn||A)(e)}function A(e){return JSON.stringify(e,(e,t)=>ve(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function pe(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>pe(e[n],t[n])):!1}var me=Object.prototype.hasOwnProperty;function he(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=_e(e)&&_e(t);if(!r&&!(ve(e)&&ve(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:me.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=he(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function ge(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function _e(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ve(e){if(!ye(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ye(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ye(e){return Object.prototype.toString.call(e)===`[object Object]`}function be(e){return new Promise(t=>{E.setTimeout(t,e)})}function xe(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:he(e,t)}function Se(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ce(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var we=Symbol();function Te(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===we?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ee(e,t){return typeof e==`function`?e(...t):!!e}function De(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Oe=(()=>{let e=()=>oe;return{isServer(){return e()},setIsServer(t){e=t}}})();function ke(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Ae=ae;function je(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Ae,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var j=je(),Me=new class extends T{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Ne(e){return Math.min(1e3*2**e,3e4)}function Pe(e){return(e??`online`)!==`online`||Me.isOnline()}var Fe=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Ie(e){let t=!1,n=0,r,i=ke(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Fe(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>re.isFocused()&&(e.networkMode===`always`||Me.isOnline())&&e.canRun(),u=()=>Pe(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Oe.isServer()?0:3),o=e.retryDelay??Ne,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),be(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Le=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ce(this.gcTime)&&(this.#e=E.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Oe.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(E.clearTimeout(this.#e),this.#e=void 0)}};function Re(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{De(e,()=>t.signal,()=>n=!0)},u=Te(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Ce:Se;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Be:ze,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:ze(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function ze(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Be(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Ve=class extends Le{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=We(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=We(this.options);e.data!==void 0&&(this.setState(Ue(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=xe(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(D).catch(D):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>k(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===we||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>O(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!le(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Te(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Re(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Ie({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Fe&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Fe){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...He(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ue(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),j.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function He(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Pe(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ue(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function We(e){let 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 Ge=class extends T{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=ke(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),qe(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Je(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Je(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof k(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!ge(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Ye(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||k(this.options.enabled,this.#t)!==k(t.enabled,this.#t)||O(this.options.staleTime,this.#t)!==O(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||k(this.options.enabled,this.#t)!==k(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Ze(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(D)),t}#g(){this.#b();let e=O(this.options.staleTime,this.#t);if(Oe.isServer()||this.#r.isStale||!ce(e))return;let t=le(this.#r.dataUpdatedAt,e)+1;this.#d=E.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(Oe.isServer()||k(this.options.enabled,this.#t)===!1||!ce(this.#p)||this.#p===0)&&(this.#f=E.setInterval(()=>{(this.options.refetchIntervalInBackground||re.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(E.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(E.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&qe(e,t),o=i&&Ye(e,n,t,r);(a||o)&&(l={...l,...He(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=xe(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=xe(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Xe(e,t),refetch:this.refetch,promise:this.#o,isEnabled:k(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=ke();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!ge(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){j.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Ke(e,t){return k(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&k(t.retryOnMount,e)===!1)}function qe(e,t){return Ke(e,t)||e.state.data!==void 0&&Je(e,t,t.refetchOnMount)}function Je(e,t,n){if(k(t.enabled,e)!==!1&&O(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Xe(e,t)}return!1}function Ye(e,t,n,r){return(e!==t||k(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Xe(e,n)}function Xe(e,t){return k(t.enabled,e)!==!1&&e.isStaleByTime(O(t.staleTime,e))}function Ze(e,t){return!ge(e.getCurrentResult(),t)}var Qe=class extends Le{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||$e(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Ie({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),j.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function $e(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var et=class extends T{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),ge(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&A(t.mutationKey)!==A(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??$e();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){j.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},M=e(t(),1),N=r(),tt=M.createContext(void 0),P=e=>{let t=M.useContext(tt);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},nt=({client:e,children:t})=>(M.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,N.jsx)(tt.Provider,{value:e,children:t})),rt=M.createContext(!1),it=()=>M.useContext(rt);rt.Provider;function at(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ot=M.createContext(at()),st=()=>M.useContext(ot),ct=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Ee(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},lt=e=>{M.useEffect(()=>{e.clearReset()},[e])},ut=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Ee(n,[e.error,r])),dt=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},ft=(e,t)=>e.isLoading&&e.isFetching&&!t,pt=(e,t)=>e?.suspense&&t.isPending,mt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ht(e,t,n){let r=it(),i=st(),a=P(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,dt(o),ct(o,i,s),lt(i);let l=!a.getQueryCache().get(o.queryHash),[u]=M.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(M.useSyncExternalStore(M.useCallback(e=>{let t=f?u.subscribe(j.batchCalls(e)):D;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),M.useEffect(()=>{u.setOptions(o)},[o,u]),pt(o,d))throw mt(o,u,i);if(ut({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!Oe.isServer()&&ft(d,r)&&(l?mt(o,u,i):s?.promise)?.catch(D).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function F(e,t){return ht(e,Ge,t)}function I(e,t){let n=P(t),[r]=M.useState(()=>new et(n,e));M.useEffect(()=>{r.setOptions(e)},[r,e]);let i=M.useSyncExternalStore(M.useCallback(e=>r.subscribe(j.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=M.useCallback((e,t)=>{r.mutate(e,t).catch(D)},[r]);if(i.error&&Ee(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var gt=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,_t=/^[\\/]{2}/;function vt(e,t){return t+e.replace(/\\/g,`/`)}var yt=`popstate`;function bt(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function xt(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return wt(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:Tt(t)}return Dt(t,n,null,e)}function L(e,t){if(e===!1||e==null)throw Error(t)}function R(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function St(){return Math.random().toString(36).substring(2,10)}function Ct(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function wt(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Et(t):t,state:n,key:t&&t.key||r||St(),mask:i}}function Tt({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Et(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Dt(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=bt(e)?e:wt(h.location,e,t);n&&n(r,e),l=u()+1;let d=Ct(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=bt(e)?e:wt(h.location,e,t);n&&n(r,e),l=u();let i=Ct(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Ot(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(yt,d),c=e,()=>{i.removeEventListener(yt,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Ot(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),L(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:Tt(t);return i=i.replace(/ $/,`%20`),!n&&_t.test(i)&&(i=r+i),new URL(i,r)}function kt(e,t,n=`/`){return At(e,t,n,!1)}function At(e,t,n,r,i){let a=z((typeof t==`string`?Et(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Mt(e),s=null,c=Yt(a);for(let e=0;s==null&&e<o.length;++e)s=Gt(o[e],c,r);return s}function jt(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function Mt(e){let t=Nt(e);return Ft(t),t}function Nt(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;L(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=B([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(L(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Nt(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Ut(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Jt(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Pt(e.path))a(e,t,!0,n)}),t}function Pt(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Pt(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Ft(e){e.sort((e,t)=>e.score===t.score?Wt(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var It=/^:[\w-]+$/,Lt=3,Rt=2,zt=1,Bt=10,Vt=-2,Ht=e=>e===`*`;function Ut(e,t){let n=e.split(`/`),r=n.length;return n.some(Ht)&&(r+=Vt),t&&(r+=Rt),n.filter(e=>!Ht(e)).reduce((e,t)=>e+(It.test(t)?Lt:t===``?zt:Bt),r)}function Wt(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Gt(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?qt(u,l,s.matcher,s.compiledParams):Kt(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Kt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:B([a,d.pathname]),pathnameBase:an(B([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=B([a,d.pathnameBase]))}return o}function Kt(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Jt(e.path,e.caseSensitive,e.end);return qt(e,t,n,r)}function qt(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Jt(e,t=!1,n=!0){R(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Yt(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return R(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function z(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Xt(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Et(e):e,a;return n?(n=nn(n),a=n.startsWith(`/`)?Zt(n.substring(1),`/`):Zt(n,t)):a=t,{pathname:a,search:on(r),hash:sn(i)}}function Zt(e,t){let n=rn(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Qt(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function $t(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function en(e){let t=$t(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function tn(e,t,n,r=!1){let i;typeof e==`string`?i=Et(e):(i={...e},L(!i.pathname||!i.pathname.includes(`?`),Qt(`?`,`pathname`,`search`,i)),L(!i.pathname||!i.pathname.includes(`#`),Qt(`#`,`pathname`,`hash`,i)),L(!i.search||!i.search.includes(`#`),Qt(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Xt(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var nn=e=>e.replace(/[\\/]{2,}/g,`/`),B=e=>nn(e.join(`/`)),rn=e=>e.replace(/\/+$/,``),an=e=>rn(e).replace(/^\/*/,`/`),on=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,sn=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,cn=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ln(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function un(e){return B(e.map(e=>e.route.path).filter(Boolean))||`/`}var dn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function fn(e,t){let n=e;if(typeof n!=`string`||!gt.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(dn)try{let e=new URL(window.location.href),r=_t.test(n)?new URL(vt(n,e.protocol)):new URL(n),a=z(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{R(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var pn=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(pn);var mn=[`GET`,...pn];new Set(mn);var hn=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function gn(e){try{return hn.includes(new URL(e).protocol)}catch{return!1}}var V=M.createContext(null);V.displayName=`DataRouter`;var _n=M.createContext(null);_n.displayName=`DataRouterState`;var vn=M.createContext(!1);function yn(){return M.useContext(vn)}var bn=M.createContext({isTransitioning:!1});bn.displayName=`ViewTransition`;var xn=M.createContext(new Map);xn.displayName=`Fetchers`;var Sn=M.createContext(null);Sn.displayName=`Await`;var H=M.createContext(null);H.displayName=`Navigation`;var Cn=M.createContext(null);Cn.displayName=`Location`;var U=M.createContext({outlet:null,matches:[],isDataRoute:!1});U.displayName=`Route`;var wn=M.createContext(null);wn.displayName=`RouteError`;var Tn=`REACT_ROUTER_ERROR`,En=`REDIRECT`,Dn=`ROUTE_ERROR_RESPONSE`;function On(e){if(e.startsWith(`${Tn}:${En}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function kn(e){if(e.startsWith(`${Tn}:${Dn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new cn(t.status,t.statusText,t.data)}catch{}}function An(e,{relative:t}={}){L(jn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=M.useContext(H),{hash:i,pathname:a,search:o}=zn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:B([n,a])),r.createHref({pathname:s,search:o,hash:i})}function jn(){return M.useContext(Cn)!=null}function W(){return L(jn(),`useLocation() may be used only in the context of a <Router> component.`),M.useContext(Cn).location}var Mn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Nn(e){M.useContext(H).static||M.useLayoutEffect(e)}function Pn(){let{isDataRoute:e}=M.useContext(U);return e?ir():Fn()}function Fn(){L(jn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=M.useContext(V),{basename:t,navigator:n}=M.useContext(H),{matches:r}=M.useContext(U),{pathname:i}=W(),a=JSON.stringify(en(r)),o=M.useRef(!1);return Nn(()=>{o.current=!0}),M.useCallback((r,s={})=>{if(R(o.current,Mn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=tn(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:B([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var In=M.createContext(null);function Ln(e){let t=M.useContext(U).outlet;return M.useMemo(()=>t&&M.createElement(In.Provider,{value:e},t),[t,e])}function Rn(){let{matches:e}=M.useContext(U);return e[e.length-1]?.params??{}}function zn(e,{relative:t}={}){let{matches:n}=M.useContext(U),{pathname:r}=W(),i=JSON.stringify(en(n));return M.useMemo(()=>tn(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Bn(e,t){return Vn(e,t)}function Vn(e,t,n){L(jn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=M.useContext(H),{matches:i}=M.useContext(U),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;or(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
2
-
3
- Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=W(),d;if(t){let e=typeof t==`string`?Et(t):t;L(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):kt(e,{pathname:p});R(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),R(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=Jn(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:B([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:B([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?M.createElement(Cn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Hn(){let e=rr(),t=ln(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=M.createElement(M.Fragment,null,M.createElement(`p`,null,`💿 Hey developer 👋`),M.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,M.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,M.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),M.createElement(M.Fragment,null,M.createElement(`h2`,null,`Unexpected Application Error!`),M.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?M.createElement(`pre`,{style:i},n):null,o)}var Un=M.createElement(Hn,null),Wn=class extends M.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=kn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:M.createElement(U.Provider,{value:this.props.routeContext},M.createElement(wn.Provider,{value:e,children:this.props.component}));return this.context?M.createElement(Kn,{error:e},t):t}};Wn.contextType=vn;var Gn=new WeakMap;function Kn({children:e,error:t}){let{basename:n}=M.useContext(H);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=On(t.digest);if(e){let r=Gn.get(t);if(r)throw r;let i=fn(e.location,n),a=i.absoluteURL||i.to;if(gn(a))throw Error(`Invalid redirect location`);if(dn&&!Gn.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Gn.set(t,n),n}return M.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function qn({routeContext:e,match:t,children:n}){let r=M.useContext(V);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),M.createElement(U.Provider,{value:e},n)}function Jn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);L(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:un(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Un,o&&(s<0&&c===0?(or(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?M.createElement(n.route.Component,null):n.route.element?n.route.element:e,M.createElement(qn,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?M.createElement(Wn,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Yn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Xn(e){let t=M.useContext(V);return L(t,Yn(e)),t}function Zn(e){let t=M.useContext(_n);return L(t,Yn(e)),t}function Qn(e){let t=M.useContext(U);return L(t,Yn(e)),t}function $n(e){let t=Qn(e),n=t.matches[t.matches.length-1];return L(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function er(){return $n(`useRouteId`)}function tr(){let e=Zn(`useNavigation`);return M.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function nr(){let{matches:e,loaderData:t}=Zn(`useMatches`);return M.useMemo(()=>e.map(e=>jt(e,t)),[e,t])}function rr(){let e=M.useContext(wn),t=Zn(`useRouteError`),n=$n(`useRouteError`);return e===void 0?t.errors?.[n]:e}function ir(){let{router:e}=Xn(`useNavigate`),t=$n(`useNavigate`),n=M.useRef(!1);return Nn(()=>{n.current=!0}),M.useCallback(async(r,i={})=>{R(n.current,Mn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var ar={};function or(e,t,n){!t&&!ar[e]&&(ar[e]=!0,R(!1,n))}M.memo(sr);function sr({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Vn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function cr({to:e,replace:t,state:n,relative:r}){L(jn(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=M.useContext(H);R(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=M.useContext(U),{pathname:o}=W(),s=Pn(),c=tn(e,en(a),o,r===`path`),l=JSON.stringify(c);return M.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function lr(e){return Ln(e.context)}function ur(e){L(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function dr({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){L(!jn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=M.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=Et(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=M.useMemo(()=>{let e=z(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return R(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:M.createElement(H.Provider,{value:c},M.createElement(Cn.Provider,{children:t,value:h}))}function fr({children:e,location:t}){return Bn(pr(e),t)}M.Component;function pr(e,t=[]){let n=[];return M.Children.forEach(e,(e,r)=>{if(!M.isValidElement(e))return;let i=[...t,r];if(e.type===M.Fragment){n.push.apply(n,pr(e.props.children,i));return}L(e.type===ur,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),L(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=pr(e.props.children,i)),n.push(a)}),n}var mr=`get`,hr=`application/x-www-form-urlencoded`;function gr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function _r(e){return gr(e)&&e.tagName.toLowerCase()===`button`}function vr(e){return gr(e)&&e.tagName.toLowerCase()===`form`}function yr(e){return gr(e)&&e.tagName.toLowerCase()===`input`}function br(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function xr(e,t){return e.button===0&&(!t||t===`_self`)&&!br(e)}function Sr(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Cr(e,t){let n=Sr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var wr=null;function Tr(){if(wr===null)try{new FormData(document.createElement(`form`),0),wr=!1}catch{wr=!0}return wr}var Er=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Dr(e){return e!=null&&!Er.has(e)?(R(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${hr}"`),null):e}function Or(e,t){let n,r,i,a,o;if(vr(e)){let o=e.getAttribute(`action`);r=o?z(o,t):null,n=e.getAttribute(`method`)||mr,i=Dr(e.getAttribute(`enctype`))||hr,a=new FormData(e)}else if(_r(e)||yr(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?z(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||mr,i=Dr(e.getAttribute(`formenctype`))||Dr(o.getAttribute(`enctype`))||hr,a=new FormData(o,e),!Tr()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(gr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=mr,r=null,i=hr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var kr={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Ar=/[&><\u2028\u2029]/g;function jr(e){return e.replace(Ar,e=>kr[e])}function Mr(e,t){if(e===!1||e==null)throw Error(t)}function Nr(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&z(i.pathname,t)===`/`?i.pathname=`${rn(t)}/_root.${r}`:i.pathname=`${rn(i.pathname)}.${r}`,i}async function Pr(e,t){if(e.id in t)return t[e.id];try{let n=await f(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Fr(e){return e!=null&&typeof e.page==`string`}function Ir(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Lr(e,t,n){return Hr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Pr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Ir).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Rr(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function zr(e,t,{includeHydrateFallback:n}={}){return Br(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Br(e){return[...new Set(e)]}function Vr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Hr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Fr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Vr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Ur(){let e=M.useContext(V);return Mr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Wr(){let e=M.useContext(_n);return Mr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Gr=M.createContext(void 0);Gr.displayName=`FrameworkContext`;function Kr(){let e=M.useContext(Gr);return Mr(e,`You must render this element inside a <HydratedRouter> element`),e}function qr(e,t){let n=M.useContext(Gr),[r,i]=M.useState(!1),[a,o]=M.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=M.useRef(null);M.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),M.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Jr(s,p),onBlur:Jr(c,m),onMouseEnter:Jr(l,p),onMouseLeave:Jr(u,m),onTouchStart:Jr(d,p)}]:[a,f,{}]:[!1,f,{}]}function Jr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Yr({page:e,...t}){let n=yn(),{nonce:r}=Kr(),{router:i}=Ur(),a=M.useMemo(()=>kt(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?M.createElement(Zr,{page:e,matches:a,...t}):M.createElement(Qr,{page:e,matches:a,...t})):null}function Xr(e){let{manifest:t,routeModules:n}=Kr(),[r,i]=M.useState([]);return M.useEffect(()=>{let r=!1;return Lr(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Zr({page:e,matches:t,...n}){let r=W(),{future:i}=Kr(),{basename:a}=Ur(),o=M.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Nr(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return M.createElement(M.Fragment,null,o.map(e=>M.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Qr({page:e,matches:t,...n}){let r=W(),{future:i,manifest:a,routeModules:o}=Kr(),{basename:s}=Ur(),{loaderData:c,matches:l}=Wr(),u=M.useMemo(()=>Rr(e,t,l,a,r,`data`),[e,t,l,a,r]),d=M.useMemo(()=>Rr(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=M.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Nr(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=M.useMemo(()=>zr(d,a),[d,a]),m=Xr(d);return M.createElement(M.Fragment,null,f.map(e=>M.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>M.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>M.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function $r(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}M.Component;var ei=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{ei&&(window.__reactRouterVersion=`7.18.1`)}catch{}function ti({basename:e,children:t,useTransitions:n,window:r}){let i=M.useRef();i.current??=xt({window:r,v5Compat:!0});let a=i.current,[o,s]=M.useState({action:a.action,location:a.location}),c=M.useCallback(e=>{n===!1?s(e):M.startTransition(()=>s(e))},[n]);return M.useLayoutEffect(()=>a.listen(c),[a,c]),M.createElement(dr,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function ni({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=M.useState({action:n.action,location:n.location}),o=M.useCallback(e=>{r===!1?a(e):M.startTransition(()=>a(e))},[r]);return M.useLayoutEffect(()=>n.listen(o),[n,o]),M.createElement(dr,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}ni.displayName=`unstable_HistoryRouter`;var ri=M.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=M.useContext(H),v=typeof l==`string`&&gt.test(l),y=fn(l,h);l=y.to;let b=An(l,{relative:r}),x=W(),S=null;if(o){let e=tn(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:B([h,e.pathname])),S=g.createHref(e)}let[C,w,ee]=qr(n,p),te=ui(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function ne(t){e&&e(t),t.defaultPrevented||te(t)}let T=!(y.isExternal||i),re=M.createElement(`a`,{...p,...ee,href:(T?S:void 0)||y.absoluteURL||b,onClick:T?ne:e,ref:$r(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?M.createElement(M.Fragment,null,re,M.createElement(Yr,{page:b})):re});ri.displayName=`Link`;var ii=M.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=zn(a,{relative:c.relative}),d=W(),f=M.useContext(_n),{navigator:p,basename:m}=M.useContext(H),h=f!=null&&xi(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=z(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let ee=typeof i==`function`?i(S):i;return M.createElement(ri,{...c,"aria-current":C,className:w,ref:l,style:ee,to:a,viewTransition:o},typeof s==`function`?s(S):s)});ii.displayName=`NavLink`;var ai=M.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=mr,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=M.useContext(H),g=mi(),_=hi(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&gt.test(s);return M.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?M.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});ai.displayName=`Form`;function oi({getKey:e,storageKey:t,...n}){let r=M.useContext(Gr),{basename:i}=M.useContext(H),a=W(),o=nr();yi({getKey:e,storageKey:t});let s=M.useMemo(()=>{if(!r||!e)return null;let t=vi(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),M.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${jr(JSON.stringify(t||gi))}, ${jr(JSON.stringify(s))})`}})}oi.displayName=`ScrollRestoration`;function si(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ci(e){let t=M.useContext(V);return L(t,si(e)),t}function li(e){let t=M.useContext(_n);return L(t,si(e)),t}function ui(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Pn(),d=W(),f=zn(e,{relative:o});return M.useCallback(p=>{if(xr(p,t)){p.preventDefault();let t=n===void 0?Tt(d)===Tt(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?M.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function di(e){R(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=M.useRef(Sr(e)),n=M.useRef(!1),r=W(),i=M.useMemo(()=>Cr(r.search,n.current?null:t.current),[r.search]),a=Pn();return[i,M.useCallback((e,t)=>{let r=Sr(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var fi=0,pi=()=>`__${String(++fi)}__`;function mi(){let{router:e}=ci(`useSubmit`),{basename:t}=M.useContext(H),n=er(),r=e.fetch,i=e.navigate;return M.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Or(e,t);if(a.navigate===!1){let e=a.fetcherKey||pi();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function hi(e,{relative:t}={}){let{basename:n}=M.useContext(H),r=M.useContext(U);L(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...zn(e||`.`,{relative:t})},o=W();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:B([n,a.pathname])),Tt(a)}var gi=`react-router-scroll-positions`,_i={};function vi(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:z(e.pathname,n)||e.pathname},t)),i??=e.key,i}function yi({getKey:e,storageKey:t}={}){let{router:n}=ci(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=li(`useScrollRestoration`),{basename:a}=M.useContext(H),o=W(),s=nr(),c=tr();M.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),bi(M.useCallback(()=>{if(c.state===`idle`){let t=vi(o,s,a,e);_i[t]=window.scrollY}try{sessionStorage.setItem(t||gi,JSON.stringify(_i))}catch(e){R(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(M.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||gi);e&&(_i=JSON.parse(e))}catch{}},[t]),M.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(_i,()=>window.scrollY,e?(t,n)=>vi(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),M.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{R(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function bi(e,t){let{capture:n}=t||{};M.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function xi(e,{relative:t}={}){let n=M.useContext(bn);L(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=ci(`useViewTransitionState`),i=zn(e,{relative:t});if(!n.isTransitioning)return!1;let a=z(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=z(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Kt(i.pathname,o)!=null||Kt(i.pathname,a)!=null}var Si=[`claude`,`codex`,`opencode`],Ci=new Set([`connected`,`disconnected`,`not-installed`,`unknown`]);function wi(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ti(e,t){if(!wi(e))return null;let{provider:n,status:r,enabled:i,hint:a,authFailureId:o}=e;return typeof n!=`string`||!Si.includes(n)||typeof r!=`string`||!Ci.has(r)||t&&typeof i!=`boolean`||!t&&i!==void 0&&typeof i!=`boolean`||a!==void 0&&typeof a!=`string`||o!==void 0&&(typeof o!=`string`||o.length<1||o.length>128||r!==`disconnected`)?null:{provider:n,status:r,...typeof i==`boolean`?{enabled:i}:{},...a===void 0?{}:{hint:a},...o===void 0?{}:{authFailureId:o}}}function Ei(e){return Ti(e,!1)}function Di(e,t){if(!wi(e)||!Array.isArray(e.providers))return null;let n=[],r=new Set;for(let i of e.providers){let e=Ti(i,t);if(e===null||r.has(e.provider))return null;r.add(e.provider),n.push(e)}return n}function G(e){let t=Di(e,!0);if(t===null||t.length!==Si.length)return null;let n=new Map(t.map(e=>[e.provider,e]));return Si.some(e=>!n.has(e))?null:Si.map(e=>n.get(e))}function Oi(e){let t=G(e);if(t===null)throw Error(`Invalid provider status response`);return{providers:t}}function ki(e,t){let n=G(e);if(n!==null)return{providers:n.map(e=>e.provider===t.provider?{provider:t.provider,status:t.status,enabled:t.enabled??e.enabled,...t.hint===void 0?{}:{hint:t.hint},...t.authFailureId===void 0?{}:{authFailureId:t.authFailureId}}:e)}}function Ai(e,t,n,r){let i=G(e),a=G(t),o=G(n);if(o===null||a===null)return n;if(i===null)return{providers:a};let s=new Map(i.map(e=>[e.provider,e])),c=new Map(a.map(e=>[e.provider,e]));return{providers:o.map(e=>{let t=s.get(e.provider),n=c.get(e.provider);if(t===void 0||n===void 0)return n??e;let i=r!==void 0&&n.authFailureId===r&&e.authFailureId===void 0;return r!==void 0&&n.authFailureId!==void 0&&n.authFailureId!==r&&e.authFailureId===void 0?n:ji(t,n)?e:i?{...e,enabled:n.enabled}:n})}}function ji(e,t){return e.provider===t.provider&&e.status===t.status&&e.enabled===t.enabled&&e.hint===t.hint&&e.authFailureId===t.authFailureId}function Mi(e){let t=G(e);if(t===null)return[];let n=new Set(t.filter(e=>e.enabled&&e.status===`connected`).map(e=>e.provider));return Si.filter(e=>n.has(e))}function Ni(e,t){return G(e)?.find(e=>e.provider===t)}var Pi=class extends Error{status;manual;command;exists;constructor(e,t,n={}){super(t,n.cause===void 0?void 0:{cause:n.cause}),this.name=`ApiError`,this.status=e,this.manual=n.manual,this.command=n.command,this.exists=n.exists}};function Fi(e){try{return JSON.parse(e)}catch{return}}function Ii(e){return typeof e==`string`?e:void 0}function Li(e,t,n){let r=Fi(n),i=r&&typeof r==`object`?r:{};return new Pi(e,Ii(i.error)??`${e} ${t||`request failed`}`.trim(),{manual:Ii(i.manual),command:Ii(i.command),exists:typeof i.exists==`boolean`?i.exists:void 0})}var K=ne({fetch:(e,t)=>Vi(Ri(String(e)),t)});function Ri(e){let t=Bi(e.endsWith(`?`)?e.slice(0,-1):e);return t.startsWith(`/`)?`${c()}${t}`:t}var zi=`${s}/p/default`;function Bi(e){if(u()!==null||!e.startsWith(zi))return e;let t=e.slice(zi.length);return t===``||t.startsWith(`/`)||t.startsWith(`?`)?`${s}${t}`:e}var q=e=>({init:{signal:e?.signal}});async function J(e,t){let n=await e.text();if(!e.ok)throw Li(e.status,e.statusText,n);let r=Fi(n);if(r===void 0)throw new Pi(e.status,`the cezar server answered ${t} with a non-JSON body`);return r}async function Vi(e,t){try{return await fetch(e,{...t,credentials:`include`})}catch(t){throw t instanceof DOMException&&t.name===`AbortError`?t:new Pi(0,`cannot reach the cezar server (${e})`,{cause:t})}}async function Hi(e,t){return Vi(i(e),t)}async function Ui(e,t={}){let n=new Headers(t.headers);n.set(`accept`,`text/plain`);let r=await Hi(e,{...t,headers:n}),i=await r.text();if(!r.ok)throw Li(r.status,r.statusText,i);return i}var Y=(e,t=``)=>`/runs/${encodeURIComponent(e)}${t}`;async function Wi(e){return J(await K.api.v1.health.$get({},q(e)),`/health`)}async function Gi(e){return J(await K.api.v1.models.$get({query:{runner:`codex`}},q(e)),`/models`)}async function Ki(e=!1,t){return Oi(await J(await K.api.v1.providers.status.$get({query:e?{refresh:`1`}:{}},q(t)),`/providers/status`))}async function qi(e){return J(await K.api.v1.p[`:projectId`][`launch-key`].$get({param:{projectId:a()}},q(e)),`/launch-key`)}async function Ji(e){return J(await K.api.v1.projects.$get({},q(e)),`/projects`)}async function Yi(e,t){return J(await K.api.v1.fs.browse.$get({query:{path:e===``?void 0:e}},q(t)),`/fs/browse`)}async function Xi(e){return J(await K.api.v1.p[`:projectId`].runs.$get({param:{projectId:a()}},q(e)),`/runs`)}async function Zi(e,t){return J(await K.api.v1.p[`:projectId`].runs.$get({param:{projectId:e}},q(t)),`/runs`)}async function Qi(e,t){return J(await K.api.v1.p[`:projectId`].runs[`:id`].$get({param:{projectId:a(),id:encodeURIComponent(e)}},q(t)),Y(e))}async function $i(e){return J(await K.api.v1.p[`:projectId`][`ui-state`].$get({param:{projectId:a()}},q(e)),`/ui-state`)}async function ea(e){return J(await K.api.v1.p[`:projectId`].workflows.$get({param:{projectId:a()}},q(e)),`/workflows`)}async function ta(e){return J(await K.api.v1.p[`:projectId`].skills.$get({param:{projectId:a()},query:{}},q(e)),`/skills`)}async function na(e){return J(await K.api.v1.p[`:projectId`].skills.$get({param:{projectId:a()},query:{wait:`1`}},q(e)),`/skills`)}async function ra(){return J(await K.api.v1.p[`:projectId`].skills.refresh.$post({param:{projectId:a()}}),`/skills/refresh`)}async function ia(e){return J(await K.api.v1.p[`:projectId`].skills.importable.$get({param:{projectId:a()},query:{}},q(e)),`/skills/importable`)}async function aa(e){return J(await K.api.v1.p[`:projectId`].skills.importable.$get({param:{projectId:a()},query:{wait:`1`}},q(e)),`/skills/importable`)}async function oa(e){return J(await K.api.v1.p[`:projectId`].todos.$get({param:{projectId:a()}},q(e)),`/todos`)}async function sa(e){return J(await K.api.v1.p[`:projectId`].repo.$get({param:{projectId:a()}},q(e)),`/repo`)}async function ca(e){return J(await K.api.v1.p[`:projectId`].config.$get({param:{projectId:a()}},q(e)),`/config`)}async function la(e={}){return J(await K.api.v1.p[`:projectId`][`agent-config`].$get({param:{projectId:a()}},q(e)),`/agent-config`)}async function ua(e,t={}){return J(await K.api.v1.p[`:projectId`][`agent-config`][`:id`].$get({param:{projectId:a(),id:encodeURIComponent(e)}},q(t)),`/agent-config/${encodeURIComponent(e)}`)}async function da(e,t){return J(await K.api.v1.p[`:projectId`][`agent-config`][`:id`].$put({param:{projectId:a(),id:encodeURIComponent(e)},json:t}),`/agent-config/${encodeURIComponent(e)}`)}async function fa(e){return J(await K.api.v1.p[`:projectId`].repo.changes.$get({param:{projectId:a()}},q(e)),`/repo/changes`)}async function pa(e,t){return J(await K.api.v1.p[`:projectId`].repo.commit[`:sha`].$get({param:{projectId:a(),sha:encodeURIComponent(e)},query:{structured:`1`}},q(t)),`/repo/commit/:sha`)}async function ma(e,t){return J(await K.api.v1.p[`:projectId`].runs[`:id`].commits.$get({param:{projectId:a(),id:encodeURIComponent(e)}},q(t)),Y(e,`/commits`))}async function ha(e,t,n){return J(await K.api.v1.p[`:projectId`].runs[`:id`].commit[`:sha`].$get({param:{projectId:a(),id:encodeURIComponent(e),sha:encodeURIComponent(t)}},q(n)),Y(e,`/commit/${encodeURIComponent(t)}`))}async function ga(e={},t){return J(await K.api.v1.p[`:projectId`].github.$get({param:{projectId:a()},query:{limit:e.limit===void 0?void 0:String(e.limit),refresh:e.refresh?`1`:void 0}},q(t)),`/github`)}async function _a(e,t){return J(await K.api.v1.p[`:projectId`].github.checks.$get({param:{projectId:a()},query:{prs:e.join(`,`)}},q(t)),`/github/checks`)}async function va(e,t,n={},r){return J(await K.api.v1.p[`:projectId`].github.comments[`:kind`][`:number`].$get({param:{projectId:a(),kind:e,number:String(t)},query:{refresh:n.refresh?`1`:void 0}},q(r)),`/github/comments/${e}/${t}`)}async function ya(e,t={},n){return J(await K.api.v1.p[`:projectId`].github.prs[`:number`][`merge-state`].$get({param:{projectId:a(),number:String(e)},query:{refresh:t.refresh?`1`:void 0}},q(n)),`/github/prs/${e}/merge-state`)}async function ba(e,t){return J(await K.api.v1.p[`:projectId`].github.prs[`:number`].merge.$post({param:{projectId:a(),number:String(e)},json:t}),`/github/prs/:number/merge`)}async function xa(e,t={},n){return J(await K.api.v1.p[`:projectId`].github.prs[`:number`].changes.$get({param:{projectId:a(),number:String(e)},query:{refresh:t.refresh?`1`:void 0}},q(n)),`/github/prs/${e}/changes`)}function Sa(e,t){return Ui(Y(e,`/diff`),{method:`GET`,signal:t?.signal})}function Ca(e,t){return Ui(Y(e,`/handoff`),{method:`GET`,signal:t?.signal})}async function wa(e,t){return J(await K.api.v1.p[`:projectId`].runs[`:id`].changes.$get({param:{projectId:a(),id:encodeURIComponent(e)}},q(t)),Y(e,`/changes`))}async function Ta(e,t,n){return J(await K.api.v1.p[`:projectId`].runs[`:id`].files.$get({param:{projectId:a(),id:encodeURIComponent(e)},query:{path:t}},q(n)),`/runs/:id/files`)}function Ea(e,t){return i(Y(e,`/files?path=${encodeURIComponent(t)}&raw=1`))}async function Da(e,t){return J(await K.api.v1.p[`:projectId`].groups[`:groupId`].$get({param:{projectId:a(),groupId:encodeURIComponent(e)}},q(t)),`/groups/${encodeURIComponent(e)}`)}async function Oa(e){return J(await K.api.v1.providers.connect.$post({json:{provider:e}}),`/providers/connect`)}async function ka(e,t){return Oi(await J(await K.api.v1.providers[`:provider`].enabled.$put({param:{provider:e},json:{enabled:t}}),`/providers/${encodeURIComponent(e)}/enabled`))}async function Aa(e,t){return Oi(await J(await K.api.v1.providers[`:provider`].retry.$post({param:{provider:e},json:{authFailureId:t}}),`/providers/${encodeURIComponent(e)}/retry`))}async function ja(e){let t=`/projects`,n=await Hi(t,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({root:e})}),r=await n.text(),i=Fi(r),a=i?.project;if((n.ok||n.status===409)&&a!=null)return i;throw n.ok?new Pi(n.status,`the cezar server answered ${t} without a project`):Li(n.status,n.statusText,r)}async function Ma(e){return J(await K.api.v1.projects.checkout.$post({json:e}),`/projects/checkout`)}async function Na(e){return J(await K.api.v1.projects[`:projectId`].$delete({param:{projectId:encodeURIComponent(e)}}),`/projects/${encodeURIComponent(e)}`)}async function Pa(e,t){return J(await K.api.v1.projects[`:projectId`].$patch({param:{projectId:encodeURIComponent(e)},json:t}),`/projects/${encodeURIComponent(e)}`)}async function Fa(e){return J(await K.api.v1.p[`:projectId`].runs.$post({param:{projectId:a()},json:e}),`/runs`)}async function Ia(e){return J(await K.api.v1.p[`:projectId`].runs[`:id`].cancel.$post({param:{projectId:a(),id:encodeURIComponent(e)}}),Y(e,`/cancel`))}async function La(e,t=!0){return J(await K.api.v1.p[`:projectId`].runs[`:id`].archive.$post({param:{projectId:a(),id:encodeURIComponent(e)},json:{archived:t}}),Y(e,`/archive`))}async function Ra(){return J(await K.api.v1.p[`:projectId`].runs[`archive-finished`].$post({param:{projectId:a()}}),`/runs/archive-finished`)}async function za(e){return J(await K.api.v1.p[`:projectId`].runs[`:id`].read.$post({param:{projectId:a(),id:encodeURIComponent(e)}}),Y(e,`/read`))}async function Ba(){return J(await K.api.v1.p[`:projectId`].runs[`read-all`].$post({param:{projectId:a()}}),`/runs/read-all`)}async function Va(e){return J(await K.api.v1.p[`:projectId`].runs[`:id`].finish.$post({param:{projectId:a(),id:encodeURIComponent(e)}}),Y(e,`/finish`))}async function Ha(e,t={}){let n={...t.text===void 0?{}:{text:t.text},...t.images===void 0?{}:{images:t.images},...t.runner===void 0?{}:{runner:t.runner},...t.model===void 0?{}:{model:t.model}};return J(await K.api.v1.p[`:projectId`].runs[`:id`].continue.$post({param:{projectId:a(),id:encodeURIComponent(e)},json:n}),Y(e,`/continue`))}async function Ua(e){return J(await K.api.v1.p[`:projectId`].runs[`:id`].pr.$post({param:{projectId:a(),id:encodeURIComponent(e)}}),Y(e,`/pr`))}async function Wa(e,t){return J(await K.api.v1.p[`:projectId`].runs[`:id`].$patch({param:{projectId:a(),id:encodeURIComponent(e)},json:t}),Y(e))}async function Ga(e){return J(await K.api.v1.p[`:projectId`].runs[`:id`].$delete({param:{projectId:a(),id:encodeURIComponent(e)}}),Y(e))}async function Ka(e){return J(await K.api.v1.p[`:projectId`].todos[`:id`].$delete({param:{projectId:a(),id:encodeURIComponent(e)}}),`/todos/${encodeURIComponent(e)}`)}async function qa(e,t={}){let n={...t.runner===void 0?{}:{runner:t.runner},...t.model===void 0?{}:{model:t.model},...t.prompt===void 0?{}:{prompt:t.prompt}};return J(await K.api.v1.p[`:projectId`].todos[`:id`].start.$post({param:{projectId:a(),id:encodeURIComponent(e)},json:Object.keys(n).length>0?n:void 0}),`/todos/${encodeURIComponent(e)}/start`)}async function Ja(e,t){return J(await K.api.v1.p[`:projectId`].groups[`:groupId`].pick.$post({param:{projectId:a(),groupId:encodeURIComponent(e)},json:{runId:t}}),`/groups/${encodeURIComponent(e)}/pick`)}async function Ya(e){return J(await K.api.v1.p[`:projectId`].runs[`:id`][`open-in-cli`].$post({param:{projectId:a(),id:encodeURIComponent(e)}}),Y(e,`/open-in-cli`))}async function Xa(e){return J(await K.api.v1.p[`:projectId`][`open-targets`].$get({param:{projectId:a()}},q(e)),`/open-targets`)}async function Za(e,t){return J(await K.api.v1.p[`:projectId`].runs[`:id`][`open-in`].$post({param:{projectId:a(),id:encodeURIComponent(e)},json:{target:t}}),Y(e,`/open-in`))}async function Qa(e,t){return J(await K.api.v1.p[`:projectId`].runs[`:id`][`open-in`].$post({param:{projectId:a(),id:encodeURIComponent(e)},json:{target:`default`,path:t}}),Y(e,`/open-in`))}async function $a(e,t){return J(await K.api.v1.p[`:projectId`].runs[`:id`].git.commit.$post({param:{projectId:a(),id:encodeURIComponent(e)},json:{message:t}}),Y(e,`/git/commit`))}async function eo(e){return J(await K.api.v1.p[`:projectId`].runs[`:id`].git.push.$post({param:{projectId:a(),id:encodeURIComponent(e)}}),Y(e,`/git/push`))}async function to(e,t){return J(await K.api.v1.p[`:projectId`].runs[`:id`].messages.$post({param:{projectId:a(),id:encodeURIComponent(e)},json:{text:t.text??``,images:t.images??[]}}),Y(e,`/messages`))}async function no(e,t,n){return J(await K.api.v1.p[`:projectId`].runs[`:id`][`queued-messages`][`:msgId`].$patch({param:{projectId:a(),id:encodeURIComponent(e),msgId:encodeURIComponent(t)},json:n}),Y(e,`/queued-messages/${encodeURIComponent(t)}`))}async function ro(e,t){return J(await K.api.v1.p[`:projectId`].runs[`:id`][`queued-messages`][`:msgId`].$delete({param:{projectId:a(),id:encodeURIComponent(e),msgId:encodeURIComponent(t)}}),Y(e,`/queued-messages/${encodeURIComponent(t)}`))}async function io(e){return J(await K.api.v1.p[`:projectId`].repo.branch.$post({param:{projectId:a()},json:e}),`/repo/branch`)}async function ao(e){return J(await K.api.v1.p[`:projectId`].plan.$post({param:{projectId:a()},json:{task:e}}),`/plan`)}async function oo(e){return J(await K.api.v1.p[`:projectId`].automations.$get({param:{projectId:a()}},q(e)),`/automations`)}async function so(e){return J(await K.api.v1.p[`:projectId`].automations.$post({param:{projectId:a()},json:e}),`/automations`)}async function co(e,t){return J(await K.api.v1.p[`:projectId`].automations[`:id`].$put({param:{projectId:a(),id:encodeURIComponent(e)},json:t}),`/automations/${encodeURIComponent(e)}`)}async function lo(e,t){let n={projectId:a(),id:encodeURIComponent(e)},r=`/automations/${encodeURIComponent(e)}/${t?`enable`:`pause`}`;return J(t?await K.api.v1.p[`:projectId`].automations[`:id`].enable.$post({param:n}):await K.api.v1.p[`:projectId`].automations[`:id`].pause.$post({param:n}),r)}async function uo(e,t){return J(await K.api.v1.p[`:projectId`].automations[`:id`].check.$post({param:{projectId:a(),id:encodeURIComponent(e)},json:{mode:t}}),`/automations/${encodeURIComponent(e)}/check`)}async function fo(e,t){return J(await K.api.v1[`automation-checks`][`:checkId`].$get({param:{checkId:encodeURIComponent(e)}},q(t)),`/automation-checks/${encodeURIComponent(e)}`)}async function po(e,t){return J(await K.api.v1.p[`:projectId`][`automation-log`].$get({param:{projectId:a()},query:{automationId:e}},q(t)),`/automation-log?automationId=${encodeURIComponent(e)}`)}async function mo(e){return J(await K.api.v1.p[`:projectId`].workflows.$post({param:{projectId:a()},json:e}),`/workflows`)}async function ho(e){return J(await K.api.v1.p[`:projectId`].workflows.parse.$post({param:{projectId:a()},json:{yaml:e}}),`/workflows/parse`)}async function go(e){return J(await K.api.v1.p[`:projectId`].workflows[`:name`].$delete({param:{projectId:a(),name:encodeURIComponent(e)}}),`/workflows/${encodeURIComponent(e)}`)}async function _o(e){return J(await K.api.v1.p[`:projectId`][`ui-state`].$put({param:{projectId:a()},json:e}),`/ui-state`)}async function vo(e){return J(await K.api.v1.workspace[`ui-state`].$get({},q(e)),`/workspace/ui-state`)}async function yo(e){return J(await K.api.v1.workspace[`ui-state`].$put({json:e}),`/workspace/ui-state`)}async function bo(e){return J(await K.api.v1.workspace.config.$get({},q(e)),`/workspace/config`)}async function xo(e,t){return J(await K.api.v1.workspace[`skills-update`].$get({query:{projectId:e}},q(t)),`/workspace/skills-update?projectId=${encodeURIComponent(e)}`)}async function So(e){return J(await K.api.v1.workspace[`skills-update`].check.$post({json:{projectId:e}}),`/workspace/skills-update/check`)}async function Co(e){return J(await K.api.v1.workspace[`skills-update`].apply.$post({json:{projectId:e}}),`/workspace/skills-update/apply`)}async function wo(e){return J(await K.api.v1.workspace.config.$put({json:e}),`/workspace/config`)}async function To(e){return J(await K.api.v1.p[`:projectId`].config.$put({param:{projectId:a()},json:e}),`/config`)}async function Eo(e){return J(await K.api.v1.p[`:projectId`].worktrees.$get({param:{projectId:a()}},q(e)),`/worktrees`)}async function Do(){return J(await K.api.v1.p[`:projectId`].worktrees.reclaim.$post({param:{projectId:a()},json:{}}),`/worktrees/reclaim`)}async function Oo(e){return J(await K.api.v1.p[`:projectId`].runs[`:id`][`remove-worktree`].$post({param:{projectId:a(),id:encodeURIComponent(e)}}),Y(e,`/remove-worktree`))}var ko={projectId:null,apiBase:s},Ao=(0,M.createContext)(ko);function jo(){return(0,M.useContext)(Ao)}function Mo({projectId:e,children:t}){u()!==e&&o(e),(0,M.useEffect)(()=>{o(e)},[e]),(0,M.useEffect)(()=>()=>o(null),[]);let n=(0,M.useMemo)(()=>e===null?ko:{projectId:e,apiBase:`${s}/p/${encodeURIComponent(e)}`},[e]);return(0,N.jsx)(Ao.Provider,{value:n,children:t})}var No=[`Needs you`,`Working`,`Recent`,`Archived`],Po={waiting:0,review:1,running:2,queued:3},Fo=e=>Po[e.status]??9;function Io(e,t){return t===`archived`?`Archived`:e.status===`waiting`||e.status===`review`?`Needs you`:e.status===`running`||e.status===`queued`?`Working`:`Recent`}function Lo(e){let t=e.titleSummary;return t===void 0||!(e.titleOrigin===`user`||e.titleOrigin===`marker`)&&/[.!?][A-Z]/.test(t)?e.title:t}function Ro(e){return e.title.replace(/ \([A-C]\)$/,``)}function zo(e){let t=e.filter(e=>!e.archived&&e.status===`queued`).sort((e,t)=>e.createdAt.localeCompare(t.createdAt));return new Map(t.map((e,t)=>[e.id,t+1]))}function Bo(e,t){return e.filter(e=>t===`archived`?e.archived:!e.archived).sort((e,t)=>{let n=Fo(e)-Fo(t);return n===0?t.createdAt.localeCompare(e.createdAt):n})}function Vo(e,t){let n=zo(e),r=Bo(e,t),i=new Map,a=(e,t)=>{let n=i.get(e);n?n.push(t):i.set(e,[t])},o=new Set;for(let e of r){if(e.groupId){if(o.has(e.groupId))continue;o.add(e.groupId);let n=r.filter(t=>t.groupId===e.groupId).sort((e,t)=>(e.variant??``).localeCompare(t.variant??``));if(n.length>1){a(Io(e,t),{kind:`group`,groupId:e.groupId,title:Ro(e),members:n});continue}}a(Io(e,t),{kind:`run`,run:e,queuePosition:n.get(e.id)??null})}return No.filter(e=>i.has(e)).map(e=>({label:e,rows:i.get(e)}))}function Ho(e,t){let n=[],r=t;for(let t of e){if(r<=0)break;let e=t.rows.slice(0,r);r-=e.length,n.push({label:t.label,rows:e})}return n}function Uo(e){let t=0,n=0,r=0;for(let i of e){if(i.archived){n+=1;continue}t+=1,(i.status===`waiting`||i.status===`review`)&&(r+=1)}return{active:t,archived:n,waiting:r}}var Wo=new Set([`running`,`waiting`]),Go=new Set([`done`,`failed`,`review`,`cancelled`]),Ko=new Set([`done`,`failed`,`cancelled`]);function qo(e){return e?e>=1024**3?`${(e/1024**3).toFixed(1)} GB`:e>=1024**2?`${Math.round(e/1024**2)} MB`:`${Math.round(e/1024)} kB`:``}function Jo(e){return e?`$${e>=10?e.toFixed(0):e.toFixed(2)}`:``}function Yo(e){if(e.workflow===`(planned)`||e.workflow===`(inbox)`){let t=e.steps.find(e=>e.kind===`agent`);if(t?.name)return t.name}return e.workflow}function Xo(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>[Lo(e),e.branch??``,e.workflow,Yo(e)].some(e=>e.toLowerCase().includes(n))):[...e]}function Zo(e){return e.filter(e=>!e.archived&&Ko.has(e.status)).length}function Qo(e){if(!e)return;let t=e.trim().replace(/\/+$/,``),n=/^(?:https?|ssh|git|git\+ssh):\/\/(?:[^@/]+@)?([^/:]+)(?::\d+)?\/(.+)$/.exec(t),r=n?null:/^(?:[^@/:]+@)?([^:/]+):(.+)$/.exec(t),i=n??r;if(!i)return;let[,a,o]=i;if(!o||a?.toLowerCase()!==`github.com`)return;let s=o.replace(/\.git$/i,``).split(`/`).filter(Boolean),c=s[s.length-2],l=s[s.length-1];return c&&l?`https://github.com/${c}/${l}`:void 0}function $o(e){if(e.pullRequestUrl)return e.pullRequestUrl;if(!(e.markerRefs?.issue!==void 0&&e.markerRefs?.pr===void 0))return e.referencedPullRequestUrl}function es(e,t){if(e.referencedIssueUrl)return e.referencedIssueUrl;let n=e.markerRefs?.issue??e.issueNumber;if(!(!n||!t))return`${t}/issues/${n}`}function ts(e){let t=$o(e),n=t?Number(ns(t)):e.prNumber;if(n&&Number.isInteger(n))return{kind:`PR`,number:n,...t?{url:t}:{}};let r=es(e),i=e.issueNumber??(r?Number(ns(r)):void 0);if(i&&Number.isInteger(i))return{kind:`Issue`,number:i,...r?{url:r}:{}}}function ns(e){let t=e.split(`/`).pop()??``;return/^\d+$/.test(t)?t:null}function rs(e,t){let n=Wo.has(e.status)?t:void 0;if(n)return{cpu:{text:`${n.cpuPct.toFixed(0)}%`,kind:`live`},mem:{text:qo(n.rssBytes),kind:`live`}};let r=qo(e.peakRssBytes);return{cpu:{text:``,kind:`none`},mem:r?{text:`peak ${r}`,kind:`peak`,title:`peak — run finished${e.peakProcCount?` · ${e.peakProcCount} procs`:``}`}:{text:``,kind:`none`}}}function is(e,t){let n=e.filter(e=>t===`archived`?e.archived:!e.archived),r=new Map;for(let e of n){if(!e.groupId)continue;let t=r.get(e.groupId);t?t.push(e):r.set(e.groupId,[e])}return[...r.entries()].flatMap(([e,t])=>{let n=t[0];return!n||t.length<2||!t.every(e=>Go.has(e.status))?[]:[{groupId:e,title:Ro(n),count:t.length}]})}var as=`/api/v1/ws`,os=3e3,ss=1e3,cs=7e4,ls=0,us=1;function ds(e){let t=new Map,n=null,r,i,a,o=()=>{clearTimeout(a),a=setTimeout(()=>{a=void 0,n?.close()},cs)},s=()=>e??`${location.protocol===`https:`?`wss:`:`ws:`}//${location.host}${as}`,c=e=>{n?.readyState===us&&n.send(JSON.stringify(e))},l=()=>{let e=globalThis.WebSocket;if(typeof e!=`function`||n&&(n.readyState===ls||n.readyState===us))return;let i=new e(s());n=i,i.addEventListener(`open`,()=>{if(i===n){o();for(let e of t.keys())c({type:`subscribe`,topic:e})}}),i.addEventListener(`message`,e=>{if(i!==n)return;o();let r;try{r=JSON.parse(e.data)}catch{return}if(typeof r!=`object`||!r)return;let{type:a,topic:s,data:c}=r;if(a!==`event`||typeof s!=`string`)return;let l=t.get(s);if(l)for(let e of[...l])e(c)}),i.addEventListener(`close`,()=>{i===n&&(n=null,clearTimeout(a),a=void 0,t.size>0&&r===void 0&&(r=setTimeout(()=>{r=void 0,t.size>0&&l()},os)))}),i.addEventListener(`error`,()=>void 0)};return{subscribe(e,o){let s=t.get(e);s||(s=new Set,t.set(e,s));let u=s.size===0;s.add(o),clearTimeout(i),i=void 0,n?u&&c({type:`subscribe`,topic:e}):(clearTimeout(r),r=void 0,l());let d=!0;return()=>{d&&(d=!1,s.delete(o),!(s.size>0)&&(t.delete(e),c({type:`unsubscribe`,topic:e}),t.size===0&&i===void 0&&(i=setTimeout(()=>{i=void 0,!(t.size>0)&&(clearTimeout(r),r=void 0,clearTimeout(a),a=void 0,n?.close(),n=null)},ss))))}}}}var fs=null;function ps(e,t){return fs??=ds(),fs.subscribe(e,t)}var X={get health(){return[a(),`health`]},runs:{get all(){return[a(),`runs`]},list:()=>[a(),`runs`,`list`],detail:e=>[a(),`runs`,`detail`,e],diff:e=>[a(),`runs`,`diff`,e],changes:e=>[a(),`runs`,`changes`,e],file:(e,t)=>[a(),`runs`,`files`,e,t],handoff:e=>[a(),`runs`,`handoff`,e],commits:e=>[a(),`runs`,`commits`,e],commit:(e,t)=>[a(),`runs`,`commit`,e,t]},groups:{detail:e=>[a(),`groups`,e]},get todos(){return[a(),`todos`]},get workflows(){return[a(),`workflows`]},get skills(){return[a(),`skills`]},get skillsReady(){return[a(),`skills`,`ready`]},get importableSkills(){return[a(),`skills`,`importable`]},get importableSkillsReady(){return[a(),`skills`,`importable`,`ready`]},get launchKey(){return[a(),`launch-key`]},get repo(){return[a(),`repo`]},get repoChanges(){return[a(),`repo`,`changes`]},repoCommit:e=>[a(),`repo`,`commit`,e],get uiState(){return[a(),`ui-state`]},get config(){return[a(),`config`]},get agentConfig(){return[a(),`agent-config`]},agentConfigFile:e=>[a(),`agent-config`,`file`,e],get worktrees(){return[a(),`worktrees`]},github:(e={})=>[a(),`github`,e.limit??null],githubChecks:e=>[a(),`github`,`checks`,[...e].sort((e,t)=>e-t).join(`,`)],githubComments:(e,t)=>[a(),`github`,`comments`,e,t],githubMergeState:e=>[a(),`github`,`merge-state`,e],get openTargets(){return[a(),`open-targets`]}},Z={models:e=>[`workspace`,`models`,e],providerStatus:[`workspace`,`providers`,`status`],projects:[`workspace`,`projects`],uiState:[`workspace`,`ui-state`],config:[`workspace`,`config`],skillsUpdate:e=>[`workspace`,`skills-update`,e],fsBrowseRoot:[`workspace`,`fs-browse`],fsBrowse:e=>[...Z.fsBrowseRoot,e]};function ms(e=!0){return F({queryKey:Z.models(`codex`),queryFn:({signal:e})=>Gi({signal:e}),staleTime:300*1e3,enabled:e})}function hs(){let e=P();return F({queryKey:Z.providerStatus,queryFn:async({signal:t})=>{let n=e.getQueryData(Z.providerStatus),r=await Ki(!1,{signal:t});return Ai(n,e.getQueryData(Z.providerStatus),r)},staleTime:5*6e4,refetchInterval:!1,refetchOnWindowFocus:!0})}function gs(){let e=P();return I({mutationFn:()=>Ki(!0),onMutate:()=>e.getQueryData(Z.providerStatus),onSuccess:(t,n,r)=>e.setQueryData(Z.providerStatus,e=>Ai(r,e,t))})}function _s(){let e=P();return I({mutationFn:({provider:e,authFailureId:t})=>Aa(e,t),onMutate:()=>e.getQueryData(Z.providerStatus),onSuccess:(t,n,r)=>{e.setQueryData(Z.providerStatus,e=>Ai(r,e,t,n.authFailureId))}})}function vs(){return F({queryKey:Z.projects,queryFn:({signal:e})=>Ji({signal:e})})}function ys(e){return F({queryKey:Z.fsBrowse(e),queryFn:({signal:t})=>Yi(e??void 0,{signal:t}),retry:!1})}function bs(){let e=P();return I({mutationFn:e=>ja(e),onSuccess:()=>e.invalidateQueries({queryKey:Z.projects})})}function xs(){let e=P();return I({mutationFn:e=>Na(e),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:Z.projects})})}function Ss(){let e=P();return I({mutationFn:e=>Pa(e.id,{maxParallel:e.maxParallel}),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:Z.projects})})}function Cs(){let e=P();return I({mutationFn:e=>Ma(e),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:Z.projects})})}function ws(){let e=P();(0,M.useEffect)(()=>{let t,n=()=>{let n=e.getQueryData(X.health)?.capabilities?.localHandoff===!0;n&&t===void 0?t=ps(`health`,t=>{e.setQueryData(X.health,t)}):!n&&t!==void 0&&(t(),t=void 0)};n();let r=e.getQueryCache().subscribe(n);return()=>{r(),t?.()}},[e])}function Ts(){return F({queryKey:X.health,queryFn:({signal:e})=>Wi({signal:e})})}function Es(){let e=Ts().data,{projectId:t}=jo();return t===null||t===e?.bootProject?Qo(e?.repo?.remote):void 0}function Ds(){return F({queryKey:X.openTargets,queryFn:({signal:e})=>Xa({signal:e}),staleTime:5*6e4})}function Os(){return F({queryKey:X.runs.list(),queryFn:({signal:e})=>Xi({signal:e})})}function ks(e,t=!0,n=!1){return F({queryKey:[n?`default`:e,`runs`,`list`],queryFn:({signal:t})=>Zi(e,{signal:t}),enabled:t})}function As(e){return F({queryKey:X.runs.detail(e??``),queryFn:({signal:t})=>Qi(e,{signal:t}),enabled:!!e})}function js(e){return F({queryKey:X.runs.diff(e??``),queryFn:({signal:t})=>Sa(e,{signal:t}),enabled:!!e})}function Ms(e,t=!1){return F({queryKey:X.runs.changes(e??``),queryFn:({signal:t})=>wa(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:t?4e3:!1,refetchOnWindowFocus:!0,staleTime:0})}function Ns(e,t){return F({queryKey:X.runs.file(e??``,t??``),queryFn:({signal:n})=>Ta(e,t,{signal:n}),enabled:!!e&&t!==void 0,retry:!1})}function Ps(e){return F({queryKey:X.groups.detail(e??``),queryFn:({signal:t})=>Da(e,{signal:t}),enabled:!!e})}function Fs(e,t=!1){return F({queryKey:X.runs.commits(e??``),queryFn:({signal:t})=>ma(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:t?5e3:!1})}function Is(e,t){return F({queryKey:X.runs.commit(e??``,t??``),queryFn:({signal:n})=>ha(e,t,{signal:n}),enabled:!!e&&!!t,retry:!1})}function Ls(e,t=!0){return F({queryKey:X.runs.handoff(e??``),queryFn:({signal:t})=>Ca(e,{signal:t}),enabled:!!e&&t})}function Rs(e=!0){return F({queryKey:X.todos,queryFn:({signal:e})=>oa({signal:e}),enabled:e})}function zs(){return F({queryKey:X.workflows,queryFn:({signal:e})=>ea({signal:e})})}function Bs(e=!0){let t=P(),n=X.skills,r=n[0],i=F({queryKey:n,queryFn:({signal:e})=>ta({signal:e}),enabled:e}),a=F({queryKey:X.skillsReady,queryFn:({signal:e})=>na({signal:e}),enabled:e&&i.isSuccess,staleTime:1/0,retry:!1});return(0,M.useEffect)(()=>{Array.isArray(a.data)&&t.setQueryData([r,`skills`],a.data)},[t,a.data,r]),i}function Vs(e=!0){let t=P(),n=X.importableSkills,r=n[0],i=F({queryKey:n,queryFn:({signal:e})=>ia({signal:e}),enabled:e}),a=F({queryKey:X.importableSkillsReady,queryFn:({signal:e})=>aa({signal:e}),enabled:e&&i.isSuccess,staleTime:1/0,retry:!1});return(0,M.useEffect)(()=>{Array.isArray(a.data)&&t.setQueryData([r,`skills`,`importable`],a.data)},[t,a.data,r]),i}function Hs(){return F({queryKey:X.launchKey,queryFn:({signal:e})=>qi({signal:e}),staleTime:1/0})}function Us(){return F({queryKey:X.repo,queryFn:({signal:e})=>sa({signal:e})})}function Ws(){return F({queryKey:X.repoChanges,queryFn:({signal:e})=>fa({signal:e}),retry:!1})}function Gs(e){return F({queryKey:X.repoCommit(e??``),queryFn:({signal:t})=>pa(e,{signal:t}),enabled:!!e,retry:!1})}function Ks(){return F({queryKey:X.config,queryFn:({signal:e})=>ca({signal:e})})}function qs(){return F({queryKey:X.worktrees,queryFn:({signal:e})=>Eo({signal:e})})}function Js(){return F({queryKey:X.uiState,queryFn:({signal:e})=>$i({signal:e})})}function Ys(){return F({queryKey:X.agentConfig,queryFn:({signal:e})=>la({signal:e})})}function Xs(e){return F({queryKey:X.agentConfigFile(e??``),queryFn:({signal:t})=>ua(e,{signal:t}),enabled:e!==null})}function Zs(e){let t=P(),n=X.agentConfig,r=X.agentConfigFile(e);return I({mutationFn:t=>da(e,t),onSuccess:e=>{t.setQueryData(r,e),t.invalidateQueries({queryKey:n})}})}function Qs(){return F({queryKey:Z.uiState,queryFn:({signal:e})=>vo({signal:e})})}function $s(){return F({queryKey:Z.config,queryFn:({signal:e})=>bo({signal:e})})}function ec(e,t=!0){return F({queryKey:Z.skillsUpdate(e),queryFn:({signal:t})=>xo(e,{signal:t}),enabled:t,refetchInterval:e=>{let t=e.state.data?.status;return t===void 0||t===`idle`||t===`checking`||t===`updating`?6e4:!1}})}function tc(e){let t=P();return I({mutationFn:t=>Wa(e,t),onSuccess:()=>t.invalidateQueries({queryKey:X.runs.all})})}function nc(){let e=P();return I({mutationFn:e=>za(e),onMutate:async t=>{await e.cancelQueries({queryKey:X.runs.list()}),await e.cancelQueries({queryKey:X.runs.detail(t)});let n=e.getQueryData(X.runs.list()),r=e.getQueryData(X.runs.detail(t)),i=new Date().toISOString();return e.setQueryData(X.runs.list(),e=>e?.map(e=>e.id===t?{...e,seenAt:i}:e)),e.setQueryData(X.runs.detail(t),e=>e&&{...e,seenAt:i}),{prevList:n,prevDetail:r,id:t}},onError:(t,n,r)=>{r?.prevList&&e.setQueryData(X.runs.list(),r.prevList),r?.prevDetail&&e.setQueryData(X.runs.detail(n),r.prevDetail)},onSuccess:t=>{e.setQueryData(X.runs.list(),e=>e?.map(e=>e.id===t.id?t:e)),e.setQueryData(X.runs.detail(t.id),t)}})}function rc(e){let t=P();return I({mutationFn:t=>to(e,t),onSuccess:()=>t.invalidateQueries({queryKey:X.runs.all}),onError:e=>{e instanceof Pi&&e.status===409&&t.invalidateQueries({queryKey:X.runs.all})}})}function ic(e){let t=P();return I({mutationFn:(t={})=>Ha(e,t),onSuccess:()=>t.invalidateQueries({queryKey:X.runs.all})})}function ac(e){let t=P();return I({mutationFn:({msgId:t,message:n})=>no(e,t,n),onSuccess:()=>t.invalidateQueries({queryKey:X.runs.all})})}function oc(e){let t=P();return I({mutationFn:t=>ro(e,t),onSuccess:()=>t.invalidateQueries({queryKey:X.runs.all})})}function sc(e={},t=!0){return F({queryKey:X.github(e),queryFn:({signal:t})=>ga({limit:e.limit},{signal:t}),enabled:t})}function cc(e,t=!0){return F({queryKey:X.githubChecks(e),queryFn:({signal:t})=>_a(e,{signal:t}),enabled:t&&e.length>0,staleTime:6e4})}function lc(e,t,n=!0){return F({queryKey:X.githubComments(e,t),queryFn:({signal:n})=>va(e,t,{},{signal:n}),enabled:n,staleTime:6e4})}function uc(e){return F({queryKey:[`github`,`pr-changes`,e??0],queryFn:({signal:t})=>xa(e,{},{signal:t}),enabled:e!==void 0,staleTime:6e4,retry:!1})}var dc=l(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),fc=l(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),pc=e(n(),1),mc=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,hc=p,gc=(e,t)=>n=>{if(t?.variants==null)return hc(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=mc(t)||mc(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return hc(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function _c(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function vc(...e){return t=>{let n=!1,r=e.map(e=>{let r=_c(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():_c(e[t],null)}}}}function yc(...e){return M.useCallback(vc(...e),e)}function bc(e){let t=M.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Oc(r)&&typeof Mc==`function`&&(r=Mc(r._payload)),M.Children.forEach(r,e=>{if(Ec(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Oc(n)&&typeof Mc==`function`&&(n=Mc(n._payload)),a=Cc(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=M.cloneElement(a,void 0,s):!o&&M.Children.count(r)===1&&M.isValidElement(r)&&(a=r);let c=a?Tc(a):void 0,l=yc(n,c);if(!a){if(r||r===0)throw Error(o?jc(e):Ac(e));return r}let u=wc(i,a.props??{});return a.type!==M.Fragment&&(u.ref=n?l:c),M.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var xc=bc(`Slot`),Sc=Symbol.for(`radix.slottable`),Cc=(e,t)=>{if(`child`in e.props){let t=e.props.child;return M.isValidElement(t)?M.cloneElement(t,void 0,e.props.children(t.props.children)):null}return M.isValidElement(t)?t:null};function wc(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Tc(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Ec(e){return M.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Sc}var Dc=Symbol.for(`react.lazy`);function Oc(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Dc&&`_payload`in e&&kc(e._payload)}function kc(e){return typeof e==`object`&&!!e&&`then`in e}var Ac=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,jc=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Mc=M.use,Nc=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=bc(`Primitive.${t}`),r=M.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,N.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Pc(e,t){e&&pc.flushSync(()=>e.dispatchEvent(t))}function Fc(e,t=[]){let n=[];function r(t,r){let i=M.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=M.useMemo(()=>o,Object.values(o));return(0,N.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=M.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>M.createContext(e));return function(n){let r=n?.[e]||t;return M.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Ic(i,...t)]}function Ic(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return M.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function Lc(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}var Rc=globalThis?.document?M.useLayoutEffect:()=>{},zc=M.useInsertionEffect||Rc;function Bc({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Vc({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=M.useRef(e!==void 0);M.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,M.useCallback(t=>{if(s){let n=Hc(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Vc({defaultProp:e,onChange:t}){let[n,r]=M.useState(e),i=M.useRef(n),a=M.useRef(t);return zc(()=>{a.current=t},[t]),M.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Hc(e){return typeof e==`function`}function Uc(e,t){return M.useReducer((e,n)=>t[e][n]??e,e)}var Wc=e=>{let{present:t,children:n}=e,r=Gc(t),i=typeof n==`function`?n({present:r.isPresent}):M.Children.only(n),a=qc(r.ref,Yc(i));return typeof n==`function`||r.isPresent?M.cloneElement(i,{ref:a}):null};Wc.displayName=`Presence`;function Gc(e){let[t,n]=M.useState(),r=M.useRef(null),i=M.useRef(e),a=M.useRef(`none`),o=M.useRef(void 0),[s,c]=Uc(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return M.useEffect(()=>{s===`mounted`?(a.current=o.current??Jc(r.current),o.current=void 0):a.current=`none`},[s]),Rc(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Jc(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Rc(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Jc(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=Jc(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:M.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Jc(t)}else r.current=null;n(e)},[])}}function Kc(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function qc(...e){let t=M.useRef(e);return t.current=e,M.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Kc(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Kc(n[e],null)}}},[])}function Jc(e){return e?.animationName||`none`}function Yc(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xc=M.useId||(()=>void 0),Zc=0;function Qc(e){let[t,n]=M.useState(Xc());return Rc(()=>{e||n(e=>e??String(Zc++))},[e]),e||(t?`radix-${t}`:``)}function $c(e){let t=M.useRef(e);return M.useEffect(()=>{t.current=e}),M.useMemo(()=>((...e)=>t.current?.(...e)),[])}var el=`DismissableLayer`,tl=`dismissableLayer.update`,nl=`dismissableLayer.pointerDownOutside`,rl=`dismissableLayer.focusOutside`,il,al=M.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ol=M.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=M.useContext(al),[d,f]=M.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=M.useState({}),h=yc(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=M.useRef(!1),C=dl(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:M.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=fl(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),ee=d?y===g.length-1:!1,te=$c(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return M.useEffect(()=>{if(ee)return p.addEventListener(`keydown`,te,{capture:!0}),()=>p.removeEventListener(`keydown`,te,{capture:!0})},[p,ee,te]),M.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(il=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),pl(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=il))}},[d,p,n,u]),M.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),pl())},[d,u]),M.useEffect(()=>{let e=()=>m({});return document.addEventListener(tl,e),()=>document.removeEventListener(tl,e)},[]),(0,N.jsx)(Nc.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:Lc(e.onFocusCapture,w.onFocusCapture),onBlurCapture:Lc(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:Lc(e.onPointerDownCapture,C.onPointerDownCapture)})});ol.displayName=el;var sl=`DismissableLayerBranch`,cl=M.forwardRef((e,t)=>{let n=M.useContext(al),r=M.useRef(null),i=yc(t,r);return M.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,N.jsx)(Nc.div,{...e,ref:i})});cl.displayName=sl;function ll(){let e=M.useContext(al),[t,n]=M.useState(null);return M.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var ul=()=>!0;function dl(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=ul}=t,s=$c(e),c=M.useRef(!1),l=M.useRef(!1),u=M.useRef(new Map),d=M.useRef(()=>{});return M.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}function t(){return Array.from(u.current.values()).some(Boolean)}function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}function p(e){l.current&&u.current.set(e.type,!1)}let m=a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||ml(nl,s,p,{discrete:!0})};if(!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:()=>c.current=!0}}function fl(e,t=globalThis?.document){let n=$c(e),r=M.useRef(!1);return M.useEffect(()=>{let e=e=>{e.target&&!r.current&&ml(rl,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function pl(){let e=new CustomEvent(tl);document.dispatchEvent(e)}function ml(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Pc(i,a):i.dispatchEvent(a)}var hl=`focusScope.autoFocusOnMount`,gl=`focusScope.autoFocusOnUnmount`,_l={bubbles:!1,cancelable:!0},vl=`FocusScope`,yl=M.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=M.useState(null),l=$c(i),u=$c(a),d=M.useRef(null),f=yc(t,c),p=M.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;M.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Q(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Q(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Q(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),M.useEffect(()=>{if(s){El.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(hl,_l);s.addEventListener(hl,l),s.dispatchEvent(t),t.defaultPrevented||(bl(kl(Sl(s)),{select:!0}),document.activeElement===e&&Q(s))}return()=>{s.removeEventListener(hl,l),setTimeout(()=>{let t=new CustomEvent(gl,_l);s.addEventListener(gl,u),s.dispatchEvent(t),t.defaultPrevented||Q(e??document.body,{select:!0}),s.removeEventListener(gl,u),El.remove(p)},0)}}},[s,l,u,p]);let m=M.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=xl(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Q(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Q(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,N.jsx)(Nc.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});yl.displayName=vl;function bl(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Q(r,{select:t}),document.activeElement!==n)return}function xl(e){let t=Sl(e);return[Cl(t,e),Cl(t.reverse(),e)]}function Sl(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Cl(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):wl(r,{upTo:t})))return r}function wl(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}function Tl(e){return e instanceof HTMLInputElement&&`select`in e}function Q(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Tl(e)&&t&&e.select()}}var El=Dl();function Dl(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ol(e,t),e.unshift(t)},remove(t){e=Ol(e,t),e[0]?.resume()}}}function Ol(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function kl(e){return e.filter(e=>e.tagName!==`A`)}var Al=`Portal`,jl=M.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=M.useState(!1);Rc(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?pc.createPortal((0,N.jsx)(Nc.div,{...r,ref:t}),o):null});jl.displayName=Al;var Ml=0,Nl=null;function Pl(){M.useEffect(()=>{Nl||={start:Fl(),end:Fl()};let{start:e,end:t}=Nl;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Ml++,()=>{Ml===1&&(Nl?.start.remove(),Nl?.end.remove(),Nl=null),Ml=Math.max(0,Ml-1)}},[])}function Fl(){let 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}var $=function(){return $=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},$.apply(this,arguments)};function Il(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ll(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Rl=`right-scroll-bar-position`,zl=`width-before-scroll-bar`,Bl=`with-scroll-bars-hidden`,Vl=`--removed-body-scroll-bar-size`;function Hl(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ul(e,t){var n=(0,M.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Wl=typeof window<`u`?M.useLayoutEffect:M.useEffect,Gl=new WeakMap;function Kl(e,t){var n=Ul(t||null,function(t){return e.forEach(function(e){return Hl(e,t)})});return Wl(function(){var t=Gl.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Hl(e,null)}),i.forEach(function(e){r.has(e)||Hl(e,a)})}Gl.set(n,e)},[e]),n}function ql(e){return e}function Jl(e,t){t===void 0&&(t=ql);var n=[],r=!1;return{read:function(){if(r)throw 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(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Yl(e){e===void 0&&(e={});var t=Jl(null);return t.options=$({async:!0,ssr:!1},e),t}var Xl=function(e){var t=e.sideCar,n=Il(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return M.createElement(r,$({},n))};Xl.isSideCarExport=!0;function Zl(e,t){return e.useMedium(t),Xl}var Ql=Yl(),$l=function(){},eu=M.forwardRef(function(e,t){var n=M.useRef(null),r=M.useState({onScrollCapture:$l,onWheelCapture:$l,onTouchMoveCapture:$l}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Il(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Kl([n,t]),C=$($({},b),i);return M.createElement(M.Fragment,null,u&&M.createElement(x,{sideCar:Ql,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?M.cloneElement(M.Children.only(s),$($({},C),{ref:S})):M.createElement(v,$({},C,{className:c,ref:S}),s))});eu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},eu.classNames={fullWidth:zl,zeroRight:Rl};var tu,nu=function(){if(tu)return tu;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ru(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=nu();return t&&e.setAttribute(`nonce`,t),e}function iu(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function au(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ou=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ru())&&(iu(t,n),au(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},su=function(){var e=ou();return function(t,n){M.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},cu=function(){var e=su();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},lu={left:0,top:0,right:0,gap:0},uu=function(e){return parseInt(e||``,10)||0},du=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[uu(n),uu(r),uu(i)]},fu=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return lu;var t=du(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])}},pu=cu(),mu=`data-scroll-locked`,hu=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
4
- .${Bl} {
5
- overflow: hidden ${r};
6
- padding-right: ${s}px ${r};
7
- }
8
- body[${mu}] {
9
- overflow: hidden ${r};
10
- overscroll-behavior: contain;
11
- ${[t&&`position: relative ${r};`,n===`margin`&&`
12
- padding-left: ${i}px;
13
- padding-top: ${a}px;
14
- padding-right: ${o}px;
15
- margin-left:0;
16
- margin-top:0;
17
- margin-right: ${s}px ${r};
18
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
19
- }
20
-
21
- .${Rl} {
22
- right: ${s}px ${r};
23
- }
24
-
25
- .${zl} {
26
- margin-right: ${s}px ${r};
27
- }
28
-
29
- .${Rl} .${Rl} {
30
- right: 0 ${r};
31
- }
32
-
33
- .${zl} .${zl} {
34
- margin-right: 0 ${r};
35
- }
36
-
37
- body[${mu}] {
38
- ${Vl}: ${s}px;
39
- }
40
- `},gu=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},_u=function(){M.useEffect(function(){return document.body.setAttribute(mu,(gu()+1).toString()),function(){var e=gu()-1;e<=0?document.body.removeAttribute(mu):document.body.setAttribute(mu,e.toString())}},[])},vu=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;_u();var a=M.useMemo(function(){return fu(i)},[i]);return M.createElement(pu,{styles:hu(a,!t,i,n?``:`!important`)})},yu=!1;if(typeof window<`u`)try{var bu=Object.defineProperty({},"passive",{get:function(){return yu=!0,!0}});window.addEventListener(`test`,bu,bu),window.removeEventListener(`test`,bu,bu)}catch{yu=!1}var xu=yu?{passive:!1}:!1,Su=function(e){return e.tagName===`TEXTAREA`},Cu=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Su(e)&&n[t]===`visible`)},wu=function(e){return Cu(e,`overflowY`)},Tu=function(e){return Cu(e,`overflowX`)},Eu=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),ku(e,r)){var i=Au(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Du=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Ou=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},ku=function(e,t){return e===`v`?wu(t):Tu(t)},Au=function(e,t){return e===`v`?Du(t):Ou(t)},ju=function(e,t){return e===`h`&&t===`rtl`?-1:1},Mu=function(e,t,n,r,i){var a=ju(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Au(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&ku(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Nu=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Pu=function(e){return[e.deltaX,e.deltaY]},Fu=function(e){return e&&`current`in e?e.current:e},Iu=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Lu=function(e){return`
41
- .block-interactivity-${e} {pointer-events: none;}
42
- .allow-interactivity-${e} {pointer-events: all;}
43
- `},Ru=0,zu=[];function Bu(e){var t=M.useRef([]),n=M.useRef([0,0]),r=M.useRef(),i=M.useState(Ru++)[0],a=M.useState(cu)[0],o=M.useRef(e);M.useEffect(function(){o.current=e},[e]),M.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Ll([e.lockRef.current],(e.shards||[]).map(Fu),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=M.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Nu(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Eu(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Eu(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Mu(h,t,e,h===`h`?s:c,!0)},[]),c=M.useCallback(function(e){var n=e;if(!(!zu.length||zu[zu.length-1]!==a)){var r=`deltaY`in n?Pu(n):Nu(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Iu(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Fu).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=M.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Vu(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=M.useCallback(function(e){n.current=Nu(e),r.current=void 0},[]),d=M.useCallback(function(t){l(t.type,Pu(t),t.target,s(t,e.lockRef.current))},[]),f=M.useCallback(function(t){l(t.type,Nu(t),t.target,s(t,e.lockRef.current))},[]);M.useEffect(function(){return zu.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,xu),document.addEventListener(`touchmove`,c,xu),document.addEventListener(`touchstart`,u,xu),function(){zu=zu.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,xu),document.removeEventListener(`touchmove`,c,xu),document.removeEventListener(`touchstart`,u,xu)}},[]);var p=e.removeScrollBar,m=e.inert;return M.createElement(M.Fragment,null,m?M.createElement(a,{styles:Lu(i)}):null,p?M.createElement(vu,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Vu(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Hu=Zl(Ql,Bu),Uu=M.forwardRef(function(e,t){return M.createElement(eu,$({},e,{ref:t,sideCar:Hu}))});Uu.classNames=eu.classNames;var Wu=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Gu=new WeakMap,Ku=new WeakMap,qu={},Ju=0,Yu=function(e){return e&&(e.host||Yu(e.parentNode))},Xu=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Yu(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Zu=function(e,t,n,r){var i=Xu(t,Array.isArray(e)?e:[e]);qu[n]||(qu[n]=new WeakMap);var a=qu[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Gu.get(e)||0)+1,l=(a.get(e)||0)+1;Gu.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Ku.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Ju++,function(){o.forEach(function(e){var t=Gu.get(e)-1,i=a.get(e)-1;Gu.set(e,t),a.set(e,i),t||(Ku.has(e)||e.removeAttribute(r),Ku.delete(e)),i||e.removeAttribute(n)}),Ju--,Ju||(Gu=new WeakMap,Gu=new WeakMap,Ku=new WeakMap,qu={})}},Qu=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Wu(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Zu(r,i,n,`aria-hidden`)):function(){return null}},$u=gc(`inline-flex shrink-0 items-center justify-center gap-[7px] rounded-md font-semibold whitespace-nowrap transition-[background-color,border-color,opacity,filter] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{primary:`bg-primary text-primary-foreground hover:brightness-[0.96]`,contrast:`bg-contrast text-contrast-foreground hover:brightness-[0.96]`,outline:`border border-border bg-card hover:bg-muted`,ghost:`text-muted-foreground hover:bg-muted hover:text-foreground`,"danger-ghost":`text-danger hover:bg-danger/10`},size:{default:`h-9 px-3.5 text-[13.5px]`,sm:`h-[30px] rounded-sm px-2.5 text-[12.5px]`,icon:`size-9`,"icon-sm":`size-[30px] rounded-sm`}},defaultVariants:{variant:`primary`,size:`default`}});function ed({className:e,variant:t=`primary`,size:n=`default`,asChild:r=!1,...i}){return(0,N.jsx)(r?xc:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:d($u({variant:t,size:n,className:e})),...i})}var td=5e3,nd=[],rd=1,id=new Set;function ad(e){nd=e;for(let e of id)e()}function od(e){return id.add(e),()=>id.delete(e)}function sd(e,t={}){let n={id:rd++,message:e,tone:t.tone??`default`};ad([...nd,n]),setTimeout(()=>ad(nd.filter(e=>e.id!==n.id)),td)}function cd(){let e=(0,M.useSyncExternalStore)(od,()=>nd);return e.length===0?null:(0,N.jsx)(`div`,{"data-slot":`toaster`,className:`pointer-events-none fixed inset-x-0 bottom-[calc(16px+env(safe-area-inset-bottom))] z-50 flex flex-col items-center gap-2 px-4`,children:e.map(e=>(0,N.jsx)(`div`,{role:`status`,"data-slot":`toast`,"data-tone":e.tone,className:d(`pointer-events-auto max-w-full rounded-md px-3.5 py-2.5 text-[13px] font-medium shadow-modal`,e.tone===`danger`?`bg-danger text-danger-foreground`:`bg-contrast text-contrast-foreground`),children:e.message},e.id))})}var ld={primary:`border-primary/25 bg-primary/15 text-primary`,neutral:`border-border bg-card text-foreground shadow-xs`,danger:`border-danger/20 bg-danger/15 text-danger`};function ud({icon:e,tone:t=`neutral`,title:n,subtitle:r,children:i,actions:a,backdrop:o=!1,heading:s=`h1`,className:c}){return(0,N.jsxs)(`div`,{"data-slot":`centered-state`,"data-tone":t,className:d(`relative isolate flex min-h-full flex-1 flex-col items-center justify-center px-6 py-12 text-center`,c),children:[o?(0,N.jsx)(pd,{}):null,(0,N.jsxs)(`div`,{className:`flex w-full max-w-md flex-col items-center gap-4`,children:[(0,N.jsx)(`div`,{"data-slot":`centered-state-tile`,className:d(`flex size-[72px] items-center justify-center rounded-[18px] border [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-7`,ld[t]),children:e}),(0,N.jsx)(s,{className:`text-2xl font-semibold text-balance text-foreground`,children:n}),r?(0,N.jsx)(`p`,{className:`text-sm text-pretty text-muted-foreground`,children:r}):null,i?(0,N.jsx)(`div`,{className:`w-full pt-2`,children:i}):null,a?(0,N.jsx)(`div`,{className:`flex items-center justify-center gap-3 pt-2`,children:a}):null]})]})}var dd=[{top:`6%`,left:`14%`,size:2,tone:`violet`,opacity:.5},{top:`11%`,left:`31%`,size:3,tone:`violet`,opacity:.45},{top:`8%`,left:`52%`,size:2,tone:`pending`,opacity:.4},{top:`15%`,left:`71%`,size:2,tone:`violet`,opacity:.5},{top:`9%`,left:`86%`,size:3,tone:`primary`,opacity:.4},{top:`22%`,left:`8%`,size:2,tone:`pending`,opacity:.4},{top:`27%`,left:`24%`,size:2,tone:`primary`,opacity:.35},{top:`20%`,left:`44%`,size:3,tone:`violet`,opacity:.35},{top:`25%`,left:`62%`,size:2,tone:`violet`,opacity:.4},{top:`30%`,left:`79%`,size:2,tone:`primary`,opacity:.35},{top:`36%`,left:`12%`,size:3,tone:`violet`,opacity:.3},{top:`42%`,left:`35%`,size:2,tone:`pending`,opacity:.28},{top:`47%`,left:`58%`,size:2,tone:`primary`,opacity:.28},{top:`52%`,left:`88%`,size:2,tone:`violet`,opacity:.25},{top:`60%`,left:`29%`,size:3,tone:`violet`,opacity:.22}],fd={violet:`bg-violet`,primary:`bg-primary`,pending:`bg-pending`};function pd({className:e}){return(0,N.jsx)(`div`,{"data-slot":`twinkle-backdrop`,"aria-hidden":`true`,className:d(`pointer-events-none absolute inset-0 -z-10 overflow-hidden [mask-image:linear-gradient(to_bottom,black_25%,transparent_88%)]`,e),children:dd.map((e,t)=>(0,N.jsx)(`span`,{className:d(`absolute rounded-[1px] motion-safe:animate-pulse`,e.size===3?`size-[3px]`:`size-0.5`,fd[e.tone]),style:{top:e.top,left:e.left,opacity:e.opacity,animationDuration:`3.5s`,animationDelay:`${t%5*700}ms`}},t))})}export{hs as $,ii as $n,La as $t,X as A,Ja as An,is as At,lc as B,Ka as Bn,Yo as Bt,xc as C,Ba as Cn,pe as Cr,Ss as Ct,gc as D,Ya as Dn,T as Dr,qs as Dt,yc as E,Za as En,re as Er,Qs as Et,ic as F,wo as Fn,ns as Ft,Vs as G,co as Gn,zo as Gt,Ps as H,lo as Hn,Vo as Ht,ac as I,yo as In,es as It,Ds as J,Oi as Jn,Mo as Jt,Hs as K,ki as Kn,Lo as Kt,ys as L,Do as Ln,$o as Lt,Xs as M,eo as Mn,Zo as Mt,Cs as N,To as Nn,Jo as Nt,fc as O,ho as On,Z as Ot,Ks as P,_o as Pn,qo as Pt,vs as Q,ri as Qn,Ra as Qt,sc as R,ra as Rn,ts as Rt,Pc as S,Ta as Sn,D as Sr,Js as St,vc as T,Qa as Tn,we as Tr,$s as Tt,Ts as U,ka as Un,Ro as Ut,uc as V,Ea as Vn,Ho as Vt,ws as W,qa as Wn,Uo as Wt,Es as X,Mi as Xn,Pi as Xt,tc as Y,Ni as Yn,jo as Yt,ks as Z,ti as Zn,Co as Zt,Bc as _,ga as _n,se as _r,Os as _t,ed as a,Ha as an,W as ar,Us as at,Fc as b,ya as bn,de as br,ec as bt,Uu as c,Fa as cn,di as cr,_s as ct,yl as d,Ga as dn,nt as dr,Is as dt,Ia as en,cr as er,Zs as et,ol as f,go as fn,P as fr,Fs as ft,Wc as g,oo as gn,j as gr,ms as gt,Qc as h,po as hn,Me as hr,Ls as ht,sd as i,Oa as in,Kt as ir,oc as it,Ys as j,ao as jn,Xo as jt,dc as k,Wa as kn,Go as kt,Pl as l,Ua as ln,I as lr,As as lt,$c as m,fo as mn,Ve as mr,Ns as mt,pd as n,So as nn,ur as nr,bs as nt,$u as o,so as on,Pn as or,Ws as ot,ll as p,Va as pn,Qe as pr,js as pt,nc as q,Ei as qn,Bo as qt,cd as r,$a as rn,fr as rr,xs as rt,Qu as s,io as sn,Rn as sr,Gs as st,ud as t,uo as tn,lr as tr,gs as tt,jl as u,mo as un,F as ur,Ms as ut,Rc as v,va as vn,A as vr,rc as vt,bc as w,ba as wn,O as wr,zs as wt,Nc as x,qi as xn,ue as xr,Rs as xt,Lc as y,xa as yn,fe as yr,Bs as yt,cc as z,Oo as zn,rs as zt};
@@ -1 +0,0 @@
1
- import{r as e}from"./utils-DsLuRXwV.js";var t=e(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]);export{t};
@@ -1 +0,0 @@
1
- import{r as e}from"./utils-DsLuRXwV.js";var t=e(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]);export{t};
@@ -1 +0,0 @@
1
- import{r as e}from"./utils-DsLuRXwV.js";var t=e(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]);export{t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{E as i,S as a,_ as o,b as s,c,d as l,f as u,g as d,h as f,l as p,m,s as h,u as g,v as _,w as v,x as y,y as b}from"./centered-state-ZtnFHA-n.js";import{r as x,t as S}from"./utils-DsLuRXwV.js";var C=x(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),w=e(t(),1),T=r();function E(e){let t=e+`CollectionProvider`,[n,r]=s(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=e=>{let{scope:t,children:n}=e,r=w.useRef(null),i=w.useRef(new Map).current;return(0,T.jsx)(a,{scope:t,itemMap:i,collectionRef:r,children:n})};c.displayName=t;let l=e+`CollectionSlot`,u=v(l),d=w.forwardRef((e,t)=>{let{scope:n,children:r}=e,a=i(t,o(l,n).collectionRef);return(0,T.jsx)(u,{ref:a,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=v(f),h=w.forwardRef((e,t)=>{let{scope:n,children:r,...a}=e,s=w.useRef(null),c=i(t,s),l=o(f,n);return w.useEffect(()=>(l.itemMap.set(s,{ref:s,...a}),()=>void l.itemMap.delete(s))),(0,T.jsx)(m,{[p]:``,ref:c,children:r})});h.displayName=f;function g(t){let n=o(e+`CollectionConsumer`,t);return w.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:c,Slot:d,ItemSlot:h},g,r]}var D=w.createContext(void 0);function O(e){let t=w.useContext(D);return e||t||`ltr`}var k=e(n(),1);function A(e){let[t,n]=w.useState(void 0);return _(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var j=[`top`,`right`,`bottom`,`left`],M=Math.min,N=Math.max,P=Math.round,F=Math.floor,I=e=>({x:e,y:e}),ee={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function te(e,t,n){return N(e,M(t,n))}function L(e,t){return typeof e==`function`?e(t):e}function R(e){return e.split(`-`)[0]}function z(e){return e.split(`-`)[1]}function B(e){return e===`x`?`y`:`x`}function ne(e){return e===`y`?`height`:`width`}function V(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function re(e){return B(V(e))}function ie(e,t,n){n===void 0&&(n=!1);let r=z(e),i=re(e),a=ne(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=pe(o)),[o,pe(o)]}function ae(e){let t=pe(e);return[oe(e),t,oe(t)]}function oe(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var se=[`left`,`right`],ce=[`right`,`left`],le=[`top`,`bottom`],ue=[`bottom`,`top`];function de(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ce:se:t?se:ce;case`left`:case`right`:return t?le:ue;default:return[]}}function fe(e,t,n,r){let i=z(e),a=de(R(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(oe)))),a}function pe(e){let t=R(e);return ee[t]+e.slice(t.length)}function me(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function he(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:me(e)}function ge(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function _e(e,t,n){let{reference:r,floating:i}=e,a=V(t),o=re(t),s=ne(o),c=R(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=z(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function ve(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=L(t,e),p=he(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ge(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ge(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ye=50,be=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ve},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=_e(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ye&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=_e(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},xe=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=L(e,t)||{};if(l==null)return{};let d=he(u),f={x:n,y:r},p=re(i),m=ne(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=M(d[_],T),D=M(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=te(E,k,O),j=!c.arrow&&z(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,N=j?k<E?k-E:k-O:0;return{[p]:f[p]+N,data:{[p]:A,centerOffset:k-A-N,...j&&{alignmentOffset:N}},reset:j}}}),Se=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=L(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=R(r),_=V(o),v=R(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[pe(o)]:ae(o)),x=p!==`none`;!d&&x&&b.push(...fe(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ie(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==V(t))||T.every(e=>V(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=V(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ce(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function we(e){return j.some(t=>e[t]>=0)}var Te=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=L(e,t);switch(i){case`referenceHidden`:{let e=Ce(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:we(e)}}}case`escaped`:{let e=Ce(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:we(e)}}}default:return{}}}}},Ee=new Set([`left`,`top`]);async function De(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=R(n),s=z(n),c=V(n)===`y`,l=Ee.has(o)?-1:1,u=a&&c?-1:1,d=L(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Oe=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await De(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ke=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=L(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=V(i),p=B(f),m=u[p],h=u[f],g=(e,t)=>te(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ae=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=L(e,t),u={x:n,y:r},d=V(i),f=B(d),p=u[f],m=u[d],h=L(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ee.has(R(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},je=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=L(e,t),c=await i.detectOverflow(t,s),l=R(n),u=z(n),d=V(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=M(p-c[m],g),y=M(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*N(c.left,c.right):S=p-2*N(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Me(){return typeof window<`u`}function Ne(e){return Pe(e)?(e.nodeName||``).toLowerCase():`#document`}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function U(e){return((Pe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Pe(e){return Me()?e instanceof Node||e instanceof H(e).Node:!1}function W(e){return Me()?e instanceof Element||e instanceof H(e).Element:!1}function G(e){return Me()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function Fe(e){return!Me()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}function Ie(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Le(e){return/^(table|td|th)$/.test(Ne(e))}function Re(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ze=/transform|translate|scale|rotate|perspective|filter/,Be=/paint|layout|strict|content/,K=e=>!!e&&e!==`none`,Ve;function He(e){let t=W(e)?q(e):e;return K(t.transform)||K(t.translate)||K(t.scale)||K(t.rotate)||K(t.perspective)||!We()&&(K(t.backdropFilter)||K(t.filter))||ze.test(t.willChange||``)||Be.test(t.contain||``)}function Ue(e){let t=J(e);for(;G(t)&&!Ge(t);){if(He(t))return t;if(Re(t))return null;t=J(t)}return null}function We(){return Ve??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ve}function Ge(e){return/^(html|body|#document)$/.test(Ne(e))}function q(e){return H(e).getComputedStyle(e)}function Ke(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if(Ne(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Fe(e)&&e.host||U(e);return Fe(t)?t.host:t}function qe(e){let t=J(e);return Ge(t)?(e.ownerDocument||e).body:G(t)&&Ie(t)?t:qe(t)}function Je(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=qe(e),i=r===e.ownerDocument?.body,a=H(r);if(i){let e=Ye(a);return t.concat(a,a.visualViewport||[],Ie(r)?r:[],e&&n?Je(e):[])}else return t.concat(r,Je(r,[],n))}function Ye(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xe(e){let t=q(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=G(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=P(n)!==a||P(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ze(e){return W(e)?e:e.contextElement}function Qe(e){let t=Ze(e);if(!G(t))return I(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Xe(t),o=(a?P(n.width):n.width)/r,s=(a?P(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var $e=I(0);function et(e){let t=H(e);return!We()||!t.visualViewport?$e:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===H(e)}function Y(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ze(e),o=I(1);t&&(r?W(r)&&(o=Qe(r)):o=Qe(e));let s=tt(a,n,r)?et(a):I(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=H(a),t=W(r)?H(r):r,n=e,i=Ye(n);for(;i&&t!==n;){let e=Qe(i),t=i.getBoundingClientRect(),r=q(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=H(i),i=Ye(n)}}return ge({width:u,height:d,x:c,y:l})}function nt(e,t){let n=Ke(e).scrollLeft;return t?t.left+n:Y(U(e)).left+n}function rt(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-nt(e,n),y:n.top+t.scrollTop}}function it(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=U(r),s=t?Re(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=I(1),u=I(0),d=G(r);if((d||!a)&&((Ne(r)!==`body`||Ie(o))&&(c=Ke(r)),d)){let e=Y(r);l=Qe(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?rt(o,c):I(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function at(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ot(e){let t=Ke(e),n=e.ownerDocument.body,r=N(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=N(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+nt(e),o=-t.scrollTop;return q(n).direction===`rtl`&&(a+=N(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var st=25;function ct(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=H(e),a=U(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!We()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(nt(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=st&&(s-=o)}return{width:s,height:c,x:l,y:u}}function lt(e,t){let n=Y(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Qe(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ut(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ct(e,n,t);else if(t===`document`)r=ot(U(e));else if(W(t))r=lt(t,n);else{let n=et(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ge(r)}function dt(e,t){let n=t.get(e);if(n)return n;let r=Je(e,[],!1).filter(e=>W(e)&&Ne(e)!==`body`),i=null,a=q(e).position===`fixed`,o=a?J(e):e;for(;W(o)&&!Ge(o);){let e=q(o),t=He(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=J(o)}return t.set(e,r),r}function ft(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Re(t)?[]:dt(t,this._c):[].concat(n),r],o=ut(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=ut(t,a[e],i);s=N(n.top,s),c=M(n.right,c),l=M(n.bottom,l),u=N(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function pt(e){let{width:t,height:n}=Xe(e);return{width:t,height:n}}function mt(e,t,n){let r=G(t),i=U(t),a=n===`fixed`,o=Y(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=I(0);if((r||!a)&&((Ne(t)!==`body`||Ie(i))&&(s=Ke(t)),r)){let e=Y(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=nt(i));let l=i&&!r&&!a?rt(i,s):I(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function ht(e){return q(e).position===`static`}function gt(e,t){if(!G(e)||q(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function _t(e,t){let n=H(e);if(Re(e))return n;if(!G(e)){let t=J(e);for(;t&&!Ge(t);){if(W(t)&&!ht(t))return t;t=J(t)}return n}let r=gt(e,t);for(;r&&Le(r)&&ht(r);)r=gt(r,t);return r&&Ge(r)&&ht(r)&&!He(r)?n:r||Ue(e)||n}var vt=async function(e){let t=this.getOffsetParent||_t,n=this.getDimensions,r=await n(e.floating);return{reference:mt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yt(e){return q(e).direction===`rtl`}var bt={convertOffsetParentRelativeRectToViewportRelativeRect:it,getDocumentElement:U,getClippingRect:ft,getOffsetParent:_t,getElementRects:vt,getClientRects:at,getDimensions:pt,getScale:Qe,isElement:W,isRTL:yt};function xt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function St(e,t,n){let r=null,i,a=U(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=F(d),h=F(a.clientWidth-(u+f)),g=F(a.clientHeight-(d+p)),_=F(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:N(0,M(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!xt(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=H(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Ct(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ze(e),u=i||a?[...l?Je(l):[],...t?Je(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?St(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Y(e):null;c&&g();function g(){let t=Y(e);h&&!xt(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var wt=Oe,Tt=ke,Et=Se,Dt=je,Ot=Te,kt=xe,At=Ae,jt=(e,t,n)=>{let r=new Map,i=n??{},a={...bt,...i.platform,_c:r};return be(e,t,{...i,platform:a})},Mt=typeof document<`u`?w.useLayoutEffect:function(){};function Nt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Nt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Nt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Pt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ft(e,t){let n=Pt(e);return Math.round(t*n)/n}function It(e){let t=w.useRef(e);return Mt(()=>{t.current=e}),t}function Lt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=w.useState(r);Nt(f,r)||p(r);let[m,h]=w.useState(null),[g,_]=w.useState(null),v=w.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=w.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=w.useRef(null),C=w.useRef(null),T=w.useRef(u),E=c!=null,D=It(c),O=It(i),A=It(l),j=w.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),jt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Nt(T.current,t)&&(T.current=t,k.flushSync(()=>{d(t)}))})},[f,t,n,O,A]);Mt(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=w.useRef(!1);Mt(()=>(M.current=!0,()=>{M.current=!1}),[]),Mt(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(D.current)return D.current(b,x,j);j()}},[b,x,j,D,E]);let N=w.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),P=w.useMemo(()=>({reference:b,floating:x}),[b,x]),F=w.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Ft(P.floating,u.x),r=Ft(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Pt(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return w.useMemo(()=>({...u,update:j,refs:N,elements:P,floatingStyles:F}),[u,j,N,P,F])}var Rt=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:kt({element:r.current,padding:i}).fn(n):r?kt({element:r,padding:i}).fn(n):{}}}},zt=(e,t)=>{let n=wt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bt=(e,t)=>{let n=Tt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vt=(e,t)=>({fn:At(e).fn,options:[e,t]}),Ht=(e,t)=>{let n=Et(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ut=(e,t)=>{let n=Dt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wt=(e,t)=>{let n=Ot(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gt=(e,t)=>{let n=Rt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kt=`Arrow`,qt=w.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,T.jsx)(y.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,T.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});qt.displayName=Kt;var Jt=qt,Yt=`Popper`,[Xt,Zt]=s(Yt),[Qt,$t]=Xt(Yt),en=e=>{let{__scopePopper:t,children:n}=e,[r,i]=w.useState(null),[a,o]=w.useState(void 0);return(0,T.jsx)(Qt,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};en.displayName=Yt;var tn=`PopperAnchor`,nn=w.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...a}=e,o=$t(tn,n),s=w.useRef(null),c=o.onAnchorChange,l=i(t,w.useCallback(e=>{s.current=e,e&&c(e)},[c])),u=w.useRef(null);w.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&c(u.current)});let d=o.placementState&&pn(o.placementState),f=d?.[0],p=d?.[1];return r?null:(0,T.jsx)(y.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...a,ref:l})});nn.displayName=tn;var rn=`PopperContent`,[an,on]=Xt(rn),sn=w.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:h=`optimized`,onPlaced:g,...v}=e,b=$t(rn,n),[x,S]=w.useState(null),C=i(t,S),[E,D]=w.useState(null),O=A(E),k=O?.width??0,j=O?.height??0,M=r+(o===`center`?``:`-`+o),N=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},P=Array.isArray(u)?u:[u],F=P.length>0,I={padding:N,boundary:P.filter(dn),altBoundary:F},{refs:ee,floatingStyles:te,placement:L,isPositioned:R,middlewareData:z}=Lt({strategy:`fixed`,placement:M,whileElementsMounted:(...e)=>Ct(...e,{animationFrame:h===`always`}),elements:{reference:b.anchor},middleware:[zt({mainAxis:a+j,alignmentAxis:s}),l&&Bt({mainAxis:!0,crossAxis:!1,limiter:f===`partial`?Vt():void 0,...I}),l&&Ht({...I}),Ut({...I,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),E&&Gt({element:E,padding:c}),fn({arrowWidth:k,arrowHeight:j}),p&&Wt({strategy:`referenceHidden`,...I,boundary:F?I.boundary:void 0})]}),B=b.setPlacementState;_(()=>(B(L),()=>{B(void 0)}),[L,B]);let[ne,V]=pn(L),re=m(g);_(()=>{R&&re?.()},[R,re]);let ie=z.arrow?.x,ae=z.arrow?.y,oe=z.arrow?.centerOffset!==0,[se,ce]=w.useState();return _(()=>{x&&ce(window.getComputedStyle(x).zIndex)},[x]),(0,T.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...te,transform:R?te.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(` `),...z.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,T.jsx)(an,{scope:n,placedSide:ne,placedAlign:V,onArrowChange:D,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,T.jsx)(y.div,{"data-side":ne,"data-align":V,...v,ref:C,style:{...v.style,animation:R?void 0:`none`}})})})});sn.displayName=rn;var cn=`PopperArrow`,ln={top:`bottom`,right:`left`,bottom:`top`,left:`right`},un=w.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=on(cn,n),a=ln[i.placedSide];return(0,T.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,T.jsx)(Jt,{...r,ref:t,style:{...r.style,display:`block`}})})});un.displayName=cn;function dn(e){return e!==null}var fn=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=pn(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function pn(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var mn=en,hn=nn,gn=sn,_n=un,vn=!1;function yn(){let[e,t]=w.useState(vn);return w.useEffect(()=>{vn||(vn=!0,t(!0))},[]),e}var bn=w.useSyncExternalStore;function xn(){return()=>{}}function Sn(){return bn(xn,()=>!0,()=>!1)}var Cn=typeof bn==`function`?Sn:yn,wn=`rovingFocusGroup.onEntryFocus`,Tn={bubbles:!1,cancelable:!0},En=`RovingFocusGroup`,[Dn,On,kn]=E(En),[An,jn]=s(En,[kn]),[Mn,Nn]=An(En),Pn=w.forwardRef((e,t)=>(0,T.jsx)(Dn.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,T.jsx)(Dn.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,T.jsx)(Fn,{...e,ref:t})})}));Pn.displayName=En;var Fn=w.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,h=w.useRef(null),g=i(t,h),_=O(s),[v,x]=o({prop:c,defaultProp:l??null,onChange:u,caller:En}),[S,C]=w.useState(!1),E=m(d),D=On(n),k=w.useRef(!1),[A,j]=w.useState(0);return w.useEffect(()=>{let e=h.current;if(e)return e.addEventListener(wn,E),()=>e.removeEventListener(wn,E)},[E]),(0,T.jsx)(Mn,{scope:n,orientation:r,dir:_,loop:a,currentTabStopId:v,onItemFocus:w.useCallback(e=>x(e),[x]),onItemShiftTab:w.useCallback(()=>C(!0),[]),onFocusableItemAdd:w.useCallback(()=>j(e=>e+1),[]),onFocusableItemRemove:w.useCallback(()=>j(e=>e-1),[]),children:(0,T.jsx)(y.div,{tabIndex:S||A===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:`none`,...e.style},onMouseDown:b(e.onMouseDown,()=>{k.current=!0}),onFocus:b(e.onFocus,e=>{let t=!k.current;if(e.target===e.currentTarget&&t&&!S){let t=new CustomEvent(wn,Tn);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=D().filter(e=>e.focusable);Vn([e.find(e=>e.active),e.find(e=>e.id===v),...e].filter(Boolean).map(e=>e.ref.current),f)}}k.current=!1}),onBlur:b(e.onBlur,()=>C(!1))})})}),In=`RovingFocusGroupItem`,Ln=w.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=f(),l=a||c,u=Nn(In,n),d=u.currentTabStopId===l,p=On(n),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:g}=u,v=Cn();return _(()=>{if(!(!v||!r))return m(),()=>h()},[v,r,m,h]),w.useEffect(()=>{if(!(v||!r))return m(),()=>h()},[v,r,m,h]),(0,T.jsx)(Dn.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,T.jsx)(y.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:b(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:b(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:b(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Bn(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=p().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Hn(n,r+1):n.slice(r+1)}setTimeout(()=>Vn(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:g!=null}):o})})});Ln.displayName=In;var Rn={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function zn(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Bn(e,t,n){let r=zn(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Rn[r]}function Vn(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Hn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Un=Pn,Wn=Ln,Gn=[`Enter`,` `],Kn=[`ArrowDown`,`PageUp`,`Home`],qn=[`ArrowUp`,`PageDown`,`End`],Jn=[...Kn,...qn],Yn={ltr:[...Gn,`ArrowRight`],rtl:[...Gn,`ArrowLeft`]},Xn={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Zn=`Menu`,[Qn,$n,er]=E(Zn),[X,tr]=s(Zn,[er,Zt,jn]),nr=Zt(),rr=jn(),[ir,Z]=X(Zn),[ar,or]=X(Zn),sr=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=nr(t),[c,l]=w.useState(null),u=w.useRef(!1),d=m(a),f=O(i);return w.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),w.useEffect(()=>{if(!n)return;let e=()=>d(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,T.jsx)(mn,{...s,children:(0,T.jsx)(ir,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,T.jsx)(ar,{scope:t,onClose:w.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};sr.displayName=Zn;var cr=`MenuAnchor`,lr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=nr(n);return(0,T.jsx)(hn,{...i,...r,ref:t})});lr.displayName=cr;var ur=`MenuPortal`,[dr,fr]=X(ur,{forceMount:void 0}),pr=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Z(ur,t);return(0,T.jsx)(dr,{scope:t,forceMount:n,children:(0,T.jsx)(d,{present:n||a.open,children:(0,T.jsx)(g,{asChild:!0,container:i,children:r})})})};pr.displayName=ur;var Q=`MenuContent`,[mr,hr]=X(Q),gr=w.forwardRef((e,t)=>{let n=fr(Q,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Z(Q,e.__scopeMenu),o=or(Q,e.__scopeMenu);return(0,T.jsx)(Qn.Provider,{scope:e.__scopeMenu,children:(0,T.jsx)(d,{present:r||a.open,children:(0,T.jsx)(Qn.Slot,{scope:e.__scopeMenu,children:o.modal?(0,T.jsx)(_r,{...i,ref:t}):(0,T.jsx)(vr,{...i,ref:t})})})})}),_r=w.forwardRef((e,t)=>{let n=Z(Q,e.__scopeMenu),r=w.useRef(null),a=i(t,r);return w.useEffect(()=>{let e=r.current;if(e)return h(e)},[]),(0,T.jsx)(br,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:b(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),vr=w.forwardRef((e,t)=>{let n=Z(Q,e.__scopeMenu);return(0,T.jsx)(br,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),yr=v(`MenuContent.ScrollLock`),br=w.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:d,onEntryFocus:f,onEscapeKeyDown:m,onPointerDownOutside:h,onFocusOutside:g,onInteractOutside:_,onDismiss:v,disableOutsideScroll:y,...x}=e,S=Z(Q,n),C=or(Q,n),E=nr(n),D=rr(n),O=$n(n),[k,A]=w.useState(null),j=w.useRef(null),M=i(t,j,S.onContentChange),N=w.useRef(0),P=w.useRef(``),F=w.useRef(0),I=w.useRef(null),ee=w.useRef(`right`),te=w.useRef(0),L=y?c:w.Fragment,R=y?{as:yr,allowPinchZoom:!0}:void 0,z=e=>{let t=P.current+e,n=O().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=ii(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){P.current=t,window.clearTimeout(N.current),t!==``&&(N.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};w.useEffect(()=>()=>window.clearTimeout(N.current),[]),p();let B=w.useCallback(e=>ee.current===I.current?.side&&oi(e,I.current?.area),[]);return(0,T.jsx)(mr,{scope:n,searchRef:P,onItemEnter:w.useCallback(e=>{B(e)&&e.preventDefault()},[B]),onItemLeave:w.useCallback(e=>{B(e)||(j.current?.focus(),A(null))},[B]),onTriggerLeave:w.useCallback(e=>{B(e)&&e.preventDefault()},[B]),pointerGraceTimerRef:F,onPointerGraceIntentChange:w.useCallback(e=>{I.current=e},[]),children:(0,T.jsx)(L,{...R,children:(0,T.jsx)(l,{asChild:!0,trapped:a,onMountAutoFocus:b(o,e=>{e.preventDefault(),j.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,T.jsx)(u,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:m,onPointerDownOutside:h,onFocusOutside:g,onInteractOutside:_,onDismiss:v,children:(0,T.jsx)(Un,{asChild:!0,...D,dir:C.dir,orientation:`vertical`,loop:r,currentTabStopId:k,onCurrentTabStopIdChange:A,onEntryFocus:b(f,e=>{C.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,T.jsx)(gn,{role:`menu`,"aria-orientation":`vertical`,"data-state":$r(S.open),"data-radix-menu-content":``,dir:C.dir,...E,...x,ref:M,style:{outline:`none`,...x.style},onKeyDown:b(x.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&z(e.key));let i=j.current;if(e.target!==i||!Jn.includes(e.key))return;e.preventDefault();let a=O().filter(e=>!e.disabled).map(e=>e.ref.current);qn.includes(e.key)&&a.reverse(),ni(a)}),onBlur:b(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(N.current),P.current=``)}),onPointerMove:b(e.onPointerMove,si(e=>{let t=e.target,n=te.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>te.current?`right`:`left`;ee.current=t,te.current=e.clientX}}))})})})})})})});gr.displayName=Q;var xr=`MenuGroup`,Sr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,T.jsx)(y.div,{role:`group`,...r,ref:t})});Sr.displayName=xr;var Cr=`MenuLabel`,wr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,T.jsx)(y.div,{...r,ref:t})});wr.displayName=Cr;var Tr=`MenuItem`,Er=`menu.itemSelect`,Dr=w.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...o}=e,s=w.useRef(null),c=or(Tr,e.__scopeMenu),l=hr(Tr,e.__scopeMenu),u=i(t,s),d=w.useRef(!1),f=()=>{let e=s.current;if(!n&&e){let t=new CustomEvent(Er,{bubbles:!0,cancelable:!0});e.addEventListener(Er,e=>r?.(e),{once:!0}),a(e,t),t.defaultPrevented?d.current=!1:c.onClose()}};return(0,T.jsx)(Or,{...o,ref:u,disabled:n,onClick:b(e.onClick,f),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:b(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:b(e.onKeyDown,e=>{n||e.target!==e.currentTarget||l.searchRef.current!==``&&e.key===` `||Gn.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Dr.displayName=Tr;var Or=w.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:a,...o}=e,s=hr(Tr,n),c=rr(n),l=w.useRef(null),u=i(t,l),[d,f]=w.useState(!1),[p,m]=w.useState(``);return w.useEffect(()=>{let e=l.current;e&&m((e.textContent??``).trim())},[o.children]),(0,T.jsx)(Qn.ItemSlot,{scope:n,disabled:r,textValue:a??p,children:(0,T.jsx)(Wn,{asChild:!0,...c,focusable:!r,children:(0,T.jsx)(y.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...o,ref:u,onPointerMove:b(e.onPointerMove,si(e=>{r?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:b(e.onPointerLeave,si(e=>s.onItemLeave(e))),onFocus:b(e.onFocus,()=>f(!0)),onBlur:b(e.onBlur,()=>f(!1))})})})}),kr=`MenuCheckboxItem`,Ar=w.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,T.jsx)(Rr,{scope:e.__scopeMenu,checked:n,children:(0,T.jsx)(Dr,{role:`menuitemcheckbox`,"aria-checked":ei(n)?`mixed`:n,...i,ref:t,"data-state":ti(n),onSelect:b(i.onSelect,()=>r?.(ei(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ar.displayName=kr;var jr=`MenuRadioGroup`,[Mr,Nr]=X(jr,{value:void 0,onValueChange:()=>{}}),Pr=w.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=m(r);return(0,T.jsx)(Mr,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,T.jsx)(Sr,{...i,ref:t})})});Pr.displayName=jr;var Fr=`MenuRadioItem`,Ir=w.forwardRef((e,t)=>{let{value:n,...r}=e,i=Nr(Fr,e.__scopeMenu),a=n===i.value;return(0,T.jsx)(Rr,{scope:e.__scopeMenu,checked:a,children:(0,T.jsx)(Dr,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":ti(a),onSelect:b(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Ir.displayName=Fr;var Lr=`MenuItemIndicator`,[Rr,zr]=X(Lr,{checked:!1}),Br=w.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=zr(Lr,n);return(0,T.jsx)(d,{present:r||ei(a.checked)||a.checked===!0,children:(0,T.jsx)(y.span,{...i,ref:t,"data-state":ti(a.checked)})})});Br.displayName=Lr;var Vr=`MenuSeparator`,Hr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,T.jsx)(y.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Hr.displayName=Vr;var Ur=`MenuArrow`,Wr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=nr(n);return(0,T.jsx)(_n,{...i,...r,ref:t})});Wr.displayName=Ur;var Gr=`MenuSub`,[Kr,qr]=X(Gr),Jr=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Z(Gr,t),o=nr(t),[s,c]=w.useState(null),[l,u]=w.useState(null),d=m(i);return w.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,T.jsx)(mn,{...o,children:(0,T.jsx)(ir,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,T.jsx)(Kr,{scope:t,contentId:f(),triggerId:f(),trigger:s,onTriggerChange:c,children:n})})})};Jr.displayName=Gr;var Yr=`MenuSubTrigger`,Xr=w.forwardRef((e,t)=>{let n=Z(Yr,e.__scopeMenu),r=or(Yr,e.__scopeMenu),a=qr(Yr,e.__scopeMenu),o=hr(Yr,e.__scopeMenu),s=w.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=o,u={__scopeMenu:e.__scopeMenu},d=w.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);w.useEffect(()=>d,[d]),w.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),l(null)}},[c,l]);let f=i(t,a.onTriggerChange);return(0,T.jsx)(lr,{asChild:!0,...u,children:(0,T.jsx)(Or,{id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?a.contentId:void 0,"data-state":$r(n.open),...e,ref:f,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:b(e.onPointerMove,si(t=>{o.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:b(e.onPointerLeave,si(e=>{d();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,a=i?-5:5,s=t[i?`left`:`right`],l=t[i?`right`:`left`];o.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:s,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:s,y:t.bottom}],side:r}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(e),e.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:b(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||o.searchRef.current!==``&&t.key===` `||Yn[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Xr.displayName=Yr;var Zr=`MenuSubContent`,Qr=w.forwardRef((e,t)=>{let n=fr(Q,e.__scopeMenu),{forceMount:r=n.forceMount,align:a=`start`,...o}=e,s=Z(Q,e.__scopeMenu),c=or(Q,e.__scopeMenu),l=qr(Zr,e.__scopeMenu),u=w.useRef(null),f=i(t,u);return(0,T.jsx)(Qn.Provider,{scope:e.__scopeMenu,children:(0,T.jsx)(d,{present:r||s.open,children:(0,T.jsx)(Qn.Slot,{scope:e.__scopeMenu,children:(0,T.jsx)(br,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:f,align:a,side:c.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{c.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:b(e.onFocusOutside,e=>{e.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:b(e.onEscapeKeyDown,e=>{c.onClose(),e.preventDefault()}),onKeyDown:b(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Xn[c.dir].includes(e.key);t&&n&&(s.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())})})})})})});Qr.displayName=Zr;function $r(e){return e?`open`:`closed`}function ei(e){return e===`indeterminate`}function ti(e){return ei(e)?`indeterminate`:e?`checked`:`unchecked`}function ni(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ri(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ii(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=ri(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function ai(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function oi(e,t){return t?ai({x:e.clientX,y:e.clientY},t):!1}function si(e){return t=>t.pointerType===`mouse`?e(t):void 0}var ci=sr,li=lr,ui=pr,di=gr,fi=Sr,pi=wr,mi=Dr,hi=Ar,gi=Pr,_i=Ir,vi=Br,yi=Hr,bi=Wr,xi=Xr,Si=Qr,Ci=`DropdownMenu`,[wi,Ti]=s(Ci,[tr]),$=tr(),[Ei,Di]=wi(Ci),Oi=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:s,modal:c=!0}=e,l=$(t),u=w.useRef(null),[d,p]=o({prop:i,defaultProp:a??!1,onChange:s,caller:Ci});return(0,T.jsx)(Ei,{scope:t,triggerId:f(),triggerRef:u,contentId:f(),open:d,onOpenChange:p,onOpenToggle:w.useCallback(()=>p(e=>!e),[p]),modal:c,children:(0,T.jsx)(ci,{...l,open:d,onOpenChange:p,dir:r,modal:c,children:n})})};Oi.displayName=Ci;var ki=`DropdownMenuTrigger`,Ai=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,o=Di(ki,n),s=$(n),c=i(t,o.triggerRef);return(0,T.jsx)(li,{asChild:!0,...s,children:(0,T.jsx)(y.button,{type:`button`,id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...a,ref:c,onPointerDown:b(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:b(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&o.onOpenToggle(),e.key===`ArrowDown`&&o.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Ai.displayName=ki;var ji=`DropdownMenuPortal`,Mi=e=>{let{__scopeDropdownMenu:t,...n}=e,r=$(t);return(0,T.jsx)(ui,{...r,...n})};Mi.displayName=ji;var Ni=`DropdownMenuContent`,Pi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Di(Ni,n),a=$(n),o=w.useRef(!1);return(0,T.jsx)(di,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:b(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:b(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.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)`}})});Pi.displayName=Ni;var Fi=`DropdownMenuGroup`,Ii=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(fi,{...i,...r,ref:t})});Ii.displayName=Fi;var Li=`DropdownMenuLabel`,Ri=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(pi,{...i,...r,ref:t})});Ri.displayName=Li;var zi=`DropdownMenuItem`,Bi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(mi,{...i,...r,ref:t})});Bi.displayName=zi;var Vi=`DropdownMenuCheckboxItem`,Hi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(hi,{...i,...r,ref:t})});Hi.displayName=Vi;var Ui=`DropdownMenuRadioGroup`,Wi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(gi,{...i,...r,ref:t})});Wi.displayName=Ui;var Gi=`DropdownMenuRadioItem`,Ki=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(_i,{...i,...r,ref:t})});Ki.displayName=Gi;var qi=`DropdownMenuItemIndicator`,Ji=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(vi,{...i,...r,ref:t})});Ji.displayName=qi;var Yi=`DropdownMenuSeparator`,Xi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(yi,{...i,...r,ref:t})});Xi.displayName=Yi;var Zi=`DropdownMenuArrow`,Qi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(bi,{...i,...r,ref:t})});Qi.displayName=Zi;var $i=`DropdownMenuSubTrigger`,ea=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(xi,{...i,...r,ref:t})});ea.displayName=$i;var ta=`DropdownMenuSubContent`,na=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(Si,{...i,...r,ref:t,style:{...e.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)`}})});na.displayName=ta;var ra=Oi,ia=Ai,aa=Mi,oa=Pi,sa=Ri,ca=Bi,la=Wi,ua=Ki,da=Ji,fa=Xi;function pa({...e}){return(0,T.jsx)(ra,{"data-slot":`dropdown-menu`,...e})}function ma({...e}){return(0,T.jsx)(ia,{"data-slot":`dropdown-menu-trigger`,...e})}function ha({className:e,sideOffset:t=4,...n}){return(0,T.jsx)(aa,{children:(0,T.jsx)(oa,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:S(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...n})})}function ga({className:e,inset:t,variant:n=`default`,...r}){return(0,T.jsx)(ca,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:S(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function _a({...e}){return(0,T.jsx)(la,{"data-slot":`dropdown-menu-radio-group`,...e})}function va({className:e,children:t,...n}){return(0,T.jsxs)(ua,{"data-slot":`dropdown-menu-radio-item`,className:S(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,T.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,T.jsx)(da,{children:(0,T.jsx)(C,{className:`size-2 fill-current`})})}),t]})}function ya({className:e,inset:t,...n}){return(0,T.jsx)(sa,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:S(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function ba({className:e,...t}){return(0,T.jsx)(fa,{"data-slot":`dropdown-menu-separator`,className:S(`-mx-1 my-1 h-px bg-border`,e),...t})}export{_a as a,ma as c,gn as d,mn as f,C as h,ya as i,hn as l,A as m,ha as n,va as o,Zt as p,ga as r,ba as s,pa as t,_n as u};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{n as r,r as i,t as a}from"./utils-DsLuRXwV.js";var o=i(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),s=i(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),c=i(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),l=i(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),u=n();function d({reference:e,taskTitle:t,className:n,compact:i=!1}){let{kind:o,number:c,url:l}=e,d=a(`inline-flex h-[22px] items-center gap-1 rounded-full border border-violet/35 px-2 font-mono text-[11px] font-semibold text-violet`,n),f=i&&o===`PR`?`PR`:c?`${o===`Issue`?`Issue `:``}#${c}`:o;return!l||!r(l)?(0,u.jsx)(`span`,{"data-slot":o===`PR`?`pr-chip`:`issue-chip`,className:d,children:f}):(0,u.jsxs)(`a`,{"data-slot":o===`PR`?`pr-chip`:`issue-chip`,href:l,target:`_blank`,rel:`noopener noreferrer`,title:l,"aria-label":`Open the ${o===`PR`?`pull request`:`issue`} for ${t}`,className:a(d,`hover:bg-violet/10`),children:[f,(0,u.jsx)(s,{className:`size-2.5`,"aria-hidden":`true`})]})}var f=e(t(),1);function p(e,t){let[n,r]=(0,f.useState)(!1),[i,a]=(0,f.useState)(``),o=(0,f.useRef)(!1);return{editing:n,draft:i,setDraft:a,begin:()=>{a(e),o.current=!1,r(!0)},commit:()=>{if(o.current)return;o.current=!0,r(!1);let n=i.trim();n.length===0||n===e||t(n)},cancel:()=>{o.current=!0,r(!1)}}}function m({editor:e,className:t}){return(0,u.jsx)(`input`,{"data-slot":`title-input`,"aria-label":`Task title`,autoFocus:!0,value:e.draft,onChange:t=>e.setDraft(t.target.value),onBlur:e.commit,onKeyDown:t=>{t.key===`Enter`?(t.preventDefault(),e.commit()):t.key===`Escape`&&(t.preventDefault(),e.cancel())},className:a(`w-full min-w-0 rounded-sm border border-border bg-card px-1.5 py-0.5 outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,t)})}export{c as a,l as i,p as n,o,d as r,m as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./utils-DsLuRXwV.js";var t=e(`git-pull-request`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]);export{t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r}from"./centered-state-ZtnFHA-n.js";import{n as i,r as a,t as o}from"./utils-DsLuRXwV.js";import{t as s}from"./chevron-right-G4caF2QV.js";import{c,n as l,r as u,t as d}from"./dropdown-menu-C1Dlf35P.js";import{t as f}from"./ellipsis-vertical-DpGTRqC2.js";import{n as p}from"./tab-link-DIlR5T07.js";import{t as m}from"./file-DlUGpUlb.js";import{t as h}from"./folder-BAY6Vddy.js";import{i as g,n as _,r as v}from"./use-desktop-Bf5LS_P4.js";import{t as y}from"./git-pull-request-agOG0iGM.js";import{t as b}from"./square-terminal-hwBL8XsC.js";import{t as x}from"./upload-BKjN59-1.js";import{t as S}from"./diff-stat-Dyfg3ltF.js";var C=a(`file-diff`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),w=e(t(),1),T=n();function E({root:e,selected:t,onSelect:n}){return(0,T.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,T.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,T.jsx)(O,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,T.jsx)(A,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function D({adds:e,dels:t}){return(0,T.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] font-medium tabular-nums`,children:[e>0?(0,T.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,T.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]}):null]})}function O({dir:e,depth:t,selected:n,onSelect:r}){let[i,a]=(0,w.useState)(!0);return(0,T.jsxs)(`li`,{children:[(0,T.jsxs)(`button`,{type:`button`,"data-slot":`tree-dir`,"data-path":e.path,"data-state":i?`open`:`closed`,"aria-expanded":i,onClick:()=>a(e=>!e),className:`flex w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+t*14}px`},children:[(0,T.jsx)(s,{"aria-hidden":`true`,className:o(`size-3.5 shrink-0 transition-transform`,i&&`rotate-90`)}),(0,T.jsx)(h,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,T.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name}),(0,T.jsx)(D,{adds:e.adds,dels:e.dels})]}),i?(0,T.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,T.jsx)(O,{dir:e,depth:t+1,selected:n,onSelect:r},e.path)),e.files.map(e=>(0,T.jsx)(A,{file:e,depth:t+1,selected:n,onSelect:r},e.path))]}):null]})}var k={added:`text-success`,deleted:`text-danger`};function A({file:e,depth:t,selected:n,onSelect:r}){let i=n===e.path;return(0,T.jsx)(`li`,{children:(0,T.jsxs)(`button`,{type:`button`,"data-slot":`tree-file`,"data-path":e.path,"aria-current":i?`true`:void 0,onClick:()=>r(e.path),className:o(`flex w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,i?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${24+t*14}px`},children:[(0,T.jsx)(m,{"aria-hidden":`true`,className:o(`size-3.5 shrink-0`,k[e.status])}),(0,T.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,T.jsx)(D,{adds:e.adds,dels:e.dels})]})})}function j(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function M(e){let t=e;for(;t.files.length===0&&t.dirs.length===1;){let e=t.dirs[0];t={...e,name:`${t.name}/${e.name}`}}return{...t,dirs:t.dirs.map(M)}}var N=(e,t)=>e.name.localeCompare(t.name);function P(e){let t=j(``,``),n=new Map([[``,t]]),r=e=>{let t=n.get(e);if(t)return t;let i=e.lastIndexOf(`/`),a=r(i===-1?``:e.slice(0,i)),o=j(i===-1?e:e.slice(i+1),e);return a.dirs.push(o),n.set(e,o),o};for(let t of e){let e=t.path.lastIndexOf(`/`);r(e===-1?``:t.path.slice(0,e)).files.push({kind:`file`,name:e===-1?t.path:t.path.slice(e+1),path:t.path,status:t.status,adds:t.adds,dels:t.dels,binary:t.binary})}let i=e=>{e.dirs.forEach(i),e.adds=e.files.reduce((e,t)=>e+t.adds,0)+e.dirs.reduce((e,t)=>e+t.adds,0),e.dels=e.files.reduce((e,t)=>e+t.dels,0)+e.dirs.reduce((e,t)=>e+t.dels,0),e.fileCount=e.files.length+e.dirs.reduce((e,t)=>e+t.fileCount,0),e.dirs.sort(N),e.files.sort(N)};return i(t),{...t,dirs:t.dirs.map(M)}}function F({bar:e,branch:t,stat:n,mode:i,wrap:a,onModeChange:o,onWrapChange:s,onAction:p}){return(0,T.jsxs)(`div`,{"data-slot":`git-toolbar`,className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[t?(0,T.jsx)(_,{branch:t}):null,n?(0,T.jsx)(R,{stat:n}):null,(0,T.jsxs)(`span`,{className:`ml-auto flex items-center gap-1`,children:[(0,T.jsx)(`span`,{className:`hidden items-center gap-1 md:flex`,children:(0,T.jsx)(v,{mode:i,wrap:a,onModeChange:o,onWrapChange:s})}),e.secondary.map(e=>(0,T.jsx)(L,{action:e,variant:`outline`,onAction:p},e.id)),(0,T.jsx)(L,{action:e.primary,variant:`primary`,onAction:p}),e.menu.length>0?(0,T.jsxs)(d,{children:[(0,T.jsx)(c,{asChild:!0,children:(0,T.jsx)(r,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,children:(0,T.jsx)(f,{"aria-hidden":`true`})})}),(0,T.jsx)(l,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,T.jsxs)(u,{disabled:!e.enabled,title:e.reason,onSelect:()=>p(e.id),children:[I[e.id],e.label]},e.id))})]}):null]})]})}var I={commit:(0,T.jsx)(g,{"aria-hidden":`true`}),push:(0,T.jsx)(x,{"aria-hidden":`true`}),"create-pr":(0,T.jsx)(y,{"aria-hidden":`true`}),"view-pr":(0,T.jsx)(p,{"aria-hidden":`true`}),"open-terminal":(0,T.jsx)(b,{"aria-hidden":`true`})};function L({action:e,variant:t,onAction:n}){return e.id===`view-pr`?i(e.href)?(0,T.jsx)(r,{asChild:!0,variant:t,size:`sm`,"data-action":e.id,children:(0,T.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[I[e.id],e.label]})}):(0,T.jsxs)(r,{variant:t,size:`sm`,"data-action":e.id,disabled:!0,title:`View PR unavailable — the recorded PR link is not an http(s) URL`,children:[I[e.id],e.label]}):(0,T.jsxs)(r,{variant:t,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>n(e.id),children:[I[e.id],e.label]})}function R({stat:e}){return(0,T.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,T.jsx)(S,{stat:{adds:z(e.adds),dels:z(e.dels),files:e.files}})})}function z(e){let[t,n]=(0,w.useState)(e),r=(0,w.useRef)(e);return(0,w.useEffect)(()=>{let t=r.current;if(t===e)return;if(typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||typeof requestAnimationFrame!=`function`){r.current=e,n(e);return}let i=performance.now(),a=0,o=s=>{let c=Math.min(1,(s-i)/350),l=1-(1-c)**3;n(Math.round(t+(e-t)*l)),c<1?a=requestAnimationFrame(o):r.current=e};return a=requestAnimationFrame(o),()=>{cancelAnimationFrame(a),r.current=e,n(e)}},[e]),t}export{C as a,E as i,F as n,P as r,R as t};